From 37238f03c4fc85f2aa817a7217847d35453b2006 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Tue, 14 Mar 2023 13:09:32 -0400 Subject: [PATCH 1/3] Reset the state of `SAMPLE_ALPHA_TO_COVERAGE` --- wgpu-hal/src/gles/queue.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/wgpu-hal/src/gles/queue.rs b/wgpu-hal/src/gles/queue.rs index add1daeb74..236803acc2 100644 --- a/wgpu-hal/src/gles/queue.rs +++ b/wgpu-hal/src/gles/queue.rs @@ -70,6 +70,7 @@ impl super::Queue { unsafe { gl.disable(glow::BLEND) }; unsafe { gl.disable(glow::CULL_FACE) }; unsafe { gl.disable(glow::POLYGON_OFFSET_FILL) }; + unsafe { gl.disable(glow::SAMPLE_ALPHA_TO_COVERAGE) }; if self.features.contains(wgt::Features::DEPTH_CLIP_CONTROL) { unsafe { gl.disable(glow::DEPTH_CLAMP) }; } From 81408fc095e2b3b4115956e0608055083c1be4d8 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Tue, 14 Mar 2023 13:14:17 -0400 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a275dbaf0e..2d883e6d4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ Bottom level categories: ## Unreleased +### Bug Fixes + +#### GLES +- Reset the state of `SAMPLE_ALPHA_TO_COVERAGE` on queue submit. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589) + + ## wgpu-0.15.2 (2023-03-08) ### Bug Fixes From cb889eb3435e7ee66d46a3899317641862dbc583 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Tue, 14 Mar 2023 14:12:01 -0400 Subject: [PATCH 3/3] Also reset state between command_buffer iterations --- CHANGELOG.md | 3 ++- wgpu-hal/src/gles/queue.rs | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d883e6d4f..fd2a01b79c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,8 @@ Bottom level categories: ### Bug Fixes #### GLES -- Reset the state of `SAMPLE_ALPHA_TO_COVERAGE` on queue submit. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589) +- Reset all queue state between command buffers in a submit. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589) +- Reset the state of `SAMPLE_ALPHA_TO_COVERAGE` on queue reset. By @jleibs [#3589](https://github.com/gfx-rs/wgpu/pull/3589) ## wgpu-0.15.2 (2023-03-08) diff --git a/wgpu-hal/src/gles/queue.rs b/wgpu-hal/src/gles/queue.rs index 236803acc2..12f975c600 100644 --- a/wgpu-hal/src/gles/queue.rs +++ b/wgpu-hal/src/gles/queue.rs @@ -1478,8 +1478,12 @@ impl crate::Queue 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) };