Commit Graph

3 Commits

Author SHA1 Message Date
b136ee4680 Tests: check Microsoft's recorded answers where Wine and Proton have no reference
Under Wine the host D3D12 is vkd3d and under Proton vkd3d-proton, and
Proton's EnumWarpAdapter returns the hardware adapter, so the host and
WARP references six tests compare with are not Microsoft's runtime:
d3d12_r9g9b9e5_uav, d3d12_method_variants and d3d12_sampler2 fail under
Proton (the last two crash inside vkd3d-proton), d3d12_fence_timing and
d3d12_subresource_copy under both, d3d12_private_data under Wine.

The six skip the host comparison there with hostwine::host_is_wine() and
check the layer against Microsoft's answers recorded in the test instead,
so Wine and Proton still check values. d3d12_r9g9b9e5_uav gets WARP's
words for its six clear cases, from the packing rule in
docs/d3d12_vulkan.md. d3d12_subresource_copy and d3d12_private_data get
answer tables, taken from the records that Windows runs on NVIDIA and AMD
compared with Microsoft's runtime with no mismatches; LEONIDA_D3D49_DUMP=1
prints the host's record on Windows to regenerate them. The other three
already had recorded answers. Windows still compares with the live
runtime too.
2026-11-22 20:40:59 -07:00
55a073183e d3d12: SetName is readable as WKPDID_D3DDebugObjectNameW, with the right GUID
@pwu2775-dev found on #2533 that the tests' WKPDID_D3DDebugObjectNameW was
mistyped ({4cca5fd8-921f-42c8-8599-d2866a3e5f7e}, the layer's old constant)
instead of d3dcommon.h's {4cca5fd8-921f-42c8-8566-70caf2a9b741}. Measured with
the right key, the host runtime does what D3D12 documents: SetName is
SetPrivateData with that key and the name with its terminator, GetPrivateData
reads it back (an empty name is a 2-byte entry), and the narrow key is not
touched. SetName(nullptr) faults in the host and leaves the name as it was.

So the name goes back into the private data, now under the right GUID, and the
separate name_ / debug_name() are gone. SetName(nullptr) answers E_INVALIDARG
and changes nothing. d3d12_private_data_test: 667 steps compared, 0 mismatches
(RTX 3060, driver 610.88); d3d12_debug_markers_test checks the name again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:24:07 +01:00
b0a9c16d21 d3d12: private data answers as the host runtime does
d3d12_private_data_test runs the same 672 GetPrivateData / SetPrivateData /
SetPrivateDataInterface / SetName steps on the device, a fence, a buffer, a
command allocator and a descriptor heap of the Vulkan-backed device and of the
host runtime, and compares every HRESULT, returned size, byte and reference
count. On main 130 of them differed (RTX 3060, driver 610.88), the same four
rules on every object:

- SetPrivateData with null data removes the entry whatever the size: S_OK
  when there was one, S_FALSE when there wasn't. The layer answered
  E_INVALIDARG for a nonzero size and kept the entry, and S_OK for a missing
  one.
- Zero bytes with data keep an empty entry (size 0); the layer removed it.
- SetPrivateDataInterface(null) releases the interface and keeps a
  pointer-sized entry that reads back as null; the layer removed it.
- SetName is not readable through GetPrivateData: the host sets neither
  WKPDID_D3DDebugObjectNameW nor the narrow key. The layer stored the name
  there; it now keeps it apart (debug_name()).

SetName(nullptr) faults in the host runtime; the layer still clears the name,
and the test reports those 5 steps as not compared.

d3d12_debug_markers_test's private-data checks expected the old answers and
now expect the host's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:24:14 +01:00