Fix webgl srgb blit not setting the viewport correctly (#3093)

* Fix webgl srgb blit not setting the viewport correctly

* Add changelog notes
This commit is contained in:
Andreas Reich 2022-10-11 20:04:06 +02:00 committed by GitHub
parent eca04f59db
commit 351ca3ea3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -56,7 +56,7 @@ Bottom level categories:
#### GLES
- Surfaces support now `TextureFormat::Rgba8Unorm` and (non-web only) `TextureFormat::Bgra8Unorm`
- Surfaces support now `TextureFormat::Rgba8Unorm` and (non-web only) `TextureFormat::Bgra8Unorm`. By @Wumpf in [#3070](https://github.com/gfx-rs/wgpu/pull/3070)
### Bug Fixes
@ -69,6 +69,10 @@ Bottom level categories:
#### WebGPU
- Use `log` instead of `println` in hello example by @JolifantoBambla in [#2858](https://github.com/gfx-rs/wgpu/pull/2858)
#### GLES
- Fixed WebGL not displaying srgb targets correctly if a non-screen filling viewport was previously set. By @Wumpf in [#3093](https://github.com/gfx-rs/wgpu/pull/3093)
### Examples
- Log adapter info in hello example on wasm target by @JolifantoBambla in [#2858](https://github.com/gfx-rs/wgpu/pull/2858)

View File

@ -171,6 +171,13 @@ impl Surface {
))?;
if swapchain.format.describe().srgb {
// Important to set the viewport since we don't know in what state the user left it.
gl.viewport(
0,
0,
swapchain.extent.width as _,
swapchain.extent.height as _,
);
gl.bind_framebuffer(glow::DRAW_FRAMEBUFFER, None);
gl.bind_sampler(0, None);
gl.active_texture(glow::TEXTURE0);