summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-07-16 05:49:41 +0200
committerSven Gothel <[email protected]>2015-07-16 05:49:41 +0200
commit0b62f343f5c2ca74d10d86c435099ce0e0ab89db (patch)
treecd0e5ad3d0618e4a3d41bb7c9943eb489085b5ed /src/test/com/jogamp
parent7bcf094c8c1be5eeec60c52e09fd8f32f42cd654 (diff)
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])
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.fp8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/PointsShader.vp8
2 files changed, 14 insertions, 2 deletions
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)