]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't set the storage bit in usage flags of multisampled images
authorMikko Rasa <tdb@tdb.fi>
Tue, 19 Apr 2022 08:44:13 +0000 (11:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 19 Apr 2022 08:45:12 +0000 (11:45 +0300)
It requires a device feature to be set.  I'll add that later.

source/backends/vulkan/texture_backend.cpp

index 1367cc8d46c2a87a24eddb892b93b0d7cb142817..db420991ee1ebf17861c8b26c6aa4666f49b93fd 100644 (file)
@@ -67,8 +67,6 @@ void VulkanTexture::allocate()
        image_info.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
 
        image_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_TRANSFER_DST_BIT|VK_IMAGE_USAGE_SAMPLED_BIT;
-       if(props.optimalTilingFeatures&VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)
-               image_info.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
 
        PixelComponents comp = get_components(self.storage_fmt);
        if(comp==DEPTH_COMPONENT || comp==STENCIL_INDEX)
@@ -78,6 +76,9 @@ void VulkanTexture::allocate()
 
        fill_image_info(&image_info);
 
+       if((props.optimalTilingFeatures&VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) && image_info.samples==VK_SAMPLE_COUNT_1_BIT)
+               image_info.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
+
        /* SwapChainTexture may have already provided the image.  Create_info is
        filled anyway because some of its fields are used for view_info. */
        if(!handle)