Skip to content

Commit

Permalink
Also reset state between command_buffer iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Mar 14, 2023
1 parent 81408fc commit ad10306
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wgpu-hal/src/gles/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,12 @@ impl crate::Queue<super::Api> for super::Queue {
) -> Result<(), crate::DeviceError> {
let shared = Arc::clone(&self.shared);
let gl = &shared.context.lock();
unsafe { self.reset_state(gl) };
for cmd_buf in command_buffers.iter() {
// The command encoder assumes a default state when encoding the command buffer.
// Always reset the state between command_buffers to reflect this assumption. Do
// this at the beginning of the loop in case something outside of wgpu modified
// this state prior to commit.
unsafe { self.reset_state(gl) };
#[cfg(not(target_arch = "wasm32"))]
if let Some(ref label) = cmd_buf.label {
unsafe { gl.push_debug_group(glow::DEBUG_SOURCE_APPLICATION, DEBUG_ID, label) };
Expand Down

0 comments on commit ad10306

Please sign in to comment.