upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/device_proxy_test.cpp
diff options
context:
space:
mode:
authorS1m0ne1997 <347981799+S1m0ne1997@users.noreply.github.com>2026-11-21 21:13:10 +0100
committerS1m0ne1997 <347981799+S1m0ne1997@users.noreply.github.com>2026-11-21 21:13:10 +0100
commit28cf235061107f91c323c0adb1a5f6d6a9d524ed (patch)
treef6dcb5973447571252817beb78539d6c528158ce /runtime/test/device_proxy_test.cpp
parent4c75ce537add406b426d0a1dc84d9a01fb4c86c9 (diff)
d3d12_xs device proxy: slot 62 takes (desc, w2, w3, riid, out)
The proxy read device slot 62 as (desc, riid, out), so XboxBvhBuilder's constructor, the only known caller, got E_POINTER on its first compute PSO and threw it. Recorded on 1.0.2.1: the DLL calls slot 62 with (desc, 0, 0, &IID_ID3D12PipelineState, out), the shape the prior art had documented (d3d12_vulkan.md, sections 4.8 and 7). Read the IID and the output from the fourth and fifth arguments, and log the two extra words once if they are ever non-zero. device_proxy_test now calls slot 62 in that shape. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/device_proxy_test.cpp')
-rw-r--r--runtime/test/device_proxy_test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/test/device_proxy_test.cpp b/runtime/test/device_proxy_test.cpp
index b05254ab2..748cc2e99 100644
--- a/runtime/test/device_proxy_test.cpp
+++ b/runtime/test/device_proxy_test.cpp
@@ -39,7 +39,9 @@ using XboxCreateDeviceFn = HRESULT(WINAPI*)(IUnknown*, const void*, const IID*,
39using XboxCreateResourceFn = HRESULT(WINAPI*)(void*, const D3D12_HEAP_PROPERTIES*, D3D12_HEAP_FLAGS, 39using XboxCreateResourceFn = HRESULT(WINAPI*)(void*, const D3D12_HEAP_PROPERTIES*, D3D12_HEAP_FLAGS,
40 const D3D12_RESOURCE_DESC*, D3D12_RESOURCE_STATES, 40 const D3D12_RESOURCE_DESC*, D3D12_RESOURCE_STATES,
41 const D3D12_CLEAR_VALUE*, REFIID, void**); 41 const D3D12_CLEAR_VALUE*, REFIID, void**);
42using XboxCreateComputePsoFn = HRESULT(WINAPI*)(void*, const D3D12_COMPUTE_PIPELINE_STATE_DESC*, REFIID, void**); 42// Xbox slot 62: (desc, two words, iid, out), as XboxBvhBuilder.dll calls it (zeros for the two words).
43using XboxCreateComputePsoFn = HRESULT(WINAPI*)(void*, const D3D12_COMPUTE_PIPELINE_STATE_DESC*, std::uint64_t,
44 std::uint64_t, REFIID, void**);
43using GetCpuHandleFn = D3D12_CPU_DESCRIPTOR_HANDLE(WINAPI*)(ID3D12DescriptorHeap*); 45using GetCpuHandleFn = D3D12_CPU_DESCRIPTOR_HANDLE(WINAPI*)(ID3D12DescriptorHeap*);
44using GetGpuHandleFn = D3D12_GPU_DESCRIPTOR_HANDLE(WINAPI*)(ID3D12DescriptorHeap*); 46using GetGpuHandleFn = D3D12_GPU_DESCRIPTOR_HANDLE(WINAPI*)(ID3D12DescriptorHeap*);
45 47
@@ -327,7 +329,7 @@ int main() {
327 auto create_pso = reinterpret_cast<XboxCreateComputePsoFn>(proxy_vtbl[62]); 329 auto create_pso = reinterpret_cast<XboxCreateComputePsoFn>(proxy_vtbl[62]);
328 const IID iid_pso = __uuidof(ID3D12PipelineState); 330 const IID iid_pso = __uuidof(ID3D12PipelineState);
329 ComPtr<ID3D12PipelineState> pso; 331 ComPtr<ID3D12PipelineState> pso;
330 hr = create_pso(device.Get(), &pso_desc, iid_pso, reinterpret_cast<void**>(pso.GetAddressOf())); 332 hr = create_pso(device.Get(), &pso_desc, 0, 0, iid_pso, reinterpret_cast<void**>(pso.GetAddressOf()));
331 check(SUCCEEDED(hr) && pso != nullptr, "slot 62 creates a compute PSO via CreateComputePipelineState"); 333 check(SUCCEEDED(hr) && pso != nullptr, "slot 62 creates a compute PSO via CreateComputePipelineState");
332 check(rt::d3d12_xs::device_slot_hits(62) == 1, "slot 62 hit counter is 1"); 334 check(rt::d3d12_xs::device_slot_hits(62) == 1, "slot 62 hit counter is 1");
333 check(rt::d3d12_xs::device_slot_first_call_seen(62), "slot 62 first-call flag is set"); 335 check(rt::d3d12_xs::device_slot_first_call_seen(62), "slot 62 first-call flag is set");