diff options
author | Sven Gothel <[email protected]> | 2013-04-14 06:28:44 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-04-14 06:28:44 +0200 |
commit | b414c4b1be05249590138e73558ada82bd170f15 (patch) | |
tree | 0475e627f78bcb94e56306b552b15dcc157b219a /make | |
parent | d7096cfeee500177db85d97241cc142af41517cb (diff) |
Fix Bug 692: Add tracking of VERTEX_ARRAY_BINDING, and enable allowing a bound non default VAO to pass VBO enabled test, even if VBO is disabled.
VAO is available if: GL >= 3.0 or is having GL_ARB_vertex_array_object extension.
checkBufferObject(..) checks whether VERTEX_ARRAY_BINDING has a non default VAO bound in case
no VBO is being bound and VAO is allowed.
glBindVertexArray(int) is being tracked, i.e. on state VERTEX_ARRAY_BINDING
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 | ||||
-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 | 14 |
5 files changed, 81 insertions, 79 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/scripts/java-win64-dbg.bat b/make/scripts/java-win64-dbg.bat index 48653d907..c14385fc7 100755 --- a/make/scripts/java-win64-dbg.bat +++ b/make/scripts/java-win64-dbg.bat @@ -39,7 +39,7 @@ REM set D_ARGS="-Djogl.debug=all" REM set D_ARGS="-Djogl.debug.GLCanvas" "-Djogl.debug.Animator" "-Djogl.debug.GLContext" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL"
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"
-set D_ARGS="-Dnewt.debug.Window"
+REM set D_ARGS="-Dnewt.debug.Window"
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"
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat index 7d1380287..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 %* @@ -47,7 +50,7 @@ REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestJScroll REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestBug642JSplitPaneMixHwLw01AWT %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestIsRealizedConcurrency01AWT %* -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.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 %* REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT %* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 2974658a8..17b3187e6 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -177,7 +177,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug=all" #D_ARGS="-Dnewt.debug.Window -Dnativewindow.debug.JAWT -Djogl.debug.Animator" #D_ARGS="-Dnewt.debug.Window -Djogl.debug.GLDrawable" - D_ARGS="-Dnewt.debug.Window" + #D_ARGS="-Dnewt.debug.Window" #D_ARGS="-Xprof" #D_ARGS="-Dnativewindow.debug=all" #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel" @@ -290,7 +290,7 @@ function testawtswt() { #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWTAnalyzeBug455 $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWTBug450 $* -testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper $* +#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestTeapotNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT $* @@ -315,9 +315,11 @@ testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper #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.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 $* @@ -544,12 +546,6 @@ testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper #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 $* |