From 9d13316d0cf134877e80813d647b469b5fd17c7c Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Thu, 4 Feb 2021 08:28:08 -0500 Subject: [PATCH] Properly transition image layouts after creation --- engine/gfx/vulkan/src/gfx_vulkan.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/gfx/vulkan/src/gfx_vulkan.cpp b/engine/gfx/vulkan/src/gfx_vulkan.cpp index 3ddbe75..a391be4 100755 --- a/engine/gfx/vulkan/src/gfx_vulkan.cpp +++ b/engine/gfx/vulkan/src/gfx_vulkan.cpp @@ -320,6 +320,8 @@ GFXTexture* GFXVulkan::create_texture(const GFXTextureCreateInfo& info) { vkBindImageMemory(device, texture->handle, texture->memory, 0); + transitionImageLayout(texture->handle, imageFormat, imageAspect, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); + // create image view VkImageViewCreateInfo viewInfo = {}; viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;