D3D12.X: default DepthEnable to false in stream_pipeline when DSVFormat is UNKNOWN #1772

Manually merged
github merged 1 commit from gh-pr/1772/head into gh-pr/1772/base 2026-11-26 05:04:29 +00:00
Owner

@⁠AlpPesen on GitHub · 2026-11-24 20:31 UTC · original
AlpPesen:fix/stream-pipeline-depth-default → main · +68 −1 · 1 files · 1 commits · merged 2026-11-25 00:21 UTC

Fixes real::stream_pipeline so DepthStencilState.DepthEnable defaults to false when a D3D12_PIPELINE_STATE_STREAM_DESC omits the DEPTH_STENCIL / DEPTH_STENCIL1 / DEPTH_STENCIL2 subobject and DSVFormat is DXGI_FORMAT_UNKNOWN (0).

Previously stream_pipeline unconditionally initialized DepthEnable = true, violating D3D12 pipeline state stream defaults for graphics streams that neither bind a depth-stencil view nor supply a depth-stencil subobject.

Part of #1488 (XCL-BT-034).

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs:
    • Track whether any depth-stencil subobject (11, 21, 26) was present in stream_pipeline.
    • After parsing subobjects, set g.DepthStencilState.DepthEnable = false.into() when !has_depth_stencil && g.DSVFormat.0 == 0 (DXGI_FORMAT_UNKNOWN). Streams with a non-UNKNOWN DSVFormat continue to default DepthEnable = true, and explicit depth-stencil subobjects are always preserved.
    • Add unit test stream_pipeline_defaults_depth_enable_from_dsv_format covering omitted/UNKNOWN DSVFormat, non-UNKNOWN DSVFormat, and explicit DEPTH_STENCIL subobjects.

Regression run

Baseline (immediate parent main b9b6ea6, warm shader/PSO cache):

xcl-smoke v1
commit: b9b6ea62080cc62fc19e212033372d01c6214e5c
gpu: AMD Radeon RX 6800
title: YouKnowWho
seconds: 60
exit: 0x0
frames shown: 1380 (PresentX 1380)
presents per 2 s (last 3): 59 60 15
device removals: 0
crashes: 0
peak commit: 14478 MB

This PR (fix/stream-pipeline-depth-default, warm shader/PSO cache):

xcl-smoke v1
commit: fa567957075adedf382f0d2d9ef9d967ea3b914e
gpu: AMD Radeon RX 6800
title: YouKnowWho
seconds: 60
exit: 0x0
frames shown: 1414 (PresentX 1414)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 11397 MB

Tested

Hardware: Windows 11 Pro for Workstations (Build 26300), Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (16337 MiB VRAM, Driver 32.0.21045.29003), rustc 1.100.0 (0ef1bc386 2026-11-09).

  • cargo test -p xcl --lib stream_pipeline_defaults_depth_enable_from_dsv_format: 1 passed; 0 failed; 0 ignored; 0 skipped.
  • XCL_REQUIRE_GPU=wave64,mesh cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 885 passed; 5 failed; 42 ignored; 0 skipped (3 pre-existing RDNA2 placed_title_textures_share_vram_and_preserve_pixels + VRAM_TEST_LOCK cascades tracked in #470, plus 2 unrelated skip-gated tests that fail when XCL_REQUIRE_GPU is set: pso_measurement_compiles_an_exact_synthetic_record needing Windows Developer Mode and heap_window_out_of_memory_falls_back_to_the_switch_form needing XCL_HEAP_WINDOWS=1).
  • .\scripts\smoke.ps1 -Game '<game folder>\YouKnowWho' on b9b6ea62080cc62fc19e212033372d01c6214e5c and fa567957075adedf382f0d2d9ef9d967ea3b914e (see Regression run above).

Not tested

  • Non-AMD GPUs and Linux / Wine.

AI use

Antigravity (Gemini 4 Neon) implemented the DepthEnable default check and unit test in crates/xcl/src/hle/d3d12x/real.rs, and ran the full test suite and paired smoke runs.

**@⁠AlpPesen** on GitHub · 2026-11-24 20:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/1772) `AlpPesen:fix/stream-pipeline-depth-default` → `main` · +68 −1 · 1 files · 1 commits · merged 2026-11-25 00:21 UTC Fixes `real::stream_pipeline` so `DepthStencilState.DepthEnable` defaults to `false` when a `D3D12_PIPELINE_STATE_STREAM_DESC` omits the `DEPTH_STENCIL` / `DEPTH_STENCIL1` / `DEPTH_STENCIL2` subobject and `DSVFormat` is `DXGI_FORMAT_UNKNOWN` (`0`). Previously `stream_pipeline` unconditionally initialized `DepthEnable = true`, violating D3D12 pipeline state stream defaults for graphics streams that neither bind a depth-stencil view nor supply a depth-stencil subobject. Part of #1488 (`XCL-BT-034`). **What is in it** - **`crates/xcl/src/hle/d3d12x/real.rs`**: - Track whether any depth-stencil subobject (`11`, `21`, `26`) was present in `stream_pipeline`. - After parsing subobjects, set `g.DepthStencilState.DepthEnable = false.into()` when `!has_depth_stencil && g.DSVFormat.0 == 0` (`DXGI_FORMAT_UNKNOWN`). Streams with a non-`UNKNOWN` `DSVFormat` continue to default `DepthEnable = true`, and explicit depth-stencil subobjects are always preserved. - Add unit test `stream_pipeline_defaults_depth_enable_from_dsv_format` covering omitted/UNKNOWN `DSVFormat`, non-`UNKNOWN` `DSVFormat`, and explicit `DEPTH_STENCIL` subobjects. **Regression run** Baseline (immediate parent `main` `b9b6ea6`, warm shader/PSO cache): ``` xcl-smoke v1 commit: b9b6ea62080cc62fc19e212033372d01c6214e5c gpu: AMD Radeon RX 6800 title: YouKnowWho seconds: 60 exit: 0x0 frames shown: 1380 (PresentX 1380) presents per 2 s (last 3): 59 60 15 device removals: 0 crashes: 0 peak commit: 14478 MB ``` This PR (`fix/stream-pipeline-depth-default`, warm shader/PSO cache): ``` xcl-smoke v1 commit: fa567957075adedf382f0d2d9ef9d967ea3b914e gpu: AMD Radeon RX 6800 title: YouKnowWho seconds: 60 exit: 0x0 frames shown: 1414 (PresentX 1414) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 11397 MB ``` **Tested** Hardware: Windows 11 Pro for Workstations (Build 26300), Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (16337 MiB VRAM, Driver `32.0.21045.29003`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`. - `cargo test -p xcl --lib stream_pipeline_defaults_depth_enable_from_dsv_format`: `1 passed; 0 failed; 0 ignored; 0 skipped`. - `XCL_REQUIRE_GPU=wave64,mesh cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: `885 passed; 5 failed; 42 ignored; 0 skipped` (3 pre-existing RDNA2 `placed_title_textures_share_vram_and_preserve_pixels` + `VRAM_TEST_LOCK` cascades tracked in #470, plus 2 unrelated skip-gated tests that fail when `XCL_REQUIRE_GPU` is set: `pso_measurement_compiles_an_exact_synthetic_record` needing Windows Developer Mode and `heap_window_out_of_memory_falls_back_to_the_switch_form` needing `XCL_HEAP_WINDOWS=1`). - `.\scripts\smoke.ps1 -Game '<game folder>\YouKnowWho'` on `b9b6ea62080cc62fc19e212033372d01c6214e5c` and `fa567957075adedf382f0d2d9ef9d967ea3b914e` (see **Regression run** above). **Not tested** - Non-AMD GPUs and Linux / Wine. **AI use** Antigravity (Gemini 4 Neon) implemented the `DepthEnable` default check and unit test in `crates/xcl/src/hle/d3d12x/real.rs`, and ran the full test suite and paired smoke runs.
In 
eal::stream_pipeline, DepthStencilState.DepthEnable was unconditionally initialized to 	rue, even when a D3D12_PIPELINE_STATE_STREAM_DESC omitted DEPTH_STENCIL / DEPTH_STENCIL1 / DEPTH_STENCIL2 and had DSVFormat == DXGI_FORMAT_UNKNOWN (0).

Per D3D12 pipeline state stream rules, default DepthEnable to alse when no depth-stencil subobject is provided and DSVFormat == DXGI_FORMAT_UNKNOWN, while keeping DepthEnable = true when a non-UNKNOWN DSVFormat is present and always honoring explicit depth-stencil subobjects.

Part of #1488 (XCL-BT-034).

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:04:27 +00:00
github manually merged commit fa56795707 into gh-pr/1772/base 2026-11-26 05:04:29 +00:00
Author
Owner

@⁠frenziedcoder on GitHub · 2026-11-24 20:55 UTC · original

NVIDIA test report for fa56795: the description's runs were Linux / Wine on an RX 6800, so here is native Windows on NVIDIA. Full suite green, the PR's own test passing, and a clean smoke pair (1654 vs 1654 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head fa567957075adedf382f0d2d9ef9d967ea3b914e, no local changes.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug): 890 passed, 0 failed, 42 ignored; stream_pipeline_defaults_depth_enable_from_dsv_format passes. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (4178e88, this PR's base; the same base run as in my report on #1747):

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: NVIDIA GeForce RTX 5080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14604 MB

this PR:

xcl-smoke v1
commit: fa567957075adedf382f0d2d9ef9d967ea3b914e
gpu: NVIDIA GeForce RTX 5080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

Not tested: a title that creates stream pipelines without a depth-stencil subobject (I don't know whether this one does at its start screen); AMD on Windows; Wine on NVIDIA.

AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.

**@⁠frenziedcoder** on GitHub · 2026-11-24 20:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1772#issuecomment-7144244669) **NVIDIA test report for `fa56795`: the description's runs were Linux / Wine on an RX 6800, so here is native Windows on NVIDIA. Full suite green, the PR's own test passing, and a clean smoke pair (1654 vs 1654 frames).** **Tested** - NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head `fa567957075adedf382f0d2d9ef9d967ea3b914e`, no local changes. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug): **890 passed, 0 failed, 42 ignored**; `stream_pipeline_defaults_depth_enable_from_dsv_format` passes. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release, the retail title of #505 at its start screen; `XCL_PSO_PRELOAD=0` for both builds, because this machine's preload list holds the program of #1307) base (`4178e88`, this PR's base; the same base run as in my report on #1747): ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: NVIDIA GeForce RTX 5080 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14604 MB ``` this PR: ``` xcl-smoke v1 commit: fa567957075adedf382f0d2d9ef9d967ea3b914e gpu: NVIDIA GeForce RTX 5080 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` **Not tested:** a title that creates stream pipelines without a depth-stencil subobject (I don't know whether this one does at its start screen); AMD on Windows; Wine on NVIDIA. *AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.*
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 23:24 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 23:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1772#issuecomment-7147366626) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.