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

Open
Kaivyyy wants to merge 1 commit from upstream-pr/82 into main
Kaivyyy commented 2026-11-24 21:20:31 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Kaivyyy on 2026-11-24T21:20:31Z.


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
<!-- greyfinch-sync:fxceless/victory-fork:issue:6591648032 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/82). Originally posted by [Kaivyyy](https://github.com/Kaivyyy) on 2026-11-24T21:20:31Z. --- ## 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`
adriaespii commented 2026-11-24 22:07:32 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by adriaespii on 2026-11-24T21:30:45Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7145027205 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/82#issuecomment-7145027205). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-24T21:30:45Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/82:upstream-pr/82'
git switch 'upstream-pr/82'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/82'
git switch 'upstream-pr/82'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/82'
git switch 'upstream-pr/82'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/82'
git switch 'main'
git merge --squash 'upstream-pr/82'
git switch 'main'
git merge --ff-only 'upstream-pr/82'
git switch 'main'
git merge 'upstream-pr/82'
git push origin 'main'
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
fxceless/victory-fork!82
No description provided.