summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-23 02:48:58 +0100
committerwm4 <wm4@nowhere>2014-12-23 02:48:58 +0100
commit04a4c9b53c14540afe5c1d644d856806070d3dc5 (patch)
tree92f5fc00d4e38025b6d4f21e3f3eb8f1451db5d8 /video/out
parenta8ffa0d0ebca8e502c4dafb6ea5011e17c978b1a (diff)
downloadmpv-04a4c9b53c14540afe5c1d644d856806070d3dc5.tar.bz2
mpv-04a4c9b53c14540afe5c1d644d856806070d3dc5.tar.xz
vo_opengl: don't allow setting 3D LUT if unsupported
The code was always uploading the 3D LUT (even of unused), as long as vo_opengl was setting a icc-profile. This could crash with GLES 2.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/gl_video.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index fdbb26a7eb..320924c927 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1473,6 +1473,9 @@ void gl_video_set_lut3d(struct gl_video *p, struct lut3d *lut3d)
return;
}
+ if (!(gl->mpgl_caps & MPGL_CAP_3D_TEX))
+ return;
+
if (!p->lut_3d_texture)
gl->GenTextures(1, &p->lut_3d_texture);
@@ -2124,6 +2127,7 @@ static void check_gl_features(struct gl_video *p)
bool have_fbo = gl->mpgl_caps & MPGL_CAP_FB;
bool have_srgb = gl->mpgl_caps & MPGL_CAP_SRGB_TEX;
bool have_arrays = gl->mpgl_caps & MPGL_CAP_1ST_CLASS_ARRAYS;
+ bool have_3d_tex = gl->mpgl_caps & MPGL_CAP_3D_TEX;
bool have_mix = gl->glsl_version >= 130;
char *disabled[10];
@@ -2157,7 +2161,7 @@ static void check_gl_features(struct gl_video *p)
// GLES3 doesn't provide filtered 16 bit integer textures
// GLES2 doesn't even provide 3D textures
- if (p->use_lut_3d && ((gl->es && gl->es < 300) || !have_float_tex)) {
+ if (p->use_lut_3d && !(have_3d_tex && have_float_tex)) {
p->use_lut_3d = false;
disabled[n_disabled++] = "color management (GLES unsupported)";
}