diff options
author | Sven Gothel <[email protected]> | 2011-04-28 08:15:11 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-04-28 08:15:11 +0200 |
commit | a34adb62a78c033a5caf27f3660b18bfc3e59edd (patch) | |
tree | 54e1c99cc2e54ab74b8691658ea2789b2cbc97a5 | |
parent | a66acbec16c339db66d5f9242f44b3b539808b99 (diff) |
Fix glsl unit tests: NV needs to have explicitly turn off vsync / Fix 'sed' havoc: gcu_ -> mgl_ uniform names
7 files changed, 45 insertions, 28 deletions
diff --git a/make/scripts/java-win64-dbg.bat b/make/scripts/java-win64-dbg.bat index 34a2fdc4c..a8a322449 100755 --- a/make/scripts/java-win64-dbg.bat +++ b/make/scripts/java-win64-dbg.bat @@ -19,7 +19,8 @@ REM set D_ARGS="-Djogl.debug.GraphicsConfiguration" REM set D_ARGS="-Djogamp.debug.JNILibLoader=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true" "-Djogl.debug.GLProfile=true"
REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.Lock" "-Djogamp.debug.Lock.TraceLock"
REM set D_ARGS="-Djogl.debug=all" "-Dnativewindow.debug=all"
-set D_ARGS="-Djogl.debug=all"
+REM set D_ARGS="-Djogl.debug=all"
+set D_ARGS="-Djogl.debug.GLDebugMessageHandler" "-Djogl.debug.DebugGL"
REM set D_ARGS="-Djogl.debug.GLContext" "-Dnewt.debug=all"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnativewindow.debug.TraceLock"
REM set D_ARGS="-Dnativewindow.debug.TraceLock"
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index 050d48368..dc06fd60f 100755 --- a/make/scripts/tests-x64.bat +++ b/make/scripts/tests-x64.bat @@ -57,9 +57,11 @@ REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.offscreen.TestO REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT01 -REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.demos.ui.UINewtDemo01 -scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo01 -REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo02 -REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo01 -REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo02 +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT +scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.graph.demos.ui.UINewtDemo01 +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo01 +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo02 +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo01 +REM scripts\java-win64.bat com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo02 diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index c433945dc..d2b787035 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -75,7 +75,8 @@ function jrun() { #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.GLDebugMessageHandler" #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL" #D_ARGS="-Djogl.debug.GLDebugMessageHandler -Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT" - #D_ARGS="-Djogl.debug.GLDebugMessageHandler -Djogl.debug.DebugGL" + #D_ARGS="-Djogl.debug.GLDebugMessageHandler" + #D_ARGS="-Djogl.debug.GLDebugMessageHandler -Djogl.debug.DebugGL -Djogl.debug.TraceGL" #D_ARGS="-Dnativewindow.debug.ToolkitLock.TraceLock" #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLCode" #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLState" @@ -206,12 +207,12 @@ function testawtmt() { #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLSimple01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState01NEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT $* #testnoawt com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 $* #testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT01 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.ui.UINewtDemo01 $* -testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo01 $* +#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo01 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo02 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo01 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo02 $* diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java index ce927ddc7..3e08f0e82 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java @@ -58,16 +58,16 @@ public class RedSquare0 implements GLEventListener { myShader = GLSLSimpleProgram.create(gl, RedSquareShader.VERTEX_SHADER_TEXT, RedSquareShader.FRAGMENT_SHADER_TEXT, true); gl.glUseProgram(myShader.getShaderProgram()); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); - // setup gcu_PMVMatrix + // setup mgl_PMVMatrix pmvMatrix = new PMVMatrix(); pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION); pmvMatrix.glLoadIdentity(); pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW); pmvMatrix.glLoadIdentity(); - mgl_PMVMatrix = gl.glGetUniformLocation(myShader.getShaderProgram(), "gcu_PMVMatrix"); + mgl_PMVMatrix = gl.glGetUniformLocation(myShader.getShaderProgram(), "mgl_PMVMatrix"); Assert.assertTrue(0 <= mgl_PMVMatrix); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); - pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); + pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); pmvMatrixUniform.setLocation(mgl_PMVMatrix); gl.glUniform(pmvMatrixUniform); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java index ca781f4ce..3ef62df31 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java @@ -38,7 +38,7 @@ public class RedSquareShader { " #define HIGHP\n" + "#endif\n" + "\n" + - "uniform MEDIUMP mat4 gcu_PMVMatrix[2];\n" + + "uniform MEDIUMP mat4 mgl_PMVMatrix[2];\n" + "attribute HIGHP vec4 mgl_Vertex;\n" + "attribute HIGHP vec4 mgl_Color;\n" + "varying HIGHP vec4 frontColor;\n" + @@ -46,7 +46,7 @@ public class RedSquareShader { "void main(void)\n" + "{\n" + " frontColor=mgl_Color;\n" + - " gl_Position = gcu_PMVMatrix[0] * gcu_PMVMatrix[1] * mgl_Vertex;\n" + + " gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex;\n" + "}\n" ; public static String FRAGMENT_SHADER_TEXT = 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 9bce30285..096496d87 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 @@ -62,6 +62,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase { GLSLMiscHelper.WindowContext winctx = GLSLMiscHelper.createWindow(GLProfile.getGL2ES2(), true); GLDrawable drawable = winctx.context.getGLDrawable(); GL2ES2 gl = winctx.context.getGL().getGL2ES2(); + System.err.println(winctx.context); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); @@ -116,15 +117,15 @@ public class TestGLSLShaderState01NEWT extends UITestCase { Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); Assert.assertEquals(st, ShaderState.getShaderState(gl)); - // setup gcu_PMVMatrix + // setup mgl_PMVMatrix PMVMatrix pmvMatrix = new PMVMatrix(); - GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); + GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); st.ownUniform(pmvMatrixUniform); st.uniform(gl, pmvMatrixUniform); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); - Assert.assertEquals(pmvMatrixUniform, st.getUniform("gcu_PMVMatrix")); + Assert.assertEquals(pmvMatrixUniform, st.getUniform("mgl_PMVMatrix")); // Allocate Vertex Array1 GLArrayDataServer vertices1 = GLSLMiscHelper.createRSVertices1(gl, st); @@ -153,6 +154,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase { pmvMatrix.glLoadIdentity(); pmvMatrix.glTranslatef(0, 0, -10); st.uniform(gl, pmvMatrixUniform); + gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); // display #1 vertices0 / colors0 (post-disable) @@ -184,6 +186,8 @@ public class TestGLSLShaderState01NEWT extends UITestCase { GLSLMiscHelper.WindowContext winctx = GLSLMiscHelper.createWindow(GLProfile.getGL2ES2(), false); GLDrawable drawable = winctx.context.getGLDrawable(); GL2ES2 gl = winctx.context.getGL().getGL2ES2(); + System.err.println(winctx.context); + gl.setSwapInterval(0); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); @@ -205,9 +209,9 @@ public class TestGLSLShaderState01NEWT extends UITestCase { st.attachShaderProgram(gl, sp); st.useProgram(gl, true); - // setup gcu_PMVMatrix + // setup mgl_PMVMatrix PMVMatrix pmvMatrix = new PMVMatrix(); - GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); + GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); st.ownUniform(pmvMatrixUniform); st.uniform(gl, pmvMatrixUniform); @@ -233,6 +237,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase { pmvMatrix.glLoadIdentity(); pmvMatrix.glTranslatef(0, 0, -10); st.uniform(gl, pmvMatrixUniform); + gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); long t0 = System.currentTimeMillis(); int frames; @@ -267,7 +272,9 @@ public class TestGLSLShaderState01NEWT extends UITestCase { GLSLMiscHelper.WindowContext winctx = GLSLMiscHelper.createWindow(GLProfile.getGL2ES2(), false); GLDrawable drawable = winctx.context.getGLDrawable(); GL2ES2 gl = winctx.context.getGL().getGL2ES2(); - + System.err.println(winctx.context); + gl.setSwapInterval(0); + Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); // test code .. @@ -288,9 +295,9 @@ public class TestGLSLShaderState01NEWT extends UITestCase { st.attachShaderProgram(gl, sp); st.useProgram(gl, true); - // setup gcu_PMVMatrix + // setup mgl_PMVMatrix PMVMatrix pmvMatrix = new PMVMatrix(); - GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); + GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); st.ownUniform(pmvMatrixUniform); st.uniform(gl, pmvMatrixUniform); @@ -326,6 +333,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase { pmvMatrix.glLoadIdentity(); pmvMatrix.glTranslatef(0, 0, -10); st.uniform(gl, pmvMatrixUniform); + gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); // validation .. GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0); 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 7e8fb7c3d..1c0f028a2 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 @@ -73,6 +73,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase { GLSLMiscHelper.WindowContext winctx = GLSLMiscHelper.createWindow(GLProfile.getGL2ES2(), true); GLDrawable drawable = winctx.context.getGLDrawable(); GL2ES2 gl = winctx.context.getGL().getGL2ES2(); + System.err.println(winctx.context); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); @@ -148,15 +149,15 @@ public class TestGLSLShaderState02NEWT extends UITestCase { Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); Assert.assertEquals(st, ShaderState.getShaderState(gl)); - // setup gcu_PMVMatrix + // setup mgl_PMVMatrix PMVMatrix pmvMatrix = new PMVMatrix(); - GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); + GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); st.ownUniform(pmvMatrixUniform); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); st.uniform(gl, pmvMatrixUniform); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); - Assert.assertEquals(pmvMatrixUniform, st.getUniform("gcu_PMVMatrix")); + Assert.assertEquals(pmvMatrixUniform, st.getUniform("mgl_PMVMatrix")); // Allocate Vertex Array1 GLArrayDataServer vertices1 = GLSLMiscHelper.createRSVertices1(gl, st); @@ -183,6 +184,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase { pmvMatrix.glLoadIdentity(); pmvMatrix.glTranslatef(0, 0, -10); st.uniform(gl, pmvMatrixUniform); + gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); // display #1 vertices0 / colors0 (post-disable) @@ -229,6 +231,8 @@ public class TestGLSLShaderState02NEWT extends UITestCase { GLSLMiscHelper.WindowContext winctx = GLSLMiscHelper.createWindow(GLProfile.getGL2ES2(), false); GLDrawable drawable = winctx.context.getGLDrawable(); GL2ES2 gl = winctx.context.getGL().getGL2ES2(); + System.err.println(winctx.context); + gl.setSwapInterval(0); Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError()); @@ -260,9 +264,9 @@ public class TestGLSLShaderState02NEWT extends UITestCase { st.attachShaderProgram(gl, sp0); st.useProgram(gl, true); - // setup gcu_PMVMatrix + // setup mgl_PMVMatrix PMVMatrix pmvMatrix = new PMVMatrix(); - GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); + GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); st.ownUniform(pmvMatrixUniform); st.uniform(gl, pmvMatrixUniform); @@ -298,6 +302,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase { pmvMatrix.glLoadIdentity(); pmvMatrix.glTranslatef(0, 0, -10); st.uniform(gl, pmvMatrixUniform); + gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); // validation .. st.attachShaderProgram(gl, sp0); @@ -323,7 +328,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase { // SP0 st.attachShaderProgram(gl, sp0); GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true); - GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true); + GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true); // SP1 st.attachShaderProgram(gl, sp1); GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true); |