gpu: Title::make_render drops ps_binding when a pixel shader needs only view_addresses, leaving fragment buffer(2) bound to vertex arguments #414
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#414
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Sheffy007 on GitHub · 2026-11-27 17:11 UTC · original
Bug
In
crates/victory-gpu/src/native/shaders.rs(Title::make_render),ps_layoutincludesRootParam::Srv { register: 1, space: MEMORY_SPACE }wheneverps_full.view_addressesistrue(Binding::layout), so Metal Shader Converter compiles the fragment shader reading a 64-bit GPU buffer pointer forview_addresses(t1, space3) at offset0of the fragment top-level argument buffer (buffer(2)).However, two lines below,
ps_bindingis filtered with:missing
b.view_addresses.When a pixel shader indexes
ResourceDescriptorHeapdirectly (s2, or an interpolated heap index in a waterfall loop, as in the 45 pixel shaders noted in #411) and queries texture dimensions or buffer metadata viaview_addresseswithout user-data dwords, root views, or the pool page table (b.view_addresses && !b.memory && b.dwords == 0 && b.views.is_empty()):ps_bindingis dropped toNone.NativeHost::prep(Cmd::Draw) never callsview_address_argsfor the pixel stage:heap.addressesis neither built nor made resident inp.bufs, andp.ps_rootremainsNone.Metal::bind_root_render(fragment.unwrap_or(root)) binds the vertex shader'srootbytes (or nothing, leaving stale fragment bytes atbuffer(2)) as the fragment argument buffer, so the fragment shader dereferences the vertex stage's first 8 bytes as a 64-bit GPU pointer fort1— faulting the GPU (#79) or reading bogus dimensions (#258).Fix
b.view_addressesinTitle::make_render'sps_bindingfilter (b.memory || b.view_addresses || b.dwords > 0 || !b.views.is_empty()), matching every condition that adds root parameters inBinding::layout.0xDEAD_BEEF) while a pixel shader withdwords == 0queries an image's dimensions fromResourceDescriptorHeapviaview_addresses, asserting the rendered texels match the texture's width and height with 0 GPU faults.Refs #79, #258, #306, #411
@Sheffy007 on GitHub · 2026-11-27 17:11 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-27 17:11 UTC · original
Claimed by @Sheffy007. Open a draft pull request with
Refs #410in its description within 24 hours, or the claim expires.