GPU: pass the depth bounds test through to host pipelines and command lists #82

Open
github-bot wants to merge 1 commit from github-bot/gh-82 into main AGit
Owner

@⁠Kaivyyy on GitHub · 2026-11-24 21:20 UTC · original
Kaivyyy:gpu/depth-bounds-test → main · +486 −62 · 4 files · 1 commits · open

Summary

  • Keep DepthBoundsTestEnable when reading pipeline-state stream subobject 21 (D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1) instead of dropping it with a warning, and distinguish depth-bounds pipelines in GraphicsState::describe so pipeline-library keys never collide with non-depth-bounds pipelines.
  • Probe D3D12_FEATURE_D3D12_OPTIONS2 (DepthBoundsTestSupported) once on Host; when supported, build and load both graphics (VS/PS and VS/GS/PS) and mesh (MS/PS) pipelines that enable depth bounds via ID3D12Device2::CreatePipelineState / ID3D12PipelineLibrary1::LoadPipeline with DEPTH_STENCIL1, falling back cleanly when the host adapter lacks support.
  • Forward command-list depth bounds (0x220 / 0x230 on newer lists) to ID3D12GraphicsCommandList1::OMSetDepthBounds via draw::State, replaying them when a title command list is cut across host command lists.

Addresses the missing depth bounds test noted in #26 and README.md.

Testing

  • Added pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws, verifying subobject 21 parsing, ID3D12PipelineLibrary1::LoadPipeline cache reuse, draw::State replay across a host-list cut, and GPU fragment culling/passing against a depth buffer via OMSetDepthBounds.
  • cargo test -p victory-gpu --locked -- pipeline::host::tests
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo xtask policy
**@⁠Kaivyyy** on GitHub · 2026-11-24 21:20 UTC · [original](https://github.com/fxceless/victory-fork/pull/82) `Kaivyyy:gpu/depth-bounds-test` → `main` · +486 −62 · 4 files · 1 commits · open ## Summary - Keep `DepthBoundsTestEnable` when reading pipeline-state stream subobject 21 (`D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1`) instead of dropping it with a warning, and distinguish depth-bounds pipelines in `GraphicsState::describe` so pipeline-library keys never collide with non-depth-bounds pipelines. - Probe `D3D12_FEATURE_D3D12_OPTIONS2` (`DepthBoundsTestSupported`) once on `Host`; when supported, build and load both graphics (VS/PS and VS/GS/PS) and mesh (MS/PS) pipelines that enable depth bounds via `ID3D12Device2::CreatePipelineState` / `ID3D12PipelineLibrary1::LoadPipeline` with `DEPTH_STENCIL1`, falling back cleanly when the host adapter lacks support. - Forward command-list depth bounds (`0x220` / `0x230` on newer lists) to `ID3D12GraphicsCommandList1::OMSetDepthBounds` via `draw::State`, replaying them when a title command list is cut across host command lists. Addresses the missing depth bounds test noted in #26 and `README.md`. ## Testing - Added `pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws`, verifying subobject 21 parsing, `ID3D12PipelineLibrary1::LoadPipeline` cache reuse, `draw::State` replay across a host-list cut, and GPU fragment culling/passing against a depth buffer via `OMSetDepthBounds`. - `cargo test -p victory-gpu --locked -- pipeline::host::tests` - `cargo clippy --workspace --all-targets --locked -- -D warnings` - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` - `cargo xtask policy`
Keep DepthBoundsTestEnable from pipeline-stream subobject 21 (DEPTH_STENCIL1), check D3D12_FEATURE_D3D12_OPTIONS2 on the host device, build depth-bounds graphics and mesh PSOs as pipeline-state streams with DEPTH_STENCIL1 (cached in ID3D12PipelineLibrary1 under a distinct state key), and forward command-list depth bounds to ID3D12GraphicsCommandList1::OMSetDepthBounds across list cuts.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:51 +00:00
Author
Owner

@⁠adriaespii on GitHub · 2026-11-24 21:30 UTC · original

Independent test run on commit 461df56 (AMD RDNA4):

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings
  • cargo test --workspace (default parallel threads): victory-gpu --lib crashed with STATUS_ACCESS_VIOLATION (0xC0000005, exit code -1073741819).
  • cargo test -p victory-gpu --lib -- --test-threads=1: 111 passed, 0 failed, 1 ignored — passes cleanly when serialized, suggesting a parallel test race (shared global state / concurrent test interaction).
  • Not tested: live game run (no game files on this machine)

AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.

**@⁠adriaespii** on GitHub · 2026-11-24 21:30 UTC · [original](https://github.com/fxceless/victory-fork/pull/82#issuecomment-7145027205) Independent test run on commit `461df56` (AMD RDNA4): - **Hardware:** AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (`x86_64-pc-windows-msvc`) - `cargo clippy --workspace --all-targets -- -D warnings`: 0 warnings - `cargo test --workspace` (default parallel threads): `victory-gpu --lib` crashed with `STATUS_ACCESS_VIOLATION` (`0xC0000005`, exit code `-1073741819`). - `cargo test -p victory-gpu --lib -- --test-threads=1`: **111 passed, 0 failed, 1 ignored** — passes cleanly when serialized, suggesting a parallel test race (shared global state / concurrent test interaction). - **Not tested:** live game run (no game files on this machine) *AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.*
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/pipeline/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/82/head:github-bot/gh-82'
git switch 'github-bot/gh-82'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-82'
git switch 'github-bot/gh-82'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-82'
git switch 'github-bot/gh-82'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-82'
git switch 'main'
git merge --squash 'github-bot/gh-82'
git switch 'main'
git merge --ff-only 'github-bot/gh-82'
git switch 'main'
git merge 'github-bot/gh-82'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.