Repository navigation
Conversation
… PSOs
When a translated pixel shader carries `"bary_fallback_input": {"location": N}`
in `spirv/index.json` (`rdna2spirv.py --bary-fallback` for GPUs without
`VK_KHR_fragment_shader_barycentric`), `PipelineState::create_graphics` now
synthesizes the triangle pass-through Geometry SPIR-V 1.5 module in memory
(`leonida::build_bary_fallback_gs` in `runtime/src/spirv_bary_fallback.h`)
after `--f16-interp-fallback` VS/PS location linking:
- Parses `bary_fallback_input.location` in `ShaderLibrary::load_index` into
`ShaderEntry::bary_fallback_location`.
- Copies `BuiltIn Position` and every `vec4<f32>` `Location` input read by the
PS (other than `bary_location`) that the VS exports, while zero-filling any
unexported PS `Location` input without declaring a dangling GS `Input` and
leaving unread VS outputs unconsumed (`VUID-RuntimeSpirv-OpEntryPoint-08743`).
- Forwards a VS `BuiltIn ClipDistance` or `BuiltIn CullDistance` `float[1..8]`
array (checking `shaderClipDistance` / `shaderCullDistance`), and emits
`(1, 0, 0)`, `(0, 1, 0)`, `(0, 0, 1)` at `bary_location` across the 3 strip
vertices so perspective interpolation matches `BaryCoordKHR`.
- Supports both eager and lazy graphics pipeline builds (`StageSource::bary_fallback`
in `stage_words`), clamps `--f16-interp-fallback` `top_location` against
`maxGeometryInputComponents` / `maxGeometryOutputComponents`, and refuses
mesh PSOs, explicit GS or rectangle-list stages, missing `geometryShader`, or
non-triangle topologies with clear HRESULTs (`E_NOTIMPL` / `E_INVALIDARG`).
- Adds `spirv_bary_fallback` (portable CPU test) and `d3d12_bary_fallback`
(end-to-end Vulkan GPU D3D12 PSO test).
Claim: RT-BARY-FALLBACK-PSO
AI-assisted: yes (Antigravity)
|
Case 3 still fails with a 64-component geometry input limit at
For the 64-component runs I wrapped the test's The diagnostic on both commits was Separately, the stock CPU test AI-assisted with OpenAI Codex ( |
483f012 to
53df7d1
Compare
|
Incorporated (with |
Claimed: RT-BARY-FALLBACK-ONLY-REQUIRED-INPUTS
Depends on: ProjectLeonida#1497
The translator declares interpolant locations from the FSSM table even when the pixel shader never loads them. The synthesized geometry stage was reading those locations from every vertex, which can exceed
maxGeometryInputComponentson devices with a 64-component limit. Keep all PS interface outputs matched, but zero-fill declared inputs with no load and read only statically loaded values from the VS.Validation:
git diff --checkpassed. Tests/build not run.GPUs tested: none (static runtime change).
AI-assisted: yes.