Upconvert initial layouts to GENERAL when promoting loadOp to LOAD

* We were doing this in vkCreateRenderPass but not vkCreateRenderPass2
This commit is contained in:
baldurk
2022-10-12 17:31:53 +01:00
parent 338541cf3f
commit 77a3e11b32
@@ -1028,20 +1028,16 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass(SerialiserType &ser, VkDevice d
if(m_ReplayOptions.optimisation != ReplayOptimisationLevel::Fastest)
{
if(att[i].loadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
{
att[i].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
}
if(att[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
att[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
if(att[i].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD &&
att[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED)
{
att[i].initialLayout = VK_IMAGE_LAYOUT_GENERAL;
}
if(att[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
{
att[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
if(att[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED)
att[i].initialLayout = VK_IMAGE_LAYOUT_GENERAL;
}
if(att[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD &&
att[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED)
{
@@ -1292,6 +1288,26 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass2(SerialiserType &ser, VkDevice
att[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
}
if(m_ReplayOptions.optimisation != ReplayOptimisationLevel::Fastest)
{
if(att[i].loadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
att[i].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
if(att[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_DONT_CARE)
att[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
if(att[i].loadOp == VK_ATTACHMENT_LOAD_OP_LOAD &&
att[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED)
{
att[i].initialLayout = VK_IMAGE_LAYOUT_GENERAL;
}
if(att[i].stencilLoadOp == VK_ATTACHMENT_LOAD_OP_LOAD &&
att[i].initialLayout == VK_IMAGE_LAYOUT_UNDEFINED)
{
att[i].initialLayout = VK_IMAGE_LAYOUT_GENERAL;
}
}
// renderpass can't start or end in presentable layout on replay
SanitiseOldImageLayout(att[i].initialLayout);
SanitiseNewImageLayout(att[i].finalLayout);