vulkan/renderpass: Use GENERAL for initial layout
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 4 Oct 2019 20:55:25 +0000 (17:55 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 5 Oct 2019 15:13:22 +0000 (12:13 -0300)
UNDEFINED initial layouts may not preserve the contents
of the attachment after transitioning the layout. We want
them to be preserved because we do partial rendering.

Use GENERAL as the initial layout for render passes.

gsk/vulkan/gskvulkanrenderpass.c

index 00fd658d8bfd813669aad36567d2cfee3655fa2c..414d8b55d43f79a49eab860effebc861e037533b 100644 (file)
@@ -172,7 +172,7 @@ gsk_vulkan_render_pass_new (GdkVulkanContext  *context,
                                               .samples = VK_SAMPLE_COUNT_1_BIT,
                                               .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
                                               .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
-                                              .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+                                              .initialLayout = VK_IMAGE_LAYOUT_GENERAL,
                                               .finalLayout = final_layout
                                            }
                                         },