1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Fix wrong gamma in WebkitGTK (#888)

Closes https://github.com/emilk/egui/issues/794

Also refactor and improve VAO support detection

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
triangle drawer
2021-11-13 11:32:01 +00:00
committed by GitHub
parent 4d4c75c6f1
commit 008a971e73
11 changed files with 115 additions and 22 deletions

View File

@@ -19,6 +19,7 @@ pub(crate) struct PostProcess {
impl PostProcess {
pub(crate) unsafe fn new(
gl: &glow::Context,
shader_prefix: &str,
need_to_emulate_vao: bool,
is_webgl_1: bool,
width: i32,
@@ -96,12 +97,20 @@ impl PostProcess {
let vert_shader = compile_shader(
gl,
glow::VERTEX_SHADER,
include_str!("shader/post_vertex_100es.glsl"),
&format!(
"{}\n{}",
shader_prefix,
include_str!("shader/post_vertex_100es.glsl")
),
)?;
let frag_shader = compile_shader(
gl,
glow::FRAGMENT_SHADER,
include_str!("shader/post_fragment_100es.glsl"),
&format!(
"{}\n{}",
shader_prefix,
include_str!("shader/post_fragment_100es.glsl")
),
)?;
let program = link_program(gl, [vert_shader, frag_shader].iter())?;