diff --git a/ui/gl/gl_image.cpp b/ui/gl/gl_image.cpp index 633d108..3db6653 100644 --- a/ui/gl/gl_image.cpp +++ b/ui/gl/gl_image.cpp @@ -155,14 +155,4 @@ TexturedRect Image::texturedRect( }; } -GLint CurrentSingleComponentFormat() { - const auto context = QOpenGLContext::currentContext(); - Assert(context != nullptr); - - const auto format = context->format(); - return (format.renderableType() == QSurfaceFormat::OpenGLES) - ? GL_LUMINANCE - : GL_RED; -} - } // namespace Ui::GL diff --git a/ui/gl/gl_image.h b/ui/gl/gl_image.h index fe8fd3e..75c24ec 100644 --- a/ui/gl/gl_image.h +++ b/ui/gl/gl_image.h @@ -134,8 +134,6 @@ private: }; -[[nodiscard]] GLint CurrentSingleComponentFormat(); - #ifdef Q_OS_WIN inline constexpr auto kFormatRGBA = GL_BGRA_EXT; inline constexpr auto kSwizzleRedBlue = false; diff --git a/ui/gl/gl_shader.cpp b/ui/gl/gl_shader.cpp index 3079a52..2f47edd 100644 --- a/ui/gl/gl_shader.cpp +++ b/ui/gl/gl_shader.cpp @@ -89,9 +89,9 @@ uniform sampler2D u_texture; uniform sampler2D v_texture; )", .body = R"( - float y = texture2D(y_texture, v_texcoord).r - 0.0625; - float u = texture2D(u_texture, v_texcoord).r - 0.5; - float v = texture2D(v_texture, v_texcoord).r - 0.5; + float y = texture2D(y_texture, v_texcoord).a - 0.0625; + float u = texture2D(u_texture, v_texcoord).a - 0.5; + float v = texture2D(v_texture, v_texcoord).a - 0.5; result = vec4( 1.164 * y + 1.596 * v, 1.164 * y - 0.392 * u - 0.813 * v,