summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r--video/out/gl_video.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 204b8a8c70..56a56cb1ae 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1214,12 +1214,17 @@ void gl_video_set_lut3d(struct gl_video *p, struct lut3d *lut3d)
{
GL *gl = p->gl;
- assert(!p->lut_3d_texture);
-
- if (!lut3d)
+ if (!lut3d) {
+ if (p->use_lut_3d) {
+ p->use_lut_3d = false;
+ reinit_rendering(p);
+ }
return;
+ }
+
+ if (!p->lut_3d_texture)
+ gl->GenTextures(1, &p->lut_3d_texture);
- gl->GenTextures(1, &p->lut_3d_texture);
gl->ActiveTexture(GL_TEXTURE0 + TEXUNIT_3DLUT);
gl->BindTexture(GL_TEXTURE_3D, p->lut_3d_texture);
gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4);
@@ -1237,6 +1242,8 @@ void gl_video_set_lut3d(struct gl_video *p, struct lut3d *lut3d)
check_gl_features(p);
debug_check_gl(p, "after 3d lut creation");
+
+ reinit_rendering(p);
}
static void set_image_textures(struct gl_video *p, struct video_image *vimg,