GPU: say when the D3D12 runtime refuses directly indexed heaps, and log the title's refused root signatures (#168, port of #317) #351

Manually merged
github merged 3 commits from gh-pr/351/head into gh-pr/351/base 2026-11-27 00:58:16 +00:00
Owner

@⁠adrianmjim on GitHub · 2026-11-26 21:40 UTC · original
adrianmjim:publier/root-sig-refused → a-publier · +187 −17 · 3 files · 3 commits · merged 2026-11-26 22:30 UTC

Refs #168. This is #317 (against main) ported to this line, a-publier cd8dfc0.

What

  • At device creation (crates/victory-gpu/src/host.rs). The runtime's own serializer is asked once whether it takes the directly indexed heap flags (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED, 0x400 | 0x800) that every host pipeline's root signature uses. If it refuses them, one error says so, with the runtime's reason: the D3D12 runtime refuses directly indexed descriptor heaps (shader model 6.6), so every host pipeline will be refused; Windows 10's in-box runtime does this, and only a newer D3D12 runtime (the Agility SDK) takes them. This line has no Agility loader (that is #44 on main), so the message names the runtime and does not point at cargo xtask agility. Before, this only showed as one refusal per pipeline, and nothing pointed at the runtime.
  • The title's own root signatures (crates/victory-gpu/src/root.rs). The title serializes root signatures at run time through D3D12SerializeVersionedRootSignature, which victory forwards to the host serializer. When the host refuses one, a warning host refused the title's root signature gives the hr, the flags and the runtime's text. The title's error out pointer is nulled, so a refusal's blob is the host's. Before, the title got E_INVALIDARG and no blob, and nothing was logged.
  • Tests (pipeline/host.rs, root.rs):
    • the_runtime_refuses_flags_it_does_not_know checks that an unknown flag is refused with the same text as #168's log. It also checks that a device reporting shader model 6.6 comes with a runtime that serializes the directly indexed flags. The converse is not asserted, since the runtime knows the flags whatever the card supports.
    • host_refusals_reach_the_title checks that a refusal reaches the title as an error with the host's blob.

Why

On Windows 10's in-box D3D12 runtime the serializer refuses those flags (Unsupported bit-flag set (root signature flags c00)), whatever the card. Every host pipeline is then refused. The logs only showed per-pipeline refusals, and the title's own refusals were silent. #168's reporter then hit an access violation inside the title. Whether a silently refused title root signature leads to it is not shown; with this change, a run would say.

Port

  • The two commits of #317 cherry-picked onto cd8dfc0. pipeline/host.rs and root.rs applied as they are.
  • host.rs had one conflict: create() ends with a Host { .. } literal here rather than Host::from_device. The check sits right after host D3D12 device ready.
  • One more commit changes the error's wording, since this line cannot load the Agility runtime.

Tested

  • This branch (a-publier cd8dfc0 + the 3 commits), Windows 11 26300, RX 7900 XT, in-box runtime:
    • cargo build -p victory builds without warnings.
    • cargo test -p victory-gpu --lib -- --test-threads=1 root:: pipeline::host:: gives 19 passed, 0 failed. That includes the two new tests.
  • The same change on main, Windows 10 Pro 19045, RX 6600, by @⁠lerapeurdu62280-debug on #168:
    • The error fires on the in-box runtime with why=Unsupported bit-flag set (root signature flags c00).
    • With the Agility runtime there is no error, and the module tests pass both ways.
    • That run was on main, not on this branch.

Not tested here: Windows 10 on this branch, the full victory-gpu suite, and the title root-signature warning in the game.

**@⁠adrianmjim** on GitHub · 2026-11-26 21:40 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351) `adrianmjim:publier/root-sig-refused` → `a-publier` · +187 −17 · 3 files · 3 commits · merged 2026-11-26 22:30 UTC Refs #168. This is #317 (against `main`) ported to this line, `a-publier` `cd8dfc0`. ## What - **At device creation** (`crates/victory-gpu/src/host.rs`). The runtime's own serializer is asked once whether it takes the directly indexed heap flags (`CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED`, 0x400 | 0x800) that every host pipeline's root signature uses. If it refuses them, one error says so, with the runtime's reason: `the D3D12 runtime refuses directly indexed descriptor heaps (shader model 6.6), so every host pipeline will be refused; Windows 10's in-box runtime does this, and only a newer D3D12 runtime (the Agility SDK) takes them`. This line has no Agility loader (that is #44 on `main`), so the message names the runtime and does not point at `cargo xtask agility`. Before, this only showed as one refusal per pipeline, and nothing pointed at the runtime. - **The title's own root signatures** (`crates/victory-gpu/src/root.rs`). The title serializes root signatures at run time through `D3D12SerializeVersionedRootSignature`, which victory forwards to the host serializer. When the host refuses one, a warning `host refused the title's root signature` gives the `hr`, the flags and the runtime's text. The title's error out pointer is nulled, so a refusal's blob is the host's. Before, the title got `E_INVALIDARG` and no blob, and nothing was logged. - **Tests** (`pipeline/host.rs`, `root.rs`): - `the_runtime_refuses_flags_it_does_not_know` checks that an unknown flag is refused with the same text as #168's log. It also checks that a device reporting shader model 6.6 comes with a runtime that serializes the directly indexed flags. The converse is not asserted, since the runtime knows the flags whatever the card supports. - `host_refusals_reach_the_title` checks that a refusal reaches the title as an error with the host's blob. ## Why On Windows 10's in-box D3D12 runtime the serializer refuses those flags (`Unsupported bit-flag set (root signature flags c00)`), whatever the card. Every host pipeline is then refused. The logs only showed per-pipeline refusals, and the title's own refusals were silent. #168's reporter then hit an access violation inside the title. Whether a silently refused title root signature leads to it is not shown; with this change, a run would say. ## Port - The two commits of #317 cherry-picked onto `cd8dfc0`. `pipeline/host.rs` and `root.rs` applied as they are. - `host.rs` had one conflict: `create()` ends with a `Host { .. }` literal here rather than `Host::from_device`. The check sits right after `host D3D12 device ready`. - One more commit changes the error's wording, since this line cannot load the Agility runtime. ## Tested - **This branch** (`a-publier` `cd8dfc0` + the 3 commits), Windows 11 26300, RX 7900 XT, in-box runtime: - `cargo build -p victory` builds without warnings. - `cargo test -p victory-gpu --lib -- --test-threads=1 root:: pipeline::host::` gives 19 passed, 0 failed. That includes the two new tests. - **The same change on `main`**, Windows 10 Pro 19045, RX 6600, by @⁠lerapeurdu62280-debug on #168: - The error fires on the in-box runtime with `why=Unsupported bit-flag set (root signature flags c00).` - With the Agility runtime there is no error, and the module tests pass both ways. - That run was on `main`, not on this branch. Not tested here: Windows 10 on this branch, the full `victory-gpu` suite, and the title root-signature warning in the game.
Every host pipeline's root signature carries the directly indexed heap
flags (0x400, 0x800). A D3D12 runtime that does not know them, such as
Windows 10's in-box one, refuses each with "Unsupported bit-flag set";
the card and driver play no part, since serializing is the runtime's.

