From 8ccea1f0ff48a39e806839330ebeb5369bc0c79a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 24 Feb 2020 05:35:53 +0100 Subject: TestSharedContextVBOES2*3: Properly validateBuffers and setSyncObjects(..) in concurrent async test case. --- .../test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java | 5 +++++ .../test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java | 5 +++++ .../test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java | 9 +++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java index 16c53564c..94a58e366 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java @@ -108,6 +108,8 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { final Frame f1 = new Frame(); final Animator animator = new Animator(); final GearsES2 g1 = new GearsES2(0); + // g1.setUseMappedBuffers(useMappedBuffers); + g1.setValidateBuffers(true); final GLCanvas c1 = createGLCanvas(f1, 0, 0, g1); animator.add(c1); @@ -244,6 +246,9 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { final Frame f1 = new Frame(); final Animator a1 = new Animator(); final GearsES2 g1 = new GearsES2(0); + g1.setSyncObjects(g1); // this is master, since rendered we must use it as sync + // g1.setUseMappedBuffers(useMappedBuffers); + g1.setValidateBuffers(true); final GLCanvas c1 = createGLCanvas(f1, 0, 0, g1); a1.add(c1); a1.start(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java index f6eb479fa..5623fc2fa 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java @@ -98,6 +98,8 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { final Frame f1 = new Frame(); final Animator animator = new Animator(); final GearsES2 g1 = new GearsES2(0); + // g1.setUseMappedBuffers(useMappedBuffers); + g1.setValidateBuffers(true); final GLJPanel c1 = createGLJPanel(f1, 0, 0, g1); animator.add(c1); @@ -196,6 +198,9 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { final Frame f1 = new Frame(); final Animator a1 = new Animator(); final GearsES2 g1 = new GearsES2(0); + g1.setSyncObjects(g1); // this is master, since rendered we must use it as sync + // g1.setUseMappedBuffers(useMappedBuffers); + g1.setValidateBuffers(true); final GLJPanel c1 = createGLJPanel(f1, 0, 0, g1); a1.add(c1); a1.start(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java index 4e2457181..332d799b2 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java @@ -180,6 +180,8 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { public void test01SyncedOneAnimator() throws InterruptedException { final Animator animator = new Animator(); final GearsES2 g1 = new GearsES2(0); + // g1.setUseMappedBuffers(useMappedBuffers); + g1.setValidateBuffers(true); final GLCanvas c1 = createGLCanvas(shell1, composite1, 0, 0, g1); animator.add(c1); @@ -208,7 +210,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { public void run() { if( !display.readAndDispatch() ) { try { - Thread.sleep(10); + Thread.sleep(200); } catch (final InterruptedException e) { } } } }; @@ -268,6 +270,9 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { public void test02AsyncEachAnimator() throws InterruptedException { final Animator a1 = new Animator(); final GearsES2 g1 = new GearsES2(0); + g1.setSyncObjects(g1); // this is master, since rendered we must use it as sync + // g1.setUseMappedBuffers(useMappedBuffers); + g1.setValidateBuffers(true); final GLCanvas c1 = createGLCanvas(shell1, composite1, 0, 0, g1); a1.add(c1); display.syncExec(new Runnable() { @@ -280,7 +285,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { public void run() { if( !display.readAndDispatch() ) { try { - Thread.sleep(10); + Thread.sleep(200); } catch (final InterruptedException e) { } } } }; -- cgit v1.2.3