mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 13:28:35 +00:00
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>
19 lines
854 B
GLSL
19 lines
854 B
GLSL
#version 460
|
|
// A vertex shader with no vertex inputs, written to the translator's runtime contract (docs/design.md, "User data"),
|
|
// standing in for a translated one in d3d12_depth_resolve_test: vertices 0, 1 and 2 make one triangle at depth 0.5
|
|
// whose long edge runs diagonally across the viewport, so the pixels it crosses have some samples covered and some
|
|
// not. Its HLSL twin for the host runtime is in the test.
|
|
|
|
layout(push_constant) uniform UserData {
|
|
uint s[32];
|
|
uvec2 heap_base;
|
|
uvec2 code_base;
|
|
} pc;
|
|
|
|
void main() {
|
|
// (-1,-1), (-1,1), (1,1) in D3D clip space: the upper-left half of the viewport, cut by the diagonal from the
|
|
// bottom-left corner to the top-right one.
|
|
const vec2 corners[3] = vec2[](vec2(-1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
|
|
gl_Position = vec4(corners[gl_VertexIndex], 0.5, 1.0);
|
|
}
|