GPU: say when a draw's render target has no host copy or lost its permission #1700
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!1700
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1700"
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?
@fiestorra on GitHub · 2026-11-24 20:52 UTC · original
fiestorra:fix/target-without-permission→main· +38 −1 · 1 files · 1 commits · openA draw that renders into nothing now says so
crates/victory-gpu/src/draw.rs,set_targets(the title'sOMSetRenderTargets): two ways a render target can be lost were silent.ALLOW_RENDER_TARGETgot a render target view anyway:CreateRenderTargetViewreturnsvoid, so a refusal is invisible, D3D12 binds an empty descriptor, and the draw renders into nothing. The same for depth andALLOW_DEPTH_STENCIL, where?skipped the depth buffer silently.Why it is worth naming now:
resource::host_texturedeliberately gives up what the host refuses (that is the point of #1630), and on the RTX 4090 the title's two 2560×1440 targets come out exactly like that — theB4G4R4A4_UNORMone is made as plain memory (flags_made=0) because that adapter refuses it as a render target at all (#1600). So a target can exist, be named by a draw, and be unrenderable, with the only trace being one line at creation time.The change:
ALLOW_DEPTH_STENCILis skipped with its own line instead of?.Verification
cargo test -p victory-gpu --locked→ 50 passed, 1 ignored;cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warningsclean;rustfmt --checkclean for the lines added.What I did not capture: a live draw binding one of those targets in a run. The title only creates those two 2560×1440 targets in some runs (they appear in one 60-second run and not in the next two on the same adapter), so the positive path is reasoned from the creation-time fallback line rather than observed here. If someone can run it where those targets appear, the new line names the resource.
No game data is involved: resource handles and flags only.
Written with an AI assistant.
@Marvisak on GitHub · 2026-11-25 03:34 UTC · original
Automated triage for the maintainers.
Needs work. The new warning for a render target with no host copy (
State::set_targets,draw.rs) is useful. Two problems with the permission check:continuecompactsrtvs, so every later target moves down a slot and the shader'sSV_TargetNwrites land in the wrong texture. Binding a null RTV in that slot would keep the indices.ALLOW_RENDER_TARGET.mainhas noresource::host_textureand nothing that removes that flag; that fallback is #1630.To change the verdict: keep the warnings, put a null descriptor in a skipped slot instead of compacting, and either rebase onto the fallback once it lands or show where
mainproduces such a texture. CI passes.Generated by Claude Code
@fiestorra on GitHub · 2026-11-26 12:19 UTC · original
The slot is no longer compacted, and the change no longer depends on a fallback that main does not have
Head
9ef0e429, rebuilt on842b0cb7; the earlier head was based on a main from two days ago, which is why the diff looked like it reverted files it does not touch.ALLOW_RENDER_TARGETpushes a nullD3D12_CPU_DESCRIPTOR_HANDLEintortvsinstead ofcontinue.SV_TargetNtherefore lands in slot N whatever happened to its neighbours, and a null descriptor is a slot D3D12 discards writes to — which is what the draw was doing silently. The resource list used for barriers and the debug line still holds only real resources.ALLOW_DEPTH_STENCIL, onewarn!and the draw runs without depth.mainnothing dropsALLOW_RENDER_TARGET, so the permission arm guards a state main does not produce today. I kept it because it is oneifon aGetDesc()and it is the only thing that would say so if a later fallback (#1630 or a widening PR) starts dropping it — but it costs nothing when it never fires, and the warnings for the two arms that are reachable (no recorded view, no host copy) are the value here. If you would rather have only those, say so and I will cut the permission arm.Measured:
cargo test -p victory-gpu --lib→ 231 passed, 0 failed;cargo clippy -p victory-gpu --all-targets -- -D warningsclean.Written with an AI assistant.
c0f73dff7fto9ef0e429fd@DenRakEiw on GitHub · 2026-11-24 20:56 UTC · original · approved these changes
Verified locally merged onto
origin/main(Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):cargo test -p victory-gpu— 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— okClean diagnostic logging when a draw's render target lacks a host copy or render-target permission. Looks good.
AI-assisted (Gemini 4 Neon).
@mercuryVM on GitHub · 2026-11-24 21:28 UTC · original · requested changes
Read only, not built (read against
set_targets):The warnings are welcome, but the new render-target arm changes which slot each target lands in (
crates/victory-gpu/src/draw.rs, inset_targets):rtvsgoes toOMSetRenderTargetsas a dense array, sortvs[i]is bound to sloti.ALLOW_RENDER_TARGETstill gothost.rtv(..). That made an empty descriptor in its slot, so its writes were dropped and the targets after it kept their slots.continue, the targets after a skipped one move down a slot. A pixel shader writingSV_Target1then lands in what the title bound as target 0.Fix: keep the warning, but hold the slot. Push the empty view as before, or a null-resource RTV made with
CreateRenderTargetView(None, Some(&desc), handle)and the target's format, instead ofcontinue, in both arms.The depth arm is fine: there is only one DSV, so
Noneloses only depth.AI-assisted (Claude Code).
@catminou4 on GitHub · 2026-11-24 22:19 UTC · original · reviewed
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Draws whose render target has no host counterpart are now reported explicitly instead of silently skipped (draw.rs, 2.4K). Small observability fix.
@fiestorra on GitHub · 2026-11-26 14:50 UTC · original
Already done in the head you are reading: the slot is held with a null descriptor
Thanks — that is exactly the fix, and it is in
9ef0e429, the head this PR has had since yesterday: none of the three armscontinues any more. Each handle pushes a view intortvs, and a handle that yields none (no recorded view, no host copy, or a host copy withoutALLOW_RENDER_TARGET) pushes a nullD3D12_CPU_DESCRIPTOR_HANDLEinstead, soSV_TargetNstays in slot N. The resource list used for the barriers and the debug line still holds only real resources.The depth arm is as you say: one DSV, so
Noneloses only depth, and that is what it does.The suggestion of
CreateRenderTargetView(None, Some(&desc), handle)is a different trade: it would make a real descriptor for a resource that has none, and D3D12 discards writes to a null descriptor anyway, so it buys nothing over the null handle while adding a call that can itself fail. If a case appears where an empty view is needed rather than a null one, say so and I will switch.Written with an AI assistant.
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.