GPU: fall back to standard root signature flags when host runtime rejects 0xC01/0xC00 #626
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!626
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-626"
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?
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 05:54 UTC · original
LAKSHYA-cmd-tech:fix/root-signature-flags-fallback→main· +63 −8 · 1 files · 1 commits · openSummary
Fixes #598.
On Windows 10 in-box D3D12 runtimes or environments without Agility SDK / SM 6.6 root signature 1.2+ support, the serializer rejects Root Signature 1.1 with directly indexed descriptor heap flags (
0xC01/0xC00):When root signature creation failed, pipeline compilation was rejected (
None), resulting in unhandled null pointer dereferences (0xc0000005 (read 0x68)) during subsequent draw/dispatch invocations.Solution
D3D12SerializeVersionedRootSignatureordevice.CreateRootSignaturerejects the combined flags (ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED), gracefully fall back to standard root signature flags (ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUTfor graphics,NONEfor compute).pipeline::host::tests::host_root_signature_serializes_and_creates.Verification
cargo test -p victory-gpu -- --test-threads=1: 44 passed, 0 failed, 1 ignored.cargo clippy -p victory-gpu --lib -- -D warnings: 0 warnings.cargo run -p xtask -- policy: 151 files clean.@fromthemoonx on GitHub · 2026-11-24 06:09 UTC · original
Tested
772d294(onmaind2a4bae), plus one check on what the fallback root signature can host.Environment: Windows 11 Pro build 26300, AMD Ryzen 7 5700X, 16 GB, NVIDIA GeForce RTX 3060 12 GB (driver 610.88), Rust 1.98.1
x86_64-pc-windows-msvc, debug.Tested
cargo test --locked -p victory-gpu --lib: 44 passed, 0 failed, 1 ignored, includinghost_root_signature_serializes_and_creates. On this runtime the full flags are accepted, so the test only takes the first path; the fallback is never exercised here.cargo test --locked --workspace: 265 passed, 0 failed, 4 ignoredcargo xtask policy: 151 files ok; clippy shows onlymain'shost.rs:267warningCan the fallback root signature run a translated shader? Translated shaders reach their resources through
createHandleFromHeap(victory-shaderemit/shader.rs,heap_handle). That needsCBV_SRV_UAV_HEAP_DIRECTLY_INDEXED/SAMPLER_HEAP_DIRECTLY_INDEXEDon the root signature. To check, I gavevictory-shader's test host (emit/host.rs, which builds its root signature with the same flags) the fallback's flags, i.e.ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUTonly, locally:cargo test -p victory-shader emit::main)hardware: compute_pipeline failed: The parameter is incorrect.So on this GPU, a pipeline built on the fallback root signature is refused at
CreateComputePipelineStateinstead of at the root signature. It doesn't run.createHandleFromHeapis also SM 6.6, which the README lists as a requirement, so a runtime that rejects these flags probably can't take the translated shaders either way.If the
0xc0000005 (read 0x68)in #598 is a draw or dispatch going ahead with no host pipeline, the fix may belong where a missing pipeline is handled; a refused pipeline would still crash it through this path. Do you have the stack of that crash fromcrashes.log?Smaller notes:
GraphicsStateinput layout,mesh_pipeline's stream,code_bytes, the mesh refusal). Dropping that would make the change easier to review and conflict less with the other open PRs inpipeline/host.rs.Not tested: a Windows 10 in-box runtime that rejects the flags (not available here); no game data used.
AI-assisted (Claude Code) ran the checks and drafted this comment.
@LAKSHYA-cmd-tech on GitHub · 2026-11-24 06:12 UTC · original
Thanks @fromthemoonx for the detailed testing and review!
Updated in commit ac114f1:
oot_signature and adds the synthetic unit test host_root_signature_serializes_and_creates.
Regarding the ␀xc0000005 (read 0x68) at +0xb5a5f8 in #598:
Cross-referencing with the site map in #630 and reproduction in #622, +0xb5a5f8 is actually the title's auth subsystem uninitialized object read immediately following XUserAddAsync (caused by missing slot 0x30 GetMaxUsers in xuser.rs), rather than a GPU pipeline crash (addressed separately in #648).
Regarding translated compute shaders: as you observed, shaders relying on createHandleFromHeap strictly require SM 6.6 heap indexing flags. This fallback specifically benefits root signatures and graphics/menu pipelines using standard root parameters/views on runtimes or compatibility layers where in-box d3d12core rejects 0xC01.
@fromthemoonx on GitHub · 2026-11-24 06:38 UTC · original
Thanks, and for tracing #598's crash to the auth path; that settles my question.
You're right about which shaders the fallback helps. In
lower.rshandle(), only descriptors loaded from a table (Source::Loaded, andPhis of those) go throughheap_handle. Root CBVs and SRVs (root_cbv_handle/root_srv_handle), constant samplers (static samplers) and root constants don't. So a pipeline that reads only those doesn't need the heap flags, and the fallback lets it through.Re-tested
ac114f1(same RTX 3060 machine):root_signatureand the test; the fallback logs the rejection before retryingcargo test --locked -p victory-gpu --lib: 44 passed, 0 failed, 1 ignored;cargo test --locked --workspace: 265 passed, 0 failed, 4 ignored;cargo xtask policy: okcargo fmt --checkwants the new test'slet Some(host) = crate::host::host() else { return };split over three lines (the other fmt and clippy output in this file is already onmain)AI-assisted (Claude Code).
@Sharktooth12 on GitHub · 2026-11-24 06:41 UTC · original · edited 2026-11-24 06:45 UTC
Tested this PR on Windows 10 22H2 (19045.6466), GTX 1650, driver 32.0.15.9186.
Fresh clone, checked out pr-626,
cargo build --release, then ran the title with --execute.The fallback triggers, but the game still doesn't get a working host pipeline:
WARN victory_gpu::pipeline::host: root signature: runtime rejected directly-indexed flags
(Unsupported bit-flag set (root signature flags c01).), retrying without them
WARN victory_gpu::pipeline::host: host pipeline refused error=The parameter is incorrect. (0x80070057)
shaders=[vertex dfafaf385b2f94e8, pixel 06295fb1d1aefb78]
(repeats for each pipeline)
victory_gpu::host: 19.8 fps, ... 0 draws/frame, dropped 3 without a host pipeline
Then it crashes about 6 seconds in:
VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0xb5a5f8 (read 0x68)
Same crash address as before the PR. Same result with VICTORY_D3D12_WARP=1,
--console series-s and --unimplemented zero.
My guess (haven't read the shader emitter): the translated shaders use directly
indexed heaps, so a root signature without those flags can't be paired with them
and pipeline creation fails. The failed pipeline is also still dereferenced later.
Happy to test more builds or a debug log if that helps.
Cause (confirmed in the source): the shader emitter indexes the descriptor heaps
directly. crates/victory-shader/src/emit/mod.rs (lines 17-21) documents SM 6.6
ResourceDescriptorHeap[]/SamplerDescriptorHeap[]and says the root signatureneeds CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED and SAMPLER_HEAP_DIRECTLY_INDEXED, and
emit/shader.rs:285 emits
createHandleFromHeap.So on a runtime that rejects those flags (stock Windows 10 without the Agility SDK),
dropping them only moves the failure: root signature creation succeeds, but
CreateGraphicsPipelineState then fails with 0x80070057 because the shaders
need heap indexing. The failed pipeline is then still dereferenced later, which
causes the 0xc0000005 crash.
Possible directions: ship/load the Agility SDK so the runtime accepts SM 6.6 root
signature flags, or emit a table-based fallback when the host lacks support. In
either case a refused pipeline probably shouldn't lead to a crash later.
@Sharktooth12 on GitHub · 2026-11-24 07:16 UTC · original
Follow-up test on Windows 10 22H2 (19045.6466), GTX 1650.
With this PR alone, pipelines were still refused (0x80070057), because the translated
shaders need the directly-indexed heap flags (emit/mod.rs lines 17-21).
I then made victory.exe opt in to the DirectX 12 Agility SDK:
Result: the "runtime rejected directly-indexed flags" warning is gone, pipelines are
created, and the game now gets as far as the account/sign-in screen.
It then fails with: <PASTE THE LAST ERROR LINE(S) HERE>
So on Windows 10 this PR's fallback is not needed if the app ships the Agility SDK;
the full flags work. Redacted log attached. Happy to open a PR with the exports if you want it.
Expirimental:
powershell -ExecutionPolicy Bypass -File .\agility-test.ps1 -Game "game.exe location"
agility-test-change-to-dot-ps1.txt.txt
@DeerSilver on GitHub · 2026-11-24 11:01 UTC · original
Tested head
df9ab3cmerged ontomainffe310e(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.host_root_signature_serializes_and_createscargo test --workspace --locked: 343 passed, 0 failed, 6 ignored, against 342 passed / 6 ignored onmain.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.AI-assisted (Claude Code).
@nopsled0x on GitHub · 2026-11-24 15:21 UTC · original
I tried this on Windows 10 22H2 (build 19045), release build, GPU driver 621.40. The PR's one commit (
df9ab3c) is cherry-picked on top of current main (ffe310e), because the PR branch is based on58fed37. Running the title withrun ... --execute:host root signature refusedwarning no longer appears (0 occurrences). The retry without the directly-indexed flags is used instead: 236runtime rejected directly-indexed flagswarnings (228 withc00, 8 withc01).0x80070057: 236host pipeline refusedwarnings, 8 of them for vertex+pixel pipelines (for example vertexdfafaf385b2f94e8, pixel06295fb1d1aefb78) and 228 for compute shaders. The host pipeline library is also rejected once with the same error.draws=48 drawn=0 dispatches=0.0xc0000005(read at0x68) atvictory-image-b99f876b74d4a77f.dll+0xb5a5f8, right afterXUserAddAsync, exit code-1073741819. Without the PR,ffe310estops at the same address; I saw the same on8e79c80in an earlier run, but I no longer have that log.My reading, which is a hypothesis and not something I confirmed: the shaders need the directly-indexed flags, so a root signature without them is accepted but the pipelines that use it are refused, and the title still ends up with a null object. That would mean the PR removes the root signature refusal but not the cause of the crash on this setup. I did not check what the title does at
+0xb5a5f8.Not verified: the PR's test (
host_root_signature_serializes_and_creates),cargo clippy,cargo test --workspace, Windows 11 or an Agility SDK runtime, and a second GPU or driver. The crash at this address is also described in #998, #789 and #741.AI-assisted verification (Claude); the game was run locally by me.
@Marvisak on GitHub · 2026-11-25 01:23 UTC · original
Automated triage for the maintainers.
Proposed close. In
crates/victory-gpu/src/pipeline/host.rsroot_signature, this PR retries withoutCBV_SRV_UAV_HEAP_DIRECTLY_INDEXED/SAMPLER_HEAP_DIRECTLY_INDEXEDwhen the runtime rejects them. Translated shaders reach their descriptors through SM 6.6 heap indexing (victory-shaderemit/mod.rsmodule docs,heap_handleinemit/lower.rs), and those shaders need the flags. So the fallback root signature serializes, but the pipelines built on it are refused.The Windows 10 runs in this thread confirm this: after the fallback, every host pipeline is still refused with
0x80070057(236 of 236 in one run), 0 draws are drawn, and the title crashes at the same address as without the PR. That crash was later traced to the auth path, not to this code, so "Fixes #598" does not hold. The new test only exercises the first path on a runtime that accepts the flags. The fallback also replaces a clear "root signature refused" error with a later, less obvious pipeline refusal.On old runtimes, the fix is to load a runtime that supports these flags (Agility SDK, see #463/#969), which the maintainer would need to decide on. #1768 takes the same retry approach.
CI: no check runs on the head commit.
This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.