d3d12: give direct-indexed compute roots with tables the resource index map #294
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/294"
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 brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-27T02:41:22Z.
Summary
A compute root that has descriptor tables and
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXEDgot no resource index map. #235 adds the map only for roots without tables (bindless_compute_root). When every table binding matched the guest's,reflected_rootreturnedTableLayout::Original. With a descriptor arena active,paged_layout_gapthen skipped every dispatch of such a pipeline:The program can still pick resources by heap index, so it needs the map just like a bindless root. In the simple/extended compute branch of
reflected_root, a root with the flag now sets the index map the same way #235 does (scalar_index = Some((0, 0)), visibility ALL). The translator already emitstb_heap_indexlookups whenever the root carries the map's SRV.The map's root SRV needs two of the root's 64 DWORDs. As in #235, a root without room keeps the guest root rather than failing to serialize (
heap_indexed_tabled_root: a table costs one DWORD, a root descriptor two).Draws are not changed: raster roots with the flag still go through the existing pixel-stage scalar-index path.
Verified on Lanes
New scenario
bindless-table-compute: thebindless-computeprogram (raw UAV store at logical heap slot 80) under a direct-indexed root that also has a bound table of four UAVs the program does not read. It runs inlanes-bindless-computewith the roomy and the constrained (64 resident) heap.Without the change:
FAIL lanes-bindless-table-compute-wide/-constrained, with the skip line above in the log. The four existing bindless trials pass.With the change: all six trials pass, no skipped dispatch, and the receipt finds
bound paged resource descriptor index map.python tuxbox.py checkpassed on this branchChanged behaviour is covered by a Lanes scenario (
bindless-table-compute)GPU, driver and backend: AMD Radeon RX 9070 XT, Mesa 26.3.1 (RADV), GE-Proton11-14, kernel 7.3.6.
Unit test:
tabled_compute_roots_that_index_the_heap_take_the_index_map(run with the Windows test binary under Wine: 2/2 incompute_table).In ProjectScarlett (not evidence, for context)
This does not fix the AMD intro fault of #232 on its own. With this change plus #258 (vkd3d-proton master 71cae091), the story intro still ends in a gfx ring timeout. The amdgpu devcoredump of that hang shows the same fault as before the change:
Faulty page starting at address: 0x0, status0x601431(SQC data read, permission fault). In that run the kernel log only showed the ring timeout, not the fault. Some compute dispatches are still skipped with the same reason, because their roots fall outside the simple/extended shapes (more tables, or tables after constants), and draws are still skipped too. Any of those may leave the data the faulting read depends on unwritten. This PR only removes the skip for the shape it covers.Related: #232, #235, #215, #289.
🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T02:50:24Z.
This matches what I measured on the RTX 5090 in #232: the culling chain is skipped with exactly that message. One thing to check before it lands: the translator drops a compute root's root constants when the runtime appends a private root SRV.
sampler_heap::constants, and the dispatch-ID register calculation, find the compute root's constants by matching the root's exact parameter count. With the index map's SRV (or the stride table's) appended after the guest parameters, the count no longer matches. The root-constant cbuffer and its register loads are then left out, so those registers read 0.maintoday this already hits 127 recorded ProjectScarlett requests through the stride-table path, 123 of themCS_RaytracingResolve. In one resolve kernel the dropped constants feed an index multiply and a mode select.table, table, constantsortable, constants(the*_BatchCullandBatchCullMeshlets*programs, andCS_DistanceWindowEmissivesCulling), so they would dispatch with zeroed constants. The newbindless-table-computescenario's root has no constants, so it can't show this.The fix is a translator change that ignores trailing space-32766 root SRVs when matching the guest root. It's on
fix/xshader-root-constants-private-srv, with a test that fails at run time onmain. Over 25,397 recorded requests, 127 change: each only regains its constant cbuffer. Nothing else changes and there are no regressions. Its AMD check passed; I'll open it as a PR once the NVIDIA check is done, shortly.I'm also running this PR's full check on NVIDIA (RTX 5090) and will post the result here.
Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-27T03:12:22Z.
Confirming on NVIDIA after the merge:
tuxbox.py checkpassed on an RTX 3080 Ti (driver 620.70.06, GE-Proton11-14, Bazzite) against341a9fd. That includes bothbindless-table-computescenarios and the other bindless and descriptor-reclaim ones. I didn't run the regression controls or translator checks, since I don't have Windows DXC set up. Results attached.results.json
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T03:19:57Z.
The root-constants fix is now #296: full checks passed on AMD (RADV) and NVIDIA (RTX 5090), 132 gates each. With #294 on its own, the culling programs it unblocks would dispatch with zeroed root constants; with #296 they keep them. The NVIDIA run of this PR's head is queued here and I'll post it when it's done.