cpp-migration: accept byte-window buffer descriptors for stores in the direct C++ compute path #2965
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#2965
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?
@Leyukaka on GitHub · 2026-11-26 23:57 UTC · original
Target branch
cpp-migration. Part of #2935 (instruction coverage). I am taking this; please say if you already have it locally and I will drop it.Gap: a common idiom turns a loaded structured-buffer descriptor into a raw byte window before a buffer store:
The direct compute analysis already recognises these word edits (
zero_stride_word,byte_count,byte_oobingfx1013_compute_native.cpp). Two things keep the store from using them:raw_buffer_uav, which expects four unmodified descriptor words. It is refused with "non-contiguous resource descriptor". Only loads relax that check, throughbyte_window_srv.byte_oobrequires word 3 to be cleared with0xcfffffffbefore the OR.tools/startup/gfx2hlsl.pyalso accepts the OR on a plain loaded word, since OR-ing0x30000000setsOOB_SELECT(DW3[29:28]) to 3 whatever it held and touches no other bit.Measured on a local capture of 2,689 compute requests (counts and instruction shape only), with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requestsbuilt fromcpp-migrationf934df52.buffer_store_dword{,x2,x3,x4}.s_max_u32 ..., 1.v_readfirstlane_b32or ans_cselect_b32chain, and are out of scope.Plan:
gfx2hlsl.pydoes. This reusesraw_buffer_uavwith the relaxed word check, so the manifest and runtime are unchanged.s_mul_i32operand must be the clamped stride of the same descriptor's word 1.docs/experiments.mdalready notes for the Python path. With a guest stride of 0, the guest byte count is 0 while the host view still accepts writes, which is the same view-sizing limit.Tests: a hardware readback through
native_store_replay.s_mul_i32operand is not the clamped stride;s_or_b32with a constant other than0x30000000.AI-assisted.
@MasterDomino on GitHub · 2026-11-27 00:36 UTC · original
Closed by #2967, merged into
cpp-migrationas78a071ca.native_bytewin_store_hardwarepasses on an RTX 5080 (author) and on an RX 9070 XT, and disabling the store byte-window path brings backnon-contiguous resource descriptor. AI-assisted.