diff options
author | bunnei <bunneidev@gmail.com> | 2022-10-27 19:19:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 19:19:40 -0700 |
commit | 84d15c7f4724b50ea653196b8350e7603b3a7024 (patch) | |
tree | 917fe6a5b6ac84116ab438a7b6fdea84f6fc6bd9 | |
parent | 8ce62567229650c519d7df4c69fbdd2da636967f (diff) | |
parent | 0ec1801bc1e07e0630e9be55ef123294c8155b6a (diff) |
Merge pull request #9127 from vonchenplus/vulkan_clear
video_core: Catch vulkan clear op not all channel need clear
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 9f05a7a18..6ab68892c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -305,14 +305,19 @@ void RasterizerVulkan::Clear() { } } - scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) { - const VkClearAttachment attachment{ - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .colorAttachment = color_attachment, - .clearValue = clear_value, - }; - cmdbuf.ClearAttachments(attachment, clear_rect); - }); + if (regs.clear_surface.R && regs.clear_surface.G && regs.clear_surface.B && + regs.clear_surface.A) { + scheduler.Record([color_attachment, clear_value, clear_rect](vk::CommandBuffer cmdbuf) { + const VkClearAttachment attachment{ + .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, + .colorAttachment = color_attachment, + .clearValue = clear_value, + }; + cmdbuf.ClearAttachments(attachment, clear_rect); + }); + } else { + UNIMPLEMENTED_MSG("Unimplemented Clear only the specified channel"); + } } if (!use_depth && !use_stencil) { |