summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* dispatch: Delete unused init_dispatch functions.Paul Berry2012-11-0632-431/+0
| | | | | | | | | | The new code-generated version of _mesa_create_exec_table() populates the entire dispatch table (except for dynamic functions) by itself; it no longer calls separate functions to initialize parts of the dispatch table. This patch removes those no-longer-needed functions. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* dispatch: Code generate api_exec.c.Paul Berry2012-11-066-934/+21
| | | | | | | | | 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]>
* dispatch: Make all API functions non-static.Paul Berry2012-11-0634-538/+1304
| | | | | | | | | | | | | | | | | Some of the functions that we store in the dispatch table are declared as non-static in their .c files and are inserted into the dispatch table directly by _mesa_create_exec_table(). Other functions are declared as static, and are inserted into the dispatch table by a dedicated function that lives in the same .c file (e.g. _mesa_loopback_init_api_table() in api_loopback.c). This patch makes all of these functions non-static, and creates appropriate prototypes for them, so that in future patches we can populate the entire dispatch table using a single code-generated function. 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]>
* dispatch: Remove a few FEATURE_ES1 conditionals.Paul Berry2012-11-065-18/+1
| | | | | | | | This allows the GLES1.1 dispatch sanity test to be run on all builds, even builds that do not include GLES1 support. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: assert that key->fragprog_inputs_read value isn't too largeBrian Paul2012-11-061-0/+2
| | | | | | | fragprog_inputs_read is a 12-bit bitfield so check the assigned value. MSVC warns on the assignment. Not easy to fix but let's do a sanity check. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix MSVC signed/unsigned warnings in context.cBrian Paul2012-11-061-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix MSVC signed/unsigned warnings in transformfeedback.cBrian Paul2012-11-061-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* swrast: fix MSVC signed/unsigned warningsBrian Paul2012-11-061-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* tnl: fix MSVC signed/unsigned warningsBrian Paul2012-11-061-1/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: silence MSVC signed/unsigned warning in texgetmage.cBrian Paul2012-11-061-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: silence MSVC signed/unsigned warning in texstorage.cBrian Paul2012-11-061-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* vbo: use GLuint for numInstances to silence MSVC warningsBrian Paul2012-11-062-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix signed/unsigned MSVC warnings in fbobject.cBrian Paul2012-11-061-2/+3
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: s/GLint/GLuint/ in matrix.c to silence MSVC warningsBrian Paul2012-11-061-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: s/int/GLuint/ in get.c to silence MSVC warningsBrian Paul2012-11-061-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix assorted MSVC conversion warnings in format_pack.cBrian Paul2012-11-061-10/+10
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: change glsl_to_tgsi_visitor from class to structBrian Paul2012-11-061-1/+1
| | | | | | To match the declaration in the .h file and silence an MSVC warning. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: add int cast to silence warningBrian Paul2012-11-061-1/+1
| | | | | | MSVC warns that negating an unsigned value yields an unsigned value. Reviewed-by: Jose Fonseca <[email protected]>
* glsl: fix signed/unsigned comparision warnings on MSVCBrian Paul2012-11-063-7/+7
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* glsl: remove incorrect 'struct' keywordBrian Paul2012-11-061-1/+1
| | | | | | ir_variable is a class, not a struct. Fixes an MSVC warning. Reviewed-by: Jose Fonseca <[email protected]>
* glsl: add 'f' suffix to floats to silence MSVC warningsBrian Paul2012-11-061-1/+1
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* glsl: change int->unsigned to silence MSVC warningsBrian Paul2012-11-062-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* r600g: add in-place DB decompression and texturing with DB tilingMarek Olšák2012-11-069-80/+218
| | | | | | | | | | | | | | | | | | | | | The decompression is done in-place and only the compressed tiles are decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F. The texture unit is programmed to use non-displayable tiling and depth ordering of samples, so that it can fetch the texture in the native DB format. The latest version of the libdrm surface allocator is required for stencil texturing to work. The old one didn't create the mipmap tree correctly. We need a separate mipmap tree for stencil, because the stencil mipmap offsets are not really depth offsets/4. There are still some known bugs, but this should save some memory and it also improves performance a little bit in Lightsmark (especially with low resolutions; tested with Radeon HD 5000). The DB->CB copy is still used for transfers. Reviewed-by: Jerome Glisse <[email protected]>
* vbo: fix glVertexAttribI* functionsMarek Olšák2012-11-0610-63/+179
| | | | | | | | | | | | | | | | | | | | | | The functions were broken, because they converted ints to floats. Now we can finally advertise OpenGL 3.0. ;) In this commit, the vbo module also tracks the type for each attrib in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT. The little ugliness is the vertex attribs are declared as floats even though there may be integer values. The code just copies integer values into them without any conversion. This implementation passes the glVertexAttribI piglit test which I am going to commit in piglit soon. The test covers vertex arrays, immediate mode and display lists. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> v2: cosmetic changes as suggested by Brian
* meta: Remove redundant code in _mesa_meta_GenerateMipmapAnuj Phogat2012-11-051-61/+4
| | | | | | | | | Integer textures generate invalid operation in glGenerateMipmap. So, the code related to integer textures is now redundant. Note: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Generate invalid operation in glGenerateMipMap for integer texturesAnuj Phogat2012-11-051-0/+9
| | | | | | | | | | | | | | | Khronos has reached a conclusion and disallowed following texture formats in glGenerateMipMap(): (a) ASTC textures (b) integer internal formats (e.g., RGBA8UI, RG16I) (c) textures with stencil formats (e.g., STENCIL_INDEX8) (d) textures with packed depth/stencil formats (e.g, DEPTH24_STENCIL8) https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9471 Note: This is a candidate for stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* trace: Prevent segfault when passing NULL to set_vertex_buffers.José Fonseca2012-11-052-15/+23
| | | | State tracker now passes NULL buffer array to unbind buffers.
* galahad: Prevent segfault when passing NULL to set_vertex_buffers.José Fonseca2012-11-051-1/+1
| | | | State tracker now passes NULL buffer array to unbind buffers.
* util: Make u_framebuffer.h C++ safe.José Fonseca2012-11-051-0/+8
|
* mesa: Use "non-gen name" more consistently as an error message in GL core.Eric Anholt2012-11-042-2/+2
| | | | | | | | | I used this to help verify that my test was actually testing the paths I wanted to. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix core GL genned-name handling for glBeginQuery().Eric Anholt2012-11-041-5/+11
| | | | | | | | | Fixes piglit gl-3.1/genned-names. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix the core GL genned-name handling for glBindBufferBase()/Range().Eric Anholt2012-11-041-8/+14
| | | | | | | | | | | This is part of fixing gl-3.1/genned-names. v2: Fix a missing return value. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Fix oversized initial allocation of the state cache table pointers.Vandrus Zoltán2012-11-041-1/+1
| | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55030
* i965: Force border color A to 1 when it's not present in the GL format.Eric Anholt2012-11-041-0/+7
| | | | | | | | | | It's usually forced to 1 by the surface format, but sometimes we actually have alpha present because it's the only format available. Fixes piglit texwrap bordercolor tests for OpenGL 1.1, GL_EXT_texture_sRGB and GL_ARB_texture_float. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix uploading user vertex arrays with basevertex set.Eric Anholt2012-11-043-2/+7
| | | | | | | | | | | If the index buffer is full of values like "0 1 2 3", but basevertex is 4, we need to upload at least vertex data for elements 4 5 6 7. Whether we also upload 0 1 2 3 is a question of whether there are VBOs present or not -- see the code setting start_vertex_bias in brw_draw_upload.c. Fixes piglit draw-elements*base-vertex user_varrays Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Set dirty state for brw_draw_upload.c when num_instances changes.Eric Anholt2012-11-041-1/+4
| | | | | | | | Otherwise, if we had a set of prims passed in with a num_instances varying between them, we wouldn't upload enough (or too much!) from user vertex arrays. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Remove the vbo_rebase_prims() path.Eric Anholt2012-11-041-15/+6
| | | | | | | | The brw_draw_upload.c start_vertex_bias code has support for doing the rebase without rewriting the index buffer by applying a basevertex. It looks like vbo_rebase_prims() is not equipped to handle basevertex. Reviewed-by: Kenneth Graunke <[email protected]>