- At device creation, an empty root signature with both flags is
  serialized once; if the runtime refuses it, one error says that every
  host pipeline will be refused and why, instead of only one warning per
  pipeline as in #168's log.
- The title's own root signatures go to the same host serializer
  (`d3d12_xs!D3D12SerializeRootSignature` and its versioned form). A
  refusal there was passed back to the title in silence: a failure and
  no blob, which the console's serializer would not return. It is now
  logged with the flags and the host's reason. The error out pointer is
  nulled before the host's call, so the blob read is the host's.

Tests: the runtime refuses an unknown flag with the text seen in #168,
and serializes the directly indexed flags exactly when the device
reports shader model 6.6; through the title's entry point, an unknown
flag gives E_INVALIDARG, no blob and the host's reason.

(cherry picked from commit 963abe387e)
(cherry picked from commit 00003e2739)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:58:14 +00:00
github manually merged commit 6482e72f3d into gh-pr/351/base 2026-11-27 00:58:16 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-26 21:43 UTC · original · reviewed

Both forwarding functions lose refusal diagnostics when callers omit the error-blob output; they should capture, log, and release a local host error blob while preserving caller ownership when an output pointer is supplied.

1 open issue
What changed in this PR

Ports the diagnostics from #317 to this branch to help identify the D3D12 runtime limitations reported in #168. This improves logging without adding Agility SDK loading or changing runtime support.

