diff options
Diffstat (limited to 'src/mapi/glapi/gen')
-rw-r--r-- | src/mapi/glapi/gen/EXT_gpu_shader4.xml | 244 | ||||
-rw-r--r-- | src/mapi/glapi/gen/Makefile | 15 | ||||
-rw-r--r-- | src/mapi/glapi/gen/glX_proto_send.py | 6 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_SPARC_asm.py | 4 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_procs.py | 8 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_table.py | 42 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_x86_asm.py | 5 |
8 files changed, 285 insertions, 41 deletions
diff --git a/src/mapi/glapi/gen/EXT_gpu_shader4.xml b/src/mapi/glapi/gen/EXT_gpu_shader4.xml new file mode 100644 index 00000000000..cb64e868dd9 --- /dev/null +++ b/src/mapi/glapi/gen/EXT_gpu_shader4.xml @@ -0,0 +1,244 @@ +<?xml version="1.0"?> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> + +<OpenGLAPI> + +<category name="GL_EXT_gpu_shader4" number="326"> + + <enum name="VERTEX_ATTRIB_ARRAY_INTEGER_EXT" value="0x88FD"/> + <enum name="SAMPLER_1D_ARRAY_EXT" value="0x8DC0"/> + <enum name="SAMPLER_2D_ARRAY_EXT" value="0x8DC1"/> + <enum name="SAMPLER_BUFFER_EXT" value="0x8DC2"/> + <enum name="SAMPLER_1D_ARRAY_SHADOW_EXT" value="0x8DC3"/> + <enum name="SAMPLER_2D_ARRAY_SHADOW_EXT" value="0x8DC4"/> + <enum name="SAMPLER_CUBE_SHADOW_EXT" value="0x8DC5"/> + <enum name="UNSIGNED_INT_VEC2_EXT" value="0x8DC6"/> + <enum name="UNSIGNED_INT_VEC3_EXT" value="0x8DC7"/> + <enum name="UNSIGNED_INT_VEC4_EXT" value="0x8DC8"/> + <enum name="INT_SAMPLER_1D_EXT" value="0x8DC9"/> + <enum name="INT_SAMPLER_2D_EXT" value="0x8DCA"/> + <enum name="INT_SAMPLER_3D_EXT" value="0x8DCB"/> + <enum name="INT_SAMPLER_CUBE_EXT" value="0x8DCC"/> + <enum name="INT_SAMPLER_2D_RECT_EXT" value="0x8DCD"/> + <enum name="INT_SAMPLER_1D_ARRAY_EXT" value="0x8DCE"/> + <enum name="INT_SAMPLER_2D_ARRAY_EXT" value="0x8DCF"/> + <enum name="INT_SAMPLER_BUFFER_EXT" value="0x8DD0"/> + <enum name="UNSIGNED_INT_SAMPLER_1D_EXT" value="0x8DD1"/> + <enum name="UNSIGNED_INT_SAMPLER_2D_EXT" value="0x8DD2"/> + <enum name="UNSIGNED_INT_SAMPLER_3D_EXT" value="0x8DD3"/> + <enum name="UNSIGNED_INT_SAMPLER_CUBE_EXT" value="0x8DD4"/> + <enum name="UNSIGNED_INT_SAMPLER_2D_RECT_EXT" value="0x8DD5"/> + <enum name="UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT" value="0x8DD6"/> + <enum name="UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT" value="0x8DD7"/> + <enum name="UNSIGNED_INT_SAMPLER_BUFFER_EXT" value="0x8DD8"/> + <enum name="MIN_PROGRAM_TEXEL_OFFSET_EXT" value="0x8904"> + <size name="Get" mode="get"/> + </enum> + <enum name="MAX_PROGRAM_TEXEL_OFFSET_EXT" value="0x8905"> + <size name="Get" mode="get"/> + </enum> + + + <function name="VertexAttribI1iEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLint"/> + </function> + + <function name="VertexAttribI2iEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + </function> + + <function name="VertexAttribI3iEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + </function> + + <function name="VertexAttribI4iEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLint"/> + <param name="y" type="GLint"/> + <param name="z" type="GLint"/> + <param name="w" type="GLint"/> + </function> + + <function name="VertexAttribI1uiEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLuint"/> + </function> + + <function name="VertexAttribI2uiEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLuint"/> + <param name="y" type="GLuint"/> + </function> + + <function name="VertexAttribI3uiEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLuint"/> + <param name="y" type="GLuint"/> + <param name="z" type="GLuint"/> + </function> + + <function name="VertexAttribI4uiEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="x" type="GLuint"/> + <param name="y" type="GLuint"/> + <param name="z" type="GLuint"/> + <param name="w" type="GLuint"/> + </function> + + <function name="VertexAttribI1ivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLint *"/> + </function> + + <function name="VertexAttribI2ivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLint *"/> + </function> + + <function name="VertexAttribI3ivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLint *"/> + </function> + + <function name="VertexAttribI4ivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLint *"/> + </function> + + <function name="VertexAttribI1uivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLuint *"/> + </function> + + <function name="VertexAttribI2uivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLuint *"/> + </function> + + <function name="VertexAttribI3uivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLuint *"/> + </function> + + <function name="VertexAttribI4uivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLuint *"/> + </function> + + <function name="VertexAttribI4bvEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLbyte *"/> + </function> + + <function name="VertexAttribI4svEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLshort *"/> + </function> + + <function name="VertexAttribI4ubvEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLubyte *"/> + </function> + + <function name="VertexAttribI4usvEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="v" type="const GLushort *"/> + </function> + + <function name="VertexAttribIPointerEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="size" type="GLint"/> + <param name="type" type="GLenum"/> + <param name="stride" type="GLsizei"/> + <param name="pointer" type="const GLvoid *"/> + </function> + + <function name="GetVertexAttribIivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint *"/> + </function> + + <function name="GetVertexAttribIuivEXT" offset="assign"> + <param name="index" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLuint *"/> + </function> + + <function name="Uniform1uiEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLuint"/> + </function> + + <function name="Uniform2uiEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLuint"/> + <param name="v1" type="GLuint"/> + </function> + + <function name="Uniform3uiEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLuint"/> + <param name="v1" type="GLuint"/> + <param name="v2" type="GLuint"/> + </function> + + <function name="Uniform4uiEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="v0" type="GLuint"/> + <param name="v1" type="GLuint"/> + <param name="v2" type="GLuint"/> + <param name="v3" type="GLuint"/> + </function> + + <function name="Uniform1uivEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLuint *"/> + </function> + + <function name="Uniform2uivEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLuint *"/> + </function> + + <function name="Uniform3uivEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLuint *"/> + </function> + + <function name="Uniform4uivEXT" offset="assign"> + <param name="location" type="GLint"/> + <param name="count" type="GLsizei"/> + <param name="value" type="const GLuint *"/> + </function> + + <function name="GetUniformuivEXT" offset="assign"> + <param name="program" type="GLuint"/> + <param name="location" type="GLint"/> + <param name="params" type="GLuint *"/> + </function> + + <function name="BindFragDataLocationEXT" offset="assign"> + <param name="program" type="GLuint"/> + <param name="colorNumber" type="GLuint"/> + <param name="name" type="const GLchar *"/> + </function> + + <function name="GetFragDataLocationEXT" offset="assign"> + <return type="GLint"/> + <param name="program" type="GLuint"/> + <param name="name" type="const GLchar *"/> + </function> + +</category> + +</OpenGLAPI> diff --git a/src/mapi/glapi/gen/Makefile b/src/mapi/glapi/gen/Makefile index de84de8d07a..ed1e664b8a8 100644 --- a/src/mapi/glapi/gen/Makefile +++ b/src/mapi/glapi/gen/Makefile @@ -14,9 +14,7 @@ MESA_GLX_DIR = $(TOP)/src/glx MESA_GLAPI_OUTPUTS = \ $(MESA_GLAPI_DIR)/glprocs.h \ $(MESA_GLAPI_DIR)/glapitemp.h \ - $(MESA_GLAPI_DIR)/glapioffsets.h \ - $(MESA_GLAPI_DIR)/glapitable.h \ - $(MESA_GLAPI_DIR)/glapidispatch.h + $(MESA_GLAPI_DIR)/glapitable.h MESA_GLAPI_ASM_OUTPUTS = \ $(MESA_GLAPI_DIR)/glapi_x86.S \ @@ -27,6 +25,7 @@ MESA_OUTPUTS = \ $(MESA_GLAPI_OUTPUTS) \ $(MESA_GLAPI_ASM_OUTPUTS) \ $(MESA_DIR)/main/enums.c \ + $(MESA_DIR)/main/glapidispatch.h \ $(MESA_DIR)/main/remap_helper.h \ $(MESA_GLX_DIR)/indirect.c \ $(MESA_GLX_DIR)/indirect.h \ @@ -85,6 +84,7 @@ API_XML = \ APPLE_vertex_array_object.xml \ EXT_draw_buffers2.xml \ EXT_framebuffer_object.xml \ + EXT_gpu_shader4.xml \ EXT_packed_depth_stencil.xml \ EXT_provoking_vertex.xml \ EXT_separate_shader_objects.xml \ @@ -133,15 +133,9 @@ $(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON) $(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -$(MESA_GLAPI_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - $(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -$(MESA_GLAPI_DIR)/glapidispatch.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ - ###################################################################### $(MESA_GLAPI_DIR)/glapi_x86.S: gl_x86_asm.py $(COMMON) @@ -160,6 +154,9 @@ $(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API) -f $(MESA_GLAPI_DIR)/gen-es/es1_API.xml \ -f $(MESA_GLAPI_DIR)/gen-es/es2_API.xml > $@ +$(MESA_DIR)/main/glapidispatch.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ + $(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py index bd41c9e667a..17ebad0176c 100644 --- a/src/mapi/glapi/gen/glX_proto_send.py +++ b/src/mapi/glapi/gen/glX_proto_send.py @@ -166,7 +166,6 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): print '#include "indirect.h"' print '#include "glxclient.h"' print '#include "indirect_size.h"' - print '#include "glapidispatch.h"' print '#include "glapi.h"' print '#include "glthread.h"' print '#include <GL/glxproto.h>' @@ -375,7 +374,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print '' print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)' print ' if (gc->isDirect) {' - print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) + print ' %sGET_DISPATCH()->%s(%s);' % (ret_string, func.name, func.get_called_parameter_string()) print ' } else' print '#endif' print ' {' @@ -994,6 +993,9 @@ extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( asdf = func.static_glx_name(n) if asdf not in func.static_entry_points: print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params) + # give it a easy-to-remember name + if func.client_handcode: + print '#define gl_dispatch_stub_%s gl%s' % (n, asdf) else: print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params) diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index cbe37f2d75a..bd212c2e4d9 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -12518,4 +12518,6 @@ <xi:include href="EXT_texture_integer.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> +<xi:include href="EXT_gpu_shader4.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + </OpenGLAPI> diff --git a/src/mapi/glapi/gen/gl_SPARC_asm.py b/src/mapi/glapi/gen/gl_SPARC_asm.py index 33e752df38c..400e684da02 100644 --- a/src/mapi/glapi/gen/gl_SPARC_asm.py +++ b/src/mapi/glapi/gen/gl_SPARC_asm.py @@ -39,8 +39,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printRealHeader(self): - print '#include "glapi/glapioffsets.h"' - print '' print '#ifdef __arch64__' print '#define GL_OFF(N)\t((N) * 8)' print '#define GL_LL\t\tldx' @@ -223,7 +221,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): for f in api.functionIterateByOffset(): name = f.dispatch_name() - print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, f.name) + print '\tGL_STUB(gl%s, %d)' % (name, f.offset) if not f.is_static_entry_point(f.name): print '\tHIDDEN(gl%s)' % (name) diff --git a/src/mapi/glapi/gen/gl_procs.py b/src/mapi/glapi/gen/gl_procs.py index 5de61fbdfe9..a9ba48297a1 100644 --- a/src/mapi/glapi/gen/gl_procs.py +++ b/src/mapi/glapi/gen/gl_procs.py @@ -96,7 +96,7 @@ typedef struct { for func in api.functionIterateByOffset(): name = func.dispatch_name() self.printFunctionString(func.name) - table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) + table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.offset)) # The length of the function's name, plus 2 for "gl", # plus 1 for the NUL. @@ -112,9 +112,9 @@ typedef struct { if func.has_different_protocol(n): alt_name = "gl" + func.static_glx_name(n) - table.append((base_offset, "gl" + name, alt_name, alt_name, func.name)) + table.append((base_offset, "gl" + name, alt_name, alt_name, func.offset)) else: - table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) + table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.offset)) base_offset += len(n) + 3 @@ -170,7 +170,7 @@ typedef struct { print 'static const glprocs_table_t static_functions[] = {' for info in table: - print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info + print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, %d),' % info print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)' print '};' diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py index 3bd7569e92a..c7cb5a40a1c 100644 --- a/src/mapi/glapi/gen/gl_table.py +++ b/src/mapi/glapi/gen/gl_table.py @@ -124,52 +124,54 @@ class PrintRemapTable(gl_XML.gl_print_base): functions.append( [f, count] ) count += 1 else: - abi_functions.append( f ) + abi_functions.append( [f, -1] ) if self.es: # remember functions with aliases if len(f.entry_points) > 1: alias_functions.append(f) + print '/* total number of offsets below */' + print '#define _gloffset_COUNT %d' % (len(abi_functions + functions)) + print '' - for f in abi_functions: - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - + for f, index in abi_functions: + print '#define _gloffset_%s %d' % (f.name, f.offset) print '' print '#if !defined(_GLAPI_USE_REMAP_TABLE)' print '' - for [f, index] in functions: - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) + for f, index in functions: + print '#define _gloffset_%s %d' % (f.name, f.offset) print '' - print '#else' + print '#else /* !_GLAPI_USE_REMAP_TABLE */' print '' + print '#define driDispatchRemapTable_size %u' % (count) print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];' print '' - for [f, index] in functions: + for f, index in functions: print '#define %s_remap_index %u' % (f.name, index) print '' - for [f, index] in functions: - arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) - cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) + for f, index in functions: + print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) - print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name) - print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name) - print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name) + print '' + print '#endif /* _GLAPI_USE_REMAP_TABLE */' + print '' + for f, index in abi_functions + functions: + arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) + cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) - print '' - print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' + print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), _gloffset_%s, parameters)' % (f.name, cast, f.name) + print '#define GET_%s(disp) GET_by_offset(disp, _gloffset_%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) SET_by_offset(disp, _gloffset_%s, fn)' % (f.name, f.name) if alias_functions: print '' diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py index 10dfa1ddb34..3b1d035f04a 100644 --- a/src/mapi/glapi/gen/gl_x86_asm.py +++ b/src/mapi/glapi/gen/gl_x86_asm.py @@ -54,7 +54,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printRealHeader(self): print '#include "x86/assyntax.h"' - print '#include "glapi/glapioffsets.h"' print '' print '#if defined(STDCALL_API)' print '# if defined(USE_MGL_NAMESPACE)' @@ -215,7 +214,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): stack = self.get_stack_size(f) alt = "%s@%u" % (name, stack) - print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt) + print '\tGL_STUB(%s, %d, %s)' % (name, f.offset, alt) if not f.is_static_entry_point(f.name): print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt) @@ -230,7 +229,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): if f.is_static_entry_point(n): if n != f.name: alt2 = "%s@%u" % (n, stack) - text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, name, alt) + text = '\tGL_STUB_ALIAS(%s, %d, %s, %s, %s)' % (n, f.offset, alt2, name, alt) if f.has_different_protocol(n): print '#ifndef GLX_INDIRECT_RENDERING' |