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>
Textual examples of STDMETHODCALLTYPE signatures can hide methods that still need overrides. Strip comments and literals before scanning sources so the report reflects code.
--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.
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>
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>
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.