aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-14 06:28:44 +0200
committerSven Gothel <[email protected]>2013-04-14 06:28:44 +0200
commitb414c4b1be05249590138e73558ada82bd170f15 (patch)
tree0475e627f78bcb94e56306b552b15dcc157b219a /src/jogl/classes/jogamp/opengl
parentd7096cfeee500177db85d97241cc142af41517cb (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 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index 4a1a81bcb..7f5316fbd 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -91,6 +91,7 @@ public class GLBufferStateTracker {
bindingMap.setKeyNotFoundValue(0xFFFFFFFF);
// Start with known unbound targets for known keys
+ // setBoundBufferObject(GL2GL3.GL_VERTEX_ARRAY_BINDING, 0); // not using default VAO (removed in GL3 core) - only explicit
setBoundBufferObject(GL.GL_ARRAY_BUFFER, 0);
setBoundBufferObject(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
setBoundBufferObject(GL2.GL_PIXEL_PACK_BUFFER, 0);
@@ -120,6 +121,7 @@ public class GLBufferStateTracker {
boolean gotQueryTarget = true;
int queryTarget = 0;
switch (target) {
+ case GL2GL3.GL_VERTEX_ARRAY_BINDING: queryTarget = GL2GL3.GL_VERTEX_ARRAY_BINDING; break;
case GL.GL_ARRAY_BUFFER: queryTarget = GL.GL_ARRAY_BUFFER_BINDING; break;
case GL.GL_ELEMENT_ARRAY_BUFFER: queryTarget = GL.GL_ELEMENT_ARRAY_BUFFER_BINDING; break;
case GL2.GL_PIXEL_PACK_BUFFER: queryTarget = GL2.GL_PIXEL_PACK_BUFFER_BINDING; break;
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 376b3c0e5..9f7c9cf57 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1790,6 +1790,10 @@ public abstract class GLContextImpl extends GLContext {
public final GLStateTracker getGLStateTracker() {
return glStateTracker;
}
+
+ public final boolean isDefaultVAO(int vao) {
+ return defaultVAO == vao;
+ }
//---------------------------------------------------------------------------
// Helpers for context optimization where the last context is left