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

Closed
github-bot wants to merge 2 commits from github-bot/gh-317 into main AGit
Owner

@⁠adrianmjim on GitHub · 2026-11-26 19:56 UTC · original
adrianmjim:gpu/root-sig-refused → main · +187 −17 · 3 files · 2 commits · closed without merging

Refs #168.

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 needs the D3D12 Agility SDK runtime beside victory.exe. 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.

Tested

  • Windows 11 26300, RX 7900 XT, in-box runtime (on 4f62c2a): cargo test -p victory-gpu --lib -- root:: pipeline::host:: gives 7 passed, 0 failed.
  • Windows 10 Pro 19045, RX 6600, by @⁠lerapeurdu62280-debug on #168:
    • In-box runtime: the device-creation error fires with why=Unsupported bit-flag set (root signature flags c00). The 7 module tests pass, and the full victory-gpu lib gives 114 passed with only the known depth_bounds_control_a_title_draw failure.
    • Agility runtime (#44): no error, and the 7 module tests pass.

Not tested: the title root-signature warning in the game, which needs the title's own calls.

**@⁠adrianmjim** on GitHub · 2026-11-26 19:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/317) `adrianmjim:gpu/root-sig-refused` → `main` · +187 −17 · 3 files · 2 commits · closed without merging Refs #168. ## 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 needs the D3D12 Agility SDK runtime beside victory.exe`. 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. ## Tested - **Windows 11 26300, RX 7900 XT, in-box runtime** (on `4f62c2a`): `cargo test -p victory-gpu --lib -- root:: pipeline::host::` gives 7 passed, 0 failed. - **Windows 10 Pro 19045, RX 6600**, by @⁠lerapeurdu62280-debug on #168: - **In-box runtime:** the device-creation error fires with `why=Unsupported bit-flag set (root signature flags c00).` The 7 module tests pass, and the full `victory-gpu` lib gives 114 passed with only the known `depth_bounds_control_a_title_draw` failure. - **Agility runtime (#44):** no error, and the 7 module tests pass. Not tested: the title root-signature warning in the game, which needs the title's own calls.
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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:59:09 +00:00
Author
Owner

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

There are no active review issues for the D3D12 root-signature diagnostic changes.

No open issues 🎉

What changed in this PR

Adds diagnostics for the D3D12 root-signature refusals reported in #168, making runtime incompatibility easier to identify without changing pipeline refusal behavior.

Changes:

  • Checks directly indexed heap flag support during host-device initialization and logs Agility SDK guidance when refused.
  • Logs title root-signature refusals with the HRESULT, flags, and host error text while preserving caller ownership of error blobs.
  • Adds regression tests for unsupported flags, error-blob forwarding, and compatibility with devices reporting shader model 6.6.
File Description
crates/​victory-gpu/​src/​root.rs Logs title serialization failures, clears error output pointers, and tests refusal forwarding.
crates/​victory-gpu/​src/​pipeline/​host.rs Shares heap flags and blob-text handling; adds the runtime probe and regression tests.
crates/​victory-gpu/​src/​host.rs Runs the initialization-time probe and reports incompatible runtimes.

Review effort: Balanced

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-26 19:58 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/317#pullrequestreview-6079882773) · **reviewed** <!-- ccr-overview-v2 --> ### 🟢 Approval recommended There are no active review issues for the D3D12 root-signature diagnostic changes. **No open issues** 🎉 <details> <summary><strong>What changed in this PR</strong></summary> Adds diagnostics for the D3D12 root-signature refusals reported in #168, making runtime incompatibility easier to identify without changing pipeline refusal behavior. **Changes:** - Checks directly indexed heap flag support during host-device initialization and logs Agility SDK guidance when refused. - Logs title root-signature refusals with the HRESULT, flags, and host error text while preserving caller ownership of error blobs. - Adds regression tests for unsupported flags, error-blob forwarding, and compatibility with devices reporting shader model 6.6. | File | Description | | ---- | ----------- | | `crates/​victory-gpu/​src/​root.rs` | Logs title serialization failures, clears error output pointers, and tests refusal forwarding. | | `crates/​victory-gpu/​src/​pipeline/​host.rs` | Shares heap flags and blob-text handling; adds the runtime probe and regression tests. | | `crates/​victory-gpu/​src/​host.rs` | Runs the initialization-time probe and reports incompatible runtimes. | </details> <sub>Review effort: Balanced</sub>
Author
Owner

@⁠lerapeurdu62280-debug on GitHub · 2026-11-26 20:08 UTC · original · approved these changes

Approving. This head (00003e2) is the commit I tested on #168: Windows 10 Pro 19045, RX 6600. The device-creation error fires on the in-box runtime with the runtime's reason, it is absent with the Agility runtime from #44, and the 7 module tests pass in both cases.

I read all three files:

  • root.rs: clear(error) before the host call, then note_refusal reads the host's blob without taking a reference (the title owns it). host_refusals_reach_the_title passes a dangling error on purpose, so it also proves the nulling. Both serialize and serialize_versioned are covered.
  • pipeline/host.rs: runtime_refuses asks the serializer once, with an empty 1.1 description; blob_text dedupes the old inline read; root_signature is unchanged apart from DIRECTLY_INDEXED. The test asserts success only where the device reports 6.6, which matches the "runtime, not card" point.
  • host.rs: log-only, after the device is ready.

Two non-blocking nits:

  • On Windows 10's in-box runtime, every title root signature that carries the 6.6 flags is refused, so host refused the title's root signature could fire many times in a run, after the device-level error has already explained why. Logging it once per distinct flags value (or at debug after the first) would keep the log readable.
  • In the test, the two consecutive if sm66 { … } blocks can be one.

I couldn't exercise the title-side warning in a real run (that needs the game).

**@⁠lerapeurdu62280-debug** on GitHub · 2026-11-26 20:08 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/317#pullrequestreview-6079974703) · **approved these changes** Approving. This head (`00003e2`) is the commit I tested on #168: Windows 10 Pro 19045, RX 6600. The device-creation error fires on the in-box runtime with the runtime's reason, it is absent with the Agility runtime from #44, and the 7 module tests pass in both cases. I read all three files: - `root.rs`: `clear(error)` before the host call, then `note_refusal` reads the host's blob without taking a reference (the title owns it). `host_refusals_reach_the_title` passes a dangling `error` on purpose, so it also proves the nulling. Both `serialize` and `serialize_versioned` are covered. - `pipeline/host.rs`: `runtime_refuses` asks the serializer once, with an empty 1.1 description; `blob_text` dedupes the old inline read; `root_signature` is unchanged apart from `DIRECTLY_INDEXED`. The test asserts success only where the device reports 6.6, which matches the "runtime, not card" point. - `host.rs`: log-only, after the device is ready. Two non-blocking nits: - On Windows 10's in-box runtime, every title root signature that carries the 6.6 flags is refused, so `host refused the title's root signature` could fire many times in a run, after the device-level error has already explained why. Logging it once per distinct `flags` value (or at `debug` after the first) would keep the log readable. - In the test, the two consecutive `if sm66 { … }` blocks can be one. I couldn't exercise the title-side warning in a real run (that needs the game).
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 21:41 UTC · original

For a-publier: the same change is ported in #351 (one conflict in create(), and the error no longer points at an Agility loader, since that line has none).

**@⁠adrianmjim** on GitHub · 2026-11-26 21:41 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/317#issuecomment-7203966217) For `a-publier`: the same change is ported in #351 (one conflict in `create()`, and the error no longer points at an Agility loader, since that line has none).
github-bot closed this pull request 2026-11-27 10:41:32 +00:00
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 09:25 UTC · original

Closing: the maintainer's line is now a-publier, and this change is there already. #351 merged it, and #384 is its follow-up (the null error pointer case and the review nits). Nothing here is needed on main any more.

**@⁠adrianmjim** on GitHub · 2026-11-27 09:25 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/317#issuecomment-7214667884) Closing: the maintainer's line is now `a-publier`, and this change is there already. #351 merged it, and #384 is its follow-up (the null error pointer case and the review nits). Nothing here is needed on `main` any more.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.