GPU: wire OMSetDepthBounds (slot 0x220) to host command list #1150

Closed
ashrafsdrop wants to merge 1 commit from upstream-pr/1150 into main
ashrafsdrop commented 2026-11-24 16:15:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ashrafsdrop on 2026-11-24T16:15:56Z.


Summary

Implements depth bounds state handling for D3D12 command lists in victory-gpu.

  • Implements set_depth_bounds on State in crates/victory-gpu/src/draw.rs to invoke OMSetDepthBounds(min, max) via ID3D12GraphicsCommandList1.
  • Replaces ignored_state at slot 68 (0x220) in METHODS with state::depth_bounds.
  • Adds fallback stub for non-Windows platforms.
  • Adds test invocation in crates/victory-gpu/src/list.rs to verify dispatch through slot 0x220.
  • Updates README.md to reflect depth bounds support in the world GPU pipeline.

Verification

  • cargo test -p victory-gpu: all 51 tests passing.
  • cargo test --workspace: all workspace crates passing cleanly.
  • cargo run -p xtask -- policy: asset policy passes (154 files ok).
<!-- greyfinch-sync:Marvisak/VIctory:issue:6586272479 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1150). Originally posted by [ashrafsdrop](https://github.com/ashrafsdrop) on 2026-11-24T16:15:56Z. --- ### Summary Implements depth bounds state handling for D3D12 command lists in `victory-gpu`. - Implements `set_depth_bounds` on `State` in `crates/victory-gpu/src/draw.rs` to invoke `OMSetDepthBounds(min, max)` via `ID3D12GraphicsCommandList1`. - Replaces `ignored_state` at slot 68 (`0x220`) in `METHODS` with `state::depth_bounds`. - Adds fallback stub for non-Windows platforms. - Adds test invocation in `crates/victory-gpu/src/list.rs` to verify dispatch through slot `0x220`. - Updates `README.md` to reflect depth bounds support in the world GPU pipeline. ### Verification - `cargo test -p victory-gpu`: all 51 tests passing. - `cargo test --workspace`: all workspace crates passing cleanly. - `cargo run -p xtask -- policy`: asset policy passes (154 files ok).
upstream-sync closed this pull request 2026-11-24 18:04:00 +00:00
shortselow-byte commented 2026-11-24 18:05:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by shortselow-byte on 2026-11-24T17:23:36Z.


Ran the CI's checks at head c1d851a (on main ffe310e), Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT: workspace 342 passed, 0 failed; both clippy runs clean; policy ok. The PR adds no test of its own; the list.rs change calls slot 0x220 but checks nothing.

Two things for review:

  • OMSetDepthBounds only matters when the pipeline enables the test (DepthBoundsTestEnable in D3D12_DEPTH_STENCIL_DESC1), and nothing on main sets it, so with this PR alone the bounds have no effect. The README change ("depth bounds" moved to what works) is ahead of that.
  • This is the fourth open PR on depth bounds, after #158, #582 and #925. #582 wires both the command-list call and the pipeline stream side.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7139125079 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1150#issuecomment-7139125079). Originally posted by [shortselow-byte](https://github.com/shortselow-byte) on 2026-11-24T17:23:36Z. --- Ran the CI's checks at head `c1d851a` (on `main` `ffe310e`), Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT: workspace 342 passed, 0 failed; both clippy runs clean; policy ok. The PR adds no test of its own; the `list.rs` change calls slot `0x220` but checks nothing. Two things for review: - `OMSetDepthBounds` only matters when the pipeline enables the test (`DepthBoundsTestEnable` in `D3D12_DEPTH_STENCIL_DESC1`), and nothing on `main` sets it, so with this PR alone the bounds have no effect. The README change ("depth bounds" moved to what works) is ahead of that. - This is the fourth open PR on depth bounds, after #158, #582 and #925. #582 wires both the command-list call and the pipeline stream side.
ashrafsdrop commented 2026-11-24 18:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ashrafsdrop on 2026-11-24T17:33:06Z.


Good catch @shortselow-byte. Indeed, OMSetDepthBounds requires DepthBoundsTestEnable on D3D12_DEPTH_STENCIL_DESC1 via pipeline subobject streams to have any rasterizer effect.

Since @plsndr33's #582 already addresses both the command list invocation and the D3D12_DEPTH_STENCIL_DESC1 stream conversion on the pipeline side, it makes sense to consolidate onto #582. Happy to close this in favor of #582.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139363497 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1150#issuecomment-7139363497). Originally posted by [ashrafsdrop](https://github.com/ashrafsdrop) on 2026-11-24T17:33:06Z. --- Good catch [@shortselow-byte](https://github.com/shortselow-byte). Indeed, `OMSetDepthBounds` requires `DepthBoundsTestEnable` on `D3D12_DEPTH_STENCIL_DESC1` via pipeline subobject streams to have any rasterizer effect. Since [@plsndr33](https://github.com/plsndr33)'s [#582](https://github.com/Marvisak/VIctory/pull/582) already addresses both the command list invocation and the `D3D12_DEPTH_STENCIL_DESC1` stream conversion on the pipeline side, it makes sense to consolidate onto [#582](https://github.com/Marvisak/VIctory/pull/582). Happy to close this in favor of [#582](https://github.com/Marvisak/VIctory/pull/582).
Zipettte commented 2026-11-24 18:06:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:01:14Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at c1d851a: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140040195 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1150#issuecomment-7140040195). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:01:14Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at c1d851a: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
mercuryVM commented 2026-11-24 19:02:31 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T18:45:50Z.

Review: COMMENTED


Tested c1d851a4 on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu passes on the head (50 passed, 1 ignored), and clippy with all features is clean.

The forwarding is fine, but on its own it does nothing yet:

  • OMSetDepthBounds only has an effect when the bound pipeline was created with DepthBoundsTestEnable in a D3D12_DEPTH_STENCIL_DESC1.
  • Nothing in the repository sets that (git grep DepthBoundsTestEnable finds nothing), so every pipeline still runs with the test off, and the bounds are ignored.
  • So the README change ("depth bounds" moved to working) overstates it.

To finish this:

  1. Carry the title's depth-bounds-enable bit into the pipeline's depth-stencil description, using the DepthStencil1 subobject or D3D12_DEPTH_STENCIL_DESC1.
  2. Check D3D12_FEATURE_DATA_D3D12_OPTIONS2::DepthBoundsTestSupported before enabling it.
  3. Keep the README row as it was until 1 lands.

Smaller point: list.list.cast::<ID3D12GraphicsCommandList1>() runs a QueryInterface on every call. Since every host list is created as at least ID3D12GraphicsCommandList, the cast could be done once, when the list is created.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6045284810 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1150#pullrequestreview-6045284810). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T18:45:50Z. **Review:** COMMENTED --- Tested c1d851a4 on Windows 11, RTX 5070, MSVC: `cargo test -p victory-gpu` passes on the head (50 passed, 1 ignored), and clippy with all features is clean. The forwarding is fine, but on its own it does nothing yet: - `OMSetDepthBounds` only has an effect when the bound pipeline was created with `DepthBoundsTestEnable` in a `D3D12_DEPTH_STENCIL_DESC1`. - Nothing in the repository sets that (`git grep DepthBoundsTestEnable` finds nothing), so every pipeline still runs with the test off, and the bounds are ignored. - So the README change ("depth bounds" moved to working) overstates it. To finish this: 1. Carry the title's depth-bounds-enable bit into the pipeline's depth-stencil description, using the `DepthStencil1` subobject or `D3D12_DEPTH_STENCIL_DESC1`. 2. Check `D3D12_FEATURE_DATA_D3D12_OPTIONS2::DepthBoundsTestSupported` before enabling it. 3. Keep the README row as it was until 1 lands. Smaller point: `list.list.cast::<ID3D12GraphicsCommandList1>()` runs a QueryInterface on every call. Since every host list is created as at least `ID3D12GraphicsCommandList`, the cast could be done once, when the list is created. AI-assisted (Claude Code).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1150
No description provided.