Changes:

  • Checks directly indexed heap flag support at device creation and logs runtime refusals.
  • Logs failed title root-signature serialization with the error code, flags, and available runtime explanation.
  • Adds tests for unsupported flags and forwarding host serialization errors to the title.
File Description
crates/​victory-gpu/​src/​root.rs Adds title serialization refusal logging, error-output initialization, and a regression test.
crates/​victory-gpu/​src/​pipeline/​host.rs Shares heap flags and blob-text handling; adds a runtime capability probe and tests.
crates/​victory-gpu/​src/​host.rs Runs the probe at device creation and logs an unsupported-runtime diagnostic.

Review effort: Balanced

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-26 21:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351#pullrequestreview-6080790797) · **reviewed** <!-- ccr-overview-v2 --> ### 🟡 Changes recommended Both forwarding functions lose refusal diagnostics when callers omit the error-blob output; they should capture, log, and release a local host error blob while preserving caller ownership when an output pointer is supplied. <details open> <summary><strong>1 open issue</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Preserve refusal diagnostics when callers omit the error-blob output](https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/pulls/351) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> Ports the diagnostics from #317 to this branch to help identify the D3D12 runtime limitations reported in #168. This improves logging without adding Agility SDK loading or changing runtime support. **Changes:** - Checks directly indexed heap flag support at device creation and logs runtime refusals. - Logs failed title root-signature serialization with the error code, flags, and available runtime explanation. - Adds tests for unsupported flags and forwarding host serialization errors to the title. | File | Description | | ---- | ----------- | | `crates/​victory-gpu/​src/​root.rs` | Adds title serialization refusal logging, error-output initialization, and a regression test. | | `crates/​victory-gpu/​src/​pipeline/​host.rs` | Shares heap flags and blob-text handling; adds a runtime capability probe and tests. | | `crates/​victory-gpu/​src/​host.rs` | Runs the probe at device creation and logs an unsupported-runtime diagnostic. | </details> <sub>Review effort: Balanced</sub>
@ -117,2 +152,2 @@
)
}
let hr =
unsafe { std::mem::transmute::<usize, Serialize>(address)(&desc, version, blob, error) };
Author
Owner

@⁠Copilot on GitHub · 2026-11-26 21:43 UTC · original

If the title passes null for the optional error-blob output, both forwarding functions also pass null to the host serializer, so this warning always has an empty why even when the runtime could explain the refusal. That loses the diagnostic this PR is intended to provide for callers that do not request error blobs. Capture a local host error blob when the title's output pointer is null, log its text, and release that local blob afterward; keep ownership with the title when it supplies an output pointer.

**@⁠Copilot** on GitHub · 2026-11-26 21:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351#discussion_r4713584877) If the title passes null for the optional error-blob output, both forwarding functions also pass null to the host serializer, so this warning always has an empty `why` even when the runtime could explain the refusal. That loses the diagnostic this PR is intended to provide for callers that do not request error blobs. Capture a local host error blob when the title's output pointer is null, log its text, and release that local blob afterward; keep ownership with the title when it supplies an output pointer.
Author
Owner

@⁠lerapeurdu62280-debug on GitHub · 2026-11-26 21:47 UTC · original

