From 87928f294a1e760562a37313d43ffa3b880365a7 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Wed, 14 Jul 2021 23:57:40 +0200 Subject: [PATCH] early-access version 1878 --- README.md | 2 +- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 89f2cb4b7..f122e569f 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1877. +This is the source code for early-access 1878. ## Legal Notice diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8ca5fca61..609f5c576 100755 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -222,11 +222,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,