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)
# Conflicts: # docs/design.md
…pairs (RT-BARY-FALLBACK-PER-VERTEX)
A pixel shader with a computed I/J pair, translated with --bary-fallback, reads the pair's attribute as a Flat
vec4[3] at the first of three locations its index entry gives under bary_fallback_input.per_vertex. The runtime's
geometry-stage builder read only bary_fallback_input.location and refused that input ("PS pass-through Input at
Location 0 is not vec4<f32>"), so such a PSO was never created.
- shader_library.h: parse per_vertex (attribute -> first location) into ShaderEntry::bary_fallback_per_vertex; one
malformed entry drops the whole map.
- spirv_bary_fallback.h: build_bary_fallback_gs takes the map and writes the triangle's three values of each mapped
VS output to the PS's Flat vec4[3] (element k = vertex k, the same at every emitted vertex), as
tools/bary_fallback_gs.py does. An attribute the VS does not export is zero-filled. A vec4[3] the map does not
name, a block that runs into another input or the barycentric location, and two attributes at one first location
are refused. The old signature stays as a wrapper with an empty map.
- d3d12_vulkan_device.cpp: both call sites (eager and lazy) pass the entry's map.
- Tests: spirv_bary_fallback (five per-vertex cases), shader_library (twelve per_vertex parsing cases),
d3d12_bary_fallback (two draws of a synthetic computed-I/J PS and one refusal).
- docs/design.md: the runtime builder in the "Barycentric fallback" row, with what was and was not checked.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
3 of 4 tasks
mrgenty
force-pushed
the
rt-bary-fallback-per-vertex
branch
from
November 26, 2026 13:17
07d0699 to
682de28
Compare
This was referenced Nov 26, 2026
Owner
|
Superseded by ProjectLeonida#2304. |
mrgenty
pushed a commit
that referenced
this pull request
Nov 28, 2026
Titles import gameinput.dll by ordinal only (VIctory's gameinput module registers #1 and nothing else). The loader looks ordinal imports up as #<n>, so the SDL3 shim was never bound and the import went to the host's GameInput.dll. Not built here: no SDL3 in this configuration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mrgenty
pushed a commit
that referenced
this pull request
Nov 28, 2026
Port VIctory's GameInput module (gameinput.rs, gameinput/dualsense.rs, GPL-3.0-or-later) as shims/gameinput_xinput.cpp: XInput pads 0-3, a wired DualSense over HID, the keyboard as its own device, and a keyboard pad that stands in while no other pad is connected. Readings per change with a 32-deep history, blocking and async device enumeration, UnregisterCallback waiting for a running callback, FindDeviceFromId and XInput rumble, all as VIctory runs the title. It is built into gta6rt when the SDL3 shim is not (the main build has no SDL3), instead of binding the import to the host's GameInput.dll, which has no keyboard pad; LEONIDA_GAMEINPUT=host keeps that path and LEONIDA_KEYBOARD_PAD=off drops the keyboard pad. Registered by name and ordinal #1. gameinput_xinput_test runs it over a fake host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mrgenty
pushed a commit
that referenced
this pull request
Nov 28, 2026
…ate-decay fix(gpu): resolve D3D12 error 538 in buffer comparisons
mrgenty
pushed a commit
that referenced
this pull request
Nov 28, 2026
Keep diagnostic end markers after the comparison while retaining its separate queue call and the existing fence. Refs: #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: RT-BARY-FALLBACK-MIXED-DISTANCES
Depends on: ProjectLeonida#1930
What and why
The synthesized fallback geometry shader previously rejected a valid vertex shader when it wrote both
ClipDistanceandCullDistance. Vulkan permits both arrays in the same stage (subject tomaxCombinedClipAndCullDistances), so rejecting them prevents otherwise supported graphics PSOs from using the barycentric fallback.The generator now declares and forwards each built-in independently, with its own array type, input/output variable and capability. The existing geometry-stage checks already require
shaderClipDistanceandshaderCullDistancefor the corresponding arrays.Verification