D3D12.X: null and default view descriptions the PC accepts #3731
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3731"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.rsso PC D3D12 accepts console null-resource view descriptions (pResource == NULL) and default/DXGI_FORMAT_UNKNOWNview descriptions on typeless depth buffers.default_dsvbranch, which duplicates earlier open #1087.dev_create_uav_checked_x'snull_uav_descfallback dimensions oruav_companion_srv(covered by open #2511);dev_create_uav_x's null-resource format/PlaneSlicesanitization is complementary.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)failures (unmapped console formats) as unsupported (None) instead of passing them through.*_TYPELESScolor, 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.PlaneSlice = 1only for 2D/2DArray stencil SRVs (X32_TYPELESS_G8X24_UINT,X24_TYPELESS_G8_UINT) and clearsPlaneSlice = 0on all other null image SRVs, all null image UAVs, and all null RTVs.D16_UNORMinpc_dsvonR24G8_TYPELESSresources instead of rewriting it toD24_UNORM_S8_UINTwhile PSOs keepDSVFormat = D16_UNORM.pc_srv's default-view (None) branch to matchdefault_dsv.skip_testand forwardSKIPPEDlines when the debug layer or WARP is unavailable.What is in it
crates/xcl/src/hle/d3d12x/real.rs:typeless_depth_format,pc_dsv, anddefault_dsv: resolveDXGI_FORMAT_UNKNOWNon typeless depth DSVs, sanitize null-resource DSV formats, support 1D/1DArray default DSVs, and reuseGetDesc()once indev_create_dsv_x.is_typeless_format,concrete_view_format,pc_format_support1,sanitize_null_image_srv,sanitize_null_image_uav, andsanitize_null_rtv: cached per-adapter format support check and null-resource view sanitization wired intodev_create_srv_inner,dev_create_uav_x, anddev_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):PR (
cb4b133553997f9061796a2cf5c6537e0521d424):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 onmain5ad98adbc).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
XCL_HEAP_WINDOWS=1.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.
Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-03T01:39:20Z.
merge-check claim
head:
cb4b133553Imported from ivall/xcl. Originally posted by jsalzy on 2026-12-03T01:47:18Z.
merge-check
base:
078358a058head:
cb4b133553merge: 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.
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 findingsIn 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 acrossCheckFeatureSupport, 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
main078358a0, 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.sanitize_null_image_srv,sanitize_null_image_uavorsanitize_null_rtvput back to whatmaindoes (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").PlaneSlice = 1branch on WARP: with a temporary print insanitize_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
XCL_COHERENT_MB=64but notXCL_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 assertsuma::get().is_some(): on a machine short of address space or commit that is a failure, not a skip.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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T05:39:41Z.
merge-check
base:
078358a058head:
cb4b133553merge: 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
Checked and fine
How this was tested
078358a0, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main078358a0and on this merge; presents per 2 s at the end: 60 60 60.XCL_RUN_SECONDS=300and 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.