Tested 6482e72 on a-publier, Windows 10 Pro 19045, RX 6600 (in-box runtime; this line has no Agility loader), no game files. As on #317, I used a throwaway test (not pushed) that installs a tracing_subscriber and calls crate::host::host() once.

  • The device-creation error fires with the new wording and the runtime's reason:
    ERROR victory_gpu::host: the D3D12 runtime refuses directly indexed descriptor heaps (shader model 6.6), so every host pipeline will be refused; Windows 10's in-box runtime does this, and only a newer D3D12 runtime (the Agility SDK) takes them why=Unsupported bit-flag set (root signature flags c00).
  • the_runtime_refuses_flags_it_does_not_know and host_refusals_reach_the_title: pass.
  • Full victory-gpu lib: 388 passed, 2 failed. Both fail on cd8dfc0 alone on this PC: views_are_made_beside_the_heap_and_copied_in (AMD descriptor bytes, #288) and depth_bounds_pipeline_loads_and_filters_draws (here it stops at the refused root signature; #328 is the WARP side).

The code is the same as #317, which I read through there; my two nits from that review (one warning per distinct flags, the two if sm66 blocks) still apply and are still non-blocking.

AI-assisted: yes (Claude Code)

**@⁠lerapeurdu62280-debug** on GitHub · 2026-11-26 21:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351#issuecomment-7204068969) Tested `6482e72` on `a-publier`, Windows 10 Pro 19045, RX 6600 (in-box runtime; this line has no Agility loader), no game files. As on #317, I used a throwaway test (not pushed) that installs a `tracing_subscriber` and calls `crate::host::host()` once. - The device-creation error fires with the new wording and the runtime's reason: `ERROR victory_gpu::host: the D3D12 runtime refuses directly indexed descriptor heaps (shader model 6.6), so every host pipeline will be refused; Windows 10's in-box runtime does this, and only a newer D3D12 runtime (the Agility SDK) takes them why=Unsupported bit-flag set (root signature flags c00).` - `the_runtime_refuses_flags_it_does_not_know` and `host_refusals_reach_the_title`: pass. - Full `victory-gpu` lib: 388 passed, 2 failed. Both fail on `cd8dfc0` alone on this PC: `views_are_made_beside_the_heap_and_copied_in` (AMD descriptor bytes, #288) and `depth_bounds_pipeline_loads_and_filters_draws` (here it stops at the refused root signature; #328 is the WARP side). The code is the same as #317, which I read through there; my two nits from that review (one warning per distinct `flags`, the two `if sm66` blocks) still apply and are still non-blocking. AI-assisted: yes (Claude Code)
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 22:31 UTC · original

Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at 6482e72: cargo test --release -p victory-gpu --lib, three runs: 388 passed, 1 failed, 34 ignored each. The one failure, descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in, fails the same way on cd8dfc0 on this card (#288 fixes it). A fourth run also failed watch::tests::a_write_opens_the_view_it_goes_through once; that watch test area is flaky on this card on the base too.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-26 22:31 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351#issuecomment-7204761957) Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `6482e72`: `cargo test --release -p victory-gpu --lib`, three runs: 388 passed, 1 failed, 34 ignored each. The one failure, `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in`, fails the same way on `cd8dfc0` on this card (#288 fixes it). A fourth run also failed `watch::tests::a_write_opens_the_view_it_goes_through` once; that `watch` test area is flaky on this card on the base too. AI-assisted (Claude Code); no game data.
@ -117,2 +152,2 @@
)
}
let hr =
unsafe { std::mem::transmute::<usize, Serialize>(address)(&desc, version, blob, error) };
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 23:01 UTC · original

Fixed in the follow-up #384 (this PR was merged before it): both forwarders go through one helper that gives the host an out pointer of ours when the title passes none, logs its text and releases the blob. A new test, a_refusal_without_an_error_pointer_keeps_the_hosts_reason, fails without the change.

**@⁠adrianmjim** on GitHub · 2026-11-26 23:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351#discussion_r4714023642) Fixed in the follow-up #384 (this PR was merged before it): both forwarders go through one helper that gives the host an out pointer of ours when the title passes none, logs its text and releases the blob. A new test, `a_refusal_without_an_error_pointer_keeps_the_hosts_reason`, fails without the change.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 23:01 UTC · original

@⁠lerapeurdu62280-debug both of your nits are in #384, the follow-up, since this one was merged first: the title-side warning now comes once per distinct flags (repeats at debug), and the two if sm66 blocks are one. Thanks for testing this on Windows 10, and @⁠MamaLeVrai for the RDNA 2 run.

**@⁠adrianmjim** on GitHub · 2026-11-26 23:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/351#issuecomment-7205187084) @⁠lerapeurdu62280-debug both of your nits are in #384, the follow-up, since this one was merged first: the title-side warning now comes once per distinct `flags` (repeats at `debug`), and the two `if sm66` blocks are one. Thanks for testing this on Windows 10, and @⁠MamaLeVrai for the RDNA 2 run.
This discussion has been locked. Commenting is limited to contributors.
No description provided.