Skip to content

Tests: depth resolves of D32S8, and of samples that differ (TEST-847, TEST-848) - #3871

Open
traeb0n wants to merge 1 commit into
ItsNotRexed:mainfrom
traeb0n:depth-resolve-edges
Open

traeb0n wants to merge 1 commit into
ItsNotRexed:mainfrom
traeb0n:depth-resolve-edges

Conversation

@traeb0n

@traeb0n traeb0n commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Items: TEST-847 and TEST-848 (claim: #3796 (comment)). Test and docs only; no runtime change.

TEST-847: D32S8 plane formats

d3d12_depth_resolve_test already compared D32 and D24S8 resolves by their plane formats with the PC runtime. The untested part was D32S8. It now runs through the same cases as D24S8, whole and rectangle:

  • the depth and stencil planes, by D32_FLOAT_S8X24_UINT (MIN, MAX);
  • the depth plane by R32_FLOAT_X8X24_TYPELESS (MIN, MAX, AVERAGE);
  • the stencil plane by X32_TYPELESS_G8X24_UINT (MIN, MAX);
  • an R32G8X24_TYPELESS resource resolved both ways;
  • refusals: AVERAGE by the D32S8 format, AVERAGE of stencil, and the stencil subresource named by the depth plane's format.

The readback used "has stencil" to mean "24-bit UNORM depth". It now tells the two apart by format (unorm24()), so D32S8's float depth is read and modelled as a float.

WARP skips D32S8 by its own format, as it already skips D32_FLOAT by its own format: that one removes WARP's device (see the top of the file). WARP still compares the plane formats.

TEST-848: modes over samples that differ

Every case also runs as an edge case. Before the resolve, one triangle is drawn over the cleared 4x source with a depth-only PSO: no PS, depth 0.5 written with ALWAYS, and stencil REPLACE with ref 0x44. Its diagonal edge leaves the pixels it crosses with some samples at the triangle's values and some at the clears' (0.25/0.75/1.0, 0x11/0x22/0x33). MIN, MAX and AVERAGE then reduce over different values.

  • There's no CPU model of the coverage. The layer has to match the PC runtime byte for byte.
  • For each edge case, MIN and MAX have to differ somewhere, so a draw that never reached the resolve fails.
  • WARP's edge results are reported as information if they differ. None did.
  • The layer's VS is a GLSL stand-in (test/glsl/vs_depth_edge.vert) behind a synthetic FSSM container in a test shader index, as d3d12_typeless_families_test does. The host's is the same triangle in HLSL, compiled by d3dcompiler_47.
  • Without glslangValidator at build time, the edge cases are skipped and the summary line says so.

docs/d3d12_vulkan.md no longer calls the D32S8 pair untested or the modes over differing samples unchecked.

Tested

Tested 6524eee on an NVIDIA GeForce RTX 5070, driver 621.01, Windows 11 Pro (26300), MSVC 14.44, Vulkan SDK 1.4.363, with LEONIDA_VK_VALIDATION=1:

Vulkan resolve modes: depth 0x2f, stencil 0x2d
depth/stencil resolves against the default adapter: 97 of 97 match, 0 host quirks, 7 refusals alike
depth/stencil resolves against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike
depth/stencil resolves: 168 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ

No validation messages (the test fails on any). Docs tests pass: test_docs_list_items, test_docs_links, test_docs_repo_paths, test_docs_design_rows.

Runs on other GPUs would help, especially AMD and Intel. The D24 AVERAGE rounding over differing samples is the case most likely to differ between drivers.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@kacper-serewis kacper-serewis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At 6524eee, Windows RTX 5070 (616.56) with Vulkan validation passed all 97 native comparisons and all 71 tested WARP comparisons. WARP skipped 26 typed D32/D32S8 cases. All 20 mixed MIN/MAX pairs differed on at least one pixel, all six mixed AVERAGE cases matched both hosts, and 12 layer refusals preserved the destination. No Vulkan validation errors. Synthetic inputs, AI-assisted.

… TEST-848)

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>
@traeb0n

traeb0n commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main aa2988c (afd5304). main now records that some drivers' D24S8 resolves differ from the clears (RTX 3070 610.74, Ryzen 7 9700X iGPU) and counts them as host quirks. Edge cases have no clear model, so on a host that had a quirk on the same case without the edge, an edge case's difference from the layer is now reported as information instead of failing, as on WARP. The host is now the layer's own adapter (#2916).

Tested afd5304 on RTX 5070, driver 621.01, Windows 11, MSVC 14.44, Vulkan SDK 1.4.363, LEONIDA_VK_VALIDATION=1: ctest -E loader -j 4 141/141, device test 0 validation messages, and

