From 8ccea1f0ff48a39e806839330ebeb5369bc0c79a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 24 Feb 2020 05:35:53 +0100 Subject: [PATCH] TestSharedContextVBOES2*3: Properly validateBuffers and setSyncObjects(..) in concurrent async test case. --- .../junit/jogl/acore/TestSharedContextVBOES2AWT3.java | 5 +++++ .../junit/jogl/acore/TestSharedContextVBOES2AWT3b.java | 5 +++++ .../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 16c53564ce..94a58e3666 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 void syncedOneAnimator(final boolean destroyCleanOrder) throws Interrupte 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 void asyncEachOneAnimator(final boolean destroyCleanOrder) throws Interru 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 f6eb479fa9..5623fc2fa1 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 void test01SyncedOneAnimator() throws InterruptedException, InvocationTar 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 void test02AsyncEachAnimator() throws InterruptedException, InvocationTar 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 4e2457181b..332d799b26 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 void run() { 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 void run() { public void run() { if( !display.readAndDispatch() ) { try { - Thread.sleep(10); + Thread.sleep(200); } catch (final InterruptedException e) { } } } }; @@ -268,6 +270,9 @@ public void run() { 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 void run() { public void run() { if( !display.readAndDispatch() ) { try { - Thread.sleep(10); + Thread.sleep(200); } catch (final InterruptedException e) { } } } };