[PR #3268] [MERGED] vk_rasterizer: Improve stencil clears #3351

Closed
opened 2026-02-27 22:03:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3268
Author: @raphaelthegreat
Created: 7/18/2025
Status: Merged
Merged: 7/18/2025
Merged by: @georgemoralis

Base: mainHead: stencil-clear


📝 Commits (1)

  • e232b8e vk_rasterizer: Improve stencil clears

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+3 -1)

📄 Description

When stencil fast clear is enabled, mask out any stencil writes from the draw itself as the clear takes priority. This has been done for a while now for depth but not for stencil, which resulted in stencil being cleared to wrong values in certain cases, depending if ref value set matched the clear value in registers.

Fixes the title screen sky in Persona 5 Strikers.

main PR
Screenshot_20250718_154840 Screenshot_20250717_202321

🔄 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/shadps4-emu/shadPS4/pull/3268 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 7/18/2025 **Status:** ✅ Merged **Merged:** 7/18/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `stencil-clear` --- ### 📝 Commits (1) - [`e232b8e`](https://github.com/shadps4-emu/shadPS4/commit/e232b8e5ec0f7cf0547df513cb5c073a019ba805) vk_rasterizer: Improve stencil clears ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+3 -1) </details> ### 📄 Description When stencil fast clear is enabled, mask out any stencil writes from the draw itself as the clear takes priority. This has been done for a while now for depth but not for stencil, which resulted in stencil being cleared to wrong values in certain cases, depending if ref value set matched the clear value in registers. Fixes the title screen sky in Persona 5 Strikers. | main | PR | | ------------- | ------------- | | <img width="1282" height="719" alt="Screenshot_20250718_154840" src="https://github.com/user-attachments/assets/cb57e2f8-3ec1-4715-b04e-d5c366477518" /> | <img width="1282" height="721" alt="Screenshot_20250717_202321" src="https://github.com/user-attachments/assets/cc129adf-40d6-49c5-a45c-a55abdc0b09e" /> | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:23 +03:00
Sign in to join this conversation.
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/shadPS4#3351
No description provided.