GPU: skip empty direct draw calls #2937
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2939"
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 andrewpozdnakov7-jpg on 2026-11-26T00:56:10Z.
A direct
DrawInstancedorDrawIndexedInstancedwith zero vertices, indices, or instances still requests a pending graphics pipeline today. Return before preparation when either count is zero. The list still counts the guest call, and nonempty draws keep requesting their pipeline. This is the direct-graphics counterpart of #2556, and the two branches merge cleanly.The same Windows/WARP test exercises both entry points, with a fresh pending pipeline per case. For each entry point the cases are zero vertices or indices, zero instances, and a nonempty draw.
63bcca43c6a00a758510398fa43096ce7e4f7df01440d8c711364b85914ad0cc7a4c788e9921e7c9The regression failed on main and passed with the patch in all six paired runs. Full WARP GPU suite passed with 247 tests and one ignored under both D3D12 debug settings. Strict GPU Clippy in both configurations and asset policy passed.
Coordination · DrawInstanced · DrawIndexedInstanced
Please retain the Git author if cherry-picking the change. If folding the fix or test into another commit, please include
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with Codex. Synthetic tests only.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:08:16Z.
Code review and RTX 5090 + WARP verification at head
1440d8c71136merged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/draw.rs:1563-1565, 1670-1672):vertices == 0 || instances == 0inState::drawandindices == 0 || instances == 0inState::draw_indexedskipstrace,completes_rectangles(host_pipeline), andprepareso zero-count direct draws never push unused graphics pipelines into on-demand compilation (host.used).Stateand lazily sync against host snapshots on the next non-empty draw, with no state desync or missed resource transitions.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy(default +--features diagnostics): 0 warningsdraw::tests pipeline:: list::: 48/48 passed on RTX 5090 (default) and 51/51 passed on WARP (--features diagnostics), includingzero_count_draws_do_not_request_graphics_pipelines.LGTM.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T01:12:25Z.
Closing the duplicate in favor of #2654, which already has the same fix and covers both graphics entry points through the guest list vtable.
Pull request closed