#version 460 // A full-screen triangle at a chosen depth, written to the translator's runtime contract (docs/design.md, "User // data"), for d3d12_depth24_draw_test: s8 is the depth at the centre and s9 how much it changes per unit of clip-space // x, so s9 = 0 gives a flat triangle and anything else a constant slope across the target. Graphics root arguments // start at s8 in the console layout (docs/d3d12_vulkan.md, D3D-448): the test's three root constants are s8..s10. layout(push_constant) uniform UserData { uint s[32]; uvec2 heap_base; uvec2 code_base; } pc; void main() { const vec2 corner = vec2(float(gl_VertexIndex & 2), float((gl_VertexIndex << 1) & 2)); const vec2 xy = corner * 2.0 - 1.0; gl_Position = vec4(xy, uintBitsToFloat(pc.s[8]) + uintBitsToFloat(pc.s[9]) * xy.x, 1.0); }