gpu(native): keep colour attachment slots when a target has no host texture #61
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/61"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by ShadyUnderLight on 2026-11-26T12:07:07Z.
Summary
OMSetRenderTargetsdropped targets the host could not make, shortening the colour list so every later target moved down one slot; the binding is now refused instead.Problem
glue::targetsbuilt the colour list withfilter_map, so a target without a host texture (an unrepresentable format, or an RTV naming a resource with no texture) vanished from the middle of the list.rp.color[i]tocolorAttachments[i], and the guessed pipeline is made from the same shortened format list, soSV_TargetNwrites a surface an earlier slot owns.filter_maphas the same effect for an unknown or stale RTV handle.Fix
targets_readyon the title list records that state;graphicsdrops a draw while it is false.Tests
a_target_the_host_cannot_make_does_not_shift_the_ones_after_itbinds [format 12, format 28]; on main the bound format list has one entry (the second target moved into slot 0), here it is empty, and binding the makeable target again gives one.Baseline failure:
With the change:
test result: ok. 1 passed; 0 failed.Verification
cargo test -p victory-gpu a_target_the_host_cannot_make_does_not_shift_the_ones_after_it— ok.cargo test -p victory-gpu(native arm64) — 146 passed, 0 failed, 1 ignored.cargo test -p victory-metal— 9 passed, 0 failed.cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings— clean.cargo clippy -p victory-gpu --all-targets -- -D warnings— the only errors are the two pre-existingunnecessary_castfindings incrates/victory-metal/src/present.rs:126,144; the same two appear on unmodifiedorigin/main, so this change adds none.cargo xtask policy—asset policy: 365 files ok.cargo build --release --target x86_64-apple-darwin -p victory— ok.recorded=13524 encoded=13524 no_pipeline=0 no_texture=0, 11 "frame presented" lines (lastframe=1024). The title does not hit this path today, so the fix is a latent correctness fix; no frames were lost.Risk
Optioncollect and a bool.Notes
All English, no game data in the repo. Found while auditing the native render-target path.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T12:48:23Z.
Review: APPROVED
Thanks. Positional colour-slot resolution with the whole binding refused when a slot is missing looks right, and the test fails on main. Approved.