summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2021-07-15 16:52:51 +0200
committerGitHub <noreply@github.com>2021-07-15 16:52:51 +0200
commit96703b82bc37ad923bcc76741ded7b0942bcc02d (patch)
tree41f1d1174e263baf5116f2c737617fcc0405e93b /src/video_core
parentMerge pull request #6525 from ameerj/nvdec-fixes (diff)
parentvk_rasterizer: Only clear valid color attachments (diff)
downloadyuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.tar
yuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.tar.gz
yuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.tar.bz2
yuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.tar.lz
yuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.tar.xz
yuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.tar.zst
yuzu-96703b82bc37ad923bcc76741ded7b0942bcc02d.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index e378a5679..a8ffbe6ba 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -357,11 +357,13 @@ void RasterizerVulkan::Clear() {
.height = std::min(clear_rect.rect.extent.height, render_area.height),
};
- if (use_color) {
+ const u32 color_attachment = regs.clear_buffers.RT;
+ const auto attachment_aspect_mask = framebuffer->ImageRanges()[color_attachment].aspectMask;
+ const bool is_color_rt = (attachment_aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != 0;
+ if (use_color && is_color_rt) {
VkClearValue clear_value;
std::memcpy(clear_value.color.float32, regs.clear_color, sizeof(regs.clear_color));
- const u32 color_attachment = regs.clear_buffers.RT;
scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) {
const VkClearAttachment attachment{
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,