diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-11-17 21:12:19 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-11-18 11:36:38 +0000 |
commit | 94b69129bd8edd794e744b9c778da057a390dd91 (patch) | |
tree | 085cc5723a909b602543feddcf4debebab5b9943 | |
parent | 93935064318f39906400a9e9fd636dd9528f5c16 (diff) |
specs: Swizzle more generic object names.gl-object-names
-rw-r--r-- | specs/glapi.py | 24 | ||||
-rw-r--r-- | specs/gltypes.py | 48 |
2 files changed, 53 insertions, 19 deletions
diff --git a/specs/glapi.py b/specs/glapi.py index e8d07414..679bb138 100644 --- a/specs/glapi.py +++ b/specs/glapi.py @@ -771,9 +771,9 @@ glapi.addFunctions([ GlFunction(Void, "glMultiDrawElementsIndirectAMD", [(GLenum_mode, "mode"), (GLenum, "type"), (GLpointerConst, "indirect"), (GLsizei, "primcount"), (GLsizei, "stride")]), # GL_AMD_name_gen_delete - GlFunction(Void, "glGenNamesAMD", [(GLenum, "identifier"), (GLuint, "num"), Out(Array(GLuint, "num"), "names")]), - GlFunction(Void, "glDeleteNamesAMD", [(GLenum, "identifier"), (GLuint, "num"), (Array(Const(GLuint), "num"), "names")]), - GlFunction(GLboolean, "glIsNameAMD", [(GLenum, "identifier"), (GLuint, "name")], sideeffects=False), + GlFunction(Void, "glGenNamesAMD", [(GLenum, "identifier"), (GLuint, "num"), Out(Array(GLname("identifier"), "num"), "names")]), + GlFunction(Void, "glDeleteNamesAMD", [(GLenum, "identifier"), (GLuint, "num"), (Array(Const(GLname("identifier")), "num"), "names")]), + GlFunction(GLboolean, "glIsNameAMD", [(GLenum, "identifier"), (GLname("identifier"), "name")], sideeffects=False), # GL_AMD_performance_monitor GlFunction(Void, "glGetPerfMonitorGroupsAMD", [Out(Pointer(GLint), "numGroups"), (GLsizei, "groupsSize"), Out(Array(GLuint, "groupsSize"), "groups")], sideeffects=False), @@ -833,8 +833,8 @@ glapi.addFunctions([ GlFunction(GLboolean, "glIsFenceAPPLE", [(GLfence, "fence")], sideeffects=False), GlFunction(GLboolean, "glTestFenceAPPLE", [(GLfence, "fence")]), GlFunction(Void, "glFinishFenceAPPLE", [(GLfence, "fence")]), - GlFunction(GLboolean, "glTestObjectAPPLE", [(GLenum, "object"), (GLuint, "name")]), # XXX: name needs swizzling - GlFunction(Void, "glFinishObjectAPPLE", [(GLenum, "object"), (GLint, "name")]), # XXX: name needs swizzling + GlFunction(GLboolean, "glTestObjectAPPLE", [(GLenum, "object"), (GLnameAPPLE("object"), "name")]), + GlFunction(Void, "glFinishObjectAPPLE", [(GLenum, "object"), (GLnameAPPLE("object", GLint), "name")]), # GL_APPLE_flush_buffer_range GlFunction(Void, "glBufferParameteriAPPLE", [(GLenum, "target"), (GLenum, "pname"), (GLint, "param")]), @@ -850,9 +850,9 @@ glapi.addFunctions([ GlFunction(Void, "glResolveMultisampleFramebufferAPPLE", []), # GL_APPLE_object_purgeable - GlFunction(GLenum, "glObjectPurgeableAPPLE", [(GLenum, "objectType"), (GLuint, "name"), (GLenum, "option")]), - GlFunction(GLenum, "glObjectUnpurgeableAPPLE", [(GLenum, "objectType"), (GLuint, "name"), (GLenum, "option")]), - GlFunction(Void, "glGetObjectParameterivAPPLE", [(GLenum, "objectType"), (GLuint, "name"), (GLenum, "pname"), Out(Array(GLint, "_gl_param_size(pname)"), "params")], sideeffects=False), + GlFunction(GLenum, "glObjectPurgeableAPPLE", [(GLenum, "objectType"), (GLnameAPPLE("objectType"), "name"), (GLenum, "option")]), + GlFunction(GLenum, "glObjectUnpurgeableAPPLE", [(GLenum, "objectType"), (GLnameAPPLE("objectType"), "name"), (GLenum, "option")]), + GlFunction(Void, "glGetObjectParameterivAPPLE", [(GLenum, "objectType"), (GLnameAPPLE("objectType"), "name"), (GLenum, "pname"), Out(Array(GLint, "_gl_param_size(pname)"), "params")], sideeffects=False), # GL_APPLE_sync GlFunction(GLsync, "glFenceSyncAPPLE", [(GLenum, "condition"), (GLbitfield, "flags")]), @@ -1913,8 +1913,8 @@ glapi.addFunctions([ GlFunction(Void, "glCullParameterfvEXT", [(GLenum, "pname"), (Array(GLfloat, 4), "params")]), # GL_EXT_debug_label - GlFunction(Void, "glLabelObjectEXT", [(GLenum, "type"), (GLuint, "object"), (GLsizei, "length"), (GLstringConst, "label")]), - GlFunction(Void, "glGetObjectLabelEXT", [(GLenum, "type"), (GLuint, "object"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), Out(GLstring, "label")], sideeffects=False), + GlFunction(Void, "glLabelObjectEXT", [(GLenum, "type"), (GLnameEXT("type"), "object"), (GLsizei, "length"), (GLstringConst, "label")]), + GlFunction(Void, "glGetObjectLabelEXT", [(GLenum, "type"), (GLnameEXT("type"), "object"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), Out(GLstring, "label")], sideeffects=False), # GL_EXT_debug_marker GlFunction(Void, "glInsertEventMarkerEXT", [(GLsizei, "length"), (String(Const(GLchar), "length ? length : strlen(marker)"), "marker")], sideeffects=True), @@ -2483,8 +2483,8 @@ glapi.addFunctions([ GlFunction(GLuint, "glGetDebugMessageLog", [(GLuint, "count"), (GLsizei, "bufsize"), Out(Array(GLenum, "count"), "sources"), Out(Array(GLenum, "count"), "types"), Out(Array(GLuint, "count"), "ids"), Out(Array(GLenum, "count"), "severities"), Out(Array(GLsizei, "count"), "lengths"), Out(String(GLchar, "_glGetDebugMessageLog_length(messageLog, lengths, _result)"), "messageLog")], sideeffects=False, fail=0), GlFunction(Void, "glPushDebugGroup", [(GLenum, "source"), (GLuint, "id"), (GLsizei, "length"), InGlString(GLchar, "length", "message")], sideeffects=True), GlFunction(Void, "glPopDebugGroup", [], sideeffects=True), - GlFunction(Void, "glObjectLabel", [(GLenum, "identifier"), (GLuint, "name"), (GLsizei, "length"), InGlString(GLchar, "length", "label")], sideeffects=True), - GlFunction(Void, "glGetObjectLabel", [(GLenum, "identifier"), (GLuint, "name"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), OutGlString(GLchar, "length", "label")], sideeffects=False), + GlFunction(Void, "glObjectLabel", [(GLenum, "identifier"), (GLname("identifier"), "name"), (GLsizei, "length"), InGlString(GLchar, "length", "label")], sideeffects=True), + GlFunction(Void, "glGetObjectLabel", [(GLenum, "identifier"), (GLname("identifier"), "name"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), OutGlString(GLchar, "length", "label")], sideeffects=False), GlFunction(Void, "glObjectPtrLabel", [(OpaquePointer(Const(Void)), "ptr"), (GLsizei, "length"), InGlString(GLchar, "length", "label")], sideeffects=True), GlFunction(Void, "glGetObjectPtrLabel", [(OpaquePointer(Const(Void)), "ptr"), (GLsizei, "bufSize"), Out(Pointer(GLsizei), "length"), OutGlString(GLchar, "length", "label")], sideeffects=False), diff --git a/specs/gltypes.py b/specs/gltypes.py index ac3dde82..853faa27 100644 --- a/specs/gltypes.py +++ b/specs/gltypes.py @@ -302,38 +302,72 @@ def GLindexBuffer(countExpr, typeExpr): # Polymorphic object name def GLname(targetExpr): return Polymorphic(targetExpr, [ + # GL_KHR_debug ('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_TRANSFORM_FEEDBACK', GLfeedback), ('GL_SAMPLER', GLsampler), ('GL_TEXTURE', GLtexture), + ('GL_RENDERBUFFER', GLrenderbuffer), + ('GL_FRAMEBUFFER', GLframebuffer), + ('GL_DISPLAY_LIST', GLlist), + # GL_ARB_copy_image ('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_2D_MULTISAMPLE_ARRAY', GLtexture), ('GL_TEXTURE_RECTANGLE', GLtexture), ('GL_TEXTURE_CUBE_MAP', GLtexture), + ('GL_TEXTURE_CUBE_MAP_ARRAY', GLtexture), + ('GL_TEXTURE_3D', GLtexture), + # GL_AMD_name_gen_delete + ('GL_DATA_BUFFER_AMD', GLbuffer), + ('GL_PERFORMANCE_MONITOR_AMD', GLuint), + ('GL_QUERY_OBJECT_AMD', GLquery), + ('GL_VERTEX_ARRAY_OBJECT_AMD', GLarray), + ('GL_SAMPLER_OBJECT_AMD', GLsampler), + # just in case + ('GL_TEXTURE_BUFFER', 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), + ], GLuint) +def GLnameAPPLE(targetExpr, defaultType=GLuint): + return Polymorphic(targetExpr, [ + # GL_APPLE_fence + ('GL_FENCE_APPLE', GLfence), + ('GL_TEXTURE', GLtexture), + ('GL_VERTEX_ARRAY', GLarrayAPPLE), + ('GL_DRAW_PIXELS_APPLE', GLuint), + # GL_APPLE_object_purgeable + ('GL_BUFFER_OBJECT_APPLE', GLbuffer), ('GL_RENDERBUFFER', GLrenderbuffer), + ], defaultType) +def GLnameEXT(targetExpr): + return Polymorphic(targetExpr, [ + # GL_EXT_debug_label + ('GL_TEXTURE', GLtexture), ('GL_FRAMEBUFFER', GLframebuffer), - ('GL_DISPLAY_LIST', GLlist), - ('GL_FENCE_APPLE', GLfence), - ('GL_DRAW_PIXELS_APPLE', GLuint), # GL_APPLE_fence + ('GL_RENDERBUFFER', GLrenderbuffer), + ('GL_BUFFER_OBJECT_EXT', GLbuffer), + ('GL_SHADER_OBJECT_EXT', GLshader), + ('GL_PROGRAM_OBJECT_EXT', GLprogram), + ('GL_VERTEX_ARRAY_OBJECT_EXT', GLarray), + ('GL_QUERY_OBJECT_EXT', GLquery), + ('GL_SAMPLER', GLsampler), + ('GL_TRANSFORM_FEEDBACK', GLfeedback), + ('GL_PROGRAM_PIPELINE_OBJECT_EXT', GLpipeline), ], GLuint) - # GL_AMD_performance_monitor GLperfMonitorCounterInfoAMD = Polymorphic('pname', [ ('GL_COUNTER_TYPE_AMD', Pointer(GLenum)), |