diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-05-10 04:47:08 -0700 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-05-13 07:35:43 -0700 |
commit | 97d22a7a36523a6dad2b41706c7ab0236c80660e (patch) | |
tree | 73e40de0aad53d2087967c96fe95e1b64c9b5299 /wrappers | |
parent | f1977beca436a1f8902052bee8ec81d3eccb22fb (diff) |
gltrace: Simplify EXT_compiled_vertex_arrays support.
Diffstat (limited to 'wrappers')
-rw-r--r-- | wrappers/gltrace.hpp | 3 | ||||
-rw-r--r-- | wrappers/gltrace.py | 23 |
2 files changed, 13 insertions, 13 deletions
diff --git a/wrappers/gltrace.hpp b/wrappers/gltrace.hpp index 441e696a..c170d749 100644 --- a/wrappers/gltrace.hpp +++ b/wrappers/gltrace.hpp @@ -49,6 +49,9 @@ public: // Whether it has been bound to a drawable bool boundDrawable = false; + // whether glLockArraysEXT() has ever been called + GLuint lockedArrayCount; + Context(void) : profile(glfeatures::API_GL, 1, 0) { } diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py index ba6e2354..60c75a52 100644 --- a/wrappers/gltrace.py +++ b/wrappers/gltrace.py @@ -181,10 +181,6 @@ class GlTracer(Tracer): print r'}' print - print '// whether glLockArraysEXT() has ever been called' - print 'static bool _checkLockArraysEXT = false;' - print - # Buffer mappings print '// whether glMapBufferRange(GL_MAP_WRITE_BIT) has ever been called' print 'static bool _checkBufferMapRange = false;' @@ -451,20 +447,16 @@ class GlTracer(Tracer): paramsMember = arg.name.lower() if paramsMember in ('mode', 'modestride'): continue - print r' _params.%s = %s;' % (paramsMember, arg.name) + print r' _params.%s = %s;' % (paramsMember, arg.name) print ' GLuint _count = _glDraw_count(_ctx, _params);' - # Some apps, in particular Quake3, can tell the driver to lock more - # vertices than those actually required for the draw call. - print ' if (_checkLockArraysEXT) {' - print ' GLuint _locked_count = _glGetInteger(GL_ARRAY_ELEMENT_LOCK_FIRST_EXT)' - print ' + _glGetInteger(GL_ARRAY_ELEMENT_LOCK_COUNT_EXT);' - print ' _count = std::max(_count, _locked_count);' - print ' }' print ' _trace_user_arrays(_ctx, _count);' print ' }' if function.name == 'glLockArraysEXT': - print ' _checkLockArraysEXT = true;' + print ' gltrace::Context *_ctx = gltrace::getContext();' + print ' if (_ctx) {' + print ' _ctx->lockedArrayCount = first + count;' + print ' }' # Warn if user arrays are used with glBegin/glArrayElement/glEnd. if function.name == 'glBegin': @@ -929,6 +921,11 @@ class GlTracer(Tracer): print ' bool es1 = profile.es() && profile.major == 1;' print + # Some apps, in particular Quake3, can tell the driver to lock more + # vertices than those actually required for the draw call. + print ' count = std::max(count, _ctx->lockedArrayCount);' + print + # Temporarily unbind the array buffer print ' GLint _array_buffer = _glGetInteger(GL_ARRAY_BUFFER_BINDING);' print ' if (_array_buffer) {' |