From: José Fonseca Date: Thu, 25 Nov 2010 19:55:27 +0000 (+0000) Subject: More extensions. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=4441baf48293cb525f2a65f6c3bce627c4576298;p=apitrace More extensions. --- diff --git a/glapi.py b/glapi.py index 4b82959..9ac6c8d 100644 --- a/glapi.py +++ b/glapi.py @@ -68,6 +68,7 @@ GLprogramARB = Handle("programARB", GLuint) GLprogramNV = Handle("programNV", GLuint) GLframebuffer = Handle("framebuffer", GLuint) GLrenderbuffer = Handle("renderbuffer", GLuint) +GLregion = Handle("region", GLuint) def GlFunction(*args, **kwargs): @@ -616,7 +617,7 @@ glapi.add_functions([ GlFunction(Void, "glGetVertexAttribdv", [(GLuint, "index"), (GLenum, "pname"), Out(Array(GLdouble, "4"), "params")], sideeffects=False), GlFunction(Void, "glGetVertexAttribfv", [(GLuint, "index"), (GLenum, "pname"), Out(Array(GLfloat, "4"), "params")], sideeffects=False), GlFunction(Void, "glGetVertexAttribiv", [(GLuint, "index"), (GLenum, "pname"), Out(Array(GLint, "4"), "params")], sideeffects=False), - #GlFunction(Void, "glGetVertexAttribPointerv", [(GLuint, "index"), (GLenum, "pname"), Out(Pointer(GLvoid*), "pointer")], sideeffects=False), + GlFunction(Void, "glGetVertexAttribPointerv", [(GLuint, "index"), (GLenum, "pname"), Out(Pointer(OpaquePointer(GLvoid)), "pointer")], sideeffects=False), GlFunction(GLboolean, "glIsProgram", [(GLprogram, "program")]), GlFunction(GLboolean, "glIsShader", [(GLshader, "shader")]), GlFunction(Void, "glLinkProgram", [(GLprogram, "program")]), @@ -742,6 +743,10 @@ glapi.add_functions([ GlFunction(Void, "glCompressedTexSubImage1DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLsizei, "imageSize"), (Const(OpaquePointer(Void)), "data")]), GlFunction(Void, "glGetCompressedTexImageARB", [(GLenum, "target"), (GLint, "level"), Out(OpaquePointer(GLvoid), "img")], sideeffects=False), + # GL_ARB_point_parameters + GlFunction(Void, "glPointParameterfARB", [(GLenum, "pname"), (GLfloat, "param")]), + GlFunction(Void, "glPointParameterfvARB", [(GLenum, "pname"), (Const(Array(GLfloat, "__glPointParameterfvARB_size(pname)")), "params")]), + # GL_ARB_matrix_palette GlFunction(Void, "glCurrentPaletteMatrixARB", [(GLint, "index")]), GlFunction(Void, "glMatrixIndexubvARB", [(GLint, "size"), (Const(Array(GLubyte, "size")), "indices")]), @@ -828,7 +833,7 @@ glapi.add_functions([ GlFunction(Void, "glGetVertexAttribdvARB", [(GLuint, "index"), (GLenum, "pname"), Out(Array(GLdouble, "4"), "params")], sideeffects=False), GlFunction(Void, "glGetVertexAttribfvARB", [(GLuint, "index"), (GLenum, "pname"), Out(Array(GLfloat, "4"), "params")], sideeffects=False), GlFunction(Void, "glGetVertexAttribivARB", [(GLuint, "index"), (GLenum, "pname"), Out(Array(GLint, "4"), "params")], sideeffects=False), - #GlFunction(Void, "glGetVertexAttribPointervARB", [(GLuint, "index"), (GLenum, "pname"), Out(Pointer(), "pointer")], sideeffects=False), + GlFunction(Void, "glGetVertexAttribPointervARB", [(GLuint, "index"), (GLenum, "pname"), Out(Pointer(OpaquePointer(GLvoid)), "pointer")], sideeffects=False), GlFunction(GLboolean, "glIsProgramARB", [(GLprogramARB, "program")]), # GL_ARB_vertex_buffer_object @@ -932,9 +937,16 @@ glapi.add_functions([ GlFunction(Void, "glRenderbufferStorageMultisample", [(GLenum, "target"), (GLsizei, "samples"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]), GlFunction(Void, "glFramebufferTextureLayer", [(GLenum, "target"), (GLenum, "attachment"), (GLtexture, "texture"), (GLint, "level"), (GLint, "layer")]), + # GL_EXT_blend_color + GlFunction(Void, "glBlendColorEXT", [(GLclampf, "red"), (GLclampf, "green"), (GLclampf, "blue"), (GLclampf, "alpha")]), + # GL_EXT_polygon_offset GlFunction(Void, "glPolygonOffsetEXT", [(GLfloat, "factor"), (GLfloat, "bias")]), + # GL_EXT_texture3D + GlFunction(Void, "glTexImage3DEXT", [(GLenum, "target"), (GLint, "level"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLint, "border"), (GLenum, "format"), (GLenum, "type"), (Const(Blob(GLvoid, "__glTexImage3DEXT_size(format, type, width, height, depth, border)")), "pixels")]), + GlFunction(Void, "glTexSubImage3DEXT", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLenum, "format"), (GLenum, "type"), (Const(Blob(GLvoid, "__glTexSubImage3DEXT_size(format, type, width, height, depth)")), "pixels")]), + # GL_SGIX_pixel_texture GlFunction(Void, "glPixelTexGenSGIX", [(GLenum, "mode")]), @@ -946,6 +958,15 @@ glapi.add_functions([ #GlFunction(Void, "glGetPixelTexGenParameterivSGIS", [(GLenum, "pname"), Out(Array(GLint, "__glGetPixelTexGenParameterivSGIS_size(pname)"), "params")], sideeffects=False), #GlFunction(Void, "glGetPixelTexGenParameterfvSGIS", [(GLenum, "pname"), Out(Array(GLfloat, "__glGetPixelTexGenParameterfvSGIS_size(pname)"), "params")], sideeffects=False), + # GL_EXT_texture_object + GlFunction(GLboolean, "glAreTexturesResidentEXT", [(GLsizei, "n"), (Const(Array(GLtexture, "n")), "textures"), Out(Array(GLboolean, "n"), "residences")]), + GlFunction(Void, "glBindTextureEXT", [(GLenum, "target"), (GLtexture, "texture")]), + GlFunction(Void, "glDeleteTexturesEXT", [(GLsizei, "n"), (Const(Array(GLtexture, "n")), "textures")]), + GlFunction(Void, "glGenTexturesEXT", [(GLsizei, "n"), Out(Array(GLtexture, "n"), "textures")]), + GlFunction(GLboolean, "glIsTextureEXT", [(GLtexture, "texture")]), + GlFunction(Void, "glPrioritizeTexturesEXT", [(GLsizei, "n"), (Const(Array(GLtexture, "n")), "textures"), (Const(Array(GLclampf, "n")), "priorities")]), + + # GL_SGIS_multisample #GlFunction(Void, "glSampleMaskSGIS", [(GLclampf, "value"), (GLboolean, "invert")]), #GlFunction(Void, "glSamplePatternSGIS", [(GLenum, "pattern")]), @@ -961,6 +982,9 @@ glapi.add_functions([ GlFunction(Void, "glTexCoordPointerEXT", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Const(OpaquePointer(GLvoid)), "pointer")]), GlFunction(Void, "glVertexPointerEXT", [(GLint, "size"), (GLenum, "type"), (GLsizei, "stride"), (GLsizei, "count"), (Const(OpaquePointer(GLvoid)), "pointer")]), + # GL_EXT_blend_minmax + GlFunction(Void, "glBlendEquationEXT", [(GLenum, "mode")]), + # GL_EXT_point_parameters GlFunction(Void, "glPointParameterfEXT", [(GLenum, "pname"), (GLfloat, "param")]), GlFunction(Void, "glPointParameterfvEXT", [(GLenum, "pname"), (Const(Array(GLfloat, "__glPointParameterfvEXT_size(pname)")), "params")]), @@ -1067,6 +1091,10 @@ glapi.add_functions([ GlFunction(Void, "glFinishFenceNV", [(GLfenceNV, "fence")]), GlFunction(Void, "glSetFenceNV", [(GLfenceNV, "fence"), (GLenum, "condition")]), + # GL_NV_register_combiners2 + GlFunction(Void, "glCombinerStageParameterfvNV", [(GLenum, "stage"), (GLenum, "pname"), (Const(OpaqueArray(GLfloat, "__glCombinerStageParameterfvNV_size(pname)")), "params")]), + GlFunction(Void, "glGetCombinerStageParameterfvNV", [(GLenum, "stage"), (GLenum, "pname"), Out(OpaqueArray(GLfloat, "__glGetCombinerStageParameterfvNV_size(pname)"), "params")], sideeffects=False), + # GL_NV_vertex_program GlFunction(GLboolean, "glAreProgramsResidentNV", [(GLsizei, "n"), (Const(Array(GLprogramNV, "n")), "ids"), Out(Array(GLboolean, "n"), "residences")]), GlFunction(Void, "glBindProgramNV", [(GLenum, "target"), (GLprogramNV, "program")]), @@ -1155,6 +1183,15 @@ glapi.add_functions([ GlFunction(Void, "glAlphaFragmentOp3ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod"), (GLuint, "arg2"), (GLuint, "arg2Rep"), (GLuint, "arg2Mod"), (GLuint, "arg3"), (GLuint, "arg3Rep"), (GLuint, "arg3Mod")]), GlFunction(Void, "glSetFragmentShaderConstantATI", [(GLuint, "dst"), (Const(Array(GLfloat, "4")), "value")]), + # GL_NV_occlusion_query + GlFunction(Void, "glGenOcclusionQueriesNV", [(GLsizei, "n"), Out(Array(GLuint, "n"), "ids")]), + GlFunction(Void, "glDeleteOcclusionQueriesNV", [(GLsizei, "n"), (Const(Array(GLuint, "n")), "ids")]), + GlFunction(GLboolean, "glIsOcclusionQueryNV", [(GLuint, "id")]), + GlFunction(Void, "glBeginOcclusionQueryNV", [(GLuint, "id")]), + GlFunction(Void, "glEndOcclusionQueryNV", []), + GlFunction(Void, "glGetOcclusionQueryivNV", [(GLuint, "id"), (GLenum, "pname"), Out(OpaqueArray(GLint, "__glGetOcclusionQueryivNV_size(pname)"), "params")], sideeffects=False), + GlFunction(Void, "glGetOcclusionQueryuivNV", [(GLuint, "id"), (GLenum, "pname"), Out(OpaqueArray(GLuint, "__glGetOcclusionQueryuivNV_size(pname)"), "params")], sideeffects=False), + # GL_NV_point_sprite GlFunction(Void, "glPointParameteriNV", [(GLenum, "pname"), (GLint, "param")]), GlFunction(Void, "glPointParameterivNV", [(GLenum, "pname"), (Const(OpaquePointer(GLint)), "params")]), @@ -1221,5 +1258,17 @@ glapi.add_functions([ # GL_NV_geometry_program4 GlFunction(Void, "glFramebufferTextureLayerEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLtexture, "texture"), (GLint, "level"), (GLint, "layer")]), + + # GL_NV_depth_buffer_float + GlFunction(Void, "glDepthRangedNV", [(GLdouble, "zNear"), (GLdouble, "zFar")]), + GlFunction(Void, "glClearDepthdNV", [(GLdouble, "depth")]), + GlFunction(Void, "glDepthBoundsdNV", [(GLdouble, "zmin"), (GLdouble, "zmax")]), + + # GL_KTX_buffer_region + GlFunction(GLregion, "glNewBufferRegion", [(GLenum, "type")]), + GlFunction(Void, "glDeleteBufferRegion", [(GLregion, "region")]), + GlFunction(Void, "glReadBufferRegion", [(GLregion, "region"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + GlFunction(Void, "glDrawBufferRegion", [(GLregion, "region"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLint, "xDest"), (GLint, "yDest")]), + GlFunction(GLuint, "glBufferRegionEnabled", [], sideeffects=False), ]) diff --git a/glretrace.py b/glretrace.py index 20e4875..792bdd8 100644 --- a/glretrace.py +++ b/glretrace.py @@ -31,6 +31,15 @@ from retrace import Retracer class GlRetracer(Retracer): + def filter_function(self, function): + return function.name not in [ + "glNewBufferRegion", + "glDeleteBufferRegion", + "glReadBufferRegion", + "glDrawBufferRegion", + "glBufferRegionEnabled", + ] + def extract_arg(self, function, arg, arg_type, lvalue, rvalue): if function.name in [ "glColorPointer", diff --git a/glsize.hpp b/glsize.hpp index 97d0ee8..1e9325b 100644 --- a/glsize.hpp +++ b/glsize.hpp @@ -1238,6 +1238,7 @@ __glPointParameterfvEXT_size(GLenum pname) #define __glPointParameterfv_size __glPointParameterfvEXT_size #define __glPointParameteriv_size __glPointParameterfvEXT_size +#define __glPointParameterfvARB_size __glPointParameterfvEXT_size #define __glPointParameterivNV_size __glPointParameterfvEXT_size static inline size_t @@ -1380,6 +1381,13 @@ __glTexImage3D_size(GLenum format, GLenum type, GLsizei width, GLsizei height, G #define __glTexSubImage2D_size(format, type, width, height) __glTexImage2D_size(format, type, width, height, 0) #define __glTexSubImage1D_size(format, type, width) __glTexImage1D_size(format, type, width, 0) +#define __glTexImage3DEXT_size __glTexImage3D_size +#define __glTexImage2DEXT_size __glTexImage2D_size +#define __glTexImage1DEXT_size __glTexImage1D_size +#define __glTexSubImage3DEXT_size __glTexSubImage3D_size +#define __glTexSubImage2DEXT_size __glTexSubImage2D_size +#define __glTexSubImage1DEXT_size __glTexSubImage1D_size + #define __glDrawPixels_size(format, type, width, height) __glTexImage2D_size(format, type, width, height, 0) #define __glBitmap_size(width, height) __glTexImage2D_size(GL_COLOR_INDEX, GL_BITMAP, width, height, 0) diff --git a/retrace.py b/retrace.py index 7525185..6dfd0a2 100644 --- a/retrace.py +++ b/retrace.py @@ -203,7 +203,12 @@ class Retracer: def extract_arg(self, function, arg, arg_type, lvalue, rvalue): ValueExtractor().visit(arg_type, lvalue, rvalue) + def filter_function(self, function): + return True + def retrace_functions(self, functions): + functions = filter(self.filter_function, functions) + for function in functions: if function.sideeffects: self.retrace_function(function) diff --git a/stdapi.py b/stdapi.py index 8826953..68a837c 100644 --- a/stdapi.py +++ b/stdapi.py @@ -442,7 +442,13 @@ class Opaque(Type): return visitor.visit_opaque(self, *args, **kwargs) -def OpaquePointer(type): +def OpaquePointer(type, *args): + return Opaque(type.expr + ' *') + +def OpaqueArray(type, size): + return Opaque(type.expr + ' *') + +def OpaqueBlob(type, size): return Opaque(type.expr + ' *') diff --git a/wglapi.py b/wglapi.py index 481a4fe..9510006 100644 --- a/wglapi.py +++ b/wglapi.py @@ -265,6 +265,9 @@ wglapi.add_functions([ StdFunction(OpaquePointer(Void), "wglAllocateMemoryNV", [(GLsizei, "size"), (GLfloat, "readfreq"), (GLfloat, "writefreq"), (GLfloat, "priority")]), StdFunction(Void, "wglFreeMemoryNV", [(OpaquePointer(Void), "pointer")]), + # GL_WIN_swap_hint + StdFunction(Void, "glAddSwapHintRectWIN", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), + # must be last StdFunction(PROC, "wglGetProcAddress", [(LPCSTR, "lpszProc")]), ])