shader: read computed buffer descriptors in guessed vertex shaders #133
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!133
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-133"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Olima34 on GitHub · 2026-11-26 18:24 UTC · original
Olima34:fix/native-vertex-computed-buffers→main· +102 −2 · 4 files · 2 commits · merged 2026-11-26 19:02 UTCThe tester log in #123 shows four guessed vertex shaders refused with "a buffer descriptor built around a computed address". The translator allowed such descriptors (read through the title-memory page table) only in pixel and compute shaders.
Why it is safe. The Metal host already gives the page table to the vertex stage of a guessed pipeline. For a draw,
memory_argsinnative/host.rsputs the table's address in the vertex shader's root arguments when itsmemoryflag is set, as it does for the pixel shader.bind_root_renderinvictory-metal/src/gfx.rssends those arguments to the vertex stage, binds the heap to both stages and makes the heap views and pool buffers resident forVertex | Fragment.shaders::unsupportedalready accepts the page table for guessed graphics at any stage. So the only block was in the translator.What.
resource::track_graphicsnow allows computed buffers in vertex shaders as well as pixel and compute shaders (mesh shaders unchanged). The refusal text is unchanged; a vertex shader translated withoutzero_copy_memoryis still refused. docs/native-host.md: "Computed pixel buffers" becomes "Computed pixel and vertex buffers" and says how the host binds the table for both stages.Tests.
gfx_refusal_tests::guessed_vertex_computed_buffer_loads_use_title_memory: a hand-assembled guessed vertex shader with a computed buffer load translates. Refused on main.addr_tests::guessed_vertex_buffer_reads_the_pool: a GPU draw whose vertex shader reads its triangle's positions from title memory through a computed descriptor must cover the whole 8×8 target. Fails on main (translation refused), and also fails if the positions in memory are zeros, so the draw checks that the vertex stage really reads title memory.cargo test -p victory-shader -p victory-gpu -p victory-metalon arm64 (248, 186 and the Metal tests), Windows clippy andcargo xtask policypass. Not checked: the four shaders from #123 themselves; they may meet another refusal after this one.A guessed vertex shader's buffer descriptor built around a computed address was refused ("a buffer descriptor built around a computed address"); the tester log in #123 shows four such shaders. The Metal host already binds the page table for the vertex stage: memory_args gives each stage's root arguments the table's address, and the heap and pool buffers are made resident for both render stages. So the resource tracker now allows computed buffers in vertex shaders too. Tests: a guessed vertex shader with a computed buffer load translates (gfx_refusal_tests), and a draw whose vertex shader reads its positions from title memory through such a descriptor covers the target (addr_tests::guessed_vertex_buffer_reads_the_pool). Both fail without the change.@LakshanSivakumar on GitHub · 2026-11-26 19:02 UTC · original · approved these changes
Reviewed and tested together with the other open PRs. I merged main into the branch and resolved the conflict in docs/native-host.md: I kept main's newer text for that bullet and added this PR's vertex-shader wording. Thanks!