From 65b5a376ed69b1cc7f46c731095d6cf692d58b8f Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Fri, 7 Jun 2013 19:16:27 +0000 Subject: [PATCH] gsdx-ogl-wnd: * Fix shader alpha issue. Hoppefully fix lots of glitches. * Use glBufferSubData to upload data into the constant buffer instead of map/unmap. More fps :) * Fix wrong api setup on EGL * Be more portable on glsl2h git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5650 96395faa-99c1-11dd-bbfe-3dabce05a288 --- linux_various/glsl2h.pl | 9 ++++++--- plugins/GSdx/CMakeLists.txt | 3 +-- plugins/GSdx/GLLoader.cpp | 2 ++ plugins/GSdx/GLLoader.h | 1 + plugins/GSdx/GSUniformBufferOGL.h | 8 ++++---- plugins/GSdx/GSWndEGL.cpp | 4 ++++ plugins/GSdx/res/tfx.glsl | 8 ++++---- plugins/GSdx/res/tfx.h | 8 ++++---- 8 files changed, 26 insertions(+), 17 deletions(-) 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"