Browse Source

Check srgb_support on other GL | ES as well. (#2012)

pull/2021/head
Adia Robbie 2 years ago
committed by GitHub
parent
commit
eeb97fa4ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      crates/egui_glow/src/painter.rs
  2. 2
      crates/egui_glow/src/vao.rs

7
crates/egui_glow/src/painter.rs

@ -116,7 +116,12 @@ impl Painter {
let is_webgl_1 = shader == ShaderVersion::Es100;
let header = shader.version_declaration();
tracing::debug!("Shader header: {:?}.", header);
let srgb_support = gl.supported_extensions().contains("EXT_sRGB");
// Previously checking srgb_support on WebGL only, now we have to check on other GL | ES as well.
let srgb_support = gl.supported_extensions().contains("EXT_sRGB")
|| gl.supported_extensions().contains("GL_EXT_sRGB")
|| gl
.supported_extensions()
.contains("GL_ARB_framebuffer_sRGB");
tracing::debug!("SRGB Support: {:?}.", srgb_support);
let (post_process, srgb_support_define) = match (shader, srgb_support) {

2
crates/egui_glow/src/vao.rs

@ -126,6 +126,7 @@ fn supports_vao(gl: &glow::Context) -> bool {
let supported_extensions = gl.supported_extensions();
tracing::debug!("Supported OpenGL extensions: {:?}", supported_extensions);
supported_extensions.contains("OES_vertex_array_object")
|| supported_extensions.contains("GL_OES_vertex_array_object")
} else {
true
}
@ -136,6 +137,7 @@ fn supports_vao(gl: &glow::Context) -> bool {
let supported_extensions = gl.supported_extensions();
tracing::debug!("Supported OpenGL extensions: {:?}", supported_extensions);
supported_extensions.contains("OES_vertex_array_object")
|| supported_extensions.contains("GL_OES_vertex_array_object")
} else {
true
}

Loading…
Cancel
Save