From eb9be6de78c8b278068032c48ddc0a8c26c2e856 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 31 Jul 2023 17:31:46 +0530 Subject: [PATCH] glcolorconvert: Fix syntax for GLSL shaders Shader compilation was failing on macOS: gstglslstage.c:519:_compile_shader: fragment shader compilation failed: ERROR: 0:10: 'input_swizzle' : syntax error: Array size must appear after variable name Co-authored-by: Matthew Waters Part-of: --- .../gst-libs/gst/gl/gstglcolorconvert.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c index 4dc46266be..e8e7f735a1 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c @@ -142,8 +142,8 @@ static const gfloat from_rgb_bt709_vcoeff[] = {0.440654f, -0.400285f, -0.040370f "uniform float height;\n" \ "uniform float poffset_x;\n" \ "uniform float poffset_y;\n" \ - "uniform int[4] input_swizzle;\n" \ - "uniform int[4] output_swizzle;\n" + "uniform int input_swizzle[4];\n" \ + "uniform int output_swizzle[4];\n" #define MAX_FUNCTIONS 4 @@ -178,22 +178,22 @@ static const char glsl_func_rgb_to_yuv[] = \ " return yuv;\n" \ "}\n"; -static const char glsl_func_swizzle[] = "vec4 swizzle(vec4 texel, int[4] components) {\n" \ +static const char glsl_func_swizzle[] = "vec4 swizzle(vec4 texel, int components[4]) {\n" \ " return vec4(texel[components[0]], texel[components[1]], texel[components[2]], texel[components[3]]);\n" \ "}\n" \ - "vec3 swizzle(vec3 texel, int[3] components) {\n" \ + "vec3 swizzle(vec3 texel, int components[3]) {\n" \ " return vec3(texel[components[0]], texel[components[1]], texel[components[2]]);\n" \ "}\n" \ - "vec2 swizzle(vec2 texel, int[2] components) {\n" \ + "vec2 swizzle(vec2 texel, int components[2]) {\n" \ " return vec2(texel[components[0]], texel[components[1]]);\n" \ "}\n" \ - "vec2 swizzle2(vec3 texel, int[3] components) {\n" \ + "vec2 swizzle2(vec3 texel, int components[3]) {\n" \ " return vec2(texel[components[0]], texel[components[1]]);\n" \ "}\n" \ - "vec2 swizzle2(vec4 texel, int[4] components) {\n" \ + "vec2 swizzle2(vec4 texel, int components[4]) {\n" \ " return vec2(texel[components[0]], texel[components[1]]);\n" \ "}\n" \ - "vec3 swizzle3(vec4 texel, int[4] components) {\n" \ + "vec3 swizzle3(vec4 texel, int components[4]) {\n" \ " return vec3(texel[components[0]], texel[components[1]], texel[components[2]]);\n" \ "}\n";