From 6936c2e99ab767a96dce0e1fe386481611ea2a18 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 29 Oct 2012 12:10:08 +0100 Subject: Fix GLSL unit tests - Add GLSL version customization, fix one wrong 'HIGHP' usage --- .../opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp | 2 +- .../opengl/test/junit/jogl/demos/es2/shader/RedSquareShader2.fp | 2 +- .../opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java | 6 ++++-- .../opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java | 9 ++++++--- .../com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java | 6 ++++-- 5 files changed, 16 insertions(+), 9 deletions(-) (limited to 'src/test/com/jogamp') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp index 9a31e2bb5..60b92401e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.fp @@ -7,7 +7,7 @@ #define mgl_FragColor gl_FragColor #endif -varying vec4 frontColor; +varying vec4 frontColor; void main (void) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader2.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader2.fp index 40a21a1a3..25a2df2d7 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader2.fp +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader2.fp @@ -7,7 +7,7 @@ #define mgl_FragColor gl_FragColor #endif -varying HIGHP vec4 frontColor; +varying vec4 frontColor; void main (void) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java index 987dedc65..e64c3de19 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java @@ -74,9 +74,11 @@ public class TestGLSLShaderState01NEWT extends UITestCase { final ShaderState st = new ShaderState(); final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader", - "shader/bin", "RedSquareShader", false); + "shader/bin", "RedSquareShader", true); final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader", - "shader/bin", "RedSquareShader", false); + "shader/bin", "RedSquareShader", true); + rsVp.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_vp); + rsFp.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_fp); final ShaderProgram sp = new ShaderProgram(); Assert.assertTrue(0>sp.program()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java index 91dcfc3c3..69736f33b 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java @@ -81,11 +81,14 @@ public class TestGLSLShaderState02NEWT extends UITestCase { final ShaderState st = new ShaderState(); final ShaderCode rsVp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader", - "shader/bin", "RedSquareShader", false); + "shader/bin", "RedSquareShader", true); final ShaderCode rsFp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader", - "shader/bin", "RedSquareShader", false); + "shader/bin", "RedSquareShader", true); final ShaderCode rsFp1 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader", - "shader/bin", "RedSquareShader2", false); + "shader/bin", "RedSquareShader2", true); + rsVp0.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_vp); + rsFp0.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_fp); + rsFp1.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_fp); final ShaderProgram sp1 = new ShaderProgram(); sp1.add(rsVp0); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java index 87d317037..a7fe9a064 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java @@ -74,9 +74,11 @@ public class TestRulerNEWT01 extends UITestCase { final ShaderState st = new ShaderState(); final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader", - "shader/bin", "default", false); + "shader/bin", "default", true); final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader", - "shader/bin", "ruler", false); + "shader/bin", "ruler", true); + vp0.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_vp); + fp0.defaultShaderCustomization(gl, true, ShaderCode.es2_default_precision_fp); final ShaderProgram sp0 = new ShaderProgram(); sp0.add(gl, vp0, System.err); -- cgit v1.2.3