From 6712a7fccb989754333edc97d8d8ce6106edbc2b Mon Sep 17 00:00:00 2001 From: John Doty Date: Thu, 24 Aug 2023 22:46:35 -0700 Subject: [PATCH] [oden] Textures are optional with no bind group --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dc81230a..afe285da 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -598,14 +598,14 @@ impl DrawCall { pub fn draw<'a>(&self, state: &'a State, pass: &mut wgpu::RenderPass<'a>) { if self.draw_end > self.draw_start { - let texture_id = match self.texture_id { - Some(id) => id, - None => return, + match self.texture_id { + Some(id) => { + let bind_group = state.sprite_textures.get(&id).unwrap(); + pass.set_bind_group(0, bind_group, &[]); + } + None => (), }; - let bind_group = state.sprite_textures.get(&texture_id).unwrap(); - pass.set_bind_group(0, bind_group, &[]); - let vb = state.get_sprite_instance_buffer(&self.vertex_buffer); pass.set_bind_group(1, &state.screen_uniform_bind_group, &[]); pass.set_vertex_buffer(0, state.sprite_vertex_buffer.slice(..));