summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi
Commit message (Collapse)AuthorAgeFilesLines
* dispatch: Code generate api_exec.c.Paul Berry2012-11-061-0/+4
| | | | | | | | | This patch adjusts makefiles to cause src/mesa/main/api_exec.c to be generated using src/mapi/glapi/gen/gl_genexec.py. There should be no functional change. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi/gen: Add code generation script for _mesa_create_exec_table().Paul Berry2012-11-061-0/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This script generates the file api_exec.c, which contains just the function _mesa_create_exec_table(), based on the XML files in src/mapi/glapi/gen. The following XML attributes, in particular, are used: - "es1" indicates functions that should be available in ES1 contexts. - "es2" indicates functions that should be available in ES2/ES3 contexts. - "exec" indicates which Mesa function should be dispatched to. E.g. if the GL function is glFoo(), then: - exec="mesa" (the default) dispatches to _mesa_Foo(). - exec="check" dispatches to _check_Foo(). - exec="es" dispatches to _es_Foo(). - exec="loopback" dispatches to loopback_Foo(). - exec="skip" or exec="dynamic" causes this function to be skipped; either it is not yet supported ("skip"), or its dispatch table entry will be dynamically populated based on GL state ("dynamic"). - "desktop" indicates functions that should be available in desktop GL (non-ES) contexts. - "deprecated" indicates functions that should not be available in core contexts. - "mesa_name" indicates functions whose implementation in Mesa has a different suffix than the corresponding GL function name. The generated code looks roughly like this (showing just a single statement in each block for brevity): struct _glapi_table * _mesa_create_exec_table(struct gl_context *ctx) { struct _glapi_table *exec; exec = _mesa_alloc_dispatch_table(_gloffset_COUNT); if (exec == NULL) return NULL; if (_mesa_is_desktop_gl(ctx)) { SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT); /* other functions not shown */ } if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) { SET_BeginQueryARB(exec, _mesa_BeginQueryARB); /* other functions not shown */ } if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES) { SET_GetPointerv(exec, _mesa_GetPointerv); /* other functions not shown */ } if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) { SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB); /* other functions not shown */ } if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2) { SET_AttachShader(exec, _mesa_AttachShader); /* other functions not shown */ } if (ctx->API == API_OPENGL) { SET_Accum(exec, _mesa_Accum); /* other functions not shown */ } if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) { SET_AlphaFunc(exec, _mesa_AlphaFunc); /* other functions not shown */ } if (ctx->API == API_OPENGLES) { SET_AlphaFuncxOES(exec, _es_AlphaFuncx); /* other functions not shown */ } return exec; } Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi/gen: handle new XML attributes.Paul Berry2012-11-061-2/+63
| | | | | | | | | This patch updates gl_XML.py to parse the new XML attributes "exec", "desktop", "deprecated", and "mesa_name", which will be needed to code generate _mesa_create_exec_table(). Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi/gen: Gather API version info across aliased functions.Paul Berry2012-11-061-1/+13
| | | | | | | | | | | | | | | | gl_XML.py's gl_function class keeps track of an entry_point_api_map property that tracks, for each set of aliased functions, which ES1 or ES2 version the given function name first appeared in. This patch aggregates that information together across aliased functions, into an easier-to-use api_map property. Future patches will use this information when code generating _mesa_create_exec_table(), to determine which set of dispatch table entries should be populated based on the API. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi/gen: Comment fix.Paul Berry2012-11-061-1/+1
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with function name suffix anomalies.Paul Berry2012-11-0614-147/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the XML lists one or more GL api functions as aliases for another GL function, the mesa function that implements the functionality is usually named after the canonical version of the function (the one that is the target of the aliases). For example, FogCoordd is listed as an alias of FogCoorddEXT, and the Mesa function implementing the functionality is called loopback_FogCoorddEXT. However, there are exceptions. For example, Enablei is listed as an alias of EnableIndexedEXT, but the Mesa function implementing the functionality is called _mesa_EnableIndexed. To account for these anomalies, this patch annotates the XML with "mesa_name" attributes, which describe how to adjust the function name to find the corresponding Mesa function. For example: <function name="EnableIndexedEXT" mesa_name="-EXT">...</function> <function name="IsProgramNV" mesa_name="-NV+ARB">...</function> means that EnableIndexedEXT is implemented by a Mesa function called _mesa_EnableIndexed, and IsProgramNV is implemented by a Mesa function called _mesa_IsProgramARB. Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine the name of the Mesa function that should be stored in each dispatch table entry. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with desktop="false" for GLES-only functions.Paul Berry2012-11-065-57/+60
| | | | | | | | | Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine which functions should be skipped when the API is desktop GL. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with exec="{es,check}" for special GLES1 functions.Paul Berry2012-11-063-48/+49
| | | | | | | | | | | | | Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine which functions should be dispatched to ES-specific implementations. exec="es" indicates that the ES-specific implementation has a name beginning with "_es_" (e.g. _es_QueryMatrixxOES), and exec="check" indicates that the ES-specific implementation has a name beginning with "_check_" (e.g. _check_GetTexGenxvOES). Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with exec="loopback" for loopback functions.Paul Berry2012-11-062-208/+271
| | | | | | | | | Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine which functions should be dispatched to functions in api_loopback.c. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with exec="dynamic" for dynamic functions.Paul Berry2012-11-068-132/+208
| | | | | | | | | | Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine which functions should be skipped because Mesa dispatches them differently depending on GL state. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with exec="skip" for unimplemented functions.Paul Berry2012-11-066-273/+310
| | | | | | | | | Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine which functions should be skipped because they aren't implemented by Mesa. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Annotate XML with deprecated="3.1" for deprecated functions.Paul Berry2012-11-067-548/+710
| | | | | | | | | Future patches will use this annotation when code generating _mesa_create_exec_table(), to determine which functions should be skipped in core contexts. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Mark GLX extensions as window_system="glX".Paul Berry2012-11-061-3/+3
| | | | | | | | We were already doing this for some GLX extensions, but not others. This patch makes our use of window_system="glX" consistent. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: Use GL_ or GLX_ prefix for all category names.Paul Berry2012-11-061-2/+2
| | | | | | | | | | This patch standardizes the category names used in the glapi XML files to begin each extension name with the prefix "GL_" or "GLX_". There is no functional change, because these category names are not used in the generated code. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glapi: alias ProgramParameteriARB to ProgramParameteriJordan Justen2012-11-031-1/+1
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glapi: move include for ARB_get_program_binary.xml to gl_API.xmlJordan Justen2012-11-032-1/+3
| | | | | | | | These functions are part in GL 4.3. Moving this will allow ProgramParameteriARB to alias ProgramParameteri. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glapi: alias FramebufferTextureARB to FramebufferTextureJordan Justen2012-11-031-1/+1
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* dispatch: Include GLES1-only functions in dispatch table.Paul Berry2012-11-013-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously dispatch table-related code was generated from gl_API.xml, so it did not include slots for GLES1-only functions (such as those taking fixed-point arguments). This patch generates dispatch table-related code from gl_and_es_API.xml, so that GLES1-only functions are included. This paves the way for future patches that will unify the GLES1 dispatch table with the dispatch tables for the other APIs. The following generated files are affected: - glapi_x86.S - glapi_x86-64.S - glapi_sparc.S - glprocs.h - glapitemp.h - glapitable.h - glapi_gentable.c - dispatch.h - remap_helper.h Since this change affects makefiles, a full rebuild is required. Reviewed-by: Kenneth Graunke <[email protected]> v2: Adjust dependencies to ensure that generated files will be rebuilt whenever any ES-related XML source files are changed. Reviewed-by: Chad Versace <[email protected]>
* dispatch: properly handle parameter name mismatches in glapitemp.h.Paul Berry2012-11-012-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when code-generating aliased functions in glapitemp.h, we weren't consistent about which function alias we used to obtain the parameter names, with the risk that we would generate incorrect code like this: KEYWORD1 void KEYWORD2 NAME(Foo)(GLint x) { (void) x; DISPATCH(Foo, (x), (F, "glFoo(%d);\n", x)); } KEYWORD1 void KEYWORD2 NAME(FooEXT)(GLint y) { (void) x; DISPATCH(Foo, (x), (F, "glFooEXT(%d);\n", x)); } At the moment there are no aliased functions with mismatched parameter names, so this isn't the problem. But when we introduce GLES1 functions into the dispatch table, there will be (MapBufferRange/MapBufferRangeEXT). This patch paves the way for that by fixing the code generation script to handle the mismatch correctly. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* dispatch: Include glheader.h in dispatch-related files.Paul Berry2012-11-012-2/+2
| | | | | | | | | This ensures that GLES1-only typedefs are available in these files. In a future patch, this will allow us to expand the dispatch table to include GLES1-only functions. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* dispatch: Update check_table.cpp to reflect recent aliasing changes.Paul Berry2012-11-011-2/+0
| | | | | | | | | | | | | | | | In commits bad96f6 and e7dd2e5 I added the following aliases: - ClampColor -> ClampColorARB - VertexAttribDivisor -> VertexAttribDivisorARB But I neglected to update check_table.cpp, causing "make check" to fail for non-shared-glapi builds. This patch removes the functions that are now aliased from check_table.cpp, so that "make check" works correctly again. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: implement ARB_map_buffer_alignmentMarek Olšák2012-10-311-1/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* glapi: Alias VertexAttribDivisor and VertexAttribDivisorARB.Paul Berry2012-10-231-1/+2
| | | | | | | | | | | | | There's no reason to have separate slots in the dispatch table for these two functions, since they are synonymous. Note: previous to this patch, we never populated the dispatch table slot for VertexAttribDivisor, which was ok, since it is not required until 3.3. After this patch, both functions will be usable provided that the ARB_instanced_arrays extension is present. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Alias ClampColor and ClampColorARB.Paul Berry2012-10-231-1/+1
| | | | | | | | | There's no reason to have separate slots in the dispatch table for these two functions, since they are synonymous. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add es2="3.0" attributes to XML.Matt Turner2012-10-1613-103/+103
| | | | | | | Note that we are missing the ARB_internalformat_query extension, which provides the glGetInternalformativ function needed by GL ES 3.0. Reviewed-by: Paul Berry <[email protected]>
* glapi: Delete gles_api.py, since it is no longer used.Paul Berry2012-10-162-472/+0
| | | | | Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Use GLES information from XML rather than gles_api.py.Paul Berry2012-10-162-16/+2
| | | | | Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Read GLES information from XML.Paul Berry2012-10-161-0/+48
| | | | | Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add es1 and es2 attributes to XML.Paul Berry2012-10-169-334/+502
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the set of functions which exist in GLES1 or GLES2 is determined by hardcoded lists of function names in gles_api.py. This patch encodes that information into the XML files using new attributes, es1 and es2. The es1 attribute denotes the first version of GLES 1 in which the function exists (e.g. es1="1.1" means the function exists in GLES 1.1 but not GLES 1.0). "none" (the default) means the function is not available in any version of GLES 1. The es2 attribute denotes the first version of GLES 2/3 in which the function exists (e.g. es2="2.0" means the function exists in both GLES 2.0 and GLES 3.0). "none" (the default) means the function is not available in any version of GLES 2 or GLES 3. Note that since GLES 3 is a strict superset of GLES 2, there is no need for a separate attribute for it; instead, 'es2="3.0"' should be used to denote functions that are present in GLES 3 but not GLES 2. This patch only adds information about GLES versions 1.0, 1.1, and 2.0. Later patches will modify the python code generation scripts to use this information rather than the hardcoded lists in gles_api.py. Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: use new-style Python classes.Paul Berry2012-10-164-10/+10
| | | | | | | | | | | | | | | | | An unfortunate quirk of Python 2 is that there are two types of classes: "classic" classes (which are backward compatible with some unfortunate design decisions made early in Python's history), and "new-style" classes. Classic classes have a number of limitations (for example they don't support super()) and are unavailable in Python 3. There's really no reason to use classic classes, except in unmaintained legacy code. For more information see http://www.python.org/download/releases/2.2.3/descrintro/. This patch upgrades the Python code in src/mapi/glapi/gen to use exclusively new-style classes. Tested-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/es: Enable GL_EXT_map_buffer_rangeFredrik Höglund2012-10-162-0/+30
| | | | | | This extension is functionally the same as GL_ARB_map_buffer_range. Reviewed-by: Ian Romanick <[email protected]>
* glapi: Reformat python code generation scripts to use 4-space indentation.Paul Berry2012-10-1021-5698/+5698
| | | | | | | | | | | | This brings us into accordance with the official Python style guide (http://www.python.org/dev/peps/pep-0008/#indentation). To preserve the indentation of the c code that is generated by these scripts, I've avoided re-indenting triple-quoted strings (unless those strings appear to be docstrings). Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension sectionImre Deak2012-10-101-1/+2
| | | | | | | | | This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the EXT_polygon_offset section. (Solution by Ian Romanick) Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
* glx: Remove the last user of -DUSE_XCB.Eric Anholt2012-10-091-2/+0
| | | | Reviewed-by: Chad Versace <[email protected]>
* glapi: Do not use backtrace on Cygwin.Vinson Lee2012-10-041-1/+1
| | | | | | | execinfo.h is not available on Cygwin. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definitionMatt Turner2012-10-014-10/+10
|
* build: Use PTHREAD_LIBS and PTHREAD_CFLAGSMatt Turner2012-10-011-1/+2
|
* intel: add support for ANGLE_texture_compression_dxt.Oliver McFadden2012-10-011-0/+6
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* scons: Disable build of assembly sources on Cygwin.Vinson Lee2012-09-281-1/+1
| | | | | | | The assembly sources currently do not build on Cygwin. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Fix compile warnings since 99fee476a102be898a1a093c037e06382f90a5b9Eric Anholt2012-09-281-1/+1
| | | | | | | | | _glapi_table is a struct full of named function pointers, while the generated code just wants to treat it as an array of function pointers. Cast to avoid the compiler warning. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* gles2: Alias glReadBufferNV with desktop glReadBufferIan Romanick2012-09-281-1/+1
| | | | | | | | NOTE: This is a candidate for the 9.0 branch Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Kristian Høgsberg <[email protected]>
* glapi/glx: rename 'table' variable to 'disp_table'Brian Paul2012-09-061-2/+2
| | | | | | | | | | | | This fixes an issue where the local 'table' variable was hiding the function parameter name in glGetColorTable(..., void *table). This should be OK as long as there's never a GL entrypoint that uses 'disp_table' as a parameter name. Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <[email protected]>
* glX_proto_send.py: Don't cast the return value of mallocMatt Turner2012-09-051-1/+1
|
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* glX_proto_send.py: Remove deprecated Xmalloc/Xfree callsMatt Turner2012-09-051-3/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* Use the correct macro _WIN32 for Windows.Vinson Lee2012-09-053-3/+3
| | | | | | | | | | | | | | The correct predefined macro for Windows is _WIN32, not WIN32 or __WIN32__. _WIN32 is defined for 32-bit and 64-bit version of Windows by both MSVC and MinGW compilers. http://sourceforge.net/p/predef/wiki/OperatingSystems http://msdn.microsoft.com/en-us/library/b0084kay.aspx This patch also fixes a MinGW automake build error. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Enable GL_OES_vertex_array_objectIan Romanick2012-08-292-0/+31
| | | | | | | Functionally the same as GL_ARB_vertex_array_object. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glapi/glx: call __glEmptyImage if USE_XCB, not memcpy directlyJulien Cristau2012-08-271-10/+25
| | | | | | | | | | | We were stomping on the caller's buffer by ignoring their alignment requests and other pixel store modes. This patch makes the USE_XCB path match the older one more closely. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52059 Signed-off-by: Julien Cristau <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* build: Only generate dispatch assembly code that will be builtMatt Turner2012-08-241-4/+12
|
* automake: convert es2apiMatt Turner2012-08-231-4/+0
|