Skip to content

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

Closed
ashrafsdrop wants to merge 1 commit into
Marvisak:mainfrom
ashrafsdrop:gpu/depth-bounds
Closed

ashrafsdrop wants to merge 1 commit into
Marvisak:mainfrom
ashrafsdrop:gpu/depth-bounds

Conversation

@ashrafsdrop

Copy link
Copy Markdown

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).

@shortselow-byte

Copy link
Copy Markdown

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:

@ashrafsdrop

Copy link
Copy Markdown
Author

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.

@Zipettte

Copy link
Copy Markdown

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 mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested c1d851a 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).

nazmi added a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
Review workers over ~45 more PRs against the merged upstream tree.

Integrated: Marvisak#1394 (antisymmetric XUserCompare), Marvisak#1390 (A8_UNORM is not in
the R8 typeless family), Marvisak#1499 (deep 3D mips stay out of the thick tail,
plus a regression test the PR lacked), Marvisak#1366 (mesh stage I/O does not parse
VS inputs), Marvisak#1594 (the title's exit status reaches the shell), Marvisak#1299 (docs:
validator prerequisite), Marvisak#1515 (dialog commands before init), Marvisak#1424 (empty
submissions skip the lock), Marvisak#1144 (shader differential skips are reported),
Marvisak#1129 (64 MB pipeline-worker stacks), Marvisak#1564/Marvisak#1565/Marvisak#1566 (MakeResident,
Evict and SetStablePowerState succeed as the console's do), Marvisak#1250 (a zero
element count reads to the end of the buffer), Marvisak#1628 (texture-creation
failure logs its states).

Re-applied after the upstream merge dropped them: f32_to_half NaN and
ties-to-even (Marvisak#843), unique-temp library writes (Marvisak#1660),
VICTORY_PIPELINE_WORKERS (Marvisak#1728), VICTORY_MODE (Marvisak#1701).

Removed: the orphaned depth-bounds test file, whose implementation
(9a6d9e6) the merge dropped and which no module compiled.

Refused: Marvisak#1099 (writing 0 for an unpaired p1 interpolation computes wrong
values; two reviewers upstream and one here reached the same conclusion).
Duplicates: Marvisak#1217, Marvisak#529, Marvisak#531, Marvisak#590, Marvisak#1102, Marvisak#398, Marvisak#1150, Marvisak#1220.

Gate at efda2c5: fmt 0 differing, both Clippy gates 0 errors, policy 219
files, workspace 674 passed / 0 failed with the 10 documented pre-existing
GPU skips.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants