[PR #1851] [MERGED] Clear color attachment if FCE was invoked before any draws #2342

Closed
opened 2026-02-27 21:16:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1851
Author: @roamic
Created: 12/22/2024
Status: Merged
Merged: 12/22/2024
Merged by: @psucien

Base: mainHead: fix-fast-clear-before-draw


📝 Commits (2)

  • 1bf277f Clear RT if FCE was invoked before any draws
  • ed23f7b address review comments

📊 Changes

2 files changed (+31 additions, -1 deletions)

View changed files

📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+30 -1)
📝 src/video_core/renderer_vulkan/vk_rasterizer.h (+1 -0)

📄 Description

Some games (for example Yakuza 0) clear color attachments by setting CMASK and then immediately calling eliminateFastClear. This color attachment can immediately be used as texture input on the next draw call. Before this PR this attachment was not properly cleared which resulted in rendering artifacts.

The proposed solution is to handle Fast Clear Elimination draws and clear the attachment if and only if the CMASK is set.


🔄 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/1851 **Author:** [@roamic](https://github.com/roamic) **Created:** 12/22/2024 **Status:** ✅ Merged **Merged:** 12/22/2024 **Merged by:** [@psucien](https://github.com/psucien) **Base:** `main` ← **Head:** `fix-fast-clear-before-draw` --- ### 📝 Commits (2) - [`1bf277f`](https://github.com/shadps4-emu/shadPS4/commit/1bf277f9366985261721a3c3574c6541a5bb0cd8) Clear RT if FCE was invoked before any draws - [`ed23f7b`](https://github.com/shadps4-emu/shadPS4/commit/ed23f7bbdec88db882df3db44cba8c1bf2abfe1c) address review comments ### 📊 Changes **2 files changed** (+31 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+30 -1) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.h` (+1 -0) </details> ### 📄 Description Some games (for example Yakuza 0) clear color attachments by setting CMASK and then immediately calling `eliminateFastClear`. This color attachment can immediately be used as texture input on the next draw call. Before this PR this attachment was not properly cleared which resulted in rendering artifacts. The proposed solution is to handle Fast Clear Elimination draws and clear the attachment if and only if the CMASK is set. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:16:09 +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#2342
No description provided.