From f650e6b37407aaa3ef6c16e7daf6423103b94ddf Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 18 May 2013 05:41:27 +0200 Subject: Fix regression of commit b2802021acf8aa9b363ebef383c8dc8c8079ffa4 (Bug 711): varying in/out mapping is different in vertex/fragment shader! Vertex shader: varying -> out Fragemnt shader: varying -> in NV GLSL compiler ignored in/out direction, where ATI GLSL compiler failed (could not find gcu_Weight, due to dead code). --- src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl | 4 ---- .../jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp | 1 + .../jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp | 1 + .../jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp | 1 + .../jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp | 1 + src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp | 5 +++++ src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl | 4 ---- 7 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl index ced118c1c..108247c9c 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl @@ -2,10 +2,6 @@ #ifndef attributes_glsl #define attributes_glsl -#if __VERSION__ >= 130 - #define attribute in -#endif - // attribute vec3 gca_Vertices; attribute vec4 gca_Vertices; attribute vec2 gca_TexCoords; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp index ca03e605c..7643dab7b 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp @@ -5,6 +5,7 @@ // #if __VERSION__ >= 130 + #define varying in out vec4 mgl_FragColor; #else #define mgl_FragColor gl_FragColor diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp index b978b62d1..e12eef4b1 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp @@ -5,6 +5,7 @@ // #if __VERSION__ >= 130 + #define varying in out vec4 mgl_FragColor; #else #define mgl_FragColor gl_FragColor diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp index 9440f314c..06edbeaee 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp @@ -5,6 +5,7 @@ // #if __VERSION__ >= 130 + #define varying in out vec4 mgl_FragColor; #else #define mgl_FragColor gl_FragColor diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp index 0d878f2e4..07a005709 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp @@ -5,6 +5,7 @@ // #if __VERSION__ >= 130 + #define varying in out vec4 mgl_FragColor; #else #define mgl_FragColor gl_FragColor diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp index 64a6835ec..4b5c8b1e2 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp @@ -1,5 +1,10 @@ //Copyright 2010 JogAmp Community. All rights reserved. +#if __VERSION__ >= 130 + #define attribute in + #define varying out +#endif + #include uniforms.glsl #include attributes.glsl #include varyings.glsl diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl index 3b9a3b727..7a9bc5a07 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl +++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl @@ -2,10 +2,6 @@ #ifndef varyings_glsl #define varyings_glsl -#if __VERSION__ >= 130 - #define varying out -#endif - //varying vec4 gcv_FrontColor; varying vec2 gcv_TexCoord; -- cgit v1.2.3