diff options
| author | 2021-07-13 13:58:24 -0400 | |
|---|---|---|
| committer | 2021-07-13 16:04:27 -0400 | |
| commit | e0978931e87c127eae061322cdb489042ed6cfde (patch) | |
| tree | 8841bd3247b107841c01a1e11573b0de372d21bd | |
| parent | Merge pull request #6574 from lioncash/i18n (diff) | |
| download | yuzu-e0978931e87c127eae061322cdb489042ed6cfde.tar.gz yuzu-e0978931e87c127eae061322cdb489042ed6cfde.tar.xz yuzu-e0978931e87c127eae061322cdb489042ed6cfde.zip | |
vk_rasterizer: Only clear valid color attachments
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 6 |
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() { | |||
| 357 | .height = std::min(clear_rect.rect.extent.height, render_area.height), | 357 | .height = std::min(clear_rect.rect.extent.height, render_area.height), |
| 358 | }; | 358 | }; |
| 359 | 359 | ||
| 360 | if (use_color) { | 360 | const u32 color_attachment = regs.clear_buffers.RT; |
| 361 | const auto attachment_aspect_mask = framebuffer->ImageRanges()[color_attachment].aspectMask; | ||
| 362 | const bool is_color_rt = (attachment_aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT) != 0; | ||
| 363 | if (use_color && is_color_rt) { | ||
| 361 | VkClearValue clear_value; | 364 | VkClearValue clear_value; |
| 362 | std::memcpy(clear_value.color.float32, regs.clear_color, sizeof(regs.clear_color)); | 365 | std::memcpy(clear_value.color.float32, regs.clear_color, sizeof(regs.clear_color)); |
| 363 | 366 | ||
| 364 | const u32 color_attachment = regs.clear_buffers.RT; | ||
| 365 | scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) { | 367 | scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) { |
| 366 | const VkClearAttachment attachment{ | 368 | const VkClearAttachment attachment{ |
| 367 | .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, | 369 | .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, |