]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/texturecube_backend.cpp
Store the number of mipmap levels in the Texture base class
[libs/gl.git] / source / backends / vulkan / texturecube_backend.cpp
index 6a4e598c0c103b0ece427cbcd34bc07faa330f09..4e0cfe61259e2dec6c362e798991c68dabfd45eb 100644 (file)
@@ -21,7 +21,6 @@ void VulkanTextureCube::fill_image_info(void *ii) const
        image_info->imageType = VK_IMAGE_TYPE_2D;
        image_info->extent.width = self.size;
        image_info->extent.height = self.size;
-       image_info->mipLevels = self.levels;
        image_info->arrayLayers = 6;
 }
 
@@ -35,8 +34,7 @@ void VulkanTextureCube::sub_image(unsigned face, unsigned level, int x, int y, u
        size_t data_size = wd*ht*get_pixel_size(storage_fmt);
        void *staging = device.get_transfer_queue().prepare_transfer(this, false, data_size,
                [this, level, discard](){
-                       unsigned n_levels = static_cast<const TextureCube *>(this)->levels;
-                       change_layout(n_levels, level, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, discard);
+                       change_layout(level, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, discard);
                },
                [this, face, level, x, y, wd, ht](VkCommandBuffer cmd_buf, VkBuffer staging_buf, size_t src_off){
                        const VulkanFunctions &vk = device.get_functions();
@@ -55,11 +53,6 @@ void VulkanTextureCube::sub_image(unsigned face, unsigned level, int x, int y, u
        stage_pixels(staging, data, wd*ht);
 }
 
-void VulkanTextureCube::generate_mipmap()
-{
-       generate_mipmap_levels(static_cast<const TextureCube *>(this)->levels);
-}
-
 void VulkanTextureCube::fill_mipmap_blit(unsigned level, void *b)
 {
        const TextureCube &self = *static_cast<const TextureCube *>(this);