GPU: create host textures without the uses the host refuses #55
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!55
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-55"
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?
@a55uka on GitHub · 2026-11-23 23:55 UTC · original
a55uka:fix/nvidia-texture-fallback→main· +47 −15 · 1 files · 1 commits · openThe console's GPU allows some uses of formats that other GPUs don't. On an RTX 4070 (Linux, vkd3d-proton), two 2560×1440 textures failed to create with
E_INVALIDARG:vkd3d-proton logs:
Requested resource flags #5, but no format in cast list supports it.Tested:
@Vyral1978 on GitHub · 2026-11-24 00:20 UTC · original
Tested on native Windows 11 D3D12 (Intel i7-12700 + NVIDIA RTX 3070):
2560x1440textures (format 86with UAV andformat 115with RT); both now create cleanly withdropped=4anddropped=1.ALLOW_RENDER_TARGETis dropped onformat 115,Host::rtv()(called fromdraw.rs::set_targetsandlist.rs::clear_rtv) still callsCreateRenderTargetView/OMSetRenderTargets/ClearRenderTargetViewon that texture, which triggersDXGI_ERROR_INVALID_CALL (0x887A0001)on native Windows D3D12.Option<D3D12_CPU_DESCRIPTOR_HANDLE>fromHost::rtv()(returningNonewhenGetDesc().Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET == 0) and skipping it inset_targets/clear_rtvcompletely fixes the0x887A0001removal (ran ~82s into the world on35b054e).@EduAzevedo on GitHub · 2026-11-24 00:42 UTC · original
Tested
56f1d41on NVIDIA GeForce RTX 2070 SUPER (Turing), driver 610.88, Windows 11 (10.0.26200), native D3D12, release build, empty cache: the textures are fixed; the world then ends in device removed withDXGI_ERROR_INVALID_CALL, which confirms the follow-up @Vyral1978 describes, on Turing too.35b054eno host texture(2560×1440, format 86 UAV and format 115 RT)host texture without a use the host refuses)0x887A0004after an 8.6 s submission (a hang)0x887A0001(invalid call), twice, after a 0.5 s submission2c3592e9bbad543f,559fb027c6d5b1db,e4a4da9c0f4d810e).AI-assisted.
@EduAzevedo on GitHub · 2026-11-24 00:54 UTC · original
Follow-up to my test above: I implemented the
Host::rtv()change @Vyral1978 describes on top of56f1d41and ran it on the same RTX 2070 SUPER (Turing), driver 610.88, Windows 11, native D3D12, release build. The0x887A0001removal is gone; the world now runs until the hang from #71 / #97.56f1d41)DXGI_ERROR_INVALID_CALL(0x887A0001)0x887A00010x887A0004after a 5.0 s submission holding the same three compute pipelines as on main (2c3592e9bbad543f,559fb027c6d5b1db,e4a4da9c0f4d810e), i.e. the hang in #71 / #97One difference from the suggestion: instead of leaving the target out of
OMSetRenderTargets, it binds a null RTV in its slot, so the targets after it keep their indices (dropping one would move the pixel shader's later outputs onto the wrong textures).clear_rtvreturns without clearing.cargo build --releaseandcargo test -p victory-gpu(39 passed) are clean.Feel free to take it into this PR; I can open it as a separate PR on top of this one instead if you prefer.
Patch (on top of
56f1d41)AI-assisted.
@DaviTostes on GitHub · 2026-11-24 00:56 UTC · original
Tested
56f1d41under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.\n\n-victory_gpu: 36 passed, 3 failed — the same three environment-only failures asmain(argument_clamp_builds,a_rejected_blob_gives_an_empty_library, #128'sVirtualQueryupload skip).\n- The diff adds no test, so this only shows nothing else broke; the refused-use fallback is not exercised by the suite here.\n\nNo game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).@r4tedx on GitHub · 2026-11-24 03:30 UTC · original
Review question (built on
maind2a4bae; tests pass on an RTX 5070). When the host refuses a texture, the fallback retries without the uses it refused (fewer.flags &= !drop), which can take awayALLOW_RENDER_TARGET, as in the B4G4R4A4 case in the description. As far as I can follow it, the title's later render-target binds still reachCreateRenderTargetViewfor that host texture (the draw and clear paths make RTVs for whatever the title binds). Microsoft's description of the flag is "Allows a render target view to be created for the resource", so a view on a texture created without it is invalid, and on a real device that tends to end in a removal rather than a clean error.Is there a check I missed that skips such binds? If not, #89 takes the other route for the packed 16-bit formats (it renders them as R8G8B8A8, keeping the capability), which avoids the problem for that case.
From reading only; I have no copy of the title.
@walterwallaceson on GitHub · 2026-11-24 05:54 UTC · original
Tested #55 (
56f1d41) and #89 (081afbd) together on an AMD CPU, so the Intel start-up blocker above doesn't apply: Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, release build. Both merged cleanly on top of #233 (3098672) + #175 (19aec59), so this is the four together, not either PR alone.no host texture(2560x1440, formats 86 and 115,0x80070057)0x887A0006, no breadcrumbs)cargo test --workspace:victory-gpu48 passed (43 without these PRs); the only failures are the known Windows 10 ones (#118/#152, #362).host pipeline refusedlines in the run come after the removal (0x887A0005), so they're a consequence of it.no free dynamic descriptor slots: a table is not madeabout 34 s before the removal, the signature #304 and #336 describe. It didn't appear in the #175 + #233 run. Adding #336 on top makes the world last about 2 min instead of 40 s (details on #336).No game data in this report.
AI-assisted (Claude Code); everything above was run on my machine.
@NuraadGit on GitHub · 2026-11-24 11:45 UTC · original
A gap this leaves on NVIDIA: the render-target views are still made, and one of them removes the device.
When the render-target use is dropped (B4G4R4A4 on NVIDIA), the comment says "the views the host cannot make are skipped as for depth". But the RTV paths don't skip them.
draw.rsset_targetsandlist.rsclear_rtvboth callhost.rtv(texture, …)for any host texture.CreateRenderTargetViewon a texture withoutALLOW_RENDER_TARGETwrites an invalid descriptor, and the next use removes the device withDXGI_ERROR_INVALID_CALL.Seen on an RTX 2080 with a stack that includes this change (JMAN730's fork + #493 + #189 + #206 + #667 + 2^18 dynamic slots from #747). That stack makes more world draws run. With the debug layer on (
VICTORY_D3D12_DEBUG=1), the last messages before the removal are:The fix I used is a check in
Host::rtvfor whether the texture allows render targets. If it doesn't, the function makes a typed null view instead (R8G8B8A8_UNORM, TEXTURE2D), which discards the writes. A clear of such a texture returns early:Same build, same input, before and after: the device was removed at world entry 2 of 2 times without it, and the run stayed up for 8 minutes with it (~2,430 draws per frame, median 0.91 s per frame). Main's
rtvtakes&ID3D12Resourcerather thanOption, so there it's the same check with an early null view. #89 is the fuller fix (render 4444 targets as R8G8B8A8). This is the minimum that makes dropping the use safe.AI-assisted (Claude Code): the debug-layer run, fix and runs were automated. The hardware, title copy and runs are the user's.
@AgneyaK on GitHub · 2026-11-24 16:51 UTC · original
Test report, and a follow-up fix for what this PR exposes.
Setup: RTX 3050 6 GB Laptop (NVIDIA, driver 32.0.16.2124), i7-13700H, 16 GB RAM, Windows 11 26300, diag build. Title 1.0.2.1, Series X profile. Tree:
mainffe310e+ #208 + the wave64 stack + #452 + #579 + #472/#322/#1024 + #492 (the tree in #1232), plus this PR56f1d41(clean merge).What this PR fixes: the two textures
mainrefuses on this card are created:What it exposes: an invalid call that removes the device. In all three runs with this PR the device was removed 1:41–1:58 in with
The application made a call that is invalid(DXGI_ERROR_INVALID_CALL). None of six runs of the same tree without it ended that way (they ran 2:20–9:27 and ended in hangs, resets or title asserts). The cause:B4G4R4A4texture (format 115) losesALLOW_RENDER_TARGET, but the title still clears it and binds it as a target.list.rs(the clear) makes an RTV of it withhost.rtv, records a raw barrier toRENDER_TARGETand callsClearRenderTargetView. All three are invalid on a resource without that flag.draw.rsset_targetsalso callshost.rtvwith no flag check. The UAV path already checks, throughfits().The fix (below, 47 lines; it applies to this PR's head):
host::renders_to(texture)check;set_targetsbinds a null RTV in that slot (Host::null_rtv), so the other targets keep their slots and the draw writes nothing there. That matches what this PR already does for the views the host cannot make.With the fix, two runs:
clear of a render target the host cannot render to: skippedat 2:18 andrender target the host cannot render to: a null view in its slotat 2:41;patch
Not tested: AMD (where nothing is dropped, so the new paths never run), more runs, a release build. The null view's format is
R8G8B8A8_UNORM, not the dropped format. I have not checked what the debug layer says about the mismatch with the pipeline's RTV format (the debug layer isn't installed here).AI use: Claude Code (Claude Opus 5.5) found the cause, wrote the patch, ran the title on my machine and drafted this note; results are from the runs described.
@AgneyaK on GitHub · 2026-11-24 19:47 UTC · original
The render-target guard from my comment above is now a PR on its own: #1613. It applies to
main, changes nothing there, and stops the invalid-call device removal once this PR lands.@Marvisak on GitHub · 2026-11-25 00:14 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/resource.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.