tirbofish/dropbear · diff
refactor: refactoring the render() functions to make it more organised, plan on optimising later.
Signature present but could not be verified.
Unverified
@@ -6,6 +6,9 @@ use glam::Mat4; use std::collections::HashMap; use std::sync::Arc; +pub const MAX_MORPH_WEIGHTS: usize = 4096; +pub const MAX_SKINNING_MATRICES: usize = 256; + #[repr(C)] #[derive(Copy, Clone, Default, Debug, bytemuck::Pod, bytemuck::Zeroable)] pub struct MorphTargetInfo { @@ -573,5 +576,3 @@ impl AnimationComponent { } } } - -pub const MAX_MORPH_WEIGHTS: usize = 4096; @@ -1,6 +1,7 @@ //! Vertices and different buffers used for wgpu use std::marker::PhantomData; +use bytemuck::NoUninit; #[derive(Debug, Clone)] pub struct ResizableBuffer<T> { @@ -11,7 +12,7 @@ pub struct ResizableBuffer<T> { _marker: PhantomData<T>, } -impl<T: bytemuck::Pod> ResizableBuffer<T> { +impl<T: NoUninit> ResizableBuffer<T> { pub fn new( device: &wgpu::Device, initial_capacity: usize, @@ -85,7 +86,7 @@ pub struct UniformBuffer<T> { _marker: PhantomData<T>, } -impl<T: bytemuck::Pod> UniformBuffer<T> { +impl<T: NoUninit> UniformBuffer<T> { pub fn new(device: &wgpu::Device, label: &str) -> Self { let size = (std::mem::size_of::<T>() as wgpu::BufferAddress).max(16); let buffer = device.create_buffer(&wgpu::BufferDescriptor {
Large diffs are not rendered by default. Showing the first 50 of 3180 lines. Show full diff