depth/stencil resolves against NVIDIA GeForce RTX 5070: 97 of 97 match, 0 host quirks, 7 refusals alike
depth/stencil resolves against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike
... 20 edge MIN/MAX pairs differ

AI-assisted (Claude Code).

@whattheflop

Copy link
Copy Markdown
Contributor

Radeon retest at afd5304c corroborates the rebased host-quirk rule. All four native AMD typed-depth cases differed both with and without the edge. The equivalent depth-plane controls matched on native AMD and WARP, and all 16 Vulkan cases matched the sample-position model with zero validation errors. Full GPU evidence in #166.

One test-coverage detail in the informational branch: on native AMD it now also downgrades a failed edge Close and compares only the selected plane. In this run all four Close calls succeeded and the other plane stayed intact. Keeping those two checks separate would retain their coverage while allowing the observed selected-plane differences. AI-assisted (Codex).

@MKmajster

Copy link
Copy Markdown

Tested afd5304 on a driver that has the quirk: NVIDIA GeForce RTX 3070 (Ampere), driver 617.42, Windows 11 24H2 (26100), MSVC 19.44 RelWithDebInfo. The new quirk path works there. The RTX 5070 run above reports 0 host quirks, so it couldn't exercise it.

Before the rebase, 6524eee failed here with 20 layer and host differ lines, all edge cases against the RTX 3070's own D3D12. All 20 had a non-edge twin that the test already counted as a host quirk (D24S8/D32S8 stencil MIN/MAX, also through X24_G8/X32_G8X24, and depth AVERAGE through R24_X8/R32_X8X24).

At afd5304:

depth/stencil resolves against NVIDIA GeForce RTX 3070: 57 of 97 match, 24 host quirks, 7 refusals alike
depth/stencil resolves against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike
depth/stencil resolves: 128 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ
  • 16 edge cases are reported as differs from the layer (information): the stencil MIN/MAX ones, rect 0 and 1. 57 + 24 + 16 = 97. The depth AVERAGE edge cases that failed before now match, with the host now being the layer's own adapter.
  • d3d12_depth_resolve: pass, also with LEONIDA_VK_VALIDATION=1 (VK_LAYER_KHRONOS_validation 1.4.350), exit 0.
  • Full CTest on this head: 154/154 passed.

No game files. AI-assisted (Claude).

@theswiss24

Copy link
Copy Markdown

Tested afd5304c (contains main aa2988cc) on NVIDIA GeForce RTX 4070 (Ada), driver 621.24, Windows 11 (26300), MSVC from Visual Studio 2026 (Ninja, RelWithDebInfo), Vulkan SDK 1.4.363.1, with LEONIDA_VK_VALIDATION=1: pass (exit 0, no validation messages). The result was the same on two runs.

Unlike the RTX 5070 run in the description, the native D3D12 driver on this card disagrees with the clears in 15 cases. The layer matches the clears in every one of them, so they count as host quirks:

Vulkan resolve modes: depth 0x2f, stencil 0x2d
depth/stencil resolves against NVIDIA GeForce RTX 4070: 74 of 97 match, 15 host quirks, 7 refusals alike
depth/stencil resolves against WARP: 71 of 71 match, 0 host quirks, 7 refusals alike
depth/stencil resolves: 145 host comparisons matched, 12 refusals kept the destination, 0 modes the device lacks were refused; 20 edge MIN/MAX pairs differ

The 15 host quirks ("the host differs from the clears; the layer matches them"), each for rect 0 and rect 1 unless noted:

  • D24S8 stencil MIN and MAX, by D24S8 and by X24_G8
  • D24S8 depth as R24_X8 AVERAGE
  • D32S8 depth as R32_X8X24 AVERAGE
  • R24G8_TYPELESS stencil as D24S8 MAX (rect 1), R24G8_TYPELESS depth as R24_X8 AVERAGE (rect 1)
  • R32G8X24_TYPELESS depth as R32_X8X24 AVERAGE (rect 0)

The other 8 of the 23 are the edge cases reported as information: "edge D24S8 stencil MIN/MAX (by D24S8 and by X24_G8), rect 0 and rect 1: NVIDIA GeForce RTX 4070 differs from the layer". The D24S8 stencil plane on the non-edge cases is also among the host quirks, so this looks like the 4070's D3D12 driver resolving that stencil plane differently in general, not something specific to the edge. WARP agrees with the layer everywhere.

So this card (Ada, 621.24) gives 74/97 where the RTX 5070 (Blackwell, 621.01) gave 97/97. No game files.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants