summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java31
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java14
2 files changed, 28 insertions, 17 deletions
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 1cd49a41f..484734b28 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
@@ -173,11 +173,11 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
NEWTGLContext.destroyWindow(winctx);
}
- @Test
+ @Test(timeout=120000)
public void testShaderState00PerformanceSingleKeepEnabled() throws InterruptedException {
testShaderState00PerformanceSingle(false);
}
- @Test
+ @Test(timeout=120000)
public void testShaderState00PerformanceSingleToggleEnable() throws InterruptedException {
testShaderState00PerformanceSingle(true);
}
@@ -240,17 +240,20 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
st.uniform(gl, pmvMatrixUniform);
gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
- long t0 = System.currentTimeMillis();
- int frames;
+ gl.setSwapInterval(0);
// validation ..
GLSLMiscHelper.displayVCArrays(drawable, gl, st, toggleEnable, vertices0, colors0, toggleEnable, 1, 0);
// warmup ..
- for(frames=0; frames<GLSLMiscHelper.frames_warmup; frames++) {
+ for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames++) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, toggleEnable, vertices0, colors0, toggleEnable);
- }
+ }
+
// measure ..
+ long t0 = System.currentTimeMillis();
+ int frames;
+
for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames++) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, toggleEnable, vertices0, colors0, toggleEnable);
}
@@ -267,7 +270,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
NEWTGLContext.destroyWindow(winctx);
}
- @Test
+ @Test(timeout=120000)
public void testShaderState01PerformanceDouble() throws InterruptedException {
// preset ..
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(GLProfile.getGL2ES2(), 480, 480, false);
@@ -336,18 +339,22 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
st.uniform(gl, pmvMatrixUniform);
gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+ gl.setSwapInterval(0);
+
// validation ..
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, 0);
-
- long t0 = System.currentTimeMillis();
- int frames;
+
// warmup ..
- for(frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
+ for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
- }
+ }
+
// measure ..
+ long t0 = System.currentTimeMillis();
+ int frames;
+
for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames+=2) {
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
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 38fbabf72..2ecc3b30d 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
@@ -229,7 +229,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
NEWTGLContext.destroyWindow(winctx);
}
- @Test
+ @Test(timeout=120000)
public void testShaderState01PerformanceDouble() throws InterruptedException {
// preset ..
final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(GLProfile.getGL2ES2(), 480, 480, false);
@@ -308,6 +308,8 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
st.uniform(gl, pmvMatrixUniform);
gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+ gl.setSwapInterval(0);
+
// validation ..
st.attachShaderProgram(gl, sp0);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
@@ -316,18 +318,20 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, 0);
- long t0 = System.currentTimeMillis();
- int frames;
// warmup ..
- for(frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
+ for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
// SP0
st.attachShaderProgram(gl, sp0);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
// SP1
st.attachShaderProgram(gl, sp1);
GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
- }
+ }
+
// measure ..
+ long t0 = System.currentTimeMillis();
+ int frames;
+
for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames+=4) {
// SP0
st.attachShaderProgram(gl, sp0);