[PR #619] vulkan_replay: use cleared aspectMask for depth/stencil rect-clear attachment views (OLD-7634) #660

Open
opened 2026-11-26 20:18:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/619
Author: @KarolKurzyna
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/stencil-rect-clear-view-aspect


📝 Commits (1)

  • 701dac3 vulkan_replay: use cleared aspects for depth/stencil rect-clear views

📊 Changes

2 files changed (+39 additions, -6 deletions)

View changed files

📝 runtime/src/vulkan_replay.h (+8 -3)
📝 runtime/test/d3d12_clear_test.cpp (+31 -3)

📄 Description

Claimed in the coordination issue as: OLD-7634 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128154815)

Carried over from upstream ItsNotRexed/Leonida PR #7634 (69d7d53539), where it received 10/10 independent PASS hardware reviews (@MartinIndra02 RTX 3080, @jeangoes Intel UHD 730 confirming the fix on a second Gen12 Intel iGPU, @Ueslii RX 5600 XT, @eizispark RX 9070 XT, @CowBoYdu76, @Ekabusto RX 9070 XT, @trick-ye RX 7800 XT, @egexon RTX 5070, @sgonzalez-glitch RTX 2080, @BeetjeMatig RTX 5070 Ti).

What was wrong

In runtime/src/vulkan_replay.h, prepare() passed p.binding.aspects (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT) to rect_view() for ClearDepthStencilView with rectangles even when clear->flags cleared only a single plane (D3D12_CLEAR_FLAG_DEPTH or D3D12_CLEAR_FLAG_STENCIL).
On Intel's Windows Vulkan driver (101.6129 on UHD Graphics 770 and UHD Graphics 730), back-to-back depth-only then stencil-only rectangle clears sharing that combined DEPTH | STENCIL attachment VkImageView silently drop the stencil vkCmdClearAttachments (8/8 combined depth-stencil cases in d3d12_clear_formats read back stale stencil values).

What changed

  • Pass the actually cleared aspects to rect_view() in prepare() so single-plane rectangle clears bind a matching single-aspect attachment VkImageView, and skip rect_view() when !aspects (D3D-437).
  • Add split-plane (D3D12_CLEAR_FLAG_DEPTH rectangle clear followed by D3D12_CLEAR_FLAG_STENCIL rectangle clear) regression cases for DXGI_FORMAT_D24_UNORM_S8_UINT and DXGI_FORMAT_D32_FLOAT_S8X24_UINT in runtime/test/d3d12_clear_test.cpp.

Tested

  • Intel(R) UHD Graphics 770 (101.6129, Vulkan 1.3.295, Windows 11):
    • Before fix: d3d12_clear_formats FAILED (8/8 combined depth-stencil stencil-plane checks failed on split rectangle clears).
    • After fix: d3d12_clear_formats PASS, vulkan_replay_test PASS, zero validation errors under LEONIDA_VK_VALIDATION=1.
  • NVIDIA GeForce RTX 3070 Ti (621.24, Vulkan 1.4.357, Windows 11):
    • d3d12_clear_formats PASS, vulkan_replay_test PASS, zero validation errors under LEONIDA_VK_VALIDATION=1.
  • Independently confirmed on Intel UHD Graphics 730 (@jeangoes) and 9 other NVIDIA/AMD GPUs on upstream #7634.

AI-assisted.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/619 **Author:** [@KarolKurzyna](https://github.com/KarolKurzyna) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/stencil-rect-clear-view-aspect` --- ### 📝 Commits (1) - [`701dac3`](https://github.com/ubiquitarianism/leonida/commit/701dac390ee9877ef77511ebb24dc4fb1426adce) vulkan_replay: use cleared aspects for depth/stencil rect-clear views ### 📊 Changes **2 files changed** (+39 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/vulkan_replay.h` (+8 -3) 📝 `runtime/test/d3d12_clear_test.cpp` (+31 -3) </details> ### 📄 Description Claimed in the coordination issue as: OLD-7634 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128154815) Carried over from upstream `ItsNotRexed/Leonida` PR `#7634` (`69d7d53539`), where it received **10/10 independent `PASS` hardware reviews** (`@MartinIndra02` RTX 3080, `@jeangoes` Intel UHD 730 confirming the fix on a second Gen12 Intel iGPU, `@Ueslii` RX 5600 XT, `@eizispark` RX 9070 XT, `@CowBoYdu76`, `@Ekabusto` RX 9070 XT, `@trick-ye` RX 7800 XT, `@egexon` RTX 5070, `@sgonzalez-glitch` RTX 2080, `@BeetjeMatig` RTX 5070 Ti). ### What was wrong In `runtime/src/vulkan_replay.h`, `prepare()` passed `p.binding.aspects` (`VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT`) to `rect_view()` for `ClearDepthStencilView` with rectangles even when `clear->flags` cleared only a single plane (`D3D12_CLEAR_FLAG_DEPTH` or `D3D12_CLEAR_FLAG_STENCIL`). On Intel's Windows Vulkan driver (`101.6129` on UHD Graphics 770 and UHD Graphics 730), back-to-back depth-only then stencil-only rectangle clears sharing that combined `DEPTH | STENCIL` attachment `VkImageView` silently drop the stencil `vkCmdClearAttachments` (`8/8` combined depth-stencil cases in `d3d12_clear_formats` read back stale stencil values). ### What changed - Pass the actually cleared `aspects` to `rect_view()` in `prepare()` so single-plane rectangle clears bind a matching single-aspect attachment `VkImageView`, and skip `rect_view()` when `!aspects` (`D3D-437`). - Add split-plane (`D3D12_CLEAR_FLAG_DEPTH` rectangle clear followed by `D3D12_CLEAR_FLAG_STENCIL` rectangle clear) regression cases for `DXGI_FORMAT_D24_UNORM_S8_UINT` and `DXGI_FORMAT_D32_FLOAT_S8X24_UINT` in `runtime/test/d3d12_clear_test.cpp`. ### Tested - **Intel(R) UHD Graphics 770** (`101.6129`, Vulkan `1.3.295`, Windows 11): - Before fix: `d3d12_clear_formats` **FAILED** (8/8 combined depth-stencil stencil-plane checks failed on split rectangle clears). - After fix: `d3d12_clear_formats` **PASS**, `vulkan_replay_test` **PASS**, zero validation errors under `LEONIDA_VK_VALIDATION=1`. - **NVIDIA GeForce RTX 3070 Ti** (`621.24`, Vulkan `1.4.357`, Windows 11): - `d3d12_clear_formats` **PASS**, `vulkan_replay_test` **PASS**, zero validation errors under `LEONIDA_VK_VALIDATION=1`. - Independently confirmed on **Intel UHD Graphics 730** (`@jeangoes`) and 9 other NVIDIA/AMD GPUs on upstream `#7634`. AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#660
No description provided.