Since 4da716493 the layer refuses a whole ExecuteCommandLists batch that holds a list whose Close failed, as
D3D12 must not be given one. resolve_and_read recorded the clears, the resolve and the read-back copy in one
list, so a refused resolve now took the clears and the copy with it and the eight refused cases read back an
unwritten buffer: "refused D24S8 depth AVERAGE rect 1: Close 0x80070057, destination changed" and seven more.
The resolve is now a list of its own between a setup list (clears, edge draw, barriers) and a copy list
(barrier, read-back). Each runs as its own batch, so the layer refuses only the resolve and the test checks
that the destination keeps its clears. The host path is unchanged: a resolve whose Close fails is still never
executed there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_depth_resolve_test now takes D32_FLOAT_S8X24_UINT through the same cases
as D24S8: either plane by the depth-stencil format, the depth plane by
R32_FLOAT_X8X24_TYPELESS (MIN, MAX, AVERAGE) and the stencil plane by
X32_TYPELESS_G8X24_UINT, an R32G8X24_TYPELESS resource, and the refusals
(AVERAGE by the D32S8 format or of stencil). The readback tells a 24-bit UNORM
depth plane from a float one by format, not by "has stencil".
Every case also runs as an edge case: a triangle drawn over the cleared 4x
source with a depth-only PSO (depth 0.5, stencil 0x44 REPLACE, test ALWAYS)
leaves the pixels its diagonal edge crosses with samples that differ, so
MIN, MAX and AVERAGE reduce over different values. There is no CPU model of
the coverage: the layer must match the PC runtime byte for byte, and MIN and
MAX of each edge case must differ somewhere. The layer's VS is a GLSL stand-in
(test/glsl/vs_depth_edge.vert) behind a synthetic FSSM container; the host's
is HLSL compiled by d3dcompiler_47. Without glslangValidator the edge cases are
skipped and the summary says so.
RTX 5070 (621.01), Windows 11, validation on: 97 of 97 cases match the PC
runtime on the default adapter, 71 of 71 on WARP, 20 edge MIN/MAX pairs differ.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_copy_xfmt, d3d12_depth_resolve, d3d12_fence_events, d3d12_indirect_zero,
d3d12_node_mask, d3d12_query_rules and d3d12_resource_desc created their hardware
reference with D3D12CreateDevice(nullptr), the default adapter, and did not read
LEONIDA_HOST_ADAPTER. On a PC with two GPUs the layer then ran on one GPU and the
host driver on the other.
runtime/test/host_adapter.h picks the adapter by the rule d3d12_copy_compare.h
already follows for d3d12_vulkan_device: the adapter LEONIDA_HOST_ADAPTER names
(a name that matches none fails the run; "warp" leaves the hardware pass out),
else the adapter behind the Vulkan device (deviceLUID), else the default adapter.
The tests print the adapter's name instead of "the default adapter".
Measured on a Ryzen 7 9700X iGPU (AMD 32.0.21042.62) next to an RTX 3070
(NVIDIA 610.74, the default adapter): d3d12_depth_resolve with the layer on the
Radeon set aside nine resolves as host quirks before and after, but four of them
were NVIDIA's ("D24S8 stencil as X24_G8"); against the Radeon's own driver the
four are D24S8 depth MIN/MAX. The other six tests print the same results against
either adapter.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The host-comparison tests added since #869 create their host devices with
D3D12CreateDevice themselves, so copycmp::try_create_host's Wine check never
reached them. Under Wine the reference is vkd3d, not Microsoft's runtime,
and they failed on a real GPU for that reason alone.
runtime/test/host_wine.h has the same check (ntdll's wine_get_version) for
them. Under Wine:
- d3d12_fence_events, d3d12_query_rules: the layer's own expectations
still run; only the host references are skipped.
- d3d12_depth_resolve: the layer is still checked against the clears; a
host reference is no longer required.
- d3d12_resource_desc, d3d12_node_mask, d3d12_copy_xfmt,
d3d12_typeless_rtv, d3d12_predicated_copy: every case compares with the
host (or WARP), so they exit 77, which ctest already reads as a skip.
Windows runs them all as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1155's comparison failed on an RTX 4060 Ti: NVIDIA's D3D12 driver returns, for 12 of 31 D24S8 / R24G8 rectangle
resolves, planes that match neither the clears nor WARP, while the layer matches both (WARP: 26 of 26). The layer
is already checked against the clears above, so such a case is now reported as a host quirk and counted, not failed;
a host that matches the clears still has to agree with the layer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MIN and MAX of either plane, and AVERAGE of the depth plane when Format is
the plane's own format, as the PC runtime accepts them (RTX 5070 and WARP).
Each resolve is a vkCmdBeginRendering scope with no draws: the MSAA plane
is the depth or stencil attachment and the destination plane its resolve
target, checked at record time against D3D12's rules and the device's
supported resolve modes. Colour resolves are unchanged.