X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mixer.cpp;h=385ca237d94364e48d834271fe2eabf82072c2c1;hb=e7042ad94ffec1505feaf7f8c5a265b2165957a0;hp=317c762a70575e9307b4c6a52c1e55aa59cb4304;hpb=4d288e59bea313bbc2369eaad5cfdfb28bbcd960;p=nageru diff --git a/mixer.cpp b/mixer.cpp index 317c762..385ca23 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -124,7 +124,11 @@ void ensure_texture_resolution(PBOFrameAllocator::Userdata *userdata, unsigned f case bmusb::PixelFormat_8BitRGBA: glBindTexture(GL_TEXTURE_2D, userdata->tex_rgba[field]); check_error(); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); + if (global_flags.can_disable_srgb_decoder) { // See the comments in tweaked_inputs.h. + glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB8_ALPHA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); + } else { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); + } check_error(); break; } @@ -206,6 +210,9 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) CHECK(init_movit(MOVIT_SHADER_DIR, MOVIT_DEBUG_OFF)); check_error(); + // This nearly always should be true. + global_flags.can_disable_srgb_decoder = epoxy_has_gl_extension("GL_EXT_texture_sRGB_decode"); + // Since we allow non-bouncing 4:2:2 YCbCrInputs, effective subpixel precision // will be halved when sampling them, and we need to compensate here. movit_texel_subpixel_precision /= 2.0;