GPU: require only the descriptor heaps used by the pipeline #411

Open
FIocker wants to merge 1 commit from upstream-pr/411 into main
FIocker commented 2026-11-24 03:01:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by FIocker on 2026-11-24T03:01:00Z.


Derive the directly indexed heap flags on a host root signature from the union of the translated stages' DXIL SFI0 requirements. This lets a buffer-only compute pipeline bind its resource heap without first providing an unused sampler heap. Static samplers use their existing root signature declarations.

I encountered the validation error with a synthetic single-thread compute shader that reads buffer SRVs and writes a UAV. The WARP debug layer required a sampler heap merely because the root signature had its direct indexing flag set. The flag mapping follows the Shader Model 6.6 specification.

Validation on x64 Windows:

  • cargo test --locked -p victory-gpu --features diagnostics resource_heap_root_can_bind_without_sampler_heap passed on WARP with the D3D12 debug layer enabled.
  • cargo test --locked --workspace --features victory/diagnostics -- --test-threads=1 passed on WARP, including all four synthetic SFI0 combinations.
  • The staged asset-policy check passed.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6573634928 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/411). Originally posted by [FIocker](https://github.com/FIocker) on 2026-11-24T03:01:00Z. --- Derive the directly indexed heap flags on a host root signature from the union of the translated stages' DXIL SFI0 requirements. This lets a buffer-only compute pipeline bind its resource heap without first providing an unused sampler heap. Static samplers use their existing root signature declarations. I encountered the validation error with a synthetic single-thread compute shader that reads buffer SRVs and writes a UAV. The WARP debug layer required a sampler heap merely because the root signature had its direct indexing flag set. The flag mapping follows the [Shader Model 6.6 specification](https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_DynamicResources.html). Validation on x64 Windows: - `cargo test --locked -p victory-gpu --features diagnostics resource_heap_root_can_bind_without_sampler_heap` passed on WARP with the D3D12 debug layer enabled. - `cargo test --locked --workspace --features victory/diagnostics -- --test-threads=1` passed on WARP, including all four synthetic SFI0 combinations. - The staged asset-policy check passed.
mercuryVM commented 2026-11-24 06:52:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:57:30Z.

Review: APPROVED


Tested 7244393 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed).

  • The two root-signature flags now follow the SFI0 bits (0x200_0000, 0x400_0000) that the translator itself writes, collected over every stage of the pipeline. A shader that indexes a heap therefore still gets its flag, and the others no longer require a sampler heap they never read. Naming the two constants in flags keeps the producer and consumer in step.
  • The flags are part of the serialized root signature, so root_blob and the pipeline-library names derived from it differ whenever the flags differ. No cached pipeline can be reused with the wrong root signature.
  • A shader whose DXIL cannot be parsed falls back to (false, false). That is the strict choice: a pipeline that really needs a heap would then fail validation rather than pass silently. That seems right.

No issues found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6034395896 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/411#pullrequestreview-6034395896). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T05:57:30Z. **Review:** APPROVED --- Tested 7244393 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (265 passed, 0 failed). - The two root-signature flags now follow the SFI0 bits (`0x200_0000`, `0x400_0000`) that the translator itself writes, collected over every stage of the pipeline. A shader that indexes a heap therefore still gets its flag, and the others no longer require a sampler heap they never read. Naming the two constants in `flags` keeps the producer and consumer in step. - The flags are part of the serialized root signature, so `root_blob` and the pipeline-library names derived from it differ whenever the flags differ. No cached pipeline can be reused with the wrong root signature. - A shader whose DXIL cannot be parsed falls back to `(false, false)`. That is the strict choice: a pipeline that really needs a heap would then fail validation rather than pass silently. That seems right. No issues found. AI-assisted (Claude Code).
Raxstreams commented 2026-11-24 06:55:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Raxstreams on 2026-11-24T03:06:38Z.


I ran the same SFI0 flag mapping on an RTX 3080 Ti in a local Series S integration. Before the change, D3D12 reported 1,606 heap-binding errors (message 1419) in the run. The repeat run reached the opening scene with zero occurrences of 1419. There are still separate rendering failures later in the scene. This confirms the specific heap requirement in a title workload.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7120779875 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/411#issuecomment-7120779875). Originally posted by [Raxstreams](https://github.com/Raxstreams) on 2026-11-24T03:06:38Z. --- I ran the same SFI0 flag mapping on an RTX 3080 Ti in a local Series S integration. Before the change, D3D12 reported 1,606 heap-binding errors (message 1419) in the run. The repeat run reached the opening scene with zero occurrences of 1419. There are still separate rendering failures later in the scene. This confirms the specific heap requirement in a title workload.
LocranKing commented 2026-11-24 06:55:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LocranKing on 2026-11-24T03:29:27Z.


Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, MSVC 1.98.1).

