diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2015-06-26 10:27:30 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-06-26 10:28:50 +0100 |
commit | 6ac76c11d710f9a4f7cbc7a52243768510580232 (patch) | |
tree | dfc1294e90abdb6a5051948c0032688c1c584252 /wrappers | |
parent | de685fa3784aa567f9d9e4206836a1e6c52fd7f3 (diff) |
gltrace: Fix tracing with OpenGL 1.1.
Some apps fully/partally use Microsoft OpenGL 1.1 GDI software renderer,
which supports only one texture coordinate (no glClientActiveTexture).
Diffstat (limited to 'wrappers')
-rw-r--r-- | wrappers/gltrace.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py index 5839c696..282666f2 100644 --- a/wrappers/gltrace.py +++ b/wrappers/gltrace.py @@ -1101,15 +1101,21 @@ class GlTracer(Tracer): def array_prolog(self, api, uppercase_name): if uppercase_name == 'TEXTURE_COORD': - print ' GLint client_active_texture = _glGetInteger(GL_CLIENT_ACTIVE_TEXTURE);' - print ' GLint max_texture_coords = 0;' + print ' GLint max_units = 0;' print ' if (ctx->profile.desktop())' - print ' _glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_texture_coords);' + print ' _glGetIntegerv(GL_MAX_TEXTURE_COORDS, &max_units);' print ' else' - print ' _glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_texture_coords);' - print ' for (GLint unit = 0; unit < max_texture_coords; ++unit) {' + print ' _glGetIntegerv(GL_MAX_TEXTURE_UNITS, &max_units);' + print ' GLint client_active_texture = GL_TEXTURE0;' + print ' if (max_units > 0) {' + print ' _glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &client_active_texture);' + print ' }' + print ' GLint unit = 0;' + print ' do {' print ' GLint texture = GL_TEXTURE0 + unit;' - print ' _glClientActiveTexture(texture);' + print ' if (max_units > 0) {' + print ' _glClientActiveTexture(texture);' + print ' }' def array_trace_prolog(self, api, uppercase_name): if uppercase_name == 'TEXTURE_COORD': @@ -1117,12 +1123,14 @@ class GlTracer(Tracer): def array_epilog(self, api, uppercase_name): if uppercase_name == 'TEXTURE_COORD': - print ' }' + print ' } while (++unit < max_units);' self.array_cleanup(api, uppercase_name) def array_cleanup(self, api, uppercase_name): if uppercase_name == 'TEXTURE_COORD': - print ' _glClientActiveTexture(client_active_texture);' + print ' if (max_units > 0) {' + print ' _glClientActiveTexture(client_active_texture);' + print ' }' def array_trace_intermezzo(self, api, uppercase_name): if uppercase_name == 'TEXTURE_COORD': |