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 cb889eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
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 cb889eb

Please sign in to comment.