GPU: preserve typed null render target slots #450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/450"
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?
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T03:32:50Z.
A typed null RTV still occupies an output slot. Skipping it in
State::set_targetsmoves the next live target into the wrong slot. Keep the typed null descriptor in the host binding array and track only live textures for state transitions and capture.The regression draws two colors with a null RGBA8 RTV in slot 0 and a live RGBA8 RTV in slot 1. The PSO uses UNKNOWN for slot 0. Before the fix, the D3D12 debug layer rejected the live target bound to slot 0. With the fix, all 16 pixels in the live texture receive the color from SV_Target1 on native D3D12 and WARP.
cargo test -p victory-gpu --features diagnosticspassed with 47 tests and one ignored benchmark. The default suite passed with 44 tests and one ignored benchmark. The default view lookup also returns no format when there is no resource. The staged asset policy check passed.Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:14:43Z.
Review: APPROVED
Tested
93edd8eon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed). The newtyped_null_rtv_keeps_the_next_color_slotonly builds with--features diagnostics, which I did not run separately for this PR.CreateRenderTargetView(None, desc)), so later targets keep their indices. Only live textures go intotargetsand capture.view_formatreorder also fixes a real bug: before,resource(this)was dereferenced beforehost_resourcecould returnNonefor a nullthis. The new test covers that.record.desc()isNone) still hitscontinueand shifts later slots, as before. D3D12 needs a desc for a null RTV, so there is no direct fix, but atracing::debug!there would make the remaining case visible.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by DeerSilver on 2026-11-24T11:01:36Z.
Tested head
93edd8emerged ontomainffe310e(clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1: pass. No game files: the test suite only.a_missing_resource_has_no_default_view_formatcargo test --workspace --locked: 343 passed, 0 failed, 6 ignored, against 342 passed / 6 ignored onmain.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:18:36Z.
Automated triage for the maintainers.
Merge candidate (re-checked on
6d96d4a). The change is the same as before the push.State::set_targetsincrates/victory-gpu/src/draw.rsbinds a typed null RTV in its own slot throughHost::rtv(None, Some(&desc))instead of skipping it, so later targets no longer shift down a slot. The new commit reordersresource::view_formatso it callshost_resource(which returnsNonefor a null pointer) before it dereferences the record. A small test,a_missing_resource_has_no_default_view_format, covers that.Overlap still stands: #1613 handles more skipped-slot cases, but it does not merge cleanly into
mainat the moment. The maintainer can pick one PR and fold the other's extra cases into it.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by AgneyaK on 2026-11-25T03:47:28Z.
Heads-up on overlap: #1613 (updated today) now also keeps a skipped render-target slot with a null view. It covers this PR's typed null view (including one with no description, which this PR still skips) and targets with no recorded view or no host texture. The last is the NVIDIA case on
main, where a refused 2560x1440 target shifts the later ones. Its test checks both the no-view and the typed-null-view case againstmain.Your test pins the PSO's slot 0 to
UNKNOWN, which is a useful extra case. Happy to fold anything from here into #1613, or the other way round, whichever the maintainer prefers.AI use: Claude Code (Claude Opus 5.5) wrote this.
upstream-sync referenced this pull request2026-11-25 08:06:32 +00:00
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.