VulkanDevice: Use vkCmdClearAttachments() to avoid render pass restart

This commit is contained in:
Stenzek
2024-04-01 18:01:17 +10:00
parent 5ec1331831
commit 41cc60e87e
4 changed files with 46 additions and 9 deletions

View File

@ -212,6 +212,18 @@ VkImageLayout VulkanTexture::GetVkLayout() const
return GetVkImageLayout(m_layout);
}
VkClearColorValue VulkanTexture::GetClearColorValue() const
{
VkClearColorValue ccv;
std::memcpy(ccv.float32, GetUNormClearColor().data(), sizeof(ccv.float32));
return ccv;
}
VkClearDepthStencilValue VulkanTexture::GetClearDepthValue() const
{
return VkClearDepthStencilValue{m_clear_value.depth, 0u};
}
VkCommandBuffer VulkanTexture::GetCommandBufferForUpdate()
{
VulkanDevice& dev = VulkanDevice::GetInstance();