summaryrefslogtreecommitdiff
path: root/wrappers/gltrace.py
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/gltrace.py')
-rw-r--r--wrappers/gltrace.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py
index ccd5860b..9244c43d 100644
--- a/wrappers/gltrace.py
+++ b/wrappers/gltrace.py
@@ -944,6 +944,15 @@ class GlTracer(Tracer):
print 'static void _trace_user_arrays(GLuint count)'
print '{'
print ' gltrace::Context *ctx = gltrace::getContext();'
+ print
+
+ # Temporarily unbind the array buffer
+ print ' GLint _array_buffer = 0;'
+ print ' _glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &_array_buffer);'
+ print ' if (_array_buffer) {'
+ self.fake_glBindBuffer(api, 'GL_ARRAY_BUFFER', '0')
+ print ' }'
+ print
for camelcase_name, uppercase_name in self.arrays:
# in which profile is the array available?
@@ -1074,6 +1083,12 @@ class GlTracer(Tracer):
print ' }'
print
+ # Restore the original array_buffer
+ print ' if (_array_buffer) {'
+ self.fake_glBindBuffer(api, 'GL_ARRAY_BUFFER', '_array_buffer')
+ print ' }'
+ print
+
print '}'
print
@@ -1121,6 +1136,10 @@ class GlTracer(Tracer):
self.fake_glClientActiveTexture_call(api, "client_active_texture");
print ' }'
+ def fake_glBindBuffer(self, api, target, buffer):
+ function = api.getFunctionByName('glBindBuffer')
+ self.fake_call(function, [target, buffer])
+
def fake_glClientActiveTexture_call(self, api, texture):
function = api.getFunctionByName('glClientActiveTexture')
self.fake_call(function, [texture])