Commit Graph
7 Commits
Author SHA1 Message Date
Dean Galvin 5a5f2b42fd test(agc): read the prepared module's specialization constants from the artifact's SPIR-V 2026-10-18 22:14:53 +13:00
Dean Galvin bfe5a3fee3 test(agc): check the prepared module carries only the depth remap mode as a specialization constant 2026-10-18 21:40:24 +13:00
Dean Galvin 69c7efa9d3 test(agc): do not expect the remap mode as a specialization constant in a direct build 2026-10-18 21:38:46 +13:00
Dean Galvin d6f03d5f17 fix(agc): close the anonymous namespace in the depth range remap test 2026-10-18 21:06:17 +13:00
Dean Galvin 5db206aba0 fix(agc): read the depth remap scale and offset from push constants at run time
The remap mode stays a specialization constant and cache key input. Scale and
offset are two push words at byte 104, patched per draw, so draws that differ
only in depth range share one pipeline. The recipe, journal and serializer
carry the mode only.
2026-10-18 19:01:14 +13:00
NikoandClaude Opus 5.5 b28e6c83de fix(agc): keep viewport depth scale and offset out of the shader cache key
Only the remap mode changes what the vertex shader compiles to. Scale and
offset are specialization constants that each materialization takes from
its own request, so they no longer split the compiled variant per depth
transform. The result memo hashes them with the snapshot instead, so one
prepared vertex shader does not hand the module specialized for one
transform to a draw with another. sameVertexInfo repeated its first
comparison without paClVsOutCntl; the repeat is dropped.

A test pins the version 27 layout (the remap fields are the last bytes
of a vertex request), a version 25 replay, truncation and trailing-data
refusal, and that scale and offset leave the cache key alone while the
mode does not. agc_depth_range_remap materializes one prepared vertex
shader with two transforms and checks that each gets its own module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 14:27:48 +13:00
Mouad-Scriptz-0andClaude Fable 5.1 53212b18ac feat(agc): remap a viewport depth range the device cannot express into the vertex shader
Without VK_EXT_depth_range_unrestricted a viewport depth range outside
[0, 1] threw. Minecraft (PPSA17221) draws its world with scale 1 and
offset 0 in negative-one-to-one clip space, so its depth is the raw z/w
clamped by PA_SC_VPORT_ZMIN/ZMAX. On such a device the vertex shader now
scales clip z so z/w is the console's depth, the pipeline clamps depth at
the console's bounds, and two clip distances restore the near and far
planes that depth clamping removes. Mode, scale and offset travel as
pipeline specialization constants from the draw's vertex stage info, in
both the per-draw and the registration-module path; mesh and tessellation
draws with such a range still throw.

The console's depth clamp bounds are clipped to [0, 1]: exact for a
normalized depth target or none, and reported once for a tested or
written float depth target, where a depth below 0 is stored as 0
(Minecraft clamps its float depth target to [-1, 1]). The shader
validator accepts the remap's two extra clip distances next to the one
a program may already export.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 14:27:48 +13:00