summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/tests/dispatch_sanity.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-04-11 13:22:00 -0700
committerKenneth Graunke <[email protected]>2013-09-26 16:55:18 -0700
commitb2e327e08f8519da131dd382adcc99240d433404 (patch)
tree228f6f2521a17994ec8d013fcadaccf3aae6f0d6 /src/mesa/main/tests/dispatch_sanity.cpp
parentf91475d4ab7e1328904a1df443fbf85ed8acb7f3 (diff)
mesa: Add core support for the GL_AMD_performance_monitor extension.
This provides an interface for applications (and OpenGL-based tools) to access GPU performance counters. Since the exact performance counters available vary between vendors and hardware generations, the extension provides an API the application can use to get the names, types, and minimum/maximum values of all available counters. Counters are also organized into groups. Applications create "performance monitor" objects, select the counters they want to track, and Begin/End monitoring, much like OpenGL's query API. Multiple monitors can be in flight simultaneously. v2: Pass ctx to all driver hooks (suggested by Christoph), and attempt to fix overallocation of bitsets (caught by Christoph). Incomplete. v3: Significantly rework core data structures. Store counters in groups rather than in a global list. Use their array index in the group's counter list as the ID rather than trying to store a globally unique counter ID. Use bitsets for active counters within a group, and also track which groups are active so that's easy to query. v4: Remove _mesa_ prefix on static functions; detect out of memory conditions in new_performance_monitor(); make BeginPerfMonitor hook return a boolean rather than setting m->Active or raising an error. Switch to GLuint/unsigned for NumGroups, NumCounters, and MaxActiveCounters (which also means switching a bunch of temporary variable types). All suggested by Brian Paul. Also, remove commented out code at the bottom of the block. Finally, fix the dispatch sanity test (noticed by Ian Romanick). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> [v3] Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/tests/dispatch_sanity.cpp')
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index bea6e964b41..244173af87c 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -908,6 +908,19 @@ const struct function gl_core_functions_possible[] = {
{ "glObjectLabel", 11, -1 },
{ "glObjectPtrLabel", 11, -1 },
+ /* GL_AMD_performance_monitor */
+ { "glGetPerfMonitorGroupsAMD", 11, -1 },
+ { "glGetPerfMonitorCountersAMD", 11, -1 },
+ { "glGetPerfMonitorGroupStringAMD", 11, -1 },
+ { "glGetPerfMonitorCounterStringAMD", 11, -1 },
+ { "glGetPerfMonitorCounterInfoAMD", 11, -1 },
+ { "glGenPerfMonitorsAMD", 11, -1 },
+ { "glDeletePerfMonitorsAMD", 11, -1 },
+ { "glSelectPerfMonitorCountersAMD", 11, -1 },
+ { "glBeginPerfMonitorAMD", 11, -1 },
+ { "glEndPerfMonitorAMD", 11, -1 },
+ { "glGetPerfMonitorCounterDataAMD", 11, -1 },
+
{ NULL, 0, -1 }
};