Archived
1
Fork 0

Properly transition image layouts after creation

This commit is contained in:
redstrate 2021-02-04 08:28:08 -05:00
parent 93b55e7022
commit 9d13316d0c

View file

@ -320,6 +320,8 @@ GFXTexture* GFXVulkan::create_texture(const GFXTextureCreateInfo& info) {
vkBindImageMemory(device, texture->handle, texture->memory, 0); 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 // create image view
VkImageViewCreateInfo viewInfo = {}; VkImageViewCreateInfo viewInfo = {};
viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;