- const char *src = static_cast<const char *>(data);
- copy(src, src+data_size, static_cast<char *>(staging));
+ stage_pixels(staging, data, wd*ht*dp);
+ tq.finalize_transfer(staging);
+}
+
+void VulkanTexture3D::fill_mipmap_blit(unsigned level, void *b)
+{
+ const Texture3D &self = *static_cast<const Texture3D *>(this);
+ VkImageBlit &blit = *static_cast<VkImageBlit *>(b);
+
+ LinAl::Vector<int, 3> src_size = self.get_level_size(level);
+ LinAl::Vector<int, 3> dst_size = self.get_level_size(level+1);
+
+ blit.srcSubresource.layerCount = (is_array() ? self.depth : 1);
+ blit.dstSubresource.layerCount = blit.srcSubresource.layerCount;
+ blit.srcOffsets[1] = { src_size.x, src_size.y, (is_array() ? 1 : src_size.z) };
+ blit.dstOffsets[1] = { dst_size.x, dst_size.y, (is_array() ? 1 : dst_size.z) };