1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

egui_glow: default to RGBA8 if sRGB not supported (#2007)

The Vivante GPU on many STM32MP1 based boards does not support sRGB
as an internal format.

Introduce a check for sRGB support and default to `RGBA8` internal format
if not supported.

Additionally the STM32MP1 needs to be checked for `GL_ARB_vertex_array_object`

Closes #1991
This commit is contained in:
Luke Jones
2022-09-06 20:07:49 +12:00
committed by GitHub
parent 1d5f20b46c
commit 7fae634dc3
2 changed files with 4 additions and 0 deletions

View File

@@ -117,6 +117,7 @@ impl Painter {
let header = shader_version.version_declaration();
tracing::debug!("Shader header: {:?}.", header);
let srgb_support = gl.supported_extensions().contains("EXT_sRGB");
tracing::debug!("SRGB Support: {:?}.", srgb_support);
let (post_process, srgb_support_define) = match (shader_version, srgb_support) {
// WebGL2 support sRGB default
@@ -591,6 +592,8 @@ impl Painter {
glow::RGBA
};
(format, format)
} else if !self.srgb_support {
(glow::RGBA8, glow::RGBA)
} else {
(glow::SRGB8_ALPHA8, glow::RGBA)
};