From 12c54069f3b12ee66fb7863656c8039324f45699 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Thu, 20 Jul 2023 12:30:13 +0200 Subject: [PATCH] set pipeline before drawing --- kubi/src/rendering/world.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kubi/src/rendering/world.rs b/kubi/src/rendering/world.rs index 4c9982c..72d8c05 100644 --- a/kubi/src/rendering/world.rs +++ b/kubi/src/rendering/world.rs @@ -170,8 +170,9 @@ pub fn draw_world( // //! //TODO THIS IS PROBABLY UB // AND I DONT FUCKING CARE let mesh = unsafe { yolo(meshes.get(key).expect("Mesh index pointing to nothing")) }; - let bind_group = unsafe { yolo(&gpu_data.bind_group) }; - render_pass.set_bind_group(0, bind_group, &[]); + let gpu_data = unsafe { yolo(gpu_data.as_ref()) }; + render_pass.set_pipeline(&gpu_data.pipeline); + render_pass.set_bind_group(0, &gpu_data.bind_group, &[]); render_pass.set_vertex_buffer(0, mesh.vertex_buffer.slice(..)); render_pass.set_index_buffer(mesh.index_buffer.slice(..), wgpu::IndexFormat::Uint32); render_pass.draw_indexed(0..mesh.idx_count, 0, 0..1);