Remove CurrentSingleComponentFormat.

This commit is contained in:
John Preston 2021-07-22 15:49:33 +03:00
parent e68f76e6ab
commit 2439235e42
3 changed files with 3 additions and 15 deletions

View file

@ -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

View file

@ -134,8 +134,6 @@ private:
};
[[nodiscard]] GLint CurrentSingleComponentFormat();
#ifdef Q_OS_WIN
inline constexpr auto kFormatRGBA = GL_BGRA_EXT;
inline constexpr auto kSwizzleRedBlue = false;

View file

@ -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,