]> git.cworth.org Git - apitrace/commitdiff
gltrace: Better handling of GetPerfMonitorCounterInfoAMD
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 14 Apr 2013 13:45:04 +0000 (14:45 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 14 Apr 2013 13:45:04 +0000 (14:45 +0100)
specs/glapi.py
specs/gltypes.py
wrappers/trace.py

index b0c0a270eb65d25c6d2d2c72c59a7cbd9934ecf3..82b79026213696c72a790345cf87fb7618531c81 100644 (file)
@@ -2690,7 +2690,7 @@ glapi.addFunctions([
     GlFunction(Void, "glGetPerfMonitorCountersAMD", [(GLuint, "group"), Out(Pointer(GLint), "numCounters"), Out(Pointer(GLint), "maxActiveCounters"), (GLsizei, "counterSize"), Out(Array(GLuint, "counterSize"), "counters")], sideeffects=False),
     GlFunction(Void, "glGetPerfMonitorGroupStringAMD", [(GLuint, "group"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), OutGlString(GLchar, "length", "groupString")], sideeffects=False),
     GlFunction(Void, "glGetPerfMonitorCounterStringAMD", [(GLuint, "group"), (GLuint, "counter"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), OutGlString(GLchar, "length", "counterString")], sideeffects=False),
-    GlFunction(Void, "glGetPerfMonitorCounterInfoAMD", [(GLuint, "group"), (GLuint, "counter"), (GLenum, "pname"), Out(OpaqueBlob(GLvoid, "_glGetPerfMonitorCounterInfoAMD_size(pname)"), "data")], sideeffects=False),
+    GlFunction(Void, "glGetPerfMonitorCounterInfoAMD", [(GLuint, "group"), (GLuint, "counter"), (GLenum, "pname"), Out(GLperfMonitorCounterInfoAMD, "data")], sideeffects=False),
     GlFunction(Void, "glGenPerfMonitorsAMD", [(GLsizei, "n"), Out(Array(GLuint, "n"), "monitors")]),
     GlFunction(Void, "glDeletePerfMonitorsAMD", [(GLsizei, "n"), (Array(GLuint, "n"), "monitors")]),
     GlFunction(Void, "glSelectPerfMonitorCountersAMD", [(GLuint, "monitor"), (GLboolean, "enable"), (GLuint, "group"), (GLint, "numCounters"), (Array(GLuint, "numCounters"), "counterList")]),
index a04990d9ec33ec72550e39aa3a5a3834e1b20187..0c1b7aee9e9c5bc32d67ae2175246e2f8c626ca7 100644 (file)
@@ -250,3 +250,13 @@ def GLindexBuffer(countExpr, typeExpr):
         IntPointer("const GLvoid *"), 
         contextLess=False,
     )
+
+
+# GL_AMD_performance_monitor
+GLperfMonitorCounterInfoAMD = Polymorphic('pname', [
+        ('GL_COUNTER_TYPE_AMD', Pointer(GLenum)),
+        ('GL_PERCENTAGE_AMD', Pointer(Float)),
+        ('GL_COUNTER_RANGE_AMD', Array(Float, 2)),
+    ],
+    OpaquePointer(GLvoid),
+)
index 61a2cb95fcf8249c13719464a36bee5891f8f76a..d9c2900936714e867f1db5c984a86d3d32104ae1 100644 (file)
@@ -138,7 +138,7 @@ class ComplexValueSerializer(stdapi.OnceVisitor):
     def visitPolymorphic(self, polymorphic):
         if not polymorphic.contextLess:
             return
-        print 'static void _write__%s(int selector, const %s & value) {' % (polymorphic.tag, polymorphic.expr)
+        print 'static void _write__%s(int selector, %s const & value) {' % (polymorphic.tag, polymorphic.expr)
         print '    switch (selector) {'
         for cases, type in polymorphic.iterSwitch():
             for case in cases: