X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Ftexture3d_backend.cpp;h=05ed51829d6bacb200fc5eef3a16cba36f5cf580;hb=0859998b4d394cb31f92c1031339bf6404561a8a;hp=86653ef2b04796f4148050b11780e16884fc932e;hpb=3abde92c3780568c792169e48741f6c5699aa0e7;p=libs%2Fgl.git diff --git a/source/backends/vulkan/texture3d_backend.cpp b/source/backends/vulkan/texture3d_backend.cpp index 86653ef2..05ed5182 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) @@ -38,8 +37,7 @@ void VulkanTexture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd size_t data_size = wd*ht*dp*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(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(); @@ -55,13 +53,7 @@ void VulkanTexture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd vk.CmdCopyBufferToImage(cmd_buf, staging_buf, handle, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); }); - const char *src = static_cast(data); - copy(src, src+data_size, static_cast(staging)); -} - -void VulkanTexture3D::generate_mipmap() -{ - generate_mipmap_levels(static_cast(this)->levels); + stage_pixels(staging, data, wd*ht*dp); } void VulkanTexture3D::fill_mipmap_blit(unsigned level, void *b)