]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/texture1d_backend.cpp
Store the number of mipmap levels in the Texture base class
[libs/gl.git] / source / backends / vulkan / texture1d_backend.cpp
index e27f371bdc33c75608303d5926198acc49840cd1..d74164842960f8189b3398f34a428e6e07624c46 100644 (file)
@@ -19,7 +19,6 @@ void VulkanTexture1D::fill_image_info(void *ii) const
        VkImageCreateInfo *image_info = static_cast<VkImageCreateInfo *>(ii);
        image_info->imageType = VK_IMAGE_TYPE_1D;
        image_info->extent.width = self.width;
-       image_info->mipLevels = self.levels;
 }
 
 void VulkanTexture1D::sub_image(unsigned level, int x, unsigned wd, const void *data)
@@ -32,8 +31,7 @@ void VulkanTexture1D::sub_image(unsigned level, int x, unsigned wd, const void *
        size_t data_size = wd*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 Texture1D *>(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, level, x, wd](VkCommandBuffer cmd_buf, VkBuffer staging_buf, size_t src_off){
                        const VulkanFunctions &vk = device.get_functions();
@@ -52,11 +50,6 @@ void VulkanTexture1D::sub_image(unsigned level, int x, unsigned wd, const void *
        stage_pixels(staging, data, wd);
 }
 
-void VulkanTexture1D::generate_mipmap()
-{
-       generate_mipmap_levels(static_cast<const Texture1D *>(this)->levels);
-}
-
 void VulkanTexture1D::fill_mipmap_blit(unsigned level, void *b)
 {
        const Texture1D &self = *static_cast<const Texture1D *>(this);