From 0b62f343f5c2ca74d10d86c435099ce0e0ab89db Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 16 Jul 2015 05:49:41 +0200 Subject: PointShader: Use same precision for shared uniform in vertex- and fragment shader On GNU/Linux NVidia 340.76 the test TestGLPointsNEWT failed otherwise: error: precision mismatch between shaders for uniform (named mgl_PointParams[0]) error: precision mismatch between shaders for uniform (named mgl_PointParams[1]) --- .../opengl/test/junit/jogl/demos/es2/shader/PointsShader.fp | 8 +++++++- .../opengl/test/junit/jogl/demos/es2/shader/PointsShader.vp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.fp index 3210762b1..82268958f 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.fp +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.fp @@ -6,9 +6,15 @@ #define mgl_FragColor gl_FragColor #endif +#ifdef GL_ES + #define MEDIUMP mediump +#else + #define MEDIUMP +#endif + // [0].rgba: 0, smooth, attnMinSz, attnMaxSz // [1].rgba: attnCoeff(3), attnFadeTs -uniform vec4 mgl_PointParams[2]; +uniform MEDIUMP vec4 mgl_PointParams[2]; #define pointSmooth (mgl_PointParams[0].g) diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.vp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.vp index 4fa49b901..562874785 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.vp +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.vp @@ -4,12 +4,18 @@ #define varying out #endif +#ifdef GL_ES + #define MEDIUMP mediump +#else + #define MEDIUMP +#endif + uniform vec4 mgl_ColorStatic; uniform mat4 mgl_PMVMatrix[4]; // P, Mv, Mvi and Mvit (transpose(inverse(ModelView)) == normalMatrix) // [0].rgba: 0, smooth, attnMinSz, attnMaxSz // [1].rgba: attnCoeff(3), attnFadeTs -uniform vec4 mgl_PointParams[2]; +uniform MEDIUMP vec4 mgl_PointParams[2]; #define pointSmooth (mgl_PointParams[0].g) #define pointSizeMin (mgl_PointParams[0].b) -- cgit v1.2.3