kitgit

tirbofish/dropbear · commit

2a0f08a88f896659e57a758b7dd2decf9d4ed541

feature: automatic component inspection

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-02-17 11:43

view full diff

diff --git a/crates/dropbear-engine/src/pipelines/light_cube.rs b/crates/dropbear-engine/src/pipelines/light_cube.rs
index 53773b3..f772ebe 100644
--- a/crates/dropbear-engine/src/pipelines/light_cube.rs
+++ b/crates/dropbear-engine/src/pipelines/light_cube.rs
@@ -3,7 +3,7 @@ use std::mem::size_of;
 use glam::DMat4;
 use slank::include_slang;
 use wgpu::{BufferAddress, CompareFunction, DepthBiasState, StencilState, VertexAttribute, VertexFormat};
-use crate::buffer::{StorageBuffer, UniformBuffer};
+use crate::buffer::{StorageBuffer};
 use crate::entity::{EntityTransform, Transform};
 use crate::graphics::SharedGraphicsContext;
 use crate::lighting::{Light, LightArrayUniform, LightComponent, MAX_LIGHTS};
@@ -87,18 +87,12 @@ impl DropbearShaderPipeline for LightCubePipeline {
             cache: None,
         });
 
-        let mut storage_buffer = None;
-
-        storage_buffer = Some(StorageBuffer::new(
+        let storage_buffer = StorageBuffer::new(
             &graphics.device,
             "light cube pipeline storage buffer",
-        ));
+        );
 
-        let light_buffer: &wgpu::Buffer = if let Some(buf) = &storage_buffer {
-            buf.buffer()
-        } else {
-            panic!("A storage buffer should have been created");
-        };
+        let light_buffer: &wgpu::Buffer = storage_buffer.buffer();
 
         let light_bind_group = graphics.device.create_bind_group(&wgpu::BindGroupDescriptor {
             layout: &graphics.layouts.light_array_bind_group_layout,
@@ -113,7 +107,7 @@ impl DropbearShaderPipeline for LightCubePipeline {
             shader,
             pipeline_layout,
             pipeline,
-            storage_buffer,
+            storage_buffer: Some(storage_buffer),
             light_bind_group,
         }
     }
diff --git a/crates/dropbear-engine/src/pipelines/shader.rs b/crates/dropbear-engine/src/pipelines/shader.rs
index c1fd9cb..b397c16 100644
--- a/crates/dropbear-engine/src/pipelines/shader.rs
+++ b/crates/dropbear-engine/src/pipelines/shader.rs
@@ -1,6 +1,5 @@
 use std::sync::Arc;

Large diffs are not rendered by default. Showing the first 50 of 903 lines. Show full diff