Browse Source
Merge pull request #9127 from vonchenplus/vulkan_clear
video_core: Catch vulkan clear op not all channel need clear
pull/15/merge
bunnei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
13 additions and
8 deletions
-
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) { |
|
|
|
|