Repository navigation
GPU: preserve typed null render target slots - #450
fuzeofficlal wants to merge 2 commits into
Conversation
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 93edd8e on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed). The new typed_null_rtv_keeps_the_next_color_slot only builds with --features diagnostics, which I did not run separately for this PR.
- A typed null RTV now takes its slot (
CreateRenderTargetView(None, desc)), so later targets keep their indices. Only live textures go intotargetsand capture. - The
view_formatreorder also fixes a real bug: before,resource(this)was dereferenced beforehost_resourcecould returnNonefor a nullthis. The new test covers that. - Nit: a null record without a desc (
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).
…t slots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested head
AI-assisted (Claude Code). |
…layout Integrates renderer changes from Marvisak/VIctory#450 and #492. Includes capture-verified surface normal decoding.
93edd8e to
11da599
Compare
|
Automated triage for the maintainers. Merge candidate.
A null view with no description is still skipped and still shifts the slots. #1613 (open, needs work) covers that case and targets without a host texture, and overlaps this PR. The maintainer should pick one, or fold this test into the other. CI: passing ( Generated by Claude Code |
Adapt typed null RTVs from fuzeofficial (Marvisak/VIctory#450) and writable RGB9E5 format substitution from Yaekai (#492). Decode captured packed surface normals and preserve disjoint buffer update ranges.
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.
…view `set_targets` skipped a target with no recorded view or no host texture (`continue`), so every later target moved down a slot: a draw writing `SV_Target1` wrote it into the texture bound as target 1 only if target 0 existed on the host. On NVIDIA, `main` already has such a target: a 2560x1440 B4G4R4A4_UNORM render target the host refuses gets no host texture (Marvisak#1754, Marvisak#1758, Marvisak#1781), so the targets after it get the wrong outputs. The title's typed null views (no resource) took the same path (Marvisak#450). Each of those slots now gets a null view: no recorded view, no host texture, a typed null view, or a copy made without the render-target use. The null view takes the title's view format where the host renders to it (`renders_format`, `D3D12_FORMAT_SUPPORT1_RENDER_TARGET`, asked once per format), so it matches the pipeline's target formats; else R8G8B8A8_UNORM. Test `a_target_that_cannot_be_bound_keeps_the_others_in_their_slots` draws SV_Target0 red and SV_Target1 green with slot 0 unbindable (no view; a typed null view) and reads the slot-1 texture back: green. On `main`'s `set_targets` it reads red in both cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 Your test pins the PSO's slot 0 to AI use: Claude Code (Claude Opus 5.5) wrote this. |
11da599 to
a511525
Compare
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.