From 04a4c9b53c14540afe5c1d644d856806070d3dc5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 23 Dec 2014 02:48:58 +0100 Subject: 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. --- video/out/gl_video.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video') 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)"; } -- cgit v1.2.3