Skip to content

d3d12: page direct-indexed raster roots, guard scalar descriptor lookup, and enforce stride-table root budget - #295

Open
smith-3 wants to merge 1 commit into
brcly:mainfrom
smith-3:fix/d3d12-page-direct-indexed-table-roots
Open

smith-3 wants to merge 1 commit into
brcly:mainfrom
smith-3:fix/d3d12-page-direct-indexed-table-roots

Conversation

@smith-3

@smith-3 smith-3 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follows up on #294 (341a9fd) to cover direct-indexed (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED) raster root signatures and tighten the 64-DWORD root-signature budget check when appending the heap stride table (t1, space32766).

Changes

  • runtime/d3d12/src/device/compute_table.rs:
    • Account for the extra 2 DWORDs in heap_indexed_tabled_root(signature, strides) (60-DWORD limit when strides is enabled, 62 otherwise) so appending both the paged index map (t0, space32766) and the heap stride table (t1, space32766) stays within the 64-DWORD D3D12 root-signature limit.
    • Support paging tb_heap_map on direct-indexed Program::Raster roots: 0-table bindless raster roots, multi-leading-table raster roots, single-table raster roots without a scalar-heap constant, and a fallback (append_index_map_only) for other finite-table direct-indexed raster roots.
    • Extend append_corroborated_ranges to also append tb_heap_map (and heap_strides when it fits) for direct-indexed compute roots that fall back to corroborated ranges.
    • Avoid forming a Rust slice from a null pParameters pointer on 0-parameter direct-indexed roots in append_ranges_and_map.
  • runtime/d3d12/src/commands/recording.rs:
    • Guard the scalar_descriptor lookup in Recording with if binding.scalar_mask != 0 so general direct-indexed raster roots (scalar_mask == 0) bind the paged index map and retain indexed_arenas instead of skipping draws with E_INVALIDARG ("draw: no scalar descriptor for the indexed load").
  • runtime/d3d12/src/tests/device/compute_table.rs:
    • Update tabled_compute_roots_that_index_the_heap_take_the_index_map for the strides parameter and assert the 60-DWORD budget when both the index map and stride table are appended.

Verification

  • python3 build.py d3d12 builds d3d12_xs.dll and all smoke executables cleanly with zero warnings.
  • cargo test --manifest-path runtime/d3d12/Cargo.toml --target x86_64-pc-windows-msvc --no-run --lib compiles and links the tuxbox-d3d12 unit test binary (including device::compute_table::tests) cleanly with zero warnings.

Copilot AI balanced review requested due to automatic review settings November 27, 2026 03:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants