Repository navigation
runtime: depth-stencil views of a multisample texture array's slice range (D3D-79 part 1) - #683
Conversation
…ange (D3D-79 part 1)
CreateDepthStencilView refused D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY, so the descriptor held an
empty TargetView and any clear through it failed when the list was recorded. Multisample textures
have one mip, so the view is {resource, mip 0, FirstArraySlice, ArraySize}; the replay already
checks the range against the image and clears through a view of those layers.
d3d12_vulkan_device_test: a 4-layer 4x multisampled D32 texture, a view of slices 1-2 captures
that range and its clear replays; a view of slices 3-4 is refused at execute
(invalid_subresource). D3D12 can't copy a multisampled texture to a buffer, so the cleared
values are not read back. Without the change the test fails at the captured-range check.
docs/d3d12_vulkan.md: drop the duplicated RTV/DSV bullet and list the new dimension. The 1D and
1D-array DSVs need 1D textures first (D3D-63, ItsNotRexed#561).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs it D3D-79 was split: multisample arrays are D3D-83 in ItsNotRexed#683. This PR keeps the TEXTURE1D and TEXTURE1DARRAY views, which wait for 1D textures (ItsNotRexed#561).
|
All 1,024 individual depth samples matched on On the 8×8, four-layer, 4× MSAA D32 target, the D3D12 command list cleared all four layers to 0.125. Through the two-layer DSV it cleared the full subresources to 0.5, then rectangle [2,6) × [1,5) to 0.75. After the D3D12 transition, submission and fence, a small Vulkan compute shader used a 2D multisample-array view to
Changing only The clears and resource transition use the runtime's actual D3D12 DSV, graphics command list and queue. The verifier creates its own Vulkan view solely to read the result, so this covers both full and rectangular MS-array clears independently of the pending multisample SRV work. |
|
Thanks @Vonsek, that's the part the in-tree test can't reach: D3D12 won't copy a multisampled texture to a buffer, so it only checks the captured range and the replay result. Your per-sample readback with validation on (1,024/1,024 for both AI-assisted. |
|
Tested 12f1dc5 on an NVIDIA GeForce RTX 4090 (driver 617.14, Vulkan 1.4.351), Windows 10 Home 22H2 (19045), MSVC 19.39, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, Ninja RelWithDebInfo,
Code: the case mirrors One possible follow-up, not for this PR: AI-assisted (Claude Code); repository tests only, no game files. |
…ange CreateRenderTargetView refused D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY, so after the DSV change in #683 a multisample array could be a depth target but not a colour target (found by @Derpbeat on #683). The view is {resource, mip 0, FirstArraySlice, ArraySize}, as for the DSV; the replay already checks the range and clears through a view of those layers. d3d12_vulkan_device_test: a 4-layer 4x RGBA8 target is cleared red through a whole-array view and green through a view of slices 1-2; every slice is resolved and read back, so slices 0 and 3 must stay red and 1-2 green. A view of slices 3-4 is refused at execute (invalid_subresource). Without the change the test fails at the captured-range check. docs/d3d12_vulkan.md: the RTV/DSV bullet lists TEXTURE2DMSARRAY for both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Item: D3D-79 part 1, claimed in #634 (#634 (comment)). Part 2 (1D and 1D-array DSVs) needs 1D textures first: D3D-63, #561.
Change
CreateDepthStencilViewrefusedD3D12_DSV_DIMENSION_TEXTURE2DMSARRAY: the slot got an emptyTargetView, so a clear through it failed when the list was recorded. Multisample textures have one mip, so the view is{resource, mip 0, FirstArraySlice, ArraySize}. The replay already checks the range against the image (view_range) and clears through a view of those layers, so nothing else changes.docs/d3d12_vulkan.md: the RTV/DSV bullet was listed twice (an older copy withoutTEXTURE2DMS); one bullet now, with the new dimension and the 1D note.Test
d3d12_vulkan_device_test, next to the resolve tests: a 4-layer 4x multisampledD32_FLOATtexture.ReplayResult::success).invalid_subresource).Without the change the test fails at the captured-range check (
line 1642); with it the whole test passes.Tested on Windows 11, RTX 3060 (NVIDIA 616.64), built with clang-cl 23 + lld-link against the MSVC 14.44 CRT and Windows SDK 10.0.26100 (no MSVC compiler here; the one-line clang-cl fix from #682 was applied locally to build, it isn't part of this PR).
d3d12_vulkan_device_testpasses;ctest20/21 as on main (thepe_loaderfailure is the clang/lld fixture difference noted in #682). No game files.By @rafaelpssz, with Claude Code (AI-assisted).