Commit Graph

12 Commits

Author SHA1 Message Date
664a36ddb9 gen_d3d12_stubs: preserve multiline comment line breaks, reject empty paths, and write atomically 2026-11-25 06:08:40 +01:00
2a0b4fd9e1 gen_d3d12_stubs: use the shared path comparison for the collision checks (#2809)
Squash-merged after diff review of PR #2809
2026-11-23 09:38:26 -06:00
40b71d427b gen_d3d12_stubs: --report counts a method declared in both #if/#else branches once
d3d12.h declares each struct-returning method twice, once in each branch of
`#if defined(_MSC_VER) || !defined(_WIN32)` / `#else`. coverage() counted every declaration, so
with the Windows SDK 10.0.26100.0 header the report gave ID3D12DescriptorHeap 11 methods instead
of 8 (GetDesc and the two Get*DescriptorHandleForHeapStart twice), ID3D12Resource 13 instead of 12
and ID3D12Device11 82 instead of 77; implemented counts were inflated the same way, and a method
not yet overridden was listed twice in "open".

coverage() now removes repeated (interface, method) pairs from the chain's method list, keeping
vtable order. Stub generation is unchanged: the generated classes still keep both preprocessor
branches, and their output is byte-identical.

Test: a synthetic header with a method in both branches; the report counts and lists it once,
and the emitted stub class still contains both branches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:54:51 +03:00
12528c6a77 Merge pull request #2284 from Vonsek 2026-11-22 11:43:46 -05:00
3e48bf6d05 fix(tools): ignore comments in D3D12 method coverage
Textual examples of STDMETHODCALLTYPE signatures can hide methods that still need overrides. Strip comments and literals before scanning sources so the report reflects code.
2026-11-22 17:34:01 +01:00
530f0f5fe2 gen_d3d12_stubs: refuse report paths that overwrite an input
--report and --out were written with write_if_changed after the header
and the --source files were read, and nothing checked the paths, so
--report <source.cpp> replaced the source with the coverage JSON (a
44-byte source became 197 bytes, exit 0) and --out <d3d12.h> would
replace the header. Validate --source/--header as files, refuse --out
or --report that alias the header, a source or each other, refuse
folders, and report write failures as one ERROR line with exit 2.
2026-11-22 23:49:01 +08:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
ef74ac8a81 tools: report D3D12 method coverage from stub generator 2026-11-22 00:26:27 -06:00
1605bfba45 gen_d3d12_stubs.py: an interface named twice is generated once
main() emitted one class per --interfaces argument, so naming an interface
twice wrote two definitions of the same class and the header no longer
compiles. Repeats are dropped, first-seen order kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:29:16 +01:00
41f6c7a2b3 gen_d3d12_stubs.py: handle line comments in SDK headers 2026-11-22 00:59:53 +01:00
1aeaec0ddb gen_d3d12_stubs.py: reject circular interface inheritance 2026-11-22 00:20:29 +01:00
Ryx
6052bf0bd5 Runtime: rectangle clears, layout tracking, enhanced barriers, COM list/queue/fence
Closes the gaps left by the barrier/clear slice:

- Rectangle clears: ClearRenderTargetView/ClearDepthStencilView rects are
  recorded and replayed with vkCmdClearAttachments in a dynamic-rendering
  scope, clipped to the mip.
- LayoutTracker: the current Vulkan layout per image subresource, so barriers
  start from the real layout. This honours implicit promotion and decay
  (COMMON is GENERAL; simultaneous-access textures stay GENERAL) and, with
  separateDepthStencilLayouts, lets one depth/stencil plane be cleared or
  transitioned while the other stays in another state.
- Enhanced barriers (global, buffer, texture, split, discard) mapped to
  vkCmdPipelineBarrier2.
- vulkan_backend.h: VulkanContext, VulkanQueue (ExecuteCommandLists checks
  every list before writing any; Wait is attached to the next submission),
  VulkanFence on timeline semaphores.
- d3d12_com.cpp: ID3D12GraphicsCommandList7, ID3D12CommandQueue,
  ID3D12CommandAllocator and ID3D12Fence1. Unimplemented methods are stubs
  generated at build time from the SDK's d3d12.h (tools/gen_d3d12_stubs.py),
  so vtables follow the SDK order and nothing SDK-derived is checked in.

Tests: command_list_test and d3d12_state_map_test (every copied D3D12
constant checked against d3d12.h) in ctest; vk_command_replay_test and the new
d3d12_com_test on the GPU, clean under the Khronos validation layer.
2026-11-21 19:19:31 +01:00