Repository navigation
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
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
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— ok
Clean renders_to guard and null_rtv() fallback preventing invalid RTV creation, barriers, or clears on textures without D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET. Looks good.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu/victory-hle/apps are Windows-only (D3D12/windows_sys), so nothing here compiles or runs on macOS — please rely on the Windows CI leg.
Textures whose host copy lacks ALLOW_RENDER_TARGET now get a null RTV in their slot instead of a view the host cannot render to: draw.rs pushes host.null_rtv() (ring slot preserved so target indices stay aligned) and clear_rtv skips with a once-per-resource warning. renders_to checks the resource flag, which matches how host_texture masks d.flags &= PC_FLAGS. Sound; OMSetRenderTargets with a null RTV is valid D3D12 and draws simply discard those outputs.
f82c960 to
e3d76bd
Compare
… a texture without the render-target use
|
Automated triage for the maintainers. Merge candidate. Update after your reply (head Not checked with the debug layer: a view recorded without a description gets the Generated by Claude Code |
…e render-target use A host texture made without ALLOW_RENDER_TARGET (Marvisak#55 drops a use the host refuses for the format, e.g. B4G4R4A4_UNORM on NVIDIA) was still cleared and bound as a render target: CreateRenderTargetView, a barrier to RENDER_TARGET and ClearRenderTargetView on it are invalid calls, and the device is removed with DXGI_ERROR_INVALID_CALL. `host::renders_to` tells. The clear skips such a texture (warned once); `set_targets` binds a null RTV in its slot (`Host::null_rtv`), so the other targets keep their slots and draws write nothing there. No change while every texture keeps its render-target use, as on `main` today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
e3d76bd to
736fa79
Compare
|
Thanks for the triage. Updated (
AI use: Claude Code (Claude Opus 5.5) wrote the change and this reply. |
…mmit Marvisak#2130 was rewritten on top of Marvisak#2120's update, so layering it on the old merges kept two versions of it. This tree is upstream main (940d32f) with all 32 open PRs of 0xkn0wh3r3 at their current commits, the upstream fixes Marvisak#1887, Marvisak#1717, Marvisak#1832, Marvisak#1630, Marvisak#1763 and Marvisak#1613, and the demo-only conformance list; the old history stays as this merge's first parent.
Two 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, NVIDIA RTX 4070 SUPER on 70564ae: device removed (INVALID_CALL, 0x887A0001) at frame 128, before the menus #1754 / RTX 5080 (wave32): device removed 8 s after start on 70564ae (castable formats refused); older builds hang the GPU in the world #1758 / Host GPU device removed (0x887A0001) shortly after no host texture for Xbox-only format 115 (title 7952987A) #1781 / RTX 3060 (NVIDIA): host device removed ~1 s after a 2560x1440 format-115 render target is refused #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: #55 (comment)host::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 Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744, and the castable test GPU tests: the castable pair is two host textures where the host refuses castable formats #1765 fixes.cargo clippy --workspace --all-targets --locked -- -D warnings, and with--all-features: clean.cargo xtask policy: ok.main+ GPU: refuse typed UAVs in unsupported formats regardless of family or castability #1763 (NVIDIA stops at boot without it, NVIDIA RTX 4070 SUPER on 70564ae: device removed (INVALID_CALL, 0x887A0001) at frame 128, before the menus #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