kitgit

tirbofish/dropbear · commit

0f3aade9411d597578d6c29027f6f5434ca905e1

refactor: refactoring the render() functions to make it more organised, plan on optimising later.

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-03-31 14:05

view full diff

diff --git a/crates/dropbear-engine/src/animation.rs b/crates/dropbear-engine/src/animation.rs
index d78bbef..1e14b0a 100644
--- a/crates/dropbear-engine/src/animation.rs
+++ b/crates/dropbear-engine/src/animation.rs
@@ -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;
diff --git a/crates/dropbear-engine/src/buffer.rs b/crates/dropbear-engine/src/buffer.rs
index 331a647..edfbb51 100644
--- a/crates/dropbear-engine/src/buffer.rs
+++ b/crates/dropbear-engine/src/buffer.rs
@@ -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