Skip to content

Commit ad10306

Browse files
committed
Also reset state between command_buffer iterations
1 parent 81408fc commit ad10306

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wgpu-hal/src/gles/queue.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,12 @@ impl crate::Queue<super::Api> for super::Queue {
14781478
) -> Result<(), crate::DeviceError> {
14791479
let shared = Arc::clone(&self.shared);
14801480
let gl = &shared.context.lock();
1481-
unsafe { self.reset_state(gl) };
14821481
for cmd_buf in command_buffers.iter() {
1482+
// The command encoder assumes a default state when encoding the command buffer.
1483+
// Always reset the state between command_buffers to reflect this assumption. Do
1484+
// this at the beginning of the loop in case something outside of wgpu modified
1485+
// this state prior to commit.
1486+
unsafe { self.reset_state(gl) };
14831487
#[cfg(not(target_arch = "wasm32"))]
14841488
if let Some(ref label) = cmd_buf.label {
14851489
unsafe { gl.push_debug_group(glow::DEBUG_SOURCE_APPLICATION, DEBUG_ID, label) };

0 commit comments

Comments
 (0)