D3D12.X: default SRVs of multisampled depth buffers are Texture2DMS views #1265
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1265
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1265/head"
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?
@emirduran707 on GitHub · 2026-11-24 13:59 UTC · original
emirduran707:d3d12x-default-srv-msaa-depth→main· +59 −13 · 1 files · 1 commits · merged 2026-11-24 15:58 UTCCreateShaderResourceViewwith a NULL description on a console depth buffer built aTEXTURE2D(orTEXTURE2DARRAY) view with a full mip range, whatever the buffer's sample count. Every console depth buffer is typeless on the PC (pc_resource_desc), sopc_srvmakes the view itself. For a multisampled depth buffer that is an invalid view of an MSAA resource.resource_dim_to_viewalso returned the single-sampled dimension, so the console T# was a D2 image instead of D2Msaa. Microsoft's documentation ofCreateShaderResourceView: with a NULL description the view "inherits the resource format and dimension", and for a multisampled 2D texture that isTEXTURE2DMS.With more than one sample, the NULL-description view is now
TEXTURE2DMS, orTEXTURE2DMSARRAYover every slice, andresource_dim_to_viewgives the MSAA dimensions (6 / 7). Single-sampled resources get the same views as before. #1087 does the same for the default DSV of these buffers.What is in it
crates/xcl/src/hle/d3d12x/real.rs:pc_srvandresource_dim_to_view; testa_default_view_of_a_depth_buffer_matches_its_sample_count_and_array_size(no device). It covers R24G8_TYPELESS at 1 and 4 samples, with 1 and 3 slices.Tested
cargo test --workspace -- --test-threads=4on615cb20: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU tests4 samples, 1 slicesleft: D3D12_SRV_DIMENSION(4),right: D3D12_SRV_DIMENSION(6); with it it passesRegression run
main:
this PR:
Not tested
dev_create_uav_xwith a NULL description also usesresource_dim_to_view: for a multisampled resource it no longer builds the TEXTURE2D SRV it made before (invalid too). No test covers that path.last_levelis 0) is as before; title-made TEXTURE2DMS views already get the same T#.AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 14:03 UTC · original
Independent D3D12 debug-layer check on
615cb20and its parent930e8b4. Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.I passed XCL’s synthesized default depth SRVs to native
CreateShaderResourceViewfor bothR24G8_TYPELESSandR32_TYPELESS, at 1× and 4× samples with one or three slices. The PR produced zero D3D12 errors across all eight cases in two fresh processes. On the parent, the two single-sample R24 controls passed. The first 4× R24 view (one slice) produced two debug-layer errors, and creating the next test resource returnedDXGI_ERROR_DEVICE_REMOVED, ending that baseline run.The three focused SRV tests passed on the PR. This covers native descriptor creation with synthetic resources. Shader sampling and retail behavior were outside this run. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 14:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@DavidM1911 on GitHub · 2026-11-26 04:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin