This commit is contained in:
2021-03-14 16:27:32 +01:00
parent c2e3c4e0e4
commit 00204104dd
2 changed files with 10 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ use std::sync::Arc;
use std::time::SystemTime;
use cgmath::{Matrix4, SquareMatrix};
use dds::get_block_size;
use vulkano::{buffer::{BufferUsage, CpuAccessibleBuffer}, command_buffer::{CommandBuffer, SubpassContents}, image::{ImageLayout, ImageUsage, MipmapsCount, immutable::SubImage}};
use vulkano::command_buffer::{AutoCommandBuffer, AutoCommandBufferBuilder, DynamicState};
use vulkano::descriptor::DescriptorSet;
@@ -467,11 +468,7 @@ impl VulkanRenderer {
let mut offset = 0;
let block_bytes = match format {
Format::BC1_RGBUnormBlock => 8,
Format::BC5UnormBlock => 16,
f => panic!(format!("Unknown texture format {:?}!", f))
};
let block_bytes = get_block_size(format).expect(&format!("Unknown texture format {:?}!", format));
for i in 0..image_view.mipmap_levels() {
let mip_size = dimensions.to_image_dimensions().mipmap_dimensions(i).unwrap().width_height_depth();