gpu: bind recording upload indices for translated indirect draws #2254
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2262"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T08:41:16Z.
Refs #1759. Follows #2252.
The translated indexed indirect route accepts an index view fully contained in a slot 148 upload allocation of the current recording. The compute validator and input assembler use the exact same GPU range in GENERIC_READ. The upload lives through the existing recording and fence ownership. The caller completes CPU writes before submission and keeps the bytes stable through execution.
The upload view must have a DWORD-aligned offset and size so an R16 load stays within its owned range while fetching a packed word. A different recording, incomplete coverage, overlapping placed buffers and readable addresses without GPU backing are refused.
At
d0b31a26on Windows 26200.9974, MSVC 19.51.36244.0 Release, D3D12 debug layer on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656:18/18 passed, zero skips. The source-built R16 case supplies an eight-byte index view at a nonzero offset, with invalid indices during recording and a final write before submission. The R32 case has different offsets and a nonzero base vertex. Both positive cases paint the expected half, with exact readback of all pixels and protected argument words. Cross-allocation, foreign-recording, half-word-aligned and unowned CPU views leave the target clear. The earlier placed-only shim refused the same eight-byte positive control on both adapters.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T08:44:55Z.
Review: COMMENTED
Review at head
d0b31a2683a4fb746e43baa8bc8ee97a50f9b69f.Scope read:
git diff --stat origin/main...HEAD(5 files, +102/-20), then thesrc/startup_stubs/d3d12_xs_device.cppandd3d12_draw.inlhunks,CMakeLists.txttest registration and thedocs/experiments.mdsection.Logic checks
indices.rejectis still refused, now with a clearer message. Placed owners without a real resource fall to the else branch, where!indices.ownermakes the upload lookup return empty, so they are still refused.translated. The range must sit fully inside one allocation of the current open recording, throughlist_upload_rangeunder the shared lock. Another recording or a partial cover therefore returns an empty allocation and is refused.(upload.offset | view.SizeInBytes) & 3refuses non-DWORD offsets and sizes. This matches the validator's 32-bit word loads for R16, so a packed half-word load cannot read a neighbouring allocation.require_stateis skipped for upload-backed indices in both places invalidate_indexed_arguments. Upload-heap resources are fixed in GENERIC_READ, so a transition there would be invalid. Skipping it is correct. Theindices != draw.argumentcomparison is unaffected.translated_indexed(timeout 60, skip code 77) and covers warp and hardware. The docs section matches the code.Commands executed locally (Linux worktree)
python3 tests/docs_links_check.py: self-test passed, 18 Markdown files, 432 links.python3 tests/bidi_controls_check.py: self-test passed, 1546 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.gh pr checks: Linux Python checks and gfx1013 fixtures pass. Windows build and test was still pending when I looked. The /O2 job was skipping.Not done
Findings
Verdict: no blocking issues found. Please wait for the Windows CI job to go green before marking this ready.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T09:04:21Z.
Review: COMMENTED
Re-review at head
18323d39054d190073cbb3c5141748b3e984cb37(previous review was atd0b31a26).Scope read:
git diff --stat origin/main...HEAD(still 5 files, +102/-20), then the PR-only hunks ofd3d12_xs_device.cpp,d3d12_draw.inl,CMakeLists.txtandtests/startup_indirect_draw_indexed.cpp. The new head is a merge of main plus the PR; I looked at how the merge resolved against the rectangle path that landed on main.What changed and how it checks out
list_execute_indirectkeeps main'stranslated && indexed && topology == 0x11rectangle allowance. The PR's upload branch sits only in the index-view lookup, so the two do not interfere.translated-indexedandtranslated-indexed-recttests from main are intact, and the newtranslated-indexed-uploadtest is registered next to them (timeout 60, skip 77, warp and hardware).index_upload_unaligned(R16 view starting at a half-word offset), plusindex_upload_crossandindex_upload_foreign(view from a different recording). All three are expected refusals.require_stateskips for upload-backed indices (!draw.indices.upload) are unchanged and still correct for GENERIC_READ upload heaps.Commands executed locally (Linux worktree at this head)
python3 tests/docs_links_check.py: self-test passed, 18 Markdown files, 433 links.python3 tests/bidi_controls_check.py: self-test passed, 1562 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.git merge-tree --write-tree origin/main HEAD: merges cleanly.gh pr checks 2262: Linux Python checks pass. gfx1013 fixtures and Windows build/test were still pending when I looked. The /O2 job was skipping.Not done
Findings
Verdict: no blocking issues at this head. Please wait for the Windows CI job to go green before marking ready.
AI-assisted; commands listed were executed locally.