summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-04 19:46:15 +0100
committerwm4 <wm4@nowhere>2013-11-04 19:46:15 +0100
commit383d8a8b60d0d289dd7cd8ad335ab90789c8fd2e (patch)
treefa49c7f4a51f969e08266dd406771f806c7d8b69 /video
parent78a9bc4a7deeacb40d755dc621560dc8e03ccd0a (diff)
downloadmpv-383d8a8b60d0d289dd7cd8ad335ab90789c8fd2e.tar.bz2
mpv-383d8a8b60d0d289dd7cd8ad335ab90789c8fd2e.tar.xz
vo_opengl: reserve 4 texture units for video instead of 3
Video has up to 4 textures, if you include obscure formats with alpha. This means alpha formats could always overwrite the first scaler texture, leading to corrupted video display. This problem was recently brought to light, when commit 571e697 started to explicitly unbind all 4 video textures, which broke rendering for non-alpha formats as well. Fix this by reserving the correct number of texture units.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index de4506c228..46fcdd9dcc 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -47,11 +47,11 @@ static const char vo_opengl_shaders[] =
// Pixel width of 1D lookup textures.
#define LOOKUP_TEXTURE_SIZE 256
-// Texture units 0-2 are used by the video, with unit 0 for free use.
-// Units 3-4 are used for scaler LUTs.
-#define TEXUNIT_SCALERS 3
-#define TEXUNIT_3DLUT 5
-#define TEXUNIT_DITHER 6
+// Texture units 0-3 are used by the video, with unit 0 for free use.
+// Units 4-5 are used for scaler LUTs.
+#define TEXUNIT_SCALERS 4
+#define TEXUNIT_3DLUT 6
+#define TEXUNIT_DITHER 7
// lscale/cscale arguments that map directly to shader filter routines.
// Note that the convolution filters are not included in this list.