GLlocation = Handle("location", GLint, key=('program', GLhandleARB))
GLlocationARB = Handle("location", GLint, key=('programObj', GLhandleARB))
+contextKey = ('reinterpret_cast<uintptr_t>(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.
#
"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, [
"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,
+ )