Repository navigation
GPU: retry a root signature without the heap-directly-indexed flags when the host refuses them - #1768
pablogonz12 wants to merge 3 commits into
Conversation
A host whose D3D12 runtime predates shader model 6.6 dynamic resources (WARP without the Agility SDK, vkd3d-proton under Wine) refuses a description that carries CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED (0x400) or SAMPLER_HEAP_DIRECTLY_INDEXED (0x800) with E_INVALIDARG. The title asks for 0xC01, so the whole root signature, and every pipeline naming it, was lost. Retry once without those two bits, and only after the host refused; every other flag and failure is untouched. Fixes Marvisak#1532.
VIctory V2: community PRs, merged and testedOpen 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). 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: Unofficial community fork of Marvisak/VIctory, GPL-3.0. |
catminou4
left a comment
There was a problem hiding this comment.
Static review only: Windows-only code (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.
Root signature serialization retries without the heap-directly-indexed flags when the device refuses them: serialize_with/retry_without_heap_flags + serialize_versioned_with, with refuses_heap_flags test doubles for both paths. This is the standard D3D12 fallback for older drivers — the retry must preserve the original flags for devices that accept them, which the structure does. Windows-only.
|
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 Written with an AI assistant (Claude). |
D3D12SerializeRootSignature hands out an ID3DBlob through ; serialize_with passed the caller's pointer to both attempts, so the retry overwrote the first blob without releasing it. The first attempt now writes to a local pointer: it is released before the retry and handed to the caller otherwise (released too when it asked for none). Same for the versioned entry point. Test: a fake host that leaves a COM-shaped blob behind.
|
Fixed in 6af59ce: 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 null |
|
Automated triage for the maintainers. Proposed close. In 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 CI: This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the Generated by Claude Code |
…ectly-indexed flags when the host refuses them
|
Checked the mechanism against the tree and you are right: every translated shader reaches descriptors through 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 |
|
Closing this one myself as discussed above: it doesn't earn its place. Thanks for the review. |
Fixes #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.