X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=specs%2Fgltypes.py;h=5f325103cd49b6debe31db84e9db9e9edadadc6e;hb=a0708b02018902497da4df6c9be05cd053374afc;hp=4324ac7e389ad75a6fb9abfadc5127a685a3a10f;hpb=cb9d2e002ba98b743851db4016dc68ba3ddbd845;p=apitrace diff --git a/specs/gltypes.py b/specs/gltypes.py index 4324ac7..5f32510 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -100,7 +100,7 @@ GLshader = Handle("shader", GLuint) GLlocation = Handle("location", GLint, key=('program', GLhandleARB)) GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB)) -contextKey = ('reinterpret_cast(glretrace::currentContext)', UIntPtr) +contextKey = ('reinterpret_cast(glretrace::getCurrentContext())', UIntPtr) GLprogramARB = Handle("programARB", GLuint) GLframebuffer = Handle("framebuffer", GLuint) @@ -237,3 +237,60 @@ GLbitfield_barrier = Flags(GLbitfield, [ size_bgra = FakeEnum(GLint, [ "GL_BGRA", ]) + + +def GLindexBuffer(countExpr, typeExpr): + # Indices arguments are polymorphic: + # - offsets when element array buffer is bound + # - or a blob otherwise. + sizeExpr = '%s*_gl_type_size(%s)' % (countExpr, typeExpr) + return Polymorphic('_element_array_buffer_binding()', [ + ('0', Blob(Const(GLvoid), sizeExpr)), + ], + IntPointer("const GLvoid *"), + contextLess=False, + ) + +# Polymorphic object name +def GLname(targetExpr): + return Polymorphic(targetExpr, [ + ('GL_BUFFER', GLbuffer), + ('GL_SHADER', GLshader), + ('GL_PROGRAM', GLprogram), + ('GL_VERTEX_ARRAY', GLarray), + ('GL_QUERY', GLquery), + ('GL_PROGRAM_PIPELINE', GLpipeline), + ('GL_TRANSFORM_FEEDBACK', GLuint), + ('GL_SAMPLER', GLsampler), + ('GL_TEXTURE', GLtexture), + ('GL_TEXTURE_1D', GLtexture), + ('GL_TEXTURE_1D_ARRAY', GLtexture), + ('GL_TEXTURE_2D', GLtexture), + ('GL_TEXTURE_2D_MULTISAMPLE', GLtexture), + ('GL_TEXTURE_2D_ARRAY', GLtexture), + ('GL_TEXTURE_RECTANGLE', GLtexture), + ('GL_TEXTURE_CUBE_MAP', GLtexture), + ('GL_TEXTURE_CUBE_MAP_POSITIVE_X', GLtexture), + ('GL_TEXTURE_CUBE_MAP_NEGATIVE_X', GLtexture), + ('GL_TEXTURE_CUBE_MAP_POSITIVE_Y', GLtexture), + ('GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', GLtexture), + ('GL_TEXTURE_CUBE_MAP_POSITIVE_Z', GLtexture), + ('GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', GLtexture), + ('GL_TEXTURE_CUBE_MAP_ARRAY', GLtexture), + ('GL_TEXTURE_3D', GLtexture), + ('GL_RENDERBUFFER', GLrenderbuffer), + ('GL_FRAMEBUFFER', GLframebuffer), + ('GL_DISPLAY_LIST', GLlist), + ('GL_FENCE_APPLE', GLfence), + ('GL_DRAW_PIXELS_APPLE', GLuint), # GL_APPLE_fence + ], GLuint) + + +# 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), +)