]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/pixelformat_backend.cpp
Only do layout transitions in render pass for swapchain images
[libs/gl.git] / source / backends / vulkan / pixelformat_backend.cpp
index 13df7ee8692fe871c3843921ea780d1c0cb6bdf6..1da1435705c6dad4f55819a2f08577cbe7819fe3 100644 (file)
@@ -74,6 +74,16 @@ unsigned get_vulkan_aspect(PixelComponents comp)
        }
 }
 
+unsigned get_vulkan_attachment_layout(PixelComponents comp)
+{
+       switch(comp)
+       {
+       case DEPTH_COMPONENT:
+       case STENCIL_INDEX: return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+       default: return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+       }
+}
+
 PixelFormat pixelformat_from_vulkan(unsigned vkf)
 {
        switch(vkf)