Disable Magpie glium gamma-correction

This commit is contained in:
mars 2022-11-18 16:48:17 -07:00
parent 25532f4f9e
commit e924a17073
1 changed files with 16 additions and 4 deletions

View File

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later // SPDX-License-Identifier: AGPL-3.0-or-later
use canary::{DrawCommand, Vec2, PX_PER_MM}; use canary::{DrawCommand, Vec2, PX_PER_MM};
use glium::Surface; use glium::{program::ProgramCreationInput, Surface};
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct Vertex { pub struct Vertex {
@ -59,9 +59,21 @@ pub struct Graphics {
impl Graphics { impl Graphics {
pub fn new(display: glium::Display) -> Self { pub fn new(display: glium::Display) -> Self {
let program = let program = glium::Program::new(
glium::Program::from_source(&display, VERTEX_SHADER_SRC, FRAGMENT_SHADER_SRC, None) &display,
.unwrap(); ProgramCreationInput::SourceCode {
vertex_shader: VERTEX_SHADER_SRC,
tessellation_control_shader: None,
tessellation_evaluation_shader: None,
geometry_shader: None,
fragment_shader: FRAGMENT_SHADER_SRC,
transform_feedback_varyings: None,
outputs_srgb: true, // don't automatically apply gamma correction
uses_point_size: false,
},
)
.unwrap();
Self { display, program } Self { display, program }
} }