restore_all_pso_vtables could write into a PSO the builder had already released.
Take an AddRef through the original vtable when hooking and drop it after the restore.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hooked PSO gets its own vtable back as soon as its name is logged (the
rest after the constructor returns), so the destructor never sees the
9-slot copy. find_pso searches newest first and skips restored entries,
the named count is of distinct creations, g_in_set_name is thread_local,
and the doc says what was measured about PostBuildInfoQuery.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LEONIDA_BVH_RECORD62=1 now prints the unwound call site (offsets from the
DLL base, with function starts from the unwind tables) and the name the
builder gives the returned PSO through SetName/SetPrivateData. Measured:
#47 and #53 are both "XDXR GetBVHCompactedSize", one PSO created twice from
FUN_18001d400; no creation is named PostBuildInfoQuery.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvh_builder_test measures 53 PSO creations over XboxBvhBuilder.dll's 52 containers.
With LEONIDA_BVH_RECORD62=1 the test now prints each container's ILDN module name and the
first bytes of its digest, which answers the open question in docs/embedded_shaders.md:
creations 1-51 are 51 distinct containers (GetBVHCompactedSize at 47), 52 is
CopyAndCompactBVH (0x1134 bytes) and 53 is GetBVHCompactedSize again (0x14a4 bytes, same
digest): the container FUN_18001d400 passes for "XDXR PostBuildInfoQuery".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LEONIDA_BVH_RECORD62=1 now prints the module of each CreateComputePipelineState
call (the file name in the container's ILDN part) and says when a creation passes
a container byte-identical to an earlier one. The constructor makes 53 creations
over 52 containers; the repeat is GetBVHCompactedSize (5,284 bytes = 0x14a4):
creations #47 and #53. The test prints a summary and checks that the repeated
container names the same module both times.
docs/embedded_shaders.md answers the open question and lists the creation order.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
clang-cl 19 and 20 crash (exit 139, in recoverAddrOfEscapedLocal) on the
__except filters of fsr_dispatch_test.cpp and bvh_builder_test.cpp: each
guard's `Call c` is also its named return value, and the filter writes it.
That stops the cross-build of runtime/cmake/clang-cl-xwin.cmake before the
rest of the tests. Return a copy instead, so `c` stays an ordinary local.
Behaviour is unchanged; both tests still skip without a package.
RT-54 switched to WARP only on NVIDIA (PCI vendor 0x10DE). AMD faults the same way: on an RX 7900 XTX the
XboxBvhBuilder constructor ends with 0xC0000005 right after the first slot 62 call (found by
@ThatZaliaSGuy, #166). The test now uses WARP whenever there is a hardware adapter, prints the vendor id it
skipped, and LEONIDA_BVH_HARDWARE=1 still keeps the hardware device. docs/d3d12_vulkan.md updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package's 53 compute shaders are Xbox DXIL (target triple dxil-ms-xb2,
xbox.compiler.options metadata; dxil.dll rejects all 53). NVIDIA's DXIL reader
rejects the 49th, the only one with a resource in a function signature, and
either returns E_OUTOFMEMORY or aborts the process inside nvwgf2umx.dll.
The proxy forwards the bytecode unchanged, so the fix is in the test: an NVIDIA
adapter switches to WARP unless LEONIDA_BVH_HARDWARE=1. LEONIDA_BVH_RECORD62
now prints each container's shape before the call, and LEONIDA_BVH_DXIL=1 adds
dx.op counts and masked validator error kinds (names and counts only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proxy answers ID3D12Device11 with a QueryInterface on the host device. The Windows 10 runtime without the Agility SDK stops before ID3D12Device11, on hardware and WARP alike, so the test failed on every Windows 10 machine with a game copy before the DLL made a call. It now prints SKIP with the reason there, as root_sig does since #597; LEONIDA_BVH_DEVICE=vulkan still runs.