Files
metal2vulkan/crates/metal2vulkan-validation/runtime-sources.sha256
T
Anees Iqbal 96167b3f8d Translator tests: a vertex function folds a viewport depth range into its position (red)
Metal maps a viewport depth range past [0, 1] that Vulkan takes in no
viewport: position.z reads znear + z * (zfar - znear) unclamped, and the
depth stored and tested is that clamped to [0, 1], with clip space's
0 <= z <= w clipping as always (the M3 Max, jobs m3-max-85541 and
m3-max-85617). The twin a draw that reads the depth under such a range
runs folds the range into the vertex position: z' = znear * w +
(zfar - znear) * z, with the Vulkan viewport [0, 1] and depth clamping on,
and clip space's z bounds kept as two clip distances.

This adds the input and its plumbing, with no lowering yet:
LoweringInputs::depth_range_fold and VariantKey::depth_range_fold (vertex
stage), its key bytes, PushField::DepthRangeFold (a uvec2 of [znear,
zfar - znear]), RuntimeFact::DepthRangeFold (a Variant mechanism), and
the codec's names (appended).

engine_depth_range_fold's tests:
- on every committed profile, rfb_full, rfb_span and fan_clip_triangle
  (six clip distances of its own) under the input state the fact, place
  the 8-byte field, record PrecisionNote::DeviceArithmetic and declare two
  clip distances after their own; without it, none of that; L3 both ways;
  a fragment function's module is the same under it;
- seven maxClipDistances or maxCombinedClipAndCullDistances refuse six
  plus two, naming the limit, and compile the function without the fold.

Red here: the input changes nothing yet.
2026-12-03 16:18:19 -08:00

2 lines
65 B
Plaintext

f563674eec4934f5b264ab81db342410a1756b43627256e8dd75700654d66522