Tested

  • Commit: 7244393 (pr-411, clean tree)
  • Environment: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (driver 32.0.16.2101), Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo xtask policy: asset policy: 151 files ok
  • cargo test --locked -p victory-gpu --features diagnostics resource_heap_root_can_bind_without_sampler_heap: 1 passed, 0 failed
  • cargo test --locked --workspace --features victory/diagnostics -- --test-threads=1: 269 passed, 0 failed, 4 ignored
  • diag build (VICTORY_D3D12_DRED=1) live boot/first-screen run (35 s) on RTX 3060 Ti: 512+ frames presented (2561/2561 draws, 256/256 dispatches), crashes.log empty.

Not tested: Gameplay/world load past the first screens; D3D12 debug layer (VICTORY_D3D12_DEBUG=1).

AI use: Antigravity (Gemini 4 Hydrogen) ran the checks and drafted this comment from the command outputs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121146968 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/411#issuecomment-7121146968). Originally posted by [LocranKing](https://github.com/LocranKing) on 2026-11-24T03:29:27Z. --- Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, MSVC `1.98.1`). **Tested** - Commit: `7244393` (`pr-411`, clean tree) - Environment: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (driver `32.0.16.2101`), Rust `1.98.1` (`x86_64-pc-windows-msvc`) - `cargo xtask policy`: `asset policy: 151 files ok` - `cargo test --locked -p victory-gpu --features diagnostics resource_heap_root_can_bind_without_sampler_heap`: **1 passed, 0 failed** - `cargo test --locked --workspace --features victory/diagnostics -- --test-threads=1`: **269 passed, 0 failed, 4 ignored** - `diag` build (`VICTORY_D3D12_DRED=1`) live boot/first-screen run (35 s) on RTX 3060 Ti: `512+` frames presented (`2561/2561` draws, `256/256` dispatches), `crashes.log` empty. **Not tested:** Gameplay/world load past the first screens; D3D12 debug layer (`VICTORY_D3D12_DEBUG=1`). **AI use:** Antigravity (`Gemini 4 Hydrogen`) ran the checks and drafted this comment from the command outputs.
DeerSilver commented 2026-11-24 11:04:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DeerSilver on 2026-11-24T11:01:40Z.


Tested head 16a5893 merged onto main ffe310e (clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1: pass. No game files: the test suite only.

  • The PR's new test passes. It uses the host GPU and ran on the RTX 5060 (DXGI adapter 0 on this laptop, so the host-device helpers return a device and the tests don't take their early return):
    • direct_heap_requirements_are_independent
  • cargo test --workspace --locked: 343 passed, 0 failed, 6 ignored, against 342 passed / 6 ignored on main.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129558220 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/411#issuecomment-7129558220). Originally posted by [DeerSilver](https://github.com/DeerSilver) on 2026-11-24T11:01:40Z. --- Tested head `16a5893` merged onto `main` `ffe310e` (clean merge) on **NVIDIA GeForce RTX 5060 Laptop GPU** (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1: **pass.** No game files: the test suite only. - The PR's new test passes. It uses the host GPU and ran on the RTX 5060 (DXGI adapter 0 on this laptop, so the host-device helpers return a device and the tests don't take their early return): - `direct_heap_requirements_are_independent` - `cargo test --workspace --locked`: **343 passed, 0 failed, 6 ignored**, against 342 passed / 6 ignored on `main`. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:07:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:16:23Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-shader/src/emit/shader.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148335351 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/411#issuecomment-7148335351). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:16:23Z. --- <!-- victory-triage v1 head=16a5893ea7fb94d1492e726c38f53caa70c79932 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-shader/src/emit/shader.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/411:upstream-pr/411'
git switch 'upstream-pr/411'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/411'
git switch 'upstream-pr/411'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/411'
git switch 'upstream-pr/411'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/411'
git switch 'main'
git merge --squash 'upstream-pr/411'
git switch 'main'
git merge --ff-only 'upstream-pr/411'
git switch 'main'
git merge 'upstream-pr/411'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!411
No description provided.