[oden] Textures are optional with no bind group
This commit is contained in:
parent
3f8e50cfc9
commit
6712a7fccb
1 changed files with 6 additions and 6 deletions
12
src/lib.rs
12
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(..));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue