mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-22 04:25:19 +00:00
vk: Do not clear memory if we're going to overwrite it with a copy anyway
This commit is contained in:
parent
69b02f7e46
commit
8ebf24d8e7
1 changed files with 11 additions and 8 deletions
|
@ -730,15 +730,18 @@ namespace vk
|
|||
VkImageSubresourceRange dst_range = { dst_aspect, 0, 1, 0, 1 };
|
||||
vk::change_image_layout(cmd, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, dst_range);
|
||||
|
||||
if (!(dst_aspect & VK_IMAGE_ASPECT_DEPTH_BIT))
|
||||
if (sections_to_copy[0].dst_w != width || sections_to_copy[0].dst_h != height)
|
||||
{
|
||||
VkClearColorValue clear = {};
|
||||
vkCmdClearColorImage(cmd, image->value, image->current_layout, &clear, 1, &dst_range);
|
||||
}
|
||||
else
|
||||
{
|
||||
VkClearDepthStencilValue clear = { 1.f, 0 };
|
||||
vkCmdClearDepthStencilImage(cmd, image->value, image->current_layout, &clear, 1, &dst_range);
|
||||
if (!(dst_aspect & VK_IMAGE_ASPECT_DEPTH_BIT))
|
||||
{
|
||||
VkClearColorValue clear = {};
|
||||
vkCmdClearColorImage(cmd, image->value, image->current_layout, &clear, 1, &dst_range);
|
||||
}
|
||||
else
|
||||
{
|
||||
VkClearDepthStencilValue clear = { 1.f, 0 };
|
||||
vkCmdClearDepthStencilImage(cmd, image->value, image->current_layout, &clear, 1, &dst_range);
|
||||
}
|
||||
}
|
||||
|
||||
copy_transfer_regions_impl(cmd, image, sections_to_copy);
|
||||
|
|
Loading…
Add table
Reference in a new issue