add transform matrix buffer

This commit is contained in:
SeanOMik 2023-05-31 23:58:10 -04:00
parent 0fdf6c1fee
commit da4297b462
1 changed files with 4 additions and 11 deletions

View File

@ -358,17 +358,6 @@ impl Renderer for BasicRenderer {
self.buffer_storage.insert(entity, buffers); self.buffer_storage.insert(entity, buffers);
} }
} }
if let Some((_e, (camera,))) = main_world.query_mut::<(&mut CameraComponent,)>().into_iter().next() {
let view_proj = self.inuse_camera.update_view_projection(camera);
self.queue.write_buffer(&self.camera_buffer, 0, bytemuck::cast_slice(&[view_proj.clone()]));
} else {
warn!("Missing camera!");
}
}
fn add_render_pipeline(&mut self, shader_id: u32, pipeline: Arc<FullRenderPipeline>) {
self.render_pipelines.insert(shader_id, pipeline);
} }
async fn render(&mut self) -> Result<(), wgpu::SurfaceError> { async fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
@ -450,4 +439,8 @@ impl Renderer for BasicRenderer {
fn surface_size(&self) -> winit::dpi::PhysicalSize<u32> { fn surface_size(&self) -> winit::dpi::PhysicalSize<u32> {
self.size self.size
} }
fn add_render_pipeline(&mut self, shader_id: u32, pipeline: Arc<FullRenderPipeline>) {
self.render_pipelines.insert(shader_id, pipeline);
}
} }