]> git.cworth.org Git - apitrace/commitdiff
Update drawable on variations of glViewport (issue #71)
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 29 Mar 2012 07:19:19 +0000 (08:19 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 29 Mar 2012 07:19:19 +0000 (08:19 +0100)
Thanks to Gregory (gregory38) for spotting this.

glretrace.py

index deeb86d4ebe39c368944da2f6147913da4701b6a..bb88288060f09d968a9303808d92894e17aeef61 100644 (file)
@@ -224,6 +224,21 @@ class GlRetracer(Retracer):
         # Infer the drawable size from GL calls
         if function.name == "glViewport":
             print '    glretrace::updateDrawable(x + width, y + height);'
+        if function.name == "glViewportArray":
+            # We are concerned about drawables so only care for the first viewport
+            print '    if (first == 0 && count > 0) {'
+            print '        GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
+            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '    }'
+        if function.name == "glViewportIndexedf":
+            print '    if (index == 0) {'
+            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '    }'
+        if function.name == "glViewportIndexedfv":
+            print '    if (index == 0) {'
+            print '        GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
+            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '    }'
         if function.name in ('glBlitFramebuffer', 'glBlitFramebufferEXT'):
             # Some applications do all their rendering in a framebuffer, and
             # then just blit to the drawable without ever calling glViewport.