Skip to content

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

Merged
raylitebull merged 1 commit into
xcl-dev:mainfrom
AlpPesen:fix/stream-pipeline-depth-default
Nov 25, 2026
Merged

raylitebull merged 1 commit into
xcl-dev:mainfrom
AlpPesen:fix/stream-pipeline-depth-default

Conversation

@AlpPesen

@AlpPesen AlpPesen commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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 D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #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.

…at is UNKNOWN

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 xcl-dev#1488 (XCL-BT-034).

Assisted-by: Antigravity (Gemini 4 Neon)
anoyarou added a commit to anoyarou/xcl that referenced this pull request Nov 24, 2026
…at is UNKNOWN (xcl-dev#1772)

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

Addresses tracking issue xcl-dev#1488 (finding XCL-BT-034). Resolves stream
pipeline creation failures (hr=0x80004005) when creating graphics pipelines with
no bound depth-stencil view. (by AlpPesen)

Assisted-by: Antigravity
@frenziedcoder

Copy link
Copy Markdown

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.

@DavidM1911

Copy link
Copy Markdown
Contributor

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!

@raylitebull
raylitebull merged commit 8c4a46a into xcl-dev:main Nov 25, 2026
3 of 4 checks passed
anoyarou added a commit to anoyarou/xcl that referenced this pull request Nov 25, 2026
, xcl-dev#1910)

Brings main to full parity with upstream/main (6567c5f):
- xcl-dev#1937: declare triangle topology for translated mesh PSOs
- xcl-dev#1772: default DepthEnable to false in stream_pipeline when DSVFormat is UNKNOWN
- xcl-dev#1910: take native compute mask branches across the whole wave

Assisted-by: Antigravity (Gemini 4)
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