From 1bb24ded57d9f8b266c5f692efc4badd0ae6b7d9 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 19 Dec 2021 15:42:10 +0100 Subject: [PATCH] rendervulkan: Remove empty texture. --- src/rendervulkan.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index ca07dae..70d21b2 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -136,8 +136,6 @@ namespace std std::unordered_map< VulkanSamplerCacheKey_t, VkSampler > g_vulkanSamplerCache; -std::shared_ptr g_emptyTex; - static std::map< VkFormat, std::map< uint64_t, VkDrmFormatModifierPropertiesEXT > > DRMModifierProps = {}; static std::vector< uint32_t > sampledShmFormats{}; static struct wlr_drm_format_set sampledDRMFormats = {}; @@ -856,15 +854,6 @@ bool vulkan_init_formats() vk_log.infof( " 0x%" PRIX32, fmt ); } - CVulkanTexture::createFlags texCreateFlags; - uint32_t bits = 0; - g_emptyTex = vulkan_create_texture_from_bits( 1, 1, VK_FORMAT_R8G8B8A8_UNORM, texCreateFlags, &bits ); - - if ( g_emptyTex == 0 ) - { - return false; - } - return true; } @@ -2027,9 +2016,9 @@ void vulkan_update_descriptor( struct Composite_t *pComposite, struct VulkanPipe float_is_integer(pComposite->data.vOffset[i].x); float_is_integer(pComposite->data.vOffset[i].y); - const std::shared_ptr& pTex = pPipeline->layerBindings[ i ].tex - ? pPipeline->layerBindings[ i ].tex - : g_emptyTex; + VkImageView imageView = pPipeline->layerBindings[ i ].tex + ? pPipeline->layerBindings[ i ].tex->m_vkImageView + : VK_NULL_HANDLE; VulkanSamplerCacheKey_t samplerKey; samplerKey.bNearest = bForceNearest || !pPipeline->layerBindings[i].bFilter; @@ -2041,7 +2030,7 @@ void vulkan_update_descriptor( struct Composite_t *pComposite, struct VulkanPipe { VkDescriptorImageInfo imageInfo = { .sampler = sampler, - .imageView = pTex->m_vkImageView, + .imageView = imageView, .imageLayout = VK_IMAGE_LAYOUT_GENERAL, };