summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* softpipe: add ARB_texture_cube_map_array support (v1.1)Dave Airlie2012-11-096-44/+274
| | | | | | | | | | | | | This adds support to the softpipe texture sampler and tgsi exec. In order to handle the extra input to the texture sampling, I've had to expand the interfaces to take a c1 value for storing the texture compare value for the TEX2 case. v1.1: add comments (Brian) Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: add support for ARB_texture_cube_map_array (v2)Dave Airlie2012-11-095-23/+64
| | | | | | | | | | | This adds mesa state tracker support for the new extension, along with glsl->tgsi conversion to use the new opcodes where appropriate. v2: fix assert found running textureSize tests. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: add defines/shader opcode for texture cube map arrayDave Airlie2012-11-096-6/+25
| | | | | | | | | | | | | | | | This just adds the texture target and capability along with 3 new opcodes required to support this extension. As this extension requires some texture opcodes with samp + 5 args, we need to use another src register, this is only required for TEX, TXL and TXB opcodes to implement this spec. TEX2 is required for shadow cube map arrays TXL2 is required for cube map array sampler + explicit lod TXB2 is required for cube map array sampler + lod bias Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: arb_texture_cube_map_array: fix attrib push/popDave Airlie2012-11-091-2/+4
| | | | | | fdo9833 piglit test caught this. Signed-off-by: Dave Airlie <[email protected]>
* glsl: add ARB_texture_cube_map_array support (v2)Dave Airlie2012-11-0912-7/+114
| | | | | | | | | | | | This adds all the new builtins + the new sampler types, and hooks them up if the extension is supported. v2: fix missing signatures for grad/lod fix missing textureSize clarifications fix compare vs starts with usage Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add get support for TEXTURE_BINDING_CUBE_MAP_ARRAY_ARBDave Airlie2012-11-092-0/+5
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)Dave Airlie2012-11-0910-7/+107
| | | | | | | | | | | | | | | This adds the mesa core + texture + fbo support for the texture cube map array extension. v2: add comment to _mesa_num_tex_faces related to cube map arrays (Brian) drop wrong comment cut-n-paste (Brian) fix / 6 maximum check issue (Kenneth) coalsece some array case statements (Kenneth) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add ARB_texture_cube_map_array extension bitsDave Airlie2012-11-092-0/+2
| | | | | | | | This just adds the bit + extension name. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glapi: add ARB_texture_cube_map_array.Dave Airlie2012-11-092-1/+19
| | | | | | | | This adds the ARB_texture_cube_map_array enums. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* r600g: fix lod bias/explicit lod with cube maps.Dave Airlie2012-11-091-8/+20
| | | | | | | | | | | | While developing cube map array support I found that we didn't support this properly, also piglit didn't test for it at all. I've submitted a test to piglit to check for this, and this fixes explicit lod and lod bias with cube maps. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Dave Airlie <[email protected]>
* r600g: clarify const buffer numbering and handlingDave Airlie2012-11-094-4/+10
| | | | | | | | | For cube map arrays I'll need another driver private constant buffer, and looking forward to UBOs. So clean up with some defines, that can be modified when adding cube map array and ubos later. Signed-off-by: Dave Airlie <[email protected]>
* i965: Fix slow leak of brw->wm.compile_data->storeEric Anholt2012-11-083-20/+6
| | | | | | | | We were successfully freeing our compile data at context destroy, but until then we were allocating a new store every compile without freeing it. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56019 Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Add support for global copy propagation.Eric Anholt2012-11-082-20/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is common for complicated shaders, particularly code-generated ones, to have a big array of uniforms or attributes, and a prologue in the shader that dereferences from the big array to more informatively-named local variables. Then there will be some small control flow operation (like a ? : statement), and then use of those informatively-named variables. We were emitting extra MOVs in these cases, because copy propagation couldn't reach across control flow. Instead, implement dataflow analysis on the output of the first copy propagation pass and re-run it to propagate those extra MOVs out. On one future Steam release, reduces VS+FS instruction count from 42837 to 41437. No statistically significant performance difference (n=48), though, at least at the low resolution I'm running it at. shader-db results: total instructions in shared programs: 722170 -> 702545 (-2.72%) instructions in affected programs: 260618 -> 240993 (-7.53%) Some shaders do get hurt by up to 2 instructions, because a choice to copy propagate instead of coalesce or something like that results in a dead write sticking around. Given that we already have instances of those instructions in the affected programs (particularly unigine), we should just improve dead code elimination to fix the problem.
* glsl_to_tgsi: fix dst register for texturing fetches.Dave Airlie2012-11-091-1/+1
| | | | | | | | | | | | | | I've no idea why there isn't a piglit that triggers this behaviour, but while enabling TBOs for softpipe and r600g, I noticed all the integer tests failed. I tracked it back to the TXF returning a float when it should be returning an int. This fixed it and I haven't seen any regressions in a full piglit run on softpipe. http://bugs.freedesktop.org/55010 NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Dave Airlie <[email protected]>
* r600g: fix pre eg export with llvmVincent Lejeune2012-11-081-1/+1
| | | | | Reviewed-by: Alex Deucher <alexander.deucher at amd.com> Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
* i965: Fix assertion in brw_alu3.Vinson Lee2012-11-071-1/+1
| | | | | | | Fixes side effect in assertion defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* wayland: Destroy frame callback when destroying surfaceJonas Ådahl2012-11-072-0/+6
| | | | | | | | | | | | | | If a frame callback is not destroyed when destroying a surface, its handler function will be invoked if the surface was destroyed after the callback was requested but before it was invoked, causing a write on free:ed memory. This can happen if eglDestroySurface() is called shortly after eglSwapBuffers(). Note: This is a candidate for stable branches. Reviewed-by: Kristian Høgsberg <[email protected]>
* r600g/compute: fix call to r600_bytecode_initAlex Deucher2012-11-071-1/+2
| | | | Signed-off-by: Alex Deucher <[email protected]>
* mesa: Remove PROG_EMIT_VERTEX and PROG_END_PRIMITIVE opcodes.Kenneth Graunke2012-11-074-14/+0
| | | | | | | | These were only used for geometry shader support back in the days before the new GLSL compiler. Future geometry shader support will not use these. Reviewed-by: Ian Romanick <[email protected]>
* svga: Ensure vb_transfer in svga_swtnl_draw_vbo in initialized.Vinson Lee2012-11-061-1/+1
| | | | | | | Fixes a uninitialized pointer read defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* scons: Build src/mesa/main/es1_conversion.c for all builds.Vinson Lee2012-11-061-1/+2
| | | | Signed-off-by: Vinson Lee <[email protected]>
* egl_dri2/x11: Fix eglPostSubBufferNV()Fredrik Höglund2012-11-071-1/+1
| | | | | | | | | This got broken in commit 0a523a8820e8a2549ac1c7887eb1892b228af44b. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
* 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]>