From 294f05591ce168ef9b1cb7c27bbf90bc8615ddc8 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Tue, 2 Jul 2019 11:17:16 +0200 Subject: [PATCH] Fix array initialization on Intel. Thankfully NVIDIA also accepts this syntax. If AMD expects something else I'll be pissed. --- shaders/glsl/mfx_borderblur.fp | 2 +- shaders/glsl/mfx_bss_blur.fp | 6 +++--- shaders/glsl/mfx_bss_sharp.fp | 6 +++--- shaders/glsl/mfx_huesaturation.fp | 6 +++--- shaders/glsl/mfx_palette.fp | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/shaders/glsl/mfx_borderblur.fp b/shaders/glsl/mfx_borderblur.fp index 636612e..ab80c77 100644 --- a/shaders/glsl/mfx_borderblur.fp +++ b/shaders/glsl/mfx_borderblur.fp @@ -4,7 +4,7 @@ */ void main() { - float gauss4[4] = { 0.270682, 0.216745, 0.111281, 0.036633 }; + float gauss4[4] = float4[]( 0.270682, 0.216745, 0.111281, 0.036633 ); vec2 coord = TexCoord; vec4 res = texture(InputTexture,coord); vec2 bresl = textureSize(InputTexture,0); diff --git a/shaders/glsl/mfx_bss_blur.fp b/shaders/glsl/mfx_bss_blur.fp index 995417b..75309ae 100644 --- a/shaders/glsl/mfx_bss_blur.fp +++ b/shaders/glsl/mfx_bss_blur.fp @@ -6,8 +6,8 @@ void main() { vec2 coord = TexCoord; vec4 res = texture(InputTexture,coord); - vec2 ofs[16] = - { + vec2 ofs[16] = vec2[] + ( vec2(1.0,1.0), vec2(-1.0,-1.0), vec2(-1.0,1.0), vec2(1.0,-1.0), @@ -19,7 +19,7 @@ void main() vec2(1.41,1.41), vec2(-1.41,-1.41), vec2(-1.41,1.41), vec2(1.41,-1.41) - }; + ); vec2 bresl = textureSize(InputTexture,0); vec2 bof = (1.0/bresl)*bssblurradius; for ( int i=0; i<16; i++ ) res.rgb += texture(InputTexture,coord+ofs[i]*bof).rgb; diff --git a/shaders/glsl/mfx_bss_sharp.fp b/shaders/glsl/mfx_bss_sharp.fp index 1877786..210c0ec 100644 --- a/shaders/glsl/mfx_bss_sharp.fp +++ b/shaders/glsl/mfx_bss_sharp.fp @@ -6,14 +6,14 @@ void main() { vec2 coord = TexCoord; vec4 res = texture(InputTexture,coord); - vec2 ofs[8] = - { + vec2 ofs[8] = vec2[] + ( vec2(1.0,1.0), vec2(-1.0,-1.0), vec2(-1.0,1.0), vec2(1.0,-1.0), vec2(1.41,1.41), vec2(-1.41,-1.41), vec2(-1.41,1.41), vec2(1.41,-1.41) - }; + ); vec2 bresl = textureSize(InputTexture,0); vec2 bof = (1.0/bresl)*bsssharpradius; vec4 tcol = res; diff --git a/shaders/glsl/mfx_huesaturation.fp b/shaders/glsl/mfx_huesaturation.fp index d7f44cb..d90c2af 100644 --- a/shaders/glsl/mfx_huesaturation.fp +++ b/shaders/glsl/mfx_huesaturation.fp @@ -51,9 +51,9 @@ void main() int ph = 0, sh = 0; float pv = 0.0, sv = 0.0; bool usesh = false; - float hues[6] = {hshue_r,hshue_y,hshue_g,hshue_c,hshue_b,hshue_m}; - float sats[6] = {hssat_r,hssat_y,hssat_g,hssat_c,hssat_b,hssat_m}; - float vals[6] = {hsval_r,hsval_y,hsval_g,hsval_c,hsval_b,hsval_m}; + float hues[6] = float[](hshue_r,hshue_y,hshue_g,hshue_c,hshue_b,hshue_m); + float sats[6] = float[](hssat_r,hssat_y,hssat_g,hssat_c,hssat_b,hssat_m); + float vals[6] = float[](hsval_r,hsval_y,hsval_g,hsval_c,hsval_b,hsval_m); float v; for ( float h=0.0; h<7.0; h+=1.0 ) { diff --git a/shaders/glsl/mfx_palette.fp b/shaders/glsl/mfx_palette.fp index 536d414..d590b68 100644 --- a/shaders/glsl/mfx_palette.fp +++ b/shaders/glsl/mfx_palette.fp @@ -5,8 +5,8 @@ void main() { #define d(x) x/64.0 - float dither8[64] = - { + float dither8[64] = float[] + ( d( 0),d(48),d(12),d(60),d( 3),d(51),d(15),d(63), d(32),d(16),d(44),d(28),d(35),d(19),d(47),d(31), d( 8),d(56),d( 4),d(52),d(11),d(59),d( 7),d(55), @@ -15,7 +15,7 @@ void main() d(34),d(18),d(46),d(30),d(33),d(17),d(45),d(29), d(10),d(58),d( 6),d(54),d( 9),d(57),d( 5),d(53), d(42),d(26),d(38),d(22),d(41),d(25),d(37),d(21) - }; + ); #undef d vec2 coord = TexCoord; vec2 sfact = textureSize(InputTexture,0);