GPU: retry a root signature without the heap-directly-indexed flags when the host refuses them #1768
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!1768
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1768/head"
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?
@pablogonz12 on GitHub · 2026-11-24 22:14 UTC · original
pablogonz12:up/1532-root-heap-flags→main· +314 −10 · 1 files · 3 commits · closed without mergingFixes #1532
What.
D3D12SerializeRootSignatureandD3D12SerializeVersionedRootSignatureare given the title's description with the console-only flags (bits 24 and up) already cleared. Two more flags,CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED(0x400) andSAMPLER_HEAP_DIRECTLY_INDEXED(0x800), are PC flags, but only a runtime with shader model 6.6 dynamic resources knows them; an older one (WARP without the Agility SDK, vkd3d-proton under Wine) refuses the whole description withE_INVALIDARG, which is the0xC01in the report. A refusal that carries either bit is now retried once with those two bits dropped, and logged at debug; no other flag and no other failure is touched.Why. The title asks for
0xC01, so on a host that refuses it the root signature, and every pipeline that names it, is lost. With the retry the title keeps a usable root signature; only shaders that index the descriptor heaps directly lose the flag, and a host without those flags cannot run them anyway.Tested
root::tests::the_heap_flags_are_dropped_only_after_the_host_refuses_them, with a fake serializer that refuses0xC01the way the report describes:0xC01→ attempts0xC01then0x1andS_OK;0x41→ one attempt; versioned0xC03→0xC03then0x3; a fake that always fails →E_INVALIDARGcomes back unchanged.cargo test -p victory-gpu --lib(Linux host): 25 passed, 0 failed.cargo xwin clippy --workspace --all-targets [--all-features] --target x86_64-pc-windows-msvc -- -D warnings: clean.Not tested. The refusal itself: there is no WARP or old-Agility host here (Linux, RADV), so the retry is covered by the unit test only; no game run.
AI-assisted (DeepSeek via OpenCode), no game data.
@DesertGamer on GitHub · 2026-11-24 22:15 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@ericomeehan on GitHub · 2026-11-24 23:31 UTC · original
Retrying once without the heap-directly-indexed flags is a neat way to keep WARP and vkd3d hosts going, and the fake-host tests pin the retry order nicely.
One small leak: in
serialize_with/retry_without_heap_flagsand inserialize_versioned_with, the first call can store an error blob in*errorbefore failing, and the retry is passed the sameerrorpointer, so that first blob is overwritten without being released. Passing a local out-pointer to the first attempt (and releasing what it gets back if you retry), or releasing*errorbefore the retry when it is non-null, would avoid it. Also, a once-onlywarninstead ofdebugfor the retry would help testers see that shaders indexing the heap directly will still be refused on that host.Written with an AI assistant (Claude).
@pablogonz12 on GitHub · 2026-11-25 03:41 UTC · original
Fixed in
6af59ce87: the first attempt writes its error blob to a local pointer, which is released before the retry (and handed to the caller untouched when there is no retry; also released when the caller passed a nullerror), in bothserialize_withandserialize_versioned_with(crates/victory-gpu/src/root.rs). Addedthe_first_error_blob_is_released_by_a_retrywith a fake host that leaves a COM-shaped blob behind: one release on the retried path, none when the first attempt is final. Not tested on Windows/WARP this cycle;cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warningsis clean.@Marvisak on GitHub · 2026-11-25 06:16 UTC · original · edited 2026-11-25 07:27 UTC
Automated triage for the maintainers.
Proposed close. In
crates/victory-gpu/src/root.rs,serialize_with/serialize_versioned_withretry a refused root signature withoutCBV_SRV_UAV_HEAP_DIRECTLY_INDEXED/SAMPLER_HEAP_DIRECTLY_INDEXED. The error-blob handling in6af59celooks right. The problem is what the retry achieves. The host pipelines' own root signature (pipeline/host.rs, around line 776) always sets both flags, and translated shaders reach descriptors through SM 6.6 heap indexing (victory-shaderemit/mod.rs). So a host that refuses these flags still cannot build any pipeline. The Windows 10 runs on #626, which took the same approach, showed exactly that. The README lists SM 6.6 as a requirement.Update after your reply: thanks for checking this against the tree. As you say, the one case that would still justify the retry is a supported SM 6.6 host that refuses the flags only on the 1.0
D3D12SerializeRootSignaturepath. A log from such a host would change this verdict.CI:
checkpassing.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
@pablogonz12 on GitHub · 2026-11-25 06:30 UTC · original
Checked the mechanism against the tree and you are right: every translated shader reaches descriptors through
ResourceDescriptorHeap/SamplerDescriptorHeap(crates/victory-shader/src/emit/mod.rs:19-22), and every host pipeline signature sets both flags unconditionally (crates/victory-gpu/src/pipeline/host.rs:776-777), so a host that refuses0xC01refuses the host signatures as well and the retry only moves the failure to pipeline creation.We have no log of an SM 6.6 host refusing the title's flags: our only host is RADV on Linux, and the Windows 10 runs on #626 refused every pipeline, which matches your reading of that PR. I am not going to defend the patch on the same premise, so I am not pushing a change; if the label stays, close it. The one case that would still make it worthwhile is a supported host that refuses
0xC01only on the 1.0D3D12SerializeRootSignaturepath (the title serializes with 1.0, the host signatures use the 1.1 versioned call), and I cannot test that here.@pablogonz12 on GitHub · 2026-11-25 11:35 UTC · original
Closing this one myself as discussed above: it doesn't earn its place. Thanks for the review.
Pull request closed