GPU: preserve typed null render target slots #450

Open
github-bot wants to merge 2 commits from github-bot/gh-450 into main AGit
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 03:32 UTC · original
fuzeofficlal:fix/typed-null-rtv → main · +232 −9 · 5 files · 2 commits · open

A typed null RTV still occupies an output slot. Skipping it in State::set_targets moves 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 diagnostics passed 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.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 03:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/450) `fuzeofficlal:fix/typed-null-rtv` → `main` · +232 −9 · 5 files · 2 commits · open A typed null RTV still occupies an output slot. Skipping it in `State::set_targets` moves 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 diagnostics` passed 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.
Materialize an explicit null RTV when recording host render-target bindings. Keep the resource-transition list limited to real textures. A synthetic MRT draw verifies that the real target receives SV_Target1 after a typed null in slot 0.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:04:29 +00:00
Author
Owner

@⁠DeerSilver on GitHub · 2026-11-24 11:01 UTC · original

Tested head 93edd8e merged onto main ffe310e (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.

  • The PR's new test passes. It uses the host GPU and ran on the RTX 5060 (DXGI adapter 0 on this laptop, so the host-device helpers return a device and the tests don't take their early return):
    • a_missing_resource_has_no_default_view_format
  • cargo test --workspace --locked: 343 passed, 0 failed, 6 ignored, against 342 passed / 6 ignored on main.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.

AI-assisted (Claude Code).

**@⁠DeerSilver** on GitHub · 2026-11-24 11:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/450#issuecomment-7129556773) Tested head `93edd8e` merged onto `main` `ffe310e` (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. - The PR's new test passes. It uses the host GPU and ran on the RTX 5060 (DXGI adapter 0 on this laptop, so the host-device helpers return a device and the tests don't take their early return): - `a_missing_resource_has_no_default_view_format` - `cargo test --workspace --locked`: **343 passed, 0 failed, 6 ignored**, against 342 passed / 6 ignored on `main`. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:18 UTC · original · edited 2026-11-26 01:22 UTC

Automated triage for the maintainers.

Merge candidate (re-checked on 6d96d4a). The change is the same as before the push. State::set_targets in crates/victory-gpu/src/draw.rs binds a typed null RTV in its own slot through Host::rtv(None, Some(&desc)) instead of skipping it, so later targets no longer shift down a slot. The new commit reorders resource::view_format so it calls host_resource (which returns None for 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 main at the moment. The maintainer can pick one PR and fold the other's extra cases into it.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/450#issuecomment-7148374286) · edited 2026-11-26 01:22 UTC <!-- victory-triage v1 head=6d96d4a4bffaaa9ae22935a0bbea63d1bab3f342 verdict=merge-candidate at=2026-11-26T01:22:45Z --> Automated triage for the maintainers. **Merge candidate (re-checked on `6d96d4a`).** The change is the same as before the push. `State::set_targets` in `crates/victory-gpu/src/draw.rs` binds a typed null RTV in its own slot through `Host::rtv(None, Some(&desc))` instead of skipping it, so later targets no longer shift down a slot. The new commit reorders `resource::view_format` so it calls `host_resource` (which returns `None` for 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 `main` at the moment. The maintainer can pick one PR and fold the other's extra cases into it. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠AgneyaK on GitHub · 2026-11-25 03:47 UTC · original

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 against main.

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.

**@⁠AgneyaK** on GitHub · 2026-11-25 03:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/450#issuecomment-7152244605) 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 against `main`. 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/450/head:github-bot/gh-450'
git switch 'github-bot/gh-450'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-450'
git switch 'github-bot/gh-450'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-450'
git switch 'github-bot/gh-450'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-450'
git switch 'main'
git merge --squash 'github-bot/gh-450'
git switch 'main'
git merge --ff-only 'github-bot/gh-450'
git switch 'main'
git merge 'github-bot/gh-450'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!450
No description provided.