Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disable_srgb to NativeOptions. #2072

Closed
wants to merge 0 commits into from
Closed

Conversation

ar37-rs
Copy link
Contributor

@ar37-rs ar37-rs commented Sep 22, 2022

VirtualBox_Ubuntu22 04_22_09_2022_16_42_45
Hi @emilk eframe broken again on virtualbox gl es 2.0 since #2070 (probably because it has GL_EXT_texture_sRGB_decode, but doesn't do anything).
adding disable_srgb will avoid srgb textures support misdetection.

@emilk
Copy link
Owner

emilk commented Sep 22, 2022

I want to merge #2071 before merging this, but a few quick comments:

  • Don't use negations in names. Call it enable_srgb_textures: bool instead
  • I don't see a need for Option<bool>. Just use bool.

Is it possible to detect virtualbox some other way? i.e. via gl.get_parameter_string(glow::SHADING_LANGUAGE_VERSION) or similar?

@ar37-rs
Copy link
Contributor Author

ar37-rs commented Sep 22, 2022

@emilk exactly, agree on that. since an OpenGL ES 2.0 driver usually has no SRGB8_ALPHA8 support, what if we just disable srgb by default if the shader version detected is egui_glow::ShaderVersion::Es100 ? that would be much more simpler.

@ar37-rs
Copy link
Contributor Author

ar37-rs commented Sep 22, 2022

Like so:

        let is_webgl_1 = shader_version == ShaderVersion::Es100;
        //...
        let srgb_textures = if is_webgl_1 { false } else { true };
        tracing::debug!("SRGB Support: {:?}", srgb_textures);

since webgl1 is equivalent to GLES2 and webgl2 is GLES 3.0

@ar37-rs
Copy link
Contributor Author

ar37-rs commented Sep 24, 2022

@emilk current master woking fine on virtualbox, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants