Commit Graph

6 Commits

Author SHA1 Message Date
78688eab40 Merge pull request #2389 from Julio Facal
# Conflicts:
#	docs/design.md
2026-11-22 13:14:35 -05:00
722292feb8 Tests: cover the exact param28 overlap boundary 2026-11-22 14:00:28 -03:00
64b24f69fd SHADER-378: dynamic --f16-interp-fallback packing and per-pipeline SPIR-V half linking 2026-11-22 13:57:55 -03:00
4f086c32b0 Tests: link f16 fallback stages at the producer's output limit (TEST-398) 2026-11-22 13:47:04 -03:00
912a6aaf50 rdna2spirv: keep --f16-interp-fallback halves at location 29 and below (SHADER-291)
MoltenVK reports maxVertexOutputComponents = 124 because Metal counts
gl_Position in its 128 vertex-output scalars, and the validation layer
counts it too. With param 0's high halves at location 30, every VS that
exports a param under --f16-interp-fallback (on by default on MoltenVK)
failed VUID-RuntimeSpirv-Location-06272. Move the halves down one
location so the top one is 29 ((29 + 1) * 4 + 4 = 124).

Update the design.md contract row and the semantic test, which now also
checks the boundary (param27 keeps param 0's halves, param28 drops them)
and that no VS output goes above location 29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:50:07 +08:00
1681f3dc1e Translator: --f16-interp-fallback reads f16 halves without PerVertexKHR (SHADER-196)
MoltenVK can't compile PerVertexKHR to MSL, so ps_interp_f16_high failed at
pipeline creation on every Mac. With --f16-interp-fallback every VS/mesh param
(and the --mesh-compute VS) also exports its two f16 halves decoded to f32,
low halves at location 29 - 2N and high halves at 30 - 2N, and a PS *_f16 read
takes them as ordinary smooth inputs. A producer skips halves that would land
on its own params; a PS whose half location is also an attribute is rejected.
The index records f16_halves on both sides.

tools/vk_subgroup_info.py reports per_vertex_inputs (false without
fragmentShaderBarycentric or on MoltenVK); make_game.py and run_gpu_tests.py
turn the flag on where it is false. Without the flag all 139 GPU-test modules
are byte-identical to main's, so NVIDIA/AMD keep the exact per-vertex path.

Apple A18 Pro, macOS 26.6.2, MoltenVK 1.4.2: ps_interp_f16_high passes, all
4096 pixels bit-exact; run_gpu_tests.py 84 pass/50 skip/1 fail -> 85/50/0
native, 112/22/1 -> 113/22/0 with wave64 emulation; ms_f16_pack passes through
--mesh-compute. Semantic suite 1194 -> 1203 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted
2026-11-22 14:32:28 +03:00