]> git.sesse.net Git - movit/commitdiff
Fix GLSL compilation errors on some drivers.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 6 Oct 2015 18:08:05 +0000 (20:08 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 6 Oct 2015 18:08:05 +0000 (20:08 +0200)
Evidently #if FOO is illegal in GLSL if FOO is not defined,
unlike in C++. Reported by Dan Dennedy.

footer.frag
ycbcr_conversion_effect.frag

index 04c8e7c0eb370f226181cd81b4712a718ecdec47..4976136abf07491c6e586fa6a9380d5878248f48 100644 (file)
@@ -1,3 +1,18 @@
+// GLSL is pickier than the C++ preprocessor in if-testing for undefined
+// tokens; do some fixups here to keep it happy.
+
+#ifndef YCBCR_OUTPUT_PLANAR
+#define YCBCR_OUTPUT_PLANAR 0
+#endif
+
+#ifndef YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
+#define YCBCR_OUTPUT_SPLIT_Y_AND_CBCR 0
+#endif
+
+#ifndef YCBCR_ALSO_OUTPUT_RGBA
+#define YCBCR_ALSO_OUTPUT_RGBA 0
+#endif
+
 #if YCBCR_OUTPUT_PLANAR
 out vec4 Y;
 out vec4 Cb;
 #if YCBCR_OUTPUT_PLANAR
 out vec4 Y;
 out vec4 Cb;
index ea5de45f14d99a984e22ec564c2f6a855cf86d1c..4ef38016a7240e88023e32b7b5e0a8764b372526 100644 (file)
@@ -1,3 +1,8 @@
+// See footer.frag for details about this if statement.
+#ifndef YCBCR_ALSO_OUTPUT_RGBA
+#define YCBCR_ALSO_OUTPUT_RGBA 0
+#endif
+
 uniform sampler2D PREFIX(tex_y);
 uniform sampler2D PREFIX(tex_cb);
 uniform sampler2D PREFIX(tex_cr);
 uniform sampler2D PREFIX(tex_y);
 uniform sampler2D PREFIX(tex_cb);
 uniform sampler2D PREFIX(tex_cr);