shader: lower computed buffer descriptors in mesh shaders, dynamic root-descriptor counts, and VGPR-spilled descriptor phis #556
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#556
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-28 03:28 UTC · original
Problem
Several classes of valid descriptors still fail in
victory_shader::resourceas"a descriptor neither loaded nor built"or"a buffer descriptor built around a computed address"(Refs #258, #525):HwStage::Ms) dropcomputed_buffers:emit::translate_withpassescomputed_buffers = truefor guessed graphics containers (which include mesh-style vertex programs whosenative.stageisHwStage::Ms), andvictory-metalalready binds the zero-copy page-table SRVs and argument buffer on the mesh stage (bind_root_render). However,resource::track_graphicsrestrictst.computed_bufferstoHwStage::Vs | HwStage::Ps | HwStage::Cs, forcingcomputed_buffers = falsefor everyHwStage::Msprogram. In addition, thestructure::killingretry inemit::emit_fastdropsnative.stage == HwStage::Csfrom itscomputed_buffersflag.RootType::Descriptor) with dynamicnum_records: Whencomputed_buffersis enabled and a 4-dword V# buffer descriptor[lo, hi, w2, w3]is built around aRootType::Descriptoraddress (slot != VERTEX_TABLE) with a runtimew2(num_records),Tracer::classifyskipsSource::BuiltMemory(which checkedaddress.param == MEMORYonly) and skipsSource::Built(which requiresTerm::Const(w2)), falling through to"a descriptor neither loaded nor built". In compute shaders (HwStage::Cs),Lower::newalso needsroot_memoryset whenSource::BuiltMemoryis present soLower::userexposes the root descriptor's 64-bit title address.w3) or immediate sampler dwords formed by constant scalar ALU chains (s_or_b32,s_and_b32,s_bfi_b32,s_bitset*, shifts, etc.) stayTerm::Valueafter copy propagation and failTerm::Constchecks inTracer::classify.75c5b97a(#404) handled VGPR-spilled descriptors when all phi edges spill the same origin, but when two uniform control-flow arms spill different descriptors into the same scratch VGPR lanes (v_writelane_b32) and restore them after the join (v_readlane_b32),Tracer::phionly checks SGPR phis and refuses the restored descriptor as"a descriptor neither loaded nor built".Proposed Fix
HwStage::Msint.computed_buffersinresource::track_graphics, and keepcomputed_buffersconsistent inemit_fast'sstructure::killingretry.Source::BuiltMemorywhencomputed_buffersis enabled and a V# buffer descriptor is built around a non-VERTEX_TABLERootType::Descriptorwith a runtimenum_records(w2), and setroot_memoryinLower::newwhenSource::BuiltMemoryis used.Source::ConstantandSource::Built/Source::BuiltMemorydwords.v_readlane_b32of constant scratch VGPR lanes across VGPRphijoins inTracer::phiandTracer::collect_descriptor_loads.victory-shaderand an end-to-end Metal GPU value test invictory-gpu(mesh_tests) verifying a mesh shader readingPoolmemory through a computed V# buffer descriptor with runtimenum_recordsbounds.@Sheffy007 on GitHub · 2026-11-28 03:28 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-28 03:29 UTC · original
Claimed by @Sheffy007. Open a draft pull request with
Refs #552in its description within 24 hours, or the claim expires.