From 94e4e411dbf33f8cbd2cde639d10d44106ece178 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Thu, 13 Jan 2022 10:48:15 -0700 Subject: [PATCH] Fix index buffer state not being reset in reset_state --- wgpu-hal/src/gles/queue.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wgpu-hal/src/gles/queue.rs b/wgpu-hal/src/gles/queue.rs index 5dee453eae..b3acddc9f8 100644 --- a/wgpu-hal/src/gles/queue.rs +++ b/wgpu-hal/src/gles/queue.rs @@ -59,7 +59,7 @@ impl super::Queue { } } - unsafe fn reset_state(&self, gl: &glow::Context) { + unsafe fn reset_state(&mut self, gl: &glow::Context) { gl.use_program(None); gl.bind_framebuffer(glow::FRAMEBUFFER, None); gl.disable(glow::DEPTH_TEST); @@ -71,6 +71,9 @@ impl super::Queue { if self.features.contains(wgt::Features::DEPTH_CLIP_CONTROL) { gl.disable(glow::DEPTH_CLAMP); } + + gl.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, None); + self.current_index_buffer = None; } unsafe fn set_attachment(