diff options
Diffstat (limited to 'make')
-rw-r--r-- | make/config/jogl/gl-common.cfg | 1 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java | 138 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 59 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 59 | ||||
-rwxr-xr-x | make/scripts/java-win64-dbg.bat | 2 | ||||
-rwxr-xr-x | make/scripts/tests-x64.bat | 5 | ||||
-rwxr-xr-x | make/scripts/tests.sh | 13 |
7 files changed, 113 insertions, 164 deletions
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index f8f4f07f5..a57400217 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -515,6 +515,7 @@ JavaPrologue glBegin inBeginEndPair = true; JavaEpilogue glEnd inBeginEndPair = false; JavaEpilogue glBindBuffer bufferStateTracker.setBoundBufferObject({0}, {1}); JavaEpilogue glBindBufferARB bufferStateTracker.setBoundBufferObject({0}, {1}); +JavaEpilogue glBindVertexArray bufferStateTracker.setBoundBufferObject(GL2GL3.GL_VERTEX_ARRAY_BINDING, {0}); JavaEpilogue glPushClientAttrib bufferStateTracker.clearBufferObjectState(); JavaEpilogue glPushClientAttrib glStateTracker.pushAttrib(mask); JavaEpilogue glPopClientAttrib bufferStateTracker.clearBufferObjectState(); diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java index e079a1a24..bfe2759c0 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java @@ -51,133 +51,135 @@ private boolean haveEXTPixelBufferObject; private boolean haveGL15; private boolean haveGL21; private boolean haveARBVertexBufferObject; +private boolean haveARBVertexArrayObject; private final void initBufferObjectExtensionChecks() { - if (bufferObjectExtensionsInitialized) + if ( bufferObjectExtensionsInitialized ) { return; + } bufferObjectExtensionsInitialized = true; haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); + haveARBVertexArrayObject = _context.getGLVersionNumber().compareTo(GLContext.Version30) >= 0 || + isExtensionAvailable("GL_ARB_vertex_array_object"); } -private final boolean checkBufferObject(boolean extension1, - boolean extension2, - boolean extension3, +private final boolean checkBufferObject(boolean extensionAvail, + boolean allowVAO, boolean enabled, int state, String kind, boolean throwException) { - if (inBeginEndPair) { + if ( inBeginEndPair ) { throw new GLException("May not call this between glBegin and glEnd"); } - boolean avail = (extension1 || extension2 || extension3); - if (!avail) { - if (!enabled) + if ( !extensionAvail ) { + if ( !enabled ) { return true; + } if(throwException) { throw new GLException("Required extensions not available to call this function"); } return false; } int buffer = bufferStateTracker.getBoundBufferObject(state, this); - if (enabled) { - if (buffer == 0) { - if(throwException) { - throw new GLException(kind + " must be enabled to call this method"); - } - return false; + if ( enabled ) { + if ( 0 != buffer ) { + return true; + } + if ( allowVAO ) { + buffer = bufferStateTracker.getBoundBufferObject(GL2GL3.GL_VERTEX_ARRAY_BINDING, this); + if( 0 != buffer && !_context.isDefaultVAO(buffer) ) { + return true; + } + } + if ( throwException ) { + throw new GLException(kind + " must be enabled to call this method"); } + return false; } else { - if (buffer != 0) { - if(throwException) { - throw new GLException(kind + " must be disabled to call this method"); - } - return false; + if ( 0 == buffer ) { + return true; } + if ( throwException ) { + throw new GLException(kind + " must be disabled to call this method"); + } + return false; } - return true; } private final boolean checkArrayVBODisabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - false, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); + return checkBufferObject(haveGL15 || haveARBVertexBufferObject, + haveARBVertexArrayObject, // allowVAO + false, // enable + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); } private final boolean checkArrayVBOEnabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - true, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); + return checkBufferObject(haveGL15 || haveARBVertexBufferObject, + haveARBVertexArrayObject, // allowVAO + true, // enable + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); } private final boolean checkElementVBODisabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - false, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); + return checkBufferObject(haveGL15 || haveARBVertexBufferObject, + haveARBVertexArrayObject, // allowVAO + false, // enable + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); } private final boolean checkElementVBOEnabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - true, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); + return checkBufferObject(haveGL15 || haveARBVertexBufferObject, + haveARBVertexArrayObject, // allowVAO + true, // enable + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); } private final boolean checkUnpackPBODisabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - false, - GL2.GL_PIXEL_UNPACK_BUFFER, - "unpack pixel_buffer_object", throwException); + return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, + false, // allowVAO + false, // enable + GL2.GL_PIXEL_UNPACK_BUFFER, + "unpack pixel_buffer_object", throwException); } private final boolean checkUnpackPBOEnabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - true, - GL2.GL_PIXEL_UNPACK_BUFFER, - "unpack pixel_buffer_object", throwException); + return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, + false, // allowVAO + true, // enable + GL2.GL_PIXEL_UNPACK_BUFFER, + "unpack pixel_buffer_object", throwException); } private final boolean checkPackPBODisabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - false, - GL2.GL_PIXEL_PACK_BUFFER, - "pack pixel_buffer_object", throwException); + return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, + false, // allowVAO + false, // enable + GL2.GL_PIXEL_PACK_BUFFER, + "pack pixel_buffer_object", throwException); } private final boolean checkPackPBOEnabled(boolean throwException) { initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - true, - GL2.GL_PIXEL_PACK_BUFFER, - "pack pixel_buffer_object", throwException); + return checkBufferObject(haveGL21 || haveARBPixelBufferObject || haveEXTPixelBufferObject, + false, // allowVAO + true, // enable + GL2.GL_PIXEL_PACK_BUFFER, + "pack pixel_buffer_object", throwException); } @Override diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index 68eadc683..70425689a 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -140,38 +140,19 @@ private final GLBufferSizeTracker bufferSizeTracker; private final GLBufferStateTracker bufferStateTracker; private final GLStateTracker glStateTracker; -private boolean bufferObjectExtensionsInitialized = false; -private boolean haveOESFramebufferObject; - -private final void initBufferObjectExtensionChecks() { - if (bufferObjectExtensionsInitialized) - return; - bufferObjectExtensionsInitialized = true; - haveOESFramebufferObject = isExtensionAvailable("GL_OES_framebuffer_object"); -} - -private final boolean checkBufferObject(boolean avail, - boolean enabled, +private final boolean checkBufferObject(boolean enabled, int state, String kind, boolean throwException) { - if (!avail) { - if (!enabled) - return true; - if(throwException) { - throw new GLException("Required extensions not available to call this function"); - } - return false; - } - int buffer = bufferStateTracker.getBoundBufferObject(state, this); + final int buffer = bufferStateTracker.getBoundBufferObject(state, this); if (enabled) { - if (buffer == 0) { + if (0 == buffer) { if(throwException) { throw new GLException(kind + " must be enabled to call this method"); } return false; } } else { - if (buffer != 0) { + if (0 != buffer) { if(throwException) { throw new GLException(kind + " must be disabled to call this method"); } @@ -182,35 +163,27 @@ private final boolean checkBufferObject(boolean avail, } private final boolean checkArrayVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - false, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); + return checkBufferObject(false, // enabled + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); } private final boolean checkArrayVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - true, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); + return checkBufferObject(true, // enabled + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); } private final boolean checkElementVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - false, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); + return checkBufferObject(false, // enabled + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); } private final boolean checkElementVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - true, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); + return checkBufferObject(true, // enabled + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); } private final boolean checkUnpackPBODisabled(boolean throwException) { diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index 760287364..37f3f33aa 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -140,38 +140,19 @@ private final GLBufferSizeTracker bufferSizeTracker; private final GLBufferStateTracker bufferStateTracker; private final GLStateTracker glStateTracker; -private boolean bufferObjectExtensionsInitialized = false; -private boolean haveOESFramebufferObject; - -private final void initBufferObjectExtensionChecks() { - if (bufferObjectExtensionsInitialized) - return; - bufferObjectExtensionsInitialized = true; - haveOESFramebufferObject = isExtensionAvailable("GL_OES_framebuffer_object"); -} - -private final boolean checkBufferObject(boolean avail, - boolean enabled, +private final boolean checkBufferObject(boolean enabled, int state, String kind, boolean throwException) { - if (!avail) { - if (!enabled) - return true; - if(throwException) { - throw new GLException("Required extensions not available to call this function"); - } - return false; - } - int buffer = bufferStateTracker.getBoundBufferObject(state, this); + final int buffer = bufferStateTracker.getBoundBufferObject(state, this); if (enabled) { - if (buffer == 0) { + if (0 == buffer) { if(throwException) { throw new GLException(kind + " must be enabled to call this method"); } return false; } } else { - if (buffer != 0) { + if (0 != buffer) { if(throwException) { throw new GLException(kind + " must be disabled to call this method"); } @@ -182,35 +163,27 @@ private final boolean checkBufferObject(boolean avail, } private final boolean checkArrayVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - false, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); + return checkBufferObject(false, // enabled + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); } private final boolean checkArrayVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - true, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); + return checkBufferObject(true, // enabled + GL.GL_ARRAY_BUFFER, + "array vertex_buffer_object", throwException); } private final boolean checkElementVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - false, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); + return checkBufferObject(false, // enabled + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); } private final boolean checkElementVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(true, - true, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); + return checkBufferObject(true, // enabled + GL.GL_ELEMENT_ARRAY_BUFFER, + "element vertex_buffer_object", throwException); } private final boolean checkUnpackPBODisabled(boolean throwException) { diff --git a/make/scripts/java-win64-dbg.bat b/make/scripts/java-win64-dbg.bat index 0dd922dde..c14385fc7 100755 --- a/make/scripts/java-win64-dbg.bat +++ b/make/scripts/java-win64-dbg.bat @@ -40,7 +40,7 @@ REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLC REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.windows.useWGLVersionOf5WGLGDIFuncSet"
REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch"
REM set D_ARGS="-Dnewt.debug.Window"
-set D_ARGS="-Dnewt.debug.Window.KeyEvent"
+REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
REM set D_ARGS="-Dnewt.debug.Window.MouseEvent" "-Dnewt.debug.Window.KeyEvent"
REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index 237770488..d647c2d4a 100755 --- a/make/scripts/tests-x64.bat +++ b/make/scripts/tests-x64.bat @@ -19,6 +19,9 @@ REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLDeb REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT %* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestMapBuffer01NEWT +REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext01NEWT %* +REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext02NEWT %* +scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestBug692GL3VAO %* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext01VSyncAnimNEWT %* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext01VSyncAnimAWT %* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext02FPSAnimNEWT %* @@ -50,7 +53,7 @@ REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestIsReali REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000 REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %* -scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %* +REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %* REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 4000 -x 10 -y 10 -width 100 -height 100 -screen 0 REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000 diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 35d669a47..17b3187e6 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -171,7 +171,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.GLContext" #D_ARGS="-Dnewt.debug.Window -Djogl.debug.Animator -Dnewt.debug.Screen" #D_ARGS="-Dnativewindow.debug.JAWT -Dnewt.debug.Window" - D_ARGS="-Dnewt.debug.Window.KeyEvent" + #D_ARGS="-Dnewt.debug.Window.KeyEvent" #D_ARGS="-Dnewt.debug.Window.MouseEvent" #D_ARGS="-Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent" #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug=all" @@ -315,8 +315,11 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLContextSurfaceLockNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug00NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug01NEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMapBufferRead01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext02NEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug692GL3VAO $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListNEWT2 $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES1NEWT $* @@ -370,7 +373,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol02NEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindows02NEWTAnimated $* -testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindowInvisiblePointer01NEWT $* +#testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindowInvisiblePointer01NEWT $* #testnoawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT #testnoawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle02NEWT #testnoawt com.jogamp.opengl.test.junit.newt.TestScreenMode00NEWT $* @@ -543,12 +546,6 @@ testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindowInvisiblePointer01NEWT $ #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo02 $* # -# Security -# -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMapBufferRead01NEWT $* - -# # OSX bugs # #testawt com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot $* |