X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=specs%2Fgltypes.py;h=a04990d9ec33ec72550e39aa3a5a3834e1b20187;hb=HEAD;hp=17b4598e50e8e39313980880726a5a91282a6a7b;hpb=e319ab480b479a35da6e55412efe39a1a01e5c04;p=apitrace diff --git a/specs/gltypes.py b/specs/gltypes.py index 17b4598..a04990d 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -32,7 +32,11 @@ import platform from stdapi import * -GLboolean = Alias("GLboolean", Bool) +GLboolean = Enum("GLboolean", [ + "GL_TRUE", + "GL_FALSE", +]) + GLvoid = Alias("GLvoid", Void) GLbyte = Alias("GLbyte", SChar) GLshort = Alias("GLshort", Short) @@ -49,11 +53,9 @@ GLfloat = Alias("GLfloat", Float) GLclampf = Alias("GLclampf", Float) GLdouble = Alias("GLdouble", Double) GLclampd = Alias("GLclampd", Double) -GLchar = Alias("GLchar", SChar) -GLstring = String("GLchar *") +GLchar = Alias("GLchar", Char) GLcharARB = Alias("GLcharARB", SChar) -GLstringARB = String("GLcharARB *") GLintptrARB = Alias("GLintptrARB", Int) GLsizeiptrARB = Alias("GLsizeiptrARB", Int) GLhandleARB = Handle("handleARB", Alias("GLhandleARB", UInt)) @@ -61,9 +63,15 @@ GLhalfARB = Alias("GLhalfARB", UShort) GLhalfNV = Alias("GLhalfNV", UShort) GLint64EXT = Alias("GLint64EXT", Int64) GLuint64EXT = Alias("GLuint64EXT", UInt64) +GLDEBUGPROC = Opaque("GLDEBUGPROC") GLDEBUGPROCARB = Opaque("GLDEBUGPROCARB") GLDEBUGPROCAMD = Opaque("GLDEBUGPROCAMD") +GLstring = String(GLchar) +GLstringConst = String(Const(GLchar)) +GLstringARB = String(GLcharARB) +GLstringConstARB = String(Const(GLcharARB)) + GLpointer = OpaquePointer(GLvoid) GLpointerConst = OpaquePointer(Const(GLvoid)) @@ -92,15 +100,19 @@ GLshader = Handle("shader", GLuint) GLlocation = Handle("location", GLint, key=('program', GLhandleARB)) GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB)) +contextKey = ('reinterpret_cast(glretrace::getCurrentContext())', UIntPtr) + GLprogramARB = Handle("programARB", GLuint) GLframebuffer = Handle("framebuffer", GLuint) GLrenderbuffer = Handle("renderbuffer", GLuint) GLfragmentShaderATI = Handle("fragmentShaderATI", GLuint) -GLarray = Handle("array", GLuint) +GLarray = Handle("array", GLuint, key=contextKey) # per-context +GLarrayAPPLE = Handle("arrayAPPLE", GLuint) # shared GLregion = Handle("region", GLuint) GLpipeline = Handle("pipeline", GLuint) GLsampler = Handle("sampler", GLuint) GLfeedback = Handle("feedback", GLuint) +GLfence = Handle("fence", GLuint) # GL mappings are pointers to linear memory regions. # @@ -108,8 +120,7 @@ GLfeedback = Handle("feedback", GLuint) # reconstructed from other state. GLmap = LinearPointer(GLvoid, "length") -GLsync_ = IntPointer("GLsync") -GLsync = Handle("sync", GLsync_) +GLsync = Handle("sync", IntPointer("GLsync")) GLenum = Enum("GLenum", [ # Parameters are added later from glparams.py's parameter table @@ -189,6 +200,7 @@ GLbitfield_shader = Flags(GLbitfield, [ "GL_GEOMETRY_SHADER_BIT", # 0x00000004 "GL_TESS_CONTROL_SHADER_BIT", # 0x00000008 "GL_TESS_EVALUATION_SHADER_BIT", # 0x00000010 + "GL_COMPUTE_SHADER_BIT", # 0x00000020 ]) GLbitfield_access = Flags(GLbitfield, [ @@ -221,3 +233,20 @@ GLbitfield_barrier = Flags(GLbitfield, [ "GL_ATOMIC_COUNTER_BARRIER_BIT", # 0x00001000 ]) +# GL_ARB_vertex_array_bgra +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, + )