1'''OpenGL extension AMD.performance_monitor
2
3This module customises the behaviour of the
4OpenGL.raw.GLES2.AMD.performance_monitor to provide a more
5Python-friendly API
6
7Overview (from the spec)
8
9	This extension enables the capture and reporting of performance monitors.
10	Performance monitors contain groups of counters which hold arbitrary counted
11	data.  Typically, the counters hold information on performance-related
12	counters in the underlying hardware.  The extension is general enough to
13	allow the implementation to choose which counters to expose and pick the
14	data type and range of the counters.  The extension also allows counting to
15	start and end on arbitrary boundaries during rendering.
16
17The official definition of this extension is available here:
18http://www.opengl.org/registry/specs/AMD/performance_monitor.txt
19'''
20from OpenGL import platform, constant, arrays
21from OpenGL import extensions, wrapper
22import ctypes
23from OpenGL.raw.GLES2 import _types, _glgets
24from OpenGL.raw.GLES2.AMD.performance_monitor import *
25from OpenGL.raw.GLES2.AMD.performance_monitor import _EXTENSION_NAME
26
27def glInitPerformanceMonitorAMD():
28    '''Return boolean indicating whether this extension is available'''
29    from OpenGL import extensions
30    return extensions.hasGLExtension( _EXTENSION_NAME )
31
32glGetPerfMonitorGroupsAMD=wrapper.wrapper(glGetPerfMonitorGroupsAMD).setOutput(
33    'groups',size=lambda x:(x,),pnameArg='groupsSize',orPassIn=True
34).setOutput(
35    'numGroups',size=(1,),orPassIn=True
36)
37glGetPerfMonitorCountersAMD=wrapper.wrapper(glGetPerfMonitorCountersAMD).setOutput(
38    'counters',size=lambda x:(x,),pnameArg='counterSize',orPassIn=True
39).setOutput(
40    'maxActiveCounters',size=(1,),orPassIn=True
41).setOutput(
42    'numCounters',size=(1,),orPassIn=True
43)
44glGetPerfMonitorGroupStringAMD=wrapper.wrapper(glGetPerfMonitorGroupStringAMD).setOutput(
45    'groupString',size=lambda x:(x,),pnameArg='bufSize',orPassIn=True
46).setOutput(
47    'length',size=(1,),orPassIn=True
48)
49glGetPerfMonitorCounterStringAMD=wrapper.wrapper(glGetPerfMonitorCounterStringAMD).setOutput(
50    'counterString',size=lambda x:(x,),pnameArg='bufSize',orPassIn=True
51).setOutput(
52    'length',size=(1,),orPassIn=True
53)
54glGetPerfMonitorCounterInfoAMD=wrapper.wrapper(glGetPerfMonitorCounterInfoAMD).setOutput(
55    'data',size=_glgets._glget_size_mapping,pnameArg='pname',orPassIn=True
56)
57glGenPerfMonitorsAMD=wrapper.wrapper(glGenPerfMonitorsAMD).setOutput(
58    'monitors',size=lambda x:(x,),pnameArg='n',orPassIn=True
59)
60glDeletePerfMonitorsAMD=wrapper.wrapper(glDeletePerfMonitorsAMD).setOutput(
61    'monitors',size=lambda x:(x,),pnameArg='n',orPassIn=True
62)
63glSelectPerfMonitorCountersAMD=wrapper.wrapper(glSelectPerfMonitorCountersAMD).setOutput(
64    'counterList',size=lambda x:(x,),pnameArg='numCounters',orPassIn=True
65)
66glGetPerfMonitorCounterDataAMD=wrapper.wrapper(glGetPerfMonitorCounterDataAMD).setOutput(
67    'bytesWritten',size=(1,),orPassIn=True
68).setOutput(
69    'data',size=lambda x:(x,),pnameArg='dataSize',orPassIn=True
70)
71### END AUTOGENERATED SECTION