summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorBin Jin <bjin1990@gmail.com>2015-12-02 00:28:26 +0000
committerwm4 <wm4@nowhere>2015-12-02 12:32:02 +0100
commit42a0f4d87b601e1a3c797c31043d3ca777881974 (patch)
tree8396475463a5f3dfbcf8a417544bcd43e14a7ec0 /video/out/opengl/video.c
parent69cc002c9294a2982dc3753a9602c10d34c1020b (diff)
downloadmpv-42a0f4d87b601e1a3c797c31043d3ca777881974.tar.bz2
mpv-42a0f4d87b601e1a3c797c31043d3ca777881974.tar.xz
vo_opengl: enable NNEDI3 prescaler on OpenGL ES 3.0
It turns out that both UBO and intBitsToFloat() are supported in OpenGL ES 3.0[1][2], enable them so that NNEDI3 prescaler can be used in a wider range of backends. Also fixes some implicit int-to-float conversions so that the shader actually compiles on GLES. Tested on Linux desktop (nvidia 358.16) with "es" sub-option. [1]: https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformBlockIndex.xhtml [2]: https://www.khronos.org/opengles/sdk/docs/manglsl/docbook4/xhtml/intBitsToFloat.xml
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 287c240691..f07fbb104b 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2483,14 +2483,18 @@ static void check_gl_features(struct gl_video *p)
if (p->opts.prescale == 2) {
if (p->opts.nnedi3_opts->upload == NNEDI3_UPLOAD_UBO) {
// Check features for uniform buffer objects.
- if (!p->gl->BindBufferBase || !p->gl->GetUniformBlockIndex) {
- MP_WARN(p, "Disabling NNEDI3 (OpenGL 3.1 required).\n");
+ if (!gl->BindBufferBase || !gl->GetUniformBlockIndex) {
+ MP_WARN(p, "Disabling NNEDI3 (%s required).\n",
+ gl->es ? "OpenGL ES 3.0" : "OpenGL 3.1");
p->opts.prescale = 0;
}
} else if (p->opts.nnedi3_opts->upload == NNEDI3_UPLOAD_SHADER) {
// Check features for hard coding approach.
- if (p->gl->glsl_version < 330) {
- MP_WARN(p, "Disabling NNEDI3 (OpenGL 3.3 required).\n");
+ if ((!gl->es && gl->glsl_version < 330) ||
+ (gl->es && gl->glsl_version < 300))
+ {
+ MP_WARN(p, "Disabling NNEDI3 (%s required).\n",
+ gl->es ? "OpenGL ES 3.0" : "OpenGL 3.3");
p->opts.prescale = 0;
}
}