D3D12.X: forward DrawIndexedX IndexOffset as BaseVertexLocation #3233
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3233"
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 ivall/xcl. Originally posted by Kalmarv on 2026-11-28T23:37:34Z.
Forward
DrawIndexedX4th parameter (IndexOffset) asBaseVertexLocation(index_offset as i32) when dispatching toprepare_indexed_drawandemit_prepared_indexed_drawinstead of hardcoding0.What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: forwardindex_offset as i32asbase_vertexindraw_indexed_xand extenddraw_indexed_x_routes_through_bind_and_restores_index_bufferto verify positive (42) and negative (0x8000_0007) sign-cast offsets.Tested
rustc 1.99.0, DXC 1.9 (XCL_DXC_DIR), debug for unit tests and release forxcl-smoke.cargo test -p xcl --lib draw_indexed_x_routes_through_bind -- --nocapture: 1 passed, 0 failed, 0 ignored.BISECT1, RTX 5070 Ti,XCL_DIRECT_DXIL=all):exit 0x0,1.69 fps(matching baseline),0removals,0crashes.Regression run
main (
f0e8fdd5c3942ddd399d5ee11384c8595c5aacff):PR head (
568806cb05c71fac4819a7bba5d07b4cf646f453):Not tested
SV_VertexIDoffset injection for input-layout-less shaders whenIndexOffset != 0.AI use
xcl-smokeregression run.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:24:06Z.
merge-check
base:
7d86c5d2b7head:
568806cb05merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2896 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (list_x.rs, +15/-11). Every DrawIndexedX whose 4th argument isn't zero now draws with that value as BaseVertexLocation. Findings: (1) nothing shows the argument's meaning: main's doc comment and HANDOFF.md (~611) call it
flags, and the PR shows no trace of a title passing a non-zero value. If it is flags, every such draw shifts its vertex fetches by that value and the geometry comes out wrong. Logging the first non-zero values a retail title passes (index address, format, count, 4th argument) would settle it, and the description should note that HANDOFF.md's "flags" becomes wrong. (2) The capture record (capture.rs ~1063) doesn't store the offset. (3) The full suite wasn't run; AI use says "Antigravity (Gemini)", not an exact model. The PR's CI failure was an access violation during theeh::/gpu::agilitytests, beforelist_x; it passes in the run above. Fine: the u32 -> i32 cast keeps the bits (the test covers 0x8000_0007),prepare_indexed_drawand the emitted draw get the same value,sync_title_buffers(None, ..., 2)copies the whole mirrored vertex buffer so a base vertex can't read stale data, the indexed path has no rect-list expansion, and the test fails without the change.performance: 60 s smoke of a retail title, main
7d86c5d2vs this merge (104474ef): 1663 -> 1686 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 17153 -> 17599 MB, 0 device removals, 0 crashes. The title doesn't show whether it passes a non-zero 4th argument, so this run doesn't settle the finding.verdict: not yet: nothing shows DrawIndexedX's 4th argument is a base vertex rather than the flags main and HANDOFF.md call it; if it is flags, every such draw fetches shifted vertices
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T19:38:19Z.
Closing: unsourced ABI guess on
DrawIndexedX's 4th argument (flagsonmain) flagged in review.Pull request closed