Resolve translated graphics root tables across a capped view heap #1248
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1255"
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-24T05:37:55Z.
Refs #874. Stacked on @triggered02's #1240 at
c74485f5. Please land #1240 first. Review this change independently at f9aa4380. The sampler path remains owned by #1237.A translated draw now resolves a graphics root table through the capped CBV/SRV/UAV heap actually bound to the list. The draw checks the complete view record against the guest extent before publishing it into its own desktop shader-visible heap. Switching away clears the old tables. Native descriptor writes and copies past the prefix have a real CPU-only destination. A copy spanning the two desktop heaps splits at their boundary. A copy extending beyond the logical range leaves the destination intact.
The source-built fixture creates two oversized heaps, gives the same slot different values, and draws eight strips across 32 RGBA pixels. It exercises simple and ranged CPU copies across the boundary, the last logical record, an overrun, a stale table after a switch, a handle from the wrong heap, and rebinding. The pixel shader is a fixture-owned buffer load; this test isolates descriptor publication from shader instruction translation.
Windows Release verification at
f9aa4380, Windows 11 build 26200, debug layer off.The validated scope is translated graphics draws. The existing probe supplies the per-driver capacity; its implementation and evidence remain in #1240.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T05:58:28Z.
Review: COMMENTED
Dual-platform review of
3b2032bbf5c96b18a271c9258c5598f131eba071(Resolve translated graphics root tables across a capped view heap).Linux Checks
git diff --check origin/main...HEAD: PASSdocs_links_check.py: PASS (16 Markdown files, 282 links)bidi_controls_check.py: PASS (1058 tracked files, no bidirectional controls)Windows Server 2025 (Build 26100, MSVC 14.44, D3D12 WARP)
Command:
C:\OEM\run_pr_test.ps1 -Pr 1255 -Targets 'startup_view_heap_check,startup_stream_consumer' -Regex '^startup_(view_heap|logical_view|stream_draw)_' -Jobs 6 -Parallel 4dev(Debug): build succeeded (7 ninja targets);ctest2/6 Passed (startup_stream_draw_warp1.96s,startup_stream_draw_hardware1.87s), 4/6 Skipped (77:startup_view_heap_hardware,startup_view_heap_warp,startup_logical_view_warp,startup_logical_view_hardware).release(/O2): build succeeded (7 ninja targets);ctest2/6 Passed (startup_stream_draw_warp1.69s,startup_stream_draw_hardware1.54s), 4/6 Skipped (77: same 4 tests).1,245,184shader-visible CBV/SRV/UAV descriptors directly, and no physical GPU is attached in the VM, so the oversized-heap clamp path (startup_view_heap_*,startup_logical_view_*) is not exercised on this host and reports capability skip (77) rather than a pass.Code Review Notes
src/startup_stubs/logical_view_table.h:resolve_view_table()andViewTable::record()guard against null handles, zero stride,UINT64_MAXwrap-around, unaligned offsets, and out-of-range reads without integer overflow.src/startup_stubs/d3d12_xs_device.cpp:accepted_view_heap_descriptors()probes once per process with a spin wait for concurrent callers and bisects down from 1,048,576 toview_heap_probe_floor(65,536).desktop_cpu_handle()andcopy_descriptor_run()/device_copy_descriptors()validate full logical ranges before copying and split runs across the physical/tail boundary;taillifetime is tied toheapviaSetPrivateDataInterface.src/startup_stubs/d3d12_draw.inl:list_set_descriptor_heaps()invalidatespass.view_tableswheneversource_view_heapchanges (including switching between an oversized heap and a non-oversized heap), andlist_table()restricts lookup to the bound oversized heap whensource_view_heapis set.tests/startup_view_heap_check.cpp&tests/startup_logical_view_check.py: cover single-log-once reporting, straddlingCopyDescriptorsSimple/CopyDescriptors, out-of-bounds copy rejection, boundary/logical-end/past-end reads, and wrong-heap / invalidated-table behavior on adapters that refuse 1,245,184 descriptors.