diff --git a/linux_various/glsl2h.pl b/linux_various/glsl2h.pl index 15aabc28e0..36c3abc73a 100755 --- a/linux_various/glsl2h.pl +++ b/linux_various/glsl2h.pl @@ -2,9 +2,10 @@ use strict; use warnings; +use File::Spec; my @res = qw/convert interlace merge shadeboost tfx/; -my $path = "plugins/GSdx/res"; +my $path = File::Spec->catdir("plugins", "GSdx", "res"); foreach my $r (@res) { glsl2h($path, $r); @@ -14,8 +15,10 @@ sub glsl2h { my $path = shift; my $glsl = shift; - open(my $GLSL, "<$path/${glsl}.glsl"); - open(my $H, ">$path/${glsl}.h"); + my $in = File::Spec->catfile($path, "${glsl}.glsl"); + my $out = File::Spec->catfile($path, "${glsl}.h"); + open(my $GLSL, "<$in") or die; + open(my $H, ">$out") or die; my $header = <= 0.5 ? TA.y : ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f; + bvec3 rgb_check = notEqual( c[i].rgb, vec3(0.0f, 0.0f, 0.0f) ); + c[i].a = c[i].a >= 0.5 ? TA.y : ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f; } } diff --git a/plugins/GSdx/res/tfx.h b/plugins/GSdx/res/tfx.h index c6f0216259..7404d405b9 100644 --- a/plugins/GSdx/res/tfx.h +++ b/plugins/GSdx/res/tfx.h @@ -554,14 +554,14 @@ static const char* tfx_glsl = " if((PS_FMT & ~FMT_PAL) == FMT_24)\n" " {\n" " // FIXME GLSL any only support bvec so try to mix it with notEqual\n" - " bvec3 rgb_check = notEqual( t.rgb, vec3(0.0f, 0.0f, 0.0f) );\n" - " t.a = ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f;\n" + " bvec3 rgb_check = notEqual( c[i].rgb, vec3(0.0f, 0.0f, 0.0f) );\n" + " c[i].a = ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f;\n" " }\n" " else if((PS_FMT & ~FMT_PAL) == FMT_16)\n" " {\n" " // FIXME GLSL any only support bvec so try to mix it with notEqual\n" - " bvec3 rgb_check = notEqual( t.rgb, vec3(0.0f, 0.0f, 0.0f) );\n" - " t.a = t.a >= 0.5 ? TA.y : ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f;\n" + " bvec3 rgb_check = notEqual( c[i].rgb, vec3(0.0f, 0.0f, 0.0f) );\n" + " c[i].a = c[i].a >= 0.5 ? TA.y : ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f;\n" " }\n" " }\n" "\n"