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;
}
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();
vk.CmdCopyBufferToImage(cmd_buf, staging_buf, handle, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion);
});
- const char *src = static_cast<const char *>(data);
- copy(src, src+data_size, static_cast<char *>(staging));
-}
-
-void VulkanTextureCube::generate_mipmap()
-{
- generate_mipmap_levels(static_cast<const TextureCube *>(this)->levels);
+ stage_pixels(staging, data, wd*ht);
}
void VulkanTextureCube::fill_mipmap_blit(unsigned level, void *b)