mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
GLES: on EGL, respect the user requesting a non-sRGB surface format (#3817)
* EGL: respect the user requesting a non-sRGB surface format What used to happen was that sRGB was used whether you requested it or not. This commit fixes that and now passing in a non-sRGB texture format in SurfaceConfiguration will result in a non-sRGB surface being created. * add changelog entry about the EGL non-sRGB support change
This commit is contained in:
@@ -65,6 +65,7 @@ Bottom level categories:
|
||||
### Bug Fixes
|
||||
|
||||
- Fix order of arguments to glPolygonOffset by @komadori in [#3783](https://github.com/gfx-rs/wgpu/pull/3783).
|
||||
- Fix OpenGL/EGL backend not respecting non-sRGB texture formats in `SurfaceConfiguration`. by @liquidev in [#3817](https://github.com/gfx-rs/wgpu/pull/3817)
|
||||
|
||||
#### Metal
|
||||
|
||||
|
||||
@@ -1152,15 +1152,17 @@ impl crate::Surface<super::Api> for Surface {
|
||||
khronos_egl::SINGLE_BUFFER
|
||||
},
|
||||
];
|
||||
match self.srgb_kind {
|
||||
SrgbFrameBufferKind::None => {}
|
||||
SrgbFrameBufferKind::Core => {
|
||||
attributes.push(khronos_egl::GL_COLORSPACE);
|
||||
attributes.push(khronos_egl::GL_COLORSPACE_SRGB);
|
||||
}
|
||||
SrgbFrameBufferKind::Khr => {
|
||||
attributes.push(EGL_GL_COLORSPACE_KHR as i32);
|
||||
attributes.push(EGL_GL_COLORSPACE_SRGB_KHR as i32);
|
||||
if config.format.is_srgb() {
|
||||
match self.srgb_kind {
|
||||
SrgbFrameBufferKind::None => {}
|
||||
SrgbFrameBufferKind::Core => {
|
||||
attributes.push(khronos_egl::GL_COLORSPACE);
|
||||
attributes.push(khronos_egl::GL_COLORSPACE_SRGB);
|
||||
}
|
||||
SrgbFrameBufferKind::Khr => {
|
||||
attributes.push(EGL_GL_COLORSPACE_KHR as i32);
|
||||
attributes.push(EGL_GL_COLORSPACE_SRGB_KHR as i32);
|
||||
}
|
||||
}
|
||||
}
|
||||
attributes.push(khronos_egl::ATTRIB_NONE as i32);
|
||||
|
||||
Reference in New Issue
Block a user