shader: lower indexed tbuffer_load_format_* and indexed byte/half buffer loads and stores #524
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#524
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 00:03 UTC · original
Problem
In
Lower::buffer(crates/victory-shader/src/emit/lower.rs):tbuffer_load_format_*/tbuffer_load_format_d16_*setstyped = trueandformat = Some(f), then lowers through raw byte reads (raw_view+format_load) rather than a typed DXIL handle. However, bothSource::Built(root views with an explicit stride in dword 1) andview_stride(heap-indexed and unstrided table views) skip foldingindex * strideintooffwhenevertypedistrue, andif let Some(f) = *formatunconditionally refusesindex.is_some()with"a typed-format load by index". InTracer::stride_cleared(crates/victory-shader/src/resource.rs), descriptors whose stride was cleared (s_and_b32with0xC000_FFFF) or rewritten bymade_rawalso did not covertbuffer_load_format_*/Resources::unstrided.buffer_load_{ubyte,sbyte,ushort,sshort}andbuffer_store_{byte,short}withidxenon aStructuredBuffer/RWStructuredBuffer(used.stride >= 4 && used.stride % 4 == 0) are unconditionally refused with"a byte or half buffer load by index"and"a byte or half buffer store by index", even though DXILrawBufferLoadandatomicBinOpaccept(index, elementByteOffset)on structured buffer handles ((12 | u, stride)).Proposed Fix
index * strideintoofffortbuffer_load_format_*(format.is_some()) onSource::Builtroot views andview_strideheap/table views, and lowerStructuredBufferindexedtbuffer_load_format_*via(12 | u, stride)handles informat_load(matchinggetDimensionson dword 2).tbuffer_load_format_*inTracer::stride_clearedand recordmade_rawbuffer sites inResources::unstridedso cleared-stride descriptors dropidxen.buffer_load_{ubyte,sbyte,ushort,sshort}andbuffer_store_{byte,short}on structured buffers viarawBufferLoad.f32and pairedatomicBinOp.i32on(12 | u, stride)handles.Refs #4, #258
@Sheffy007 on GitHub · 2026-11-28 00:03 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-28 00:04 UTC · original
Claimed by @Sheffy007. Open a draft pull request with
Refs #520in its description within 24 hours, or the claim expires.