Repository navigation
Runtime: clear selected slices of 3D color targets (D3D-64) - #643
Conversation
A volume mip has a single tracked layout, but its color attachment may cover only part of its depth. Use the view to select W slices and keep barriers on the whole mip so clears preserve neighboring slices.
|
Tested 2cb28a4 merged onto main c432cdc on NVIDIA GeForce RTX 4060 Ti (Ada), driver 32.0.16.2124 (NVIDIA 621.24), Windows 11 Home 26300, MSVC 2022 / Ninja, Vulkan SDK 1.4.363: pass for what this PR adds; one existing check fails the same way on main. Besides ctest, I ran each test program this PR changes directly (several aren't registered with ctest):
ctest: 100% tests passed, 0 tests failed out of 27. The one failure, AI-assisted. |
|
Tested 2cb28a4 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass
No game files used. AI-assisted run (Claude Code). |
Claimed in the coordination issue as D3D-64, committed 3D color targets. Current tracker is #634.
What and why
The Vulkan device refused any 3D texture with
ALLOW_RENDER_TARGET. A typed color target can now expose the entire base mip through its default RTV, or the W slices selected by an explicitTEXTURE3DRTV. A full clear of a subset of slices uses a 2D-array attachment view. The image layout is tracked and transitioned once for the entire 3D mip. The change covers clears on committed textures. Typeless volume RTVs and depth-stencil resources are outside this change.Tested
Windows 11, NVIDIA RTX 5080 driver 616.92, Vulkan SDK 1.4.350.0, Windows D3D12 WARP as the second rendering backend.
c432cdcwith the synthetic fixture, WARP produced the expected colors. The Vulkan layer rejectedCreateCommittedResourcebefore it could create a view.d3d12_clear_test --volumematched all 648 RGBA texels against an independent expected array on each backend with Khronos validation enabled. The 8×6×12 base mip stayed red; the 4×3×6 mip exercised a two-slice full clear and a rectangular clear from slice 2 through the end. Both the RGB and alpha channels vary.vkCmdClearColorImagechanged exactly 30 of 648 texels on Vulkan, the predicted number of neighboring texels outside the rectangle. Restoring the attachment path returned the mismatch count to zero.d3d12_clear_teststill reports the same existing 2D UNORM rounding difference on both an unmodified build of the parent and this change (format 28, case 0, byte 2, Vulkan 0x7f and WARP 0x80). Runtime: clears match WARP on every format class: tie rounding, and the SNORM/SINT/R8/R16 formats (D3D-45) #521 addresses that comparison separately.Checklist
docs/d3d12_vulkan.md.AI-assisted with Codex.