shader: formatted buffer byte-window review follow-up #3346
No reviewers
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!3346
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3344"
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?
@romn4rch on GitHub · 2026-11-28 11:21 UTC · original
romn4rch:copilot/pr-3232-review-2e633a14→main· +268 −35 · 14 files · 5 commits · openReplacement submission for #3234. This branch contains the existing formatted-buffer work plus the verified review follow-up commit. The original PR remains open because its author-owned branch was not writable from this account; these PRs overlap in scope, so please keep only one submission and close/mark the other as superseded when choosing.
Validation: build,
native_direct_container, hardware dispatch, and docs-link checks passed. In-box WARP was skipped because of its 4-lane wave limit.@KelboLive on GitHub · 2026-11-28 21:23 UTC · original · approved these changes
LGTM — clean extension of MTBUF formatted loads to the SRV byte window with identity DST_SEL enforcement.
requires_identity_dst_selthreads cleanly from manifest → cache encoding → binder → dispatch refusal.indirect_table_bufferchecks identity DST_SEL (word 3) and component mapping (shader4component) before binding.gfx1013_compute_mtbuf.inldetects the zero-stride rewrite and routes throughbyte_window_srv.startup_compute_mtbuf_window_check.pycovers identity readback, swapped X/Y refusal, CBV-token refusal, and cold/warm cache manifest equality.The flag propagation and refusal granularity are consistent with the existing codebase patterns.
@KelboLive on GitHub · 2026-11-28 21:57 UTC · original · approved these changes
LGTM — clean extension of MTBUF formatted loads to the SRV byte window with identity DST_SEL enforcement.
requires_identity_dst_selthreads cleanly from manifest → cache encoding → binder → dispatch refusal.indirect_table_bufferchecks identity DST_SEL (word 3) and component mapping (shader4component) before binding.gfx1013_compute_mtbuf.inldetects the zero-stride rewrite and routes throughbyte_window_srv.startup_compute_mtbuf_window_check.pycovers identity readback, swapped X/Y refusal, CBV-token refusal, and cold/warm cache manifest equality.The flag propagation and refusal granularity are consistent with the existing codebase patterns.
@Leyukaka on GitHub · 2026-11-29 07:20 UTC · original · requested changes
Reviewed
2e633a14by its diff, againstmain212d4b5f; by reading only, nothing built or run. The body declares this a replacement for #3234. Thesrc/patch is line-for-line the one in #3234 at1b3ee661(same six files, same commits587fc6d2and80952189); the two heads differ insrc/only by base drift. The three points of my review there still apply:git merge-tree --write-tree origin/main 2e633a14exits 1 with conflicts ingfx1013_compute_mtbuf.inl,d3d12_compute_dispatch.inl,d3d12_draw.inlandnative_mtbuf_check.py.mainadded a sixth parameter toindirect_table_buffer(d3d12_draw.inl:2514), before the snapshot bool: The PR's call atd3d12_compute_dispatch.inl:655is: Withrequires_identity_dst_selappended tomain's signature, this call still compiles if kept as is:truebecomes alignment 1, the flag becomes the snapshot bool, and the DST_SEL check is never requested. Fix:(..., 16u << 20, D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT, true, slot.requires_identity_dst_sel), asmainpasses atd3d12_compute_dispatch.inl:794.gfx1013_direct_graphics.inl:1960, thengfx1013_direct_compute.inl:561). The graphics manifest (direct_compute_cache.cpp:913) writessrv <i> buf tablewithoutidentity_dst_sel, and the graphics binder (d3d12_draw.inl:2986) callsindirect_table_buffer(self, words)with no DST_SEL check. Fix: refuse a flagged binding in the graphics formatter, or limit the byte window to compute, and add a pixel-shader refusal case.0x0103efa5against0x0103efac; DST_SEL_X is bits 2:0,tools/startup/gfx2hlsl.py:179). Changing(words[3] & 0xfffu) != 0xfacuto(words[3] & 0x3fu) != 0x2cuatd3d12_draw.inl:2422still refuses that input, so the suite passes. The same holds at:2390for a low-6-bit compare ofShader4ComponentMapping, since the only control isENCODE(1, 0, 2, 3). Fix: anxyzwload with a Z/W swap control, for both the DST_SEL word and the SRV mapping.On a pull request, CI runs
ctest --preset pr(.github/workflows/windows.yml:493). Its include list (CMakePresets.json:51) matches none ofnative_mtbuf_*,native_direct_container,native_global_srv_heap_replay_*orstartup_compute_mtbuf_window_*, so the green check does not cover these tests. After the rebase, please post thectest -Rcommand and its result for them.Request changes for 1-3 on
2e633a14.@JohnConnorNPC on GitHub · 2026-11-29 13:24 UTC · original
Review of head
2e633a14againstmainc04e0dd6. I read git objects only; nothing was built or run.This looks superseded by #3234, which has merged. #3234 merged on 29 November (
94ce06a3).src/commits of this branch are onmain:git merge-base --is-ancestor 587fc6d2 origin/mainand the same for80952189both exit 0.b450fe44(test: cover MTBUF byte-window refusals), andgit merge-base --is-ancestor b450fe44 origin/mainexits 1. #3234 landed a different follow-up for the same review point,5399a2d8(test: cover MTBUF writable alias and CBV refusals). Onmain,tests/startup_compute_mtbuf_window_check.pyalready refuses the writable alias (reason = 'a writable MTBUF byte window has no verified view contract').main. The call ind3d12_compute_dispatch.inlreadsindirect_table_buffer(self, words, false, &reason, 16u << 20, D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT, true, slot.requires_identity_dst_sel).git merge-tree --write-tree origin/main 2e633a14exits 1, with conflicts indocs/experiments/native-global-srv-heap-replay.md,tests/startup_compute_mtbuf_window_check.pyandtests/startup_stream_consumer.cpp. Those are the files whereb450fe44and5399a2d8differ.MUST
mainalready has. I suggest closing it as superseded by #3234. If anyb450fe44case is still wanted, open a small PR againstmainwith just that case. One example is the direct-containercompute-tbuffer-writable-byte-windowcontrol, whichmaindoesn't have.The graphics-path and DST_SEL mask points from the review of this head were raised against the
src/patch that is now onmain. If they still hold onmain, they need an issue againstmain, not this branch.SHOULD / NIT: none.
AI-assisted.
@Leyukaka on GitHub · 2026-12-02 07:13 UTC · original
This looks fully superseded by #3234, which merged on 29 November: as noted above, both
src/commits here are already ancestors ofmain. Unless something is still missing from it, I think this one can be closed. Thanks for the work on it!View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.