startup: bind translated resources for indirect draws #2224
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2232"
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-25T06:43:04Z.
Refs #870.
Enable one translated, non-indexed slot 61 Draw with
X2W_TRANSLATED_INDIRECT_DRAW=1. After validating the signature, root, target and placed argument span, the translator binds its existing graphics PSO and sampled texture resources. Desktop ExecuteIndirect reads the argument at its recorded GPU offset. The caller supplies legal draw arguments.This scope covers a triangle list with one single-sample colour target, a matching slot 57 root, explicit viewport and scissor, and the existing texture-table bindings. Compiled shader reflection checks actual use of entry constants. Draw-dependent start vertex or instance, vertex streams, buffer SRVs, dynamic samplers, unknown bindings and unreflectable shaders are refused.
Local MSVC Release, Windows 11 build 26200.9974. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, D3D12 debug layer enabled. The fixture compiles its own shaders. A GPU producer writes one Draw command at byte 4 in a separate desktop resource. Red and green texture bindings both match all eight pixels, guard words and GPU argument words. The omitted producer, wrong root, short argument range, missing texture and shader that reads start vertex all leave the clear colour. The CPU argument backing stays zero.
21/21 passed, no skips. After adding the shader key to the success diagnostic, the two translated draw tests passed again. AI-assisted. Commands executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T06:46:30Z.
Review: COMMENTED
Review of head
38971e07f5347922ec716f02772a45c3aab94f8b(static review plus Linux checks; the Windows-only C++ was not built or run locally).Commands executed locally
git diff --stat origin/main...HEAD: 5 files, +302/-14python3 tests/docs_links_check.py: self-test passed, 18 Markdown files and 412 links OKpython3 tests/bidi_controls_check.py: 1507 files, no bidirectional controlsgit diff --check origin/main...HEAD: cleangh pr checks: Linux Python checks, Windows build and test, and gfx1013 fixtures pass. The /O2 job and the chart job are skipped.Findings
d3d12_xs_device.cpp,list_execute_indirect): the commit subject says "bounded indirect draws" but the PR title says "indirect draws". Align them before merge.d3d12_draw.inl,draw_translated): refusals inside the SRV loop happen after earlier SRV slots may already have calledrequire_state/upload_texture. This only adds barriers and uploads that the next draw would add anyway, so it is harmless, but a short comment would help the next reader.d3d12_draw.inl,indirect_shader_entry):Translation::independent_indirect_entryis cached per translation. That is correct today because the shaders andudsare fixed per translation. Please note that invariant next to the member.draw_dump_afterand the per-draw log. That is fine, but it makes diagnostics weaker than direct draws.What looks right
X2W_TRANSLATED_INDIRECT_DRAW). The default path is unchanged: the old condition is only relaxed whentranslatedis true.pass.root, and refuses dynamic samplers, non-zero SRV sources, and any used entry constant that is not a root constant, rect or d16 constant. This covers start vertex and start instance.ExecuteIndirect, the code restores the guest root and resetssrv_bound, so later draws re-bind.SKIP_RETURN_CODE 77only for backend unavailability.Not done
win2025run. The PR reports local WARP and hardware results, and Windows CI is green.AI-assisted; commands listed were executed locally.