[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,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(..));