diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index 8bde426..cb6411e 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -1690,6 +1690,11 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin usage |= VK_IMAGE_USAGE_STORAGE_BIT; } + if ( flags.bColorAttachment == true ) + { + usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + } + if ( flags.bFlippable == true ) { flags.bExportable = true; @@ -2136,7 +2141,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin assert ( flags.bStorage == false ); } - if ( flags.bStorage || flags.bSampled ) + if ( flags.bStorage || flags.bSampled || flags.bColorAttachment ) { VkImageViewCreateInfo createInfo = { .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, diff --git a/src/rendervulkan.hpp b/src/rendervulkan.hpp index 6698c5e..e5a24f1 100644 --- a/src/rendervulkan.hpp +++ b/src/rendervulkan.hpp @@ -137,6 +137,7 @@ public: bLinear = false; bExportable = false; bSwapchain = false; + bColorAttachment = false; imageType = VK_IMAGE_TYPE_2D; } @@ -149,6 +150,7 @@ public: bool bLinear : 1; bool bExportable : 1; bool bSwapchain : 1; + bool bColorAttachment : 1; VkImageType imageType; };