gpu: read live aliased indices in direct translated draws #2716
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2724"
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-26T03:49:44Z.
Refs #2714. Uses the source-built reproduction published in that issue.
On the same Windows build and adapters, the current direct draw matched the two unchanged controls but missed all 32 pixels in each late-write case. If the index range fits one live placed alias and the translation has no vertex-stream SRV that needs slicing, keep the desktop index resource with the recording and use its GPU view. The existing snapshot remains paired with any vertex range derived from it, so command lists cannot read a newer index against an older sliced vertex stream.
Windows Release passed 10/10 related CTests on WARP and RTX 4060 Laptop (32.0.16.1656) without skips. The new test covers visible and clipped controls, both directions of the pre-submit rewrite, and a 32-bit view with a leading decoy index. All 32 pixels match in each case with the debug layer enabled. Copied descriptors, stream fetch, translated indirect targets and pixel UAVs passed in the same tree.
This covers the live-alias slice of the source-built report. The recorded executable trace does not establish that its clipped draw used this sequence.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:12:07Z.
Review: COMMENTED
Win2025 WARP receipt for head
602e9189after updating with main (3 commits).Review of this head (code and fixture tests only; no executable or game results claimed):
src/startup_stubs/d3d12_draw.inl: the live alias is used only when the index range is aligned, inside the view, fits one placed alias, the owner is still alive, and no vertex-stream SRV needs the recording-time scan. All other draws keep the snapshot path, so a sliced vertex range is never paired with a newer index read.tests/startup_direct_index_late_write_check.py+startup_stream_draw.cpp: unchanged controls, both directions of a pre-submit rewrite, and a 32-bit view with a leading decoy index. All 32 pixels are compared after the fence.git diff --check origin/main...HEADclean,tests/docs_links_check.pyandtests/bidi_controls_check.pypass. PR CI is green on this head.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
--preset dev):ctest --preset dev -R '^startup_(direct_index_late_write|copied_vertex_srv|stream_fetch|indirect_translated_targets|pixel_uav|address_buffer_srv|frame_copy)_(warp)$' --no-tests=error --output-on-failure: 7/7 passed.--preset release): same regex: 7/7 passed.d3d12_xs_device_obj d3d12_xs_shim startup_stream_consumer startup_indirect_draw_indexed.startup_indirect_draw_indexedin the targets failedstartup_indirect_translated_targets_warp(fixture not built); with the target it passes.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:12:08Z.
Win2025 WARP receipt for head
602e9189after updating with main (3 commits).Review of this head (code and fixture tests only; no executable or game results claimed):
src/startup_stubs/d3d12_draw.inl: the live alias is used only when the index range is aligned, inside the view, fits one placed alias, the owner is still alive, and no vertex-stream SRV needs the recording-time scan. All other draws keep the snapshot path, so a sliced vertex range is never paired with a newer index read.tests/startup_direct_index_late_write_check.py+startup_stream_draw.cpp: unchanged controls, both directions of a pre-submit rewrite, and a 32-bit view with a leading decoy index. All 32 pixels are compared after the fence.git diff --check origin/main...HEADclean,tests/docs_links_check.pyandtests/bidi_controls_check.pypass. PR CI is green on this head.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
--preset dev):ctest --preset dev -R '^startup_(direct_index_late_write|copied_vertex_srv|stream_fetch|indirect_translated_targets|pixel_uav|address_buffer_srv|frame_copy)_(warp)$' --no-tests=error --output-on-failure: 7/7 passed.--preset release): same regex: 7/7 passed.d3d12_xs_device_obj d3d12_xs_shim startup_stream_consumer startup_indirect_draw_indexed.startup_indirect_draw_indexedin the targets failedstartup_indirect_translated_targets_warp(fixture not built); with the target it passes.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T04:17:20Z.
Post-merge receipt on
602e9189(#2724), independent AMD RDNA 4 result: the neighbourhood passes on hardware, and reverting onlyd3d12_draw.inlmakeslate-visiblefail. Not a code change; measurements only.Environment
10.0.26200.9974, UBR0x26f6,DisplayVersion25H2; the registryProductNameon this install still readsWindows 10 Pro.19.44.35230(VCToolsVersion=14.44.35207); the DXC and FXC used are the ones underWindows Kits\10\bin\10.0.26100.0\x64\.AMD Radeon RX 9070 XT, driver32.0.32029.2010. Thewarpbackend selects an adapter reported asMicrosoft Basic Render Driver, driver10.0.26100.9818.dev(CMAKE_BUILD_TYPE=DebuginCMakePresets.json). Every mode line reportsdebug layer unavailable, and withX2W_D3D12_DEBUG=1the shim printsx2w-d3d12 debug layer: 0x887a002d (not installed?)— no API validation is involved below.602e9189(Merge branch 'main' into codex/live-index-alias); the API reports base562f7ddbonmainfor this PR. The PR was merged asfeec219ewhile these runs were in progress, and602e9189is the head that was merged, so this is a receipt on whatmainnow carries.Commands
The regex takes the five prefixes listed in the description plus
address_buffer_srvandframe_copy, on both backends.Observed
100% tests passed out of 14, 14Passedlines and no***Skippedor***Failedline,Total Test time (real) = 24.88 sec. The same regex reduced to the five prefixes of the description gives100% tests passed out of 10in20.79 sec. The hardware entry prints one line per mode:The warp entry prints the same five lines with
adapter=Microsoft Basic Render Driver driver=10.0.26100.9818. In the hardware block oneadapter=line before the modes also namesMicrosoft Basic Render Driver; the five lines that report each mode are the ones that name the AMD adapter. Three further runs ofstartup_direct_index_late_write_hardwareeach reported100% tests passed out of 1.Reverting only
d3d12_draw.inlThe PR's test file and its
tests/startup_stream_draw.cppwere kept; onlysrc/startup_stubs/d3d12_draw.inlwas restored to the base562f7ddb(the file then differs from the head by7 insertions(+), 32 deletions(-), and afindstrforlive_index_resourceon it returns nothing), then rebuilt. The shim banner in those logs readsbuild=602e9189-dirty, againstbuild=602e9189for the restored rebuild. Two lines of the resulting log, the second from its final summary:That assertion appears once per backend; both entries (
1/2for warp,2/2for hardware) are***Failed. The message prints 32 four-byte groups, all0000ffff, abbreviated above. That is the fixture'sCLIPPEDconstant, the value theclippedcontrol reads back, and the clear colour the record-time indices (3, 4, 5) leave behind. Both controls printed32 exact pixelsfirst.The traceback stops in
check()at line 47, after the guards at lines 41-44 (theslot133 ... aliased gpuva=line and theindexed(3, 1, start 0, base 0) ... -> drawnline). The pixel assertion does not print the child's stderr, so the line number only shows that those two guards were satisfied on the old path, not what they matched. Restoring the file and rebuilding returns 2/2 passed.On this adapter, then, with the PR's fixture and the base draw file,
late-visiblereads back the record-time indices. That is the source mutation the receipt above lists as not run.Binaries on the restored tree:
startup_stream_consumer.exe36B3F967DDB78B195D6372DBF51A8007F13C5030805D526C71BB3792F986E055,d3d12_xs.dll8A94B7FFCB433C4CD432C306596F9242B4A9912663A811D4C37DCB4100A8A87E. The reverted run used a differentd3d12_xs.dll, identified by itsbuild=602e9189-dirtybanner rather than by a separate hash.Limits
visible,clippedandlate-visibleexecuted, solate-clippedandlate-visible-r32were not compared against the old path. The causal statement above coverslate-visible.releasepreset is not measured here.require_statecall on the live view are not validated.srv.source == 1) is not exercised: none of the five modes records a vertex-stream SRV (the vertex shader uses onlySV_VertexID), so the new path is only seen on the branch where that guard is absent.count=3,startin{0, 1}, base vertex 0, one index buffer, no indirect,R16_UINTin four modes andR32_UINTin one.D3D12_FEATURE_EXISTING_HEAPSis unsupported; it is supported here, so no mode skipped.AI-assisted.