Skip to content

Commit 63ede07

Browse files
authored
Reset the queue state between each command buffer on queue submit (#3589)
1 parent ca9341b commit 63ede07

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ Bottom level categories:
4343
#### GLES
4444
- Fix `Vertex buffer is not big enough for the draw call.` for ANGLE/Web when rendering with instance attributes on a single instance. By @wumpf in [#3596](https://github.com/gfx-rs/wgpu/pull/3596)
4545

46+
### Bug Fixes
47+
48+
#### GLES
49+
- Reset all queue state between command buffers in a submit. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589)
50+
- Reset the state of `SAMPLE_ALPHA_TO_COVERAGE` on queue reset. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589)
51+
52+
4653
## wgpu-0.15.2 (2023-03-08)
4754

4855
### Bug Fixes

wgpu-hal/src/gles/queue.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ impl super::Queue {
7070
unsafe { gl.disable(glow::BLEND) };
7171
unsafe { gl.disable(glow::CULL_FACE) };
7272
unsafe { gl.disable(glow::POLYGON_OFFSET_FILL) };
73+
unsafe { gl.disable(glow::SAMPLE_ALPHA_TO_COVERAGE) };
7374
if self.features.contains(wgt::Features::DEPTH_CLIP_CONTROL) {
7475
unsafe { gl.disable(glow::DEPTH_CLAMP) };
7576
}
@@ -1464,8 +1465,12 @@ impl crate::Queue<super::Api> for super::Queue {
14641465
) -> Result<(), crate::DeviceError> {
14651466
let shared = Arc::clone(&self.shared);
14661467
let gl = &shared.context.lock();
1467-
unsafe { self.reset_state(gl) };
14681468
for cmd_buf in command_buffers.iter() {
1469+
// The command encoder assumes a default state when encoding the command buffer.
1470+
// Always reset the state between command_buffers to reflect this assumption. Do
1471+
// this at the beginning of the loop in case something outside of wgpu modified
1472+
// this state prior to commit.
1473+
unsafe { self.reset_state(gl) };
14691474
#[cfg(not(target_arch = "wasm32"))]
14701475
if let Some(ref label) = cmd_buf.label {
14711476
unsafe { gl.push_debug_group(glow::DEBUG_SOURCE_APPLICATION, DEBUG_ID, label) };

0 commit comments

Comments
 (0)