Fix OpenGL non-srgb on Linux (#5642)

This commit is contained in:
Valaphee The Meerkat authored and Erich Gubler committed 2024-05-18 12:27:31 -04:00
1 parent 5f357506dd
commit ae7842e539
2 files changed
+16

No files matched your search

+4
View File
@@ -51,6 +51,10 @@ Bottom level categories:
- Fix enablement of subgroup ops extension on Vulkan devices that don't support Vulkan 1.3. By @cwfitzgerald in [#5624](https://github.com/gfx-rs/wgpu/pull/5624).
#### GLES / OpenGL
- Fix regression on OpenGL (EGL) where non-sRGB still used sRGB [#5642](https://github.com/gfx-rs/wgpu/pull/5642)
## v0.20.0 (2024-04-28)
### Major Changes
+12
View File
@@ -1130,6 +1130,13 @@ impl Surface {
unsafe { gl.bind_framebuffer(glow::DRAW_FRAMEBUFFER, None) };
unsafe { gl.bind_framebuffer(glow::READ_FRAMEBUFFER, Some(sc.framebuffer)) };
if !matches!(self.srgb_kind, SrgbFrameBufferKind::None) {
// Disable sRGB conversions for `glBlitFramebuffer` as behavior does diverge between
// drivers and formats otherwise and we want to ensure no sRGB conversions happen.
unsafe { gl.disable(glow::FRAMEBUFFER_SRGB) };
}
// Note the Y-flipping here. GL's presentation is not flipped,
// but main rendering is. Therefore, we Y-flip the output positions
// in the shader, and also this blit.
@@ -1147,6 +1154,11 @@ impl Surface {
glow::NEAREST,
)
};
if !matches!(self.srgb_kind, SrgbFrameBufferKind::None) {
unsafe { gl.enable(glow::FRAMEBUFFER_SRGB) };
}
unsafe { gl.bind_framebuffer(glow::READ_FRAMEBUFFER, None) };
self.egl