GPU: render targets keep their slots (null views for targets the host cannot bind), and no RTV or clear without the render-target use #1613
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!1613
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1613"
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?
@AgneyaK on GitHub · 2026-11-24 19:47 UTC · original
AgneyaK:fix/rtv-without-render-target-use→main· +201 −1 · 3 files · 2 commits · openTwo commits, rebased onto
main940d32f. The second one (added 2026-11-25) makes this useful onmainby itself, not only with #55.1. Render targets keep their slots (
736fa79, useful onmainnow)State::set_targetsskipped a target it couldn't bind (continue): one with no recorded view, or one with no host texture. Every later target then moved down a slot, so a draw'sSV_Target1landed in the texture bound as target 0, and so on.maintoday. The title's 2560x1440B4G4R4A4_UNORM(format 115) render target is refused by the host (no host texture, #1754 / #1758 / #1781 / #1952), so any pass that binds it before other targets writes them to the wrong outputs.Now every such slot gets a null view and keeps its position: no recorded view, no host texture, a typed null view, or a copy made without the render-target use (part 2).
The null view's format (the triage question): it now takes the title's view format where the host renders to that format (
host::renders_format,D3D12_FORMAT_SUPPORT1_RENDER_TARGET, asked once per format). So it matches the pipeline'sRTVFormatsfor the slot. Only where the host can't render the format at all (or there's no record) is itR8G8B8A8_UNORM. In that case the pipeline with that format is refused by the host anyway, so no draw pairs the two.2. No RTV, barrier or clear for a copy without the render-target use (
7b8c8e3, needed by #55)#55 makes a host texture without a use the host refuses, which on NVIDIA hits format 115 as a render target. The title still clears that texture and binds it, and
host.rtv, the barrier toRENDER_TARGETandClearRenderTargetVieware invalid calls on a resource withoutALLOW_RENDER_TARGET. With #55 on an RTX 3050, 3 of 3 runs lost the device 1:41–1:58 in (The application made a call that is invalid); with this, two runs had no invalid call (5:51 and 8:37). Details: #55host::renders_to(texture): whether the host copy hasALLOW_RENDER_TARGET.set_targetsbinds a null view for it (part 1).Tested (on
940d32f+ this)a_target_that_cannot_be_bound_keeps_the_others_in_their_slots: a pipeline writesSV_Target0red andSV_Target1green, slot 0 can't be bound, and the slot-1 texture is read back.--features diagnostics,VICTORY_D3D12_WARP=1) and the RTX 3050 6 GB (with a local adapter patch, not in this PR).main'sset_targetsit fails in both cases:left: [1.0, 0.0, 0.0, 1.0](red),right: [0.0, 1.0, 0.0, 1.0].cargo test -p victory-gpu --locked: 141 passed, 3 failed. The 3 fail onmainthe same way on this Intel iGPU: the 2 heap-cap tests of #1744, and the castable test #1765 fixes.cargo clippy --workspace --all-targets --locked -- -D warnings, and with--all-features: clean.cargo xtask policy: ok.main+ #1763 (NVIDIA stops at boot without it, #1754) + this, diag build, 55 s from launch. No device removal (frame 611). The refused format-115 texture appears (no host texture), but it isn't bound as a target within 55 s, so the null-view path didn't run in the title there. This laptop can't go further safely (it runs out of memory in the story load).Not tested: the debug layer (not installed here), so whether it has an opinion on a format-matched null view isn't checked; AMD, where nothing is refused, so the new paths only run for the title's typed null views.
No game data. AI use: Claude Code (Claude Opus 5.5) found the causes, wrote the changes and tests, ran the checks and the title on my machine, and drafted this description.
🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 03:31 UTC · original · edited 2026-11-25 15:54 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/list.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge candidate) was for an older state ofmain.Generated by Claude Code
@AgneyaK on GitHub · 2026-11-25 03:47 UTC · original
Thanks for the triage. Updated (
736fa79, description rewritten), so this no longer depends on #55:maintoday.set_targetsskipped any target with no recorded view or no host texture, which moves every later target down a slot. On NVIDIA the title's 2560x1440 format-115 render target has no host texture onmain(#1754 and the issues linked there), so this happens now. Those slots now get a null view too, and a new test showsmainwritesSV_Target0into the slot-1 texture (fails onmainfor no view and for a typed null view, passes here on Intel, WARP and an RTX 3050).D3D12_FORMAT_SUPPORT1_RENDER_TARGET), so it matches the pipeline'sRTVFormats. It'sR8G8B8A8_UNORMonly when the host can't render that format, where such a pipeline is refused anyway. No debug layer here, so that's not checked against it.AI use: Claude Code (Claude Opus 5.5) wrote the change and this reply.
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.