Skip to content

Commit

Permalink
Check srgb_support on other GL | ES as well. (#2012)
Browse files Browse the repository at this point in the history
  • Loading branch information
ar37-rs authored Sep 6, 2022
1 parent 64aac30 commit eeb97fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/egui_glow/src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions crates/egui_glow/src/vao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit eeb97fa

Please sign in to comment.