bc5 normal maps

This commit is contained in:
2021-03-14 16:22:11 +01:00
parent 0c8d09effa
commit c2e3c4e0e4
6 changed files with 52 additions and 23 deletions

View File

@@ -34,6 +34,7 @@ use crate::vulkan::gameobject::{GameObject, GameObjectHandle};
pub mod pipelines;
pub mod gameobject;
pub mod mesh;
pub mod dds;
mod renderpass;
mod framebuffers;
@@ -464,12 +465,17 @@ impl VulkanRenderer {
let mut cbb = AutoCommandBufferBuilder::new(device.clone(), self.queue.family()).unwrap();
let mut offset: usize = 128;
let mut offset = 0;
let block_bytes = match format {
Format::BC1_RGBUnormBlock => 8,
Format::BC5UnormBlock => 16,
f => panic!(format!("Unknown texture format {:?}!", f))
};
for i in 0..image_view.mipmap_levels() {
let mip_size = dimensions.to_image_dimensions().mipmap_dimensions(i).unwrap().width_height_depth();
let block_bytes = 8;
let mip_byte_size = (
(u32::max(4, mip_size[0]) / 4)
* (u32::max(4, mip_size[1]) / 4)