[oden] Textures are optional with no bind group

This commit is contained in:
John Doty 2023-08-24 22:46:35 -07:00
parent 3f8e50cfc9
commit 6712a7fccb

View file

@ -598,13 +598,13 @@ impl DrawCall {
pub fn draw<'a>(&self, state: &'a State, pass: &mut wgpu::RenderPass<'a>) { pub fn draw<'a>(&self, state: &'a State, pass: &mut wgpu::RenderPass<'a>) {
if self.draw_end > self.draw_start { if self.draw_end > self.draw_start {
let texture_id = match self.texture_id { match self.texture_id {
Some(id) => id, Some(id) => {
None => return, let bind_group = state.sprite_textures.get(&id).unwrap();
};
let bind_group = state.sprite_textures.get(&texture_id).unwrap();
pass.set_bind_group(0, bind_group, &[]); pass.set_bind_group(0, bind_group, &[]);
}
None => (),
};
let vb = state.get_sprite_instance_buffer(&self.vertex_buffer); let vb = state.get_sprite_instance_buffer(&self.vertex_buffer);
pass.set_bind_group(1, &state.screen_uniform_bind_group, &[]); pass.set_bind_group(1, &state.screen_uniform_bind_group, &[]);