D3D12.X: null and default view descriptions the PC accepts #3731

Open
Kalmarv wants to merge 1 commit from upstream-pr/3731 into main
Kalmarv commented 2026-12-02 20:51:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T20:51:52Z.


Consolidates #3319 and #3280 into one change on crates/xcl/src/hle/d3d12x/real.rs so PC D3D12 accepts console null-resource view descriptions (pResource == NULL) and default/DXGI_FORMAT_UNKNOWN view descriptions on typeless depth buffers.

  • Drops #3280's MSAA default_dsv branch, which duplicates earlier open #1087.
  • Does not touch dev_create_uav_checked_x's null_uav_desc fallback dimensions or uav_companion_srv (covered by open #2511); dev_create_uav_x's null-resource format/PlaneSlice sanitization is complementary.
  • Addresses all review findings from #3319 and #3280:
    • Treats CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) failures (unmapped console formats) as unsupported (None) instead of passing them through.
    • Maps all 22 *_TYPELESS color, BC, and depth formats to concrete same-family view formats on null SRVs/UAVs/RTVs, and rejects depth formats (D32_FLOAT_S8X24_UINT, D32_FLOAT, D24_UNORM_S8_UINT, D16_UNORM) on null RTVs.
    • Sets PlaneSlice = 1 only for 2D/2DArray stencil SRVs (X32_TYPELESS_G8X24_UINT, X24_TYPELESS_G8_UINT) and clears PlaneSlice = 0 on all other null image SRVs, all null image UAVs, and all null RTVs.
    • Preserves D16_UNORM in pc_dsv on R24G8_TYPELESS resources instead of rewriting it to D24_UNORM_S8_UINT while PSOs keep DSVFormat = D16_UNORM.
    • Adds 1D/1DArray support to pc_srv's default-view (None) branch to match default_dsv.
    • Makes the child-isolated WARP D3D12 debug-layer test call skip_test and forward SKIPPED lines when the debug layer or WARP is unavailable.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs:
    • typeless_depth_format, pc_dsv, and default_dsv: resolve DXGI_FORMAT_UNKNOWN on typeless depth DSVs, sanitize null-resource DSV formats, support 1D/1DArray default DSVs, and reuse GetDesc() once in dev_create_dsv_x.
    • is_typeless_format, concrete_view_format, pc_format_support1, sanitize_null_image_srv, sanitize_null_image_uav, and sanitize_null_rtv: cached per-adapter format support check and null-resource view sanitization wired into dev_create_srv_inner, dev_create_uav_x, and dev_create_rtv.
    • pc_srv: 1D and 1DArray default SRV construction for typeless depth textures.
    • null_and_default_view_tests: unit tests for 1D/typeless DSV and SRV construction plus a child-isolated WARP D3D12 debug-layer test verifying null SRV/UAV/RTV/DSV and default 1D/2D view creation with zero debug-layer errors.

Regression run

main (5ad98adbc360225ac8a57ad9661e16fe8df9d8dd):

xcl-smoke v1
commit: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1555 (PresentX 1555)
presents per 2 s (last 3): 80 169 71
device removals: 0
crashes: 0
peak commit: 16102 MB

PR (cb4b133553997f9061796a2cf5c6537e0521d424):

xcl-smoke v1
commit: cb4b133553997f9061796a2cf5c6537e0521d424
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1663 (PresentX 1663)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16837 MB

Tested

Hardware: AMD Ryzen 9 9950X, Windows 11 10.0.26200.0, NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), rustc 1.99.0, DXC 1.9.2609.5.

  • cargo build --release -p xcl: ok (39 warnings, unchanged from 39 on main 5ad98adbc).
  • cargo test -p xcl --lib -- null_and_default_view_tests --nocapture: 2 passed, 0 failed, 0 ignored, 0 SKIPPED (D3D12 debug layer ran on WARP with 0 errors).
  • .\scripts\test.ps1: 3007 passed, 0 failed, 52 ignored, 24 SKIPPED (22 no wave64 on RTX 5070 Ti, 2 no heap windows).

Not tested

  • AMD/Intel/wave64 GPUs and XCL_HEAP_WINDOWS=1.
  • Retail title paths exercising 1D depth buffers or MSAA default DSVs (the 1D/null-view paths are covered by unit tests and the WARP D3D12 debug-layer test).

AI use

Antigravity (Gemini 4 Neon) consolidated #3319 and #3280, fixed the review findings, wrote the unit and WARP debug-layer tests, ran the test suite and paired smoke runs, and drafted this PR description.

<!-- greyfinch-sync:ivall/xcl:issue:5614498821 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3731). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T20:51:52Z. --- Consolidates #3319 and #3280 into one change on `crates/xcl/src/hle/d3d12x/real.rs` so PC D3D12 accepts console null-resource view descriptions (`pResource == NULL`) and default/`DXGI_FORMAT_UNKNOWN` view descriptions on typeless depth buffers. - Drops #3280's MSAA `default_dsv` branch, which duplicates earlier open #1087. - Does not touch `dev_create_uav_checked_x`'s `null_uav_desc` fallback dimensions or `uav_companion_srv` (covered by open #2511); `dev_create_uav_x`'s null-resource format/`PlaneSlice` sanitization is complementary. - Addresses all review findings from #3319 and #3280: - Treats `CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)` failures (unmapped console formats) as unsupported (`None`) instead of passing them through. - Maps all 22 `*_TYPELESS` color, BC, and depth formats to concrete same-family view formats on null SRVs/UAVs/RTVs, and rejects depth formats (`D32_FLOAT_S8X24_UINT`, `D32_FLOAT`, `D24_UNORM_S8_UINT`, `D16_UNORM`) on null RTVs. - Sets `PlaneSlice = 1` only for 2D/2DArray stencil SRVs (`X32_TYPELESS_G8X24_UINT`, `X24_TYPELESS_G8_UINT`) and clears `PlaneSlice = 0` on all other null image SRVs, all null image UAVs, and all null RTVs. - Preserves `D16_UNORM` in `pc_dsv` on `R24G8_TYPELESS` resources instead of rewriting it to `D24_UNORM_S8_UINT` while PSOs keep `DSVFormat = D16_UNORM`. - Adds 1D/1DArray support to `pc_srv`'s default-view (`None`) branch to match `default_dsv`. - Makes the child-isolated WARP D3D12 debug-layer test call `skip_test` and forward `SKIPPED ` lines when the debug layer or WARP is unavailable. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: - `typeless_depth_format`, `pc_dsv`, and `default_dsv`: resolve `DXGI_FORMAT_UNKNOWN` on typeless depth DSVs, sanitize null-resource DSV formats, support 1D/1DArray default DSVs, and reuse `GetDesc()` once in `dev_create_dsv_x`. - `is_typeless_format`, `concrete_view_format`, `pc_format_support1`, `sanitize_null_image_srv`, `sanitize_null_image_uav`, and `sanitize_null_rtv`: cached per-adapter format support check and null-resource view sanitization wired into `dev_create_srv_inner`, `dev_create_uav_x`, and `dev_create_rtv`. - `pc_srv`: 1D and 1DArray default SRV construction for typeless depth textures. - `null_and_default_view_tests`: unit tests for 1D/typeless DSV and SRV construction plus a child-isolated WARP D3D12 debug-layer test verifying null SRV/UAV/RTV/DSV and default 1D/2D view creation with zero debug-layer errors. **Regression run** `main` (`5ad98adbc360225ac8a57ad9661e16fe8df9d8dd`): ``` xcl-smoke v1 commit: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1555 (PresentX 1555) presents per 2 s (last 3): 80 169 71 device removals: 0 crashes: 0 peak commit: 16102 MB ``` PR (`cb4b133553997f9061796a2cf5c6537e0521d424`): ``` xcl-smoke v1 commit: cb4b133553997f9061796a2cf5c6537e0521d424 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1663 (PresentX 1663) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16837 MB ``` **Tested** Hardware: AMD Ryzen 9 9950X, Windows 11 10.0.26200.0, NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), `rustc 1.99.0`, DXC 1.9.2609.5. - `cargo build --release -p xcl`: ok (39 warnings, unchanged from 39 on `main` `5ad98adbc`). - `cargo test -p xcl --lib -- null_and_default_view_tests --nocapture`: 2 passed, 0 failed, 0 ignored, 0 SKIPPED (D3D12 debug layer ran on WARP with 0 errors). - `.\scripts\test.ps1`: 3007 passed, 0 failed, 52 ignored, 24 SKIPPED (22 no wave64 on RTX 5070 Ti, 2 no heap windows). **Not tested** - AMD/Intel/wave64 GPUs and `XCL_HEAP_WINDOWS=1`. - Retail title paths exercising 1D depth buffers or MSAA default DSVs (the 1D/null-view paths are covered by unit tests and the WARP D3D12 debug-layer test). **AI use** Antigravity (Gemini 4 Neon) consolidated #3319 and #3280, fixed the review findings, wrote the unit and WARP debug-layer tests, ran the test suite and paired smoke runs, and drafted this PR description.
jsalzy commented 2026-12-03 01:39:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-03T01:39:20Z.


merge-check claim
head: cb4b133553

<!-- greyfinch-sync:ivall/xcl:comment:7364586012 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3731#issuecomment-7364586012). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-12-03T01:39:20Z. --- merge-check claim head: cb4b133553997f9061796a2cf5c6537e0521d424
jsalzy commented 2026-12-03 01:47:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-03T01:47:18Z.


merge-check
base: 078358a058
head: cb4b133553
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3008 passed, 0 failed, 52 ignored (44 test binaries); SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. Both tests the PR adds ran and passed; null_and_default_views_pass_d3d12_debug_layer_on_warp ran its child with the D3D12 debug layer (not skipped). git diff --check clean; 39 compiler warnings, the same as main.
title run: not run
review: (1) On by default for every title: null-resource SRV/UAV/RTV formats now go through a format-support check, with fallbacks to R32_FLOAT (SRV/UAV) and R8G8B8A8_UNORM (RTV). A null-resource DSV without a depth format becomes D32_FLOAT. UNKNOWN DSVs on typeless depth buffers get the typed depth format, and 1D depth buffers get 1D default views. No AMD run here (the PR is gpu:both). (2) A multisampled typeless depth buffer's default DSV is still TEXTURE2D, by design (the PR leaves it to #1087). Open #1087 and open #3618 both make default_dsv pick the MS dimensions, and each conflicts with this PR in real.rs (git merge-tree), so whichever lands second has to adapt. Checked and fine: pc_format_support1 asks the device once per adapter and format and caches the answer, a failed query included, which counts as unsupported. The call goes through XCL's CheckFeatureSupport hook, which passes PC formats through unchanged. concrete_view_format maps all 22 *_TYPELESS formats to a readable format of the same family (depth families to R32_FLOAT, R24_UNORM_X8_TYPELESS, R32_FLOAT_X8X24_TYPELESS or R16_UNORM). The stencil formats (X32_TYPELESS_G8X24_UINT, X24_TYPELESS_G8_UINT) get PlaneSlice 1 only on 2D and 2D-array SRVs; all other null image SRVs, and all null UAVs and RTVs, get PlaneSlice 0. Null RTVs refuse depth formats. Only null-resource views take the new sanitizers; views of real resources keep main's format mapping (pc_view_format / pc_shader_view_format). The debug-layer test reports 0 validation errors and no device removal on WARP for these views. Duplicates: I searched open and merged PRs for null-resource view, null SRV, default_dsv, typeless depth view, null RTV, PlaneSlice and DXGI_FORMAT_UNKNOWN DSV, and checked #1607's groups (none lists 3731, 1087, 2511 or 3618). No open PR makes the same change: it consolidates the author's closed #3319 and #3280. #1087 and #3618 change default_dsv for MSAA as in (2). #2511 changes the null-UAV fallback in dev_create_uav_checked_x and the UAV companion SRV, and merges with this PR without a text conflict.
performance: none worth measuring (reasoned): one CheckFeatureSupport call per adapter and format, cached, and only for null-resource views.
verdict: safe to merge: no blocking finding, and the suite passes, the debug-layer WARP test included. It conflicts with open #1087 and #3618 in default_dsv (review (2)).
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.

<!-- greyfinch-sync:ivall/xcl:comment:7364734998 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3731#issuecomment-7364734998). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-12-03T01:47:18Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: cb4b133553997f9061796a2cf5c6537e0521d424 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3008 passed, 0 failed, 52 ignored (44 test binaries); SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. Both tests the PR adds ran and passed; null_and_default_views_pass_d3d12_debug_layer_on_warp ran its child with the D3D12 debug layer (not skipped). git diff --check clean; 39 compiler warnings, the same as main. title run: not run review: (1) On by default for every title: null-resource SRV/UAV/RTV formats now go through a format-support check, with fallbacks to R32_FLOAT (SRV/UAV) and R8G8B8A8_UNORM (RTV). A null-resource DSV without a depth format becomes D32_FLOAT. UNKNOWN DSVs on typeless depth buffers get the typed depth format, and 1D depth buffers get 1D default views. No AMD run here (the PR is gpu:both). (2) A multisampled typeless depth buffer's default DSV is still TEXTURE2D, by design (the PR leaves it to #1087). Open #1087 and open #3618 both make default_dsv pick the MS dimensions, and each conflicts with this PR in real.rs (git merge-tree), so whichever lands second has to adapt. Checked and fine: pc_format_support1 asks the device once per adapter and format and caches the answer, a failed query included, which counts as unsupported. The call goes through XCL's CheckFeatureSupport hook, which passes PC formats through unchanged. concrete_view_format maps all 22 *_TYPELESS formats to a readable format of the same family (depth families to R32_FLOAT, R24_UNORM_X8_TYPELESS, R32_FLOAT_X8X24_TYPELESS or R16_UNORM). The stencil formats (X32_TYPELESS_G8X24_UINT, X24_TYPELESS_G8_UINT) get PlaneSlice 1 only on 2D and 2D-array SRVs; all other null image SRVs, and all null UAVs and RTVs, get PlaneSlice 0. Null RTVs refuse depth formats. Only null-resource views take the new sanitizers; views of real resources keep main's format mapping (pc_view_format / pc_shader_view_format). The debug-layer test reports 0 validation errors and no device removal on WARP for these views. Duplicates: I searched open and merged PRs for null-resource view, null SRV, default_dsv, typeless depth view, null RTV, PlaneSlice and DXGI_FORMAT_UNKNOWN DSV, and checked #1607's groups (none lists 3731, 1087, 2511 or 3618). No open PR makes the same change: it consolidates the author's closed #3319 and #3280. #1087 and #3618 change default_dsv for MSAA as in (2). #2511 changes the null-UAV fallback in dev_create_uav_checked_x and the UAV companion SRV, and merges with this PR without a text conflict. performance: none worth measuring (reasoned): one CheckFeatureSupport call per adapter and format, cached, and only for null-resource views. verdict: safe to merge: no blocking finding, and the suite passes, the debug-layer WARP test included. It conflicts with open #1087 and #3618 in default_dsv (review (2)). hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.
vasanex commented 2026-12-03 02:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-03T02:06:38Z.

Review: COMMENTED


Review of cb4b1335 (code reading and the tests named below, not a merge-check) · no findings

In short: views of a real resource with a valid description take the same code as on main; the only change there is a DSV with format UNKNOWN on a typeless depth buffer, which now gets the typed depth format. Null-resource image SRVs, UAVs and RTVs go through the new sanitizers, null DSVs get a depth format, and 1D typeless depth buffers get 1D default views. The typeless and depth format tables are right, the support cache is a leaf lock that is not held across CheckFeatureSupport, and the rewritten descriptions outlive the forwarded call.

Result: no blockers found. From the code, nothing stands in the way of a merge. This is a review, not a merge-check: the suite and a title run are not covered here.

Measured (RTX 3080, merge of this head onto main 078358a0, debug; the debug-layer test ran its child on WARP, not skipped)

  • cargo test -p xcl --lib -- null_and_default_view_tests: 2 passed, 0 failed.
  • The debug-layer test covers each sanitizer: with sanitize_null_image_srv, sanitize_null_image_uav or sanitize_null_rtv put back to what main does (one at a time), it fails at the first case of that kind ("null SRV fmt=118", "null UAV fmt=29", "null RTV fmt=0").
  • The stencil cases do reach the PlaneSlice = 1 branch on WARP: with a temporary print in sanitize_null_image_srv, formats 47 on Texture2D and 22 on Texture2DArray are kept with plane 1 and the debug layer accepts them; on TextureCube and Texture2DMS they fall back to R32_FLOAT.

Notes, none blocking

  1. The test's child sets XCL_COHERENT_MB=64 but not XCL_UMA_MB; the two other child tests in this file set both to 64. Here unified memory comes up with its default size, and the child then asserts uma::get().is_some(): on a machine short of address space or commit that is a failure, not a skip.
  2. The debug-layer test asserts "no error", not which format a case ends up with, so a sanitizer that always fell back to R32_FLOAT would pass it too. The measurement above shows that is not what happens today; an assertion on two or three of the resulting formats (the stencil plane, one typeless mapping) would keep it that way.

Not checked: the whole suite and a title run on this head (see the merge check), AMD and Intel (the support bits differ per driver; only WARP and the RTX 3080's build were run here), whether a title on this machine creates null views of the kinds changed.

Review by Claude Code (Claude Fable 5.2), with an independent second read by a subagent (Claude Fable 5.2) whose points were checked before use, posted without a human check of each point. An automated PR review workflow is running at the request of the user.

<!-- greyfinch-sync:ivall/xcl:review:6162474914 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3731#pullrequestreview-6162474914). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-03T02:06:38Z. **Review:** COMMENTED --- **Review** of `cb4b1335` (code reading and the tests named below, not a merge-check) · no findings **In short:** views of a real resource with a valid description take the same code as on `main`; the only change there is a DSV with format UNKNOWN on a typeless depth buffer, which now gets the typed depth format. Null-resource image SRVs, UAVs and RTVs go through the new sanitizers, null DSVs get a depth format, and 1D typeless depth buffers get 1D default views. The typeless and depth format tables are right, the support cache is a leaf lock that is not held across `CheckFeatureSupport`, and the rewritten descriptions outlive the forwarded call. **Result:** no blockers found. From the code, nothing stands in the way of a merge. This is a review, not a merge-check: the suite and a title run are not covered here. **Measured** (RTX 3080, merge of this head onto `main` `078358a0`, debug; the debug-layer test ran its child on WARP, not skipped) - `cargo test -p xcl --lib -- null_and_default_view_tests`: 2 passed, 0 failed. - The debug-layer test covers each sanitizer: with `sanitize_null_image_srv`, `sanitize_null_image_uav` or `sanitize_null_rtv` put back to what `main` does (one at a time), it fails at the first case of that kind ("null SRV fmt=118", "null UAV fmt=29", "null RTV fmt=0"). - The stencil cases do reach the `PlaneSlice = 1` branch on WARP: with a temporary print in `sanitize_null_image_srv`, formats 47 on Texture2D and 22 on Texture2DArray are kept with plane 1 and the debug layer accepts them; on TextureCube and Texture2DMS they fall back to R32_FLOAT. **Notes, none blocking** 1. The test's child sets `XCL_COHERENT_MB=64` but not `XCL_UMA_MB`; the two other child tests in this file set both to 64. Here unified memory comes up with its default size, and the child then asserts `uma::get().is_some()`: on a machine short of address space or commit that is a failure, not a skip. 2. The debug-layer test asserts "no error", not which format a case ends up with, so a sanitizer that always fell back to R32_FLOAT would pass it too. The measurement above shows that is not what happens today; an assertion on two or three of the resulting formats (the stencil plane, one typeless mapping) would keep it that way. **Not checked:** the whole suite and a title run on this head (see the merge check), AMD and Intel (the support bits differ per driver; only WARP and the RTX 3080's build were run here), whether a title on this machine creates null views of the kinds changed. Review by Claude Code (Claude Fable 5.2), with an independent second read by a subagent (Claude Fable 5.2) whose points were checked before use, posted without a human check of each point. An automated PR review workflow is running at the request of the user.
Foniass commented 2026-12-03 05:39:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T05:39:41Z.


merge-check
base: 078358a058
head: cb4b133553
merge: clean
build: ok
tests: 3008 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 3 medium (below)
performance: 60 s smoke run: 1669 → 1670 frames (100 % of main), peak commit 17577 → 17659 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 242 s there, 0 device removals, 0 crashes, 3 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Turns null-resource SRV, image UAV, RTV and DSV descriptions into formats and PlaneSlices the PC accepts, resolves DXGI_FORMAT_UNKNOWN on typeless depth DSVs, and adds 1D/1DArray default DSV and SRV views. Reading the code found no bug, and only null views and calls that were invalid on main behave differently. Nothing blocks it; it is over the size target and conflicts with the open #1087.

Medium

  1. Over the size target with no reason given. 636 changed lines in real.rs (about 250 runtime, 380 test), combining two earlier PRs (#3319 null views, #3280 default and UNKNOWN depth views). That is under 800, but the description should say why this is one PR, or split it.
  2. Conflicts with open #1087. A trial merge (git merge-tree) of this head with #1087 conflicts in real.rs, because both rewrite default_dsv. The description leaves out #1087's MSAA default-DSV case on purpose, so one of the two has to be rebased on the other.
  3. Second format-support cache duplicates pc_typed_uav_supported. pc_format_support1 (real.rs ~3260) copies device_x::pc_typed_uav_supported (device_x.rs ~974) with its own cache, and gives the opposite answer when CheckFeatureSupport fails. Use one cached Support1 lookup for both, or comment why they differ. Every null image SRV, UAV and RTV now takes a mutex and calls GetAdapterLuid; that is cheap but not measured on a descriptor-heavy frame.
Checked and fine
  • Earlier finding fixed: the debug-layer test now calls skip_test when D3D12GetDebugInterface, WARP or ID3D12InfoQueue is missing, and the parent passes on the child's SKIPPED lines (skip_test writes to stderr)
  • Earlier finding fixed: null stencil SRVs on Cube or MSAA dimensions, which have no PlaneSlice field, fall back to R32_FLOAT; PlaneSlice 1 is set only on Texture2D/2DArray
  • Earlier finding fixed: #3280's rewrite of D16 views on R24G8 resources to D24S8 is gone, so the DSV keeps matching PSOs that declare D16; the behaviour is the same as main
  • Earlier finding fixed: AI use names the tool and model
  • pc_dsv behaves as main for non-null resources (only UNKNOWN on a typeless depth buffer is resolved), and the null DSV fallback maps every non-depth format to a depth one
  • The null image UAV path reuses pc_target_format, pc_uav_linear_format and the typed-UAV support bit, and null buffer views are left alone
  • Merges cleanly into main and with #2511 and #3730
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7368976852 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3731#issuecomment-7368976852). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T05:39:41Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: cb4b133553997f9061796a2cf5c6537e0521d424 merge: clean build: ok tests: 3008 passed, 0 failed, 52 ignored; 28 skipped, the same as on main review: 3 medium (below) performance: 60 s smoke run: 1669 → 1670 frames (100 % of main), peak commit 17577 → 17659 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 242 s there, 0 device removals, 0 crashes, 3 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: safe to merge: no blocking finding (the points below are medium or nits), the suite passes and the smoke run is clean hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Turns null-resource SRV, image UAV, RTV and DSV descriptions into formats and PlaneSlices the PC accepts, resolves DXGI_FORMAT_UNKNOWN on typeless depth DSVs, and adds 1D/1DArray default DSV and SRV views. Reading the code found no bug, and only null views and calls that were invalid on main behave differently. Nothing blocks it; it is over the size target and conflicts with the open #1087. #### Medium 1. **Over the size target with no reason given.** 636 changed lines in real.rs (about 250 runtime, 380 test), combining two earlier PRs (#3319 null views, #3280 default and UNKNOWN depth views). That is under 800, but the description should say why this is one PR, or split it. 2. **Conflicts with open #1087.** A trial merge (git merge-tree) of this head with #1087 conflicts in real.rs, because both rewrite default_dsv. The description leaves out #1087's MSAA default-DSV case on purpose, so one of the two has to be rebased on the other. 3. **Second format-support cache duplicates pc_typed_uav_supported.** pc_format_support1 (real.rs ~3260) copies device_x::pc_typed_uav_supported (device_x.rs ~974) with its own cache, and gives the opposite answer when CheckFeatureSupport fails. Use one cached Support1 lookup for both, or comment why they differ. Every null image SRV, UAV and RTV now takes a mutex and calls GetAdapterLuid; that is cheap but not measured on a descriptor-heavy frame. <details><summary>Checked and fine</summary> - Earlier finding fixed: the debug-layer test now calls skip_test when D3D12GetDebugInterface, WARP or ID3D12InfoQueue is missing, and the parent passes on the child's SKIPPED lines (skip_test writes to stderr) - Earlier finding fixed: null stencil SRVs on Cube or MSAA dimensions, which have no PlaneSlice field, fall back to R32_FLOAT; PlaneSlice 1 is set only on Texture2D/2DArray - Earlier finding fixed: #3280's rewrite of D16 views on R24G8 resources to D24S8 is gone, so the DSV keeps matching PSOs that declare D16; the behaviour is the same as main - Earlier finding fixed: AI use names the tool and model - pc_dsv behaves as main for non-null resources (only UNKNOWN on a typeless depth buffer is resolved), and the null DSV fallback maps every non-depth format to a depth one - The null image UAV path reuses pc_target_format, pc_uav_linear_format and the typed-UAV support bit, and null buffer views are left alone - Merges cleanly into main and with #2511 and #3730 </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
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/3731:upstream-pr/3731'
git switch 'upstream-pr/3731'

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/3731'
git switch 'upstream-pr/3731'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3731'
git switch 'upstream-pr/3731'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3731'
git switch 'main'
git merge --squash 'upstream-pr/3731'
git switch 'main'
git merge --ff-only 'upstream-pr/3731'
git switch 'main'
git merge 'upstream-pr/3731'
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
xcl-dev/xcl!3731
No description provided.