X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Ftexture3d_backend.cpp;h=67adb8d130e610173895d84acfd1d69a2c90ff5e;hb=33253bf6d6a330181fda83ba23a6ac0a756d9a8d;hp=ee3490a77263e43e25ddb6d967e2d839926897ab;hpb=7b0a38db12c3d1aacb59520a3f4baa16d9ec0048;p=libs%2Fgl.git diff --git a/source/backends/vulkan/texture3d_backend.cpp b/source/backends/vulkan/texture3d_backend.cpp index ee3490a7..67adb8d1 100644 --- a/source/backends/vulkan/texture3d_backend.cpp +++ b/source/backends/vulkan/texture3d_backend.cpp @@ -25,7 +25,6 @@ void VulkanTexture3D::fill_image_info(void *ii) const image_info->extent.width = self.width; image_info->extent.height = self.height; image_info->extent.depth = self.depth; - image_info->mipLevels = self.levels; } void VulkanTexture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, const void *data) @@ -35,11 +34,11 @@ void VulkanTexture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd auto level_size = self.get_level_size(level); bool discard = (x==0 && y==0 && z==0 && wd==level_size.x && ht==level_size.y && dp==level_size.z); + TransferQueue &tq = device.get_transfer_queue(); size_t data_size = wd*ht*dp*get_pixel_size(storage_fmt); - void *staging = device.get_transfer_queue().prepare_transfer(this, false, data_size, + void *staging = tq.prepare_transfer(this, false, data_size, [this, level, discard](){ - unsigned n_levels = static_cast(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, y, z, wd, ht, dp](VkCommandBuffer cmd_buf, VkBuffer staging_buf, size_t src_off){ const VulkanFunctions &vk = device.get_functions(); @@ -56,11 +55,7 @@ void VulkanTexture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd }); stage_pixels(staging, data, wd*ht*dp); -} - -void VulkanTexture3D::generate_mipmap() -{ - generate_mipmap_levels(static_cast(this)->levels); + tq.finalize_transfer(staging); } void VulkanTexture3D::fill_mipmap_blit(unsigned level, void *b)