feat(gpu): wire up depth bounds testing on command lists and pipeline streams #582
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/582"
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 matheusfrta on 2026-11-24T05:13:05Z.
i wired up
OMSetDepthBoundson the command list tables and keptDepthBoundsTestEnablefromD3D12_DEPTH_STENCIL_DESC1in pipeline state streams for both mesh and graphics pipelines. it checksD3D12_FEATURE_D3D12_OPTIONS2first so adapters without depth bounds support like WARP fall back cleanly without rejecting pipelines or command lists.Imported from Marvisak/VIctory. Originally posted by fromthemoonx on 2026-11-24T07:39:51Z.
Tested
7e78c81(onmaind2a4bae) on NVIDIA, including the new stream path.Environment: Windows 11 Pro build 26300, AMD Ryzen 7 5700X, 16 GB, NVIDIA GeForce RTX 3060 12 GB (driver 610.88), Rust 1.98.1
x86_64-pc-windows-msvc, debug.Tested
cargo test --locked -p victory-gpu --lib: 43 passed, 0 failed, 1 ignored.every_inline_command_falls_back_to_the_tablecalls the new slot, which here reachesOMSetDepthBoundson the hardware list. The 0x220/0x230 pair is right:newer_slotmoves slot 68 to 70.cargo test --locked --workspace: 264 passed, 0 failed, 4 ignoredcargo xtask policy: 151 files ok;git diff --check: clean; clippy: onlymain'shost.rs:267warningOPTIONS2):DepthBoundsTestSupportedis true on the RTX 3060 and on WARP, andhost().depth_bounds()returns true. So the description's "adapters without depth bounds support like WARP" doesn't hold here: WARP takes the same path as hardware. The fallback for unsupported adapters stays untested on both.graphics_pipelinestream (throwaway test with a trivialvs_6_0/ps_6_0pair from the SDK'sdxc,root_signature(&[], &[], false)andGraphicsState::default()plus one RGBA8 target): created on the RTX 3060 with depth bounds on and a D32 depth buffer, with depth bounds off, with D24S8, and with depth bounds on and no depth buffer. So the driver accepts the stream layout and theDEPTH_STENCIL1subobject.Notes
cargo fmt --checkadds new diffs overmainin the five changed files:draw.rs,host.rs,list.rsandpipeline.rslose their final newline (\ No newline at end of filein the diff), andpipeline/host.rshas five, including the longmesh_pipeline(...)call and stream lines. Runningcargo fmton those files would clear them.copy_memorychange (dst as *const u8→dst as *mut u8passed tocommitted, which takes*const u8) doesn't change behavior, so it could be left out.LoadPipelinerather thanLoadGraphicsPipeline). The name includesdepth_boundsthroughdescribe(), so the two shouldn't collide.Not tested: that pixels outside the bounds are actually discarded (no render-and-read-back test); title pipelines (no game data).
AI-assisted (Claude Code) ran the checks and drafted this comment.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T13:40:28Z.
Review: APPROVED
Tested head
7e78c81merged cleanly ontomain(ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):cargo test -p victory-gpu(RTX 5090): 50 passed, 0 failed, 1 ignored (includespipeline::tests::streams_yield_their_shaderswithDepthBoundsTestEnableandlist::tests::every_inline_command_falls_back_to_the_tablewithOMSetDepthBounds)VICTORY_D3D12_WARP=1 cargo test -p victory-gpu(WARP): 50 passed, 0 failed, 1 ignoredcargo clippy -p victory-gpu --all-targets: 0 warningscargo xtask policy: okCode review looks solid —
GraphicsState::depth_boundsis preserved fromD3D12_DEPTH_STENCIL_DESC1(subobject 21), reset onD3D12_DEPTH_STENCIL_DESC(subobject 11), hashed intodescribe(), and gated onD3D12_FEATURE_DATA_D3D12_OPTIONS2::DepthBoundsTestSupportedfor bothgraphics_pipeline/mesh_pipelinestreams andOMSetDepthBounds.Two minor non-blocking nits:
Host::depth_bounds(&self)caches the result in a function-localstatic OnceLock<bool>rather than a field onHost; storing it onHostavoids tying a&selfmethod to process-global state if multiple adapters are ever instantiated in one process.crates/victory-gpu/src/list.rs:768(dst as *const u8→dst as *mut u8) is an unrelated change (and a few touched files lost their trailing newline).Approving.
AI-assisted (Gemini 4 Neon).
upstream-sync referenced this pull request2026-11-25 01:02:50 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:25:38Z.
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #158. Same depth-bounds wiring as #158 (list slot, DEPTH_STENCIL1 flag, OPTIONS2 check) without tests.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed