dds import WIP

This commit is contained in:
2021-03-11 01:34:51 +01:00
parent 31cdfa1885
commit 9848fbc183
3 changed files with 38 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
use std::time::SystemTime;
use gltf::Error;
use gltf::{Document, Error};
use gltf::mesh::util::{ReadJoints, ReadNormals, ReadPositions, ReadTangents, ReadTexCoords, ReadWeights};
use crate::vulkan::mesh::LoadError::{GltfError, MeshDataMissing, NoIndices};
@@ -34,7 +34,7 @@ pub struct CPUMesh {
pub name: Option<String>,
}
pub fn load_mesh(mesh_path: &str, print_status: bool) -> Result<(Vec<CPUMesh>, Vec<gltf::image::Data>), LoadError> {
pub fn load_mesh(mesh_path: &str, print_status: bool) -> Result<(Vec<CPUMesh>, Document), LoadError> {
let mut start_time = None;
let mut total_vertices = 0;
let mut total_indices = 0;
@@ -92,7 +92,7 @@ pub fn load_mesh(mesh_path: &str, print_status: bool) -> Result<(Vec<CPUMesh>, V
println!("Finished loading file, total vertices: {}, total indices: {}", total_vertices, total_indices);
}
Ok((meshes, textures))
Ok((meshes, document))
}
fn create_vertices(positions: Option<ReadPositions>,