Repository navigation
vulkan_replay: use cleared aspectMask for depth/stencil rect-clear attachment views - #7634
KarolKurzyna wants to merge 1 commit into
Conversation
prepare() passed p.binding.aspects (DEPTH | STENCIL) to rect_view() for ClearDepthStencilView with rectangles even when clearing a single plane. On Intel's proprietary Windows Vulkan driver (101.6129, UHD Graphics 770), back-to-back depth-only then stencil-only rectangle clears sharing that combined DEPTH | STENCIL attachment image view silently drop the stencil vkCmdClearAttachments (8 of 8 combined depth-stencil cases in d3d12_clear_formats). Pass the actually cleared `aspects` to rect_view() so single-plane rectangle clears use a matching single-aspect attachment view, and skip rect_view() when !aspects (D3D-437). Add split-plane (depth-only then stencil-only) rectangle clear regression cases for D24_UNORM_S8_UINT and D32_FLOAT_S8X24_UINT to d3d12_clear_test.cpp.
|
Independent Windows + GPU test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
Tested 69d7d53 on Windows 11 against its merge base a779d64, on a second Intel iGPU of the same generation with a newer driver: UHD 730 (Gen12 Xe-LP, driver 101.7085), plus RTX 4060 (621.14). MSVC 14.44, Vulkan SDK 1.4.363.0,
The driver bug doesn't reproduce on 101.7085: the new split-plane checks match WARP even with the unpatched AI-assisted run. |
|
Tested
AI-assisted. |
|
Tested 69d7d53 merged onto main (5fa095b) on AMD Radeon RX 9070 XT, Adrenalin 26.11.1 (LLPC / Vulkan 1.4.359), Windows 11:
|
|
Tested 69d7d53 merged onto main dfe4e4a (clean merge) on Windows 11 build 26300, MSVC 19.44, Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0,
AI-assisted (Claude Code). No game files. |
|
Tested
AI-assisted: yes (Claude ran the build and tests; results checked by me). |
|
Tested
AI-assisted (Claude Code). |
|
Tested 69d7d53 (merged onto main 867d922) on RTX 5070, NVIDIA 621.24, Windows 11, Vulkan validation layer on (
Synthetic inputs only, no game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted: yes |
|
Tested 69d7d53 (head of this PR) on RTX 5070 Ti (Blackwell, subgroup 32), NVIDIA 621.01, Windows 11, MSVC 14.44 (VS 2022 17.14 Build Tools), CMake 4.5.1 + Ninja, Vulkan headers sdk-1.4.363.0 (fetched), no game copy: pass, with a caveat. I applied the diff to a clone of main at dfe4e4a (clean git apply), built d3d12_clear_test and ran it: exit 0, including "RTV and DSV clears: 234 full/rectangle readbacks matched WARP", which now includes the new split-plane rect clears on D24_UNORM_S8_UINT and D32_FLOAT_S8X24_UINT. Negative control: with vulkan_replay.h reverted to main and the PR's test kept, the test also passes on this GPU. The PR describes an Intel UHD 770 driver bug (101.6129), so NVIDIA does not reproduce the failure; this run shows the change is harmless here and the new cases match WARP, not that the fix works. AI-assisted (Claude Code): checked by applying the diff to a private clone of main and building and running the tests above. No game data was used. |
Claimed in #7496 (comment) (originally observed on Intel UHD Graphics 770 in #166 (comment)).
Problem
In
runtime/src/vulkan_replay.h(prepare()),ClearDepthStencilwith rectangles calledrect_view(..., p.binding.aspects)instead of using the clearedaspects. For a combined depth-stencil texture (D24_UNORM_S8_UINTorD32_FLOAT_S8X24_UINT), both a depth-only rectangle clear and a stencil-only rectangle clear therefore requested the same cachedDEPTH | STENCILVkImageView.On Intel's proprietary Windows Vulkan driver (
101.6129, Intel UHD Graphics 770, Vulkan1.3.295), back-to-back depth-only then stencil-only rectangle clears sharing a combinedDEPTH | STENCILattachment view silently drop the stencil-onlyvkCmdClearAttachments— leaving the stencil plane at its pre-clear value across all 8 combined depth-stencil cases ind3d12_clear_formats(4 × D24_UNORM_S8_UINTand4 × D32_FLOAT_S8X24_UINT), with 0 Vulkan validation errors.Additionally, when
!aspects(D3D-437:STENCILon a depth-only view),p.skip = truewas set butrect_view()was still called.Fix
runtime/src/vulkan_replay.h, passaspects(notp.binding.aspects) torect_view()forClearDepthStenciland skip callingrect_view()when!aspects.runtime/test/d3d12_clear_test.cpp, add split-plane (depth-only rect followed by stencil-only rect) regression checks forDXGI_FORMAT_D24_UNORM_S8_UINTandDXGI_FORMAT_D32_FLOAT_S8X24_UINTcompared against WARP.Testing
Windows 11 x64 (
10.0.26300), MSVC19.52.37029(VS 2026), Windows SDK10.0.26100.0, Vulkan SDK1.4.363.1,LEONIDA_VK_VALIDATION=1(VK_LOADER_LAYERS_DISABLE=~implicit~), commit69d7d53:d3d12_clear_testagainst unpatchedvulkan_replay.hon Intel UHD Graphics 770): FAIL on both formats (depth-stencil split-plane rect clear format 45: stencil readback differs from WARPandformat 20: stencil readback differs from WARP).101.6129, Vulkan1.3.295,LEONIDA_VK_VALIDATION=1):ctest -R "^(d3d12_clear|vk_command_replay|replay_clear_gate|d3d12_depth_resolve|d3d12_typeless_depth|d3d12_view_slices|d3d12_depth24_draw|d3d12_predicated_copy)$": 8/8 PASS (0 validation errors).d3d12_clear_formats: depth-stencil diffs dropped from 8 → 0 (241matched WARP vs233onmain; only the 10 pre-existing 1-ULP sRGB diffs remain, 0 validation errors).621.24, Vulkan1.4.357,LEONIDA_VK_VALIDATION=1):d3d12_clear_formats: PASS (251 matched WARP, 0 differ, 0 failed, 0 validation errors).Synthetic tests only, no game data. AI-assisted.