summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove FEATURE_dlist define.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_dispatch define.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Remove useless checks for NULL before freeingMatt Turner2012-09-051-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + free ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - free((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - } @@ expression E; type T; @@ + free ((T) E); - if (unlikely (E != NULL)) { - free ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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) )
* mesa: Don't allow display lists or evaluators in core contextIan Romanick2012-08-291-1/+1
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa: Kill ES2 wrapper functionsIan Romanick2012-08-291-7/+3
| | | | | | | | | v2: Fix completely broken condition around ClearColorIiEXT and ClearColorIuiEXT. v3: Add special VertexAttrib handling for ES2. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Default to GL 3.1's limits on uniform blocks.Eric Anholt2012-08-071-11/+15
| | | | | | | | | | | | The ARB spec lets you get away with the default block counting against the blocks for combined size limits. The core spec says you need to be able to support the maximum size of default block *and* the maximum size of each uniform block. I see no reason that any driver would have a problem with that. Fixes gl 3.1/minmax (with an associated fix to the test) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't enable legacy GL functions when using API_OPENGL_COREJordan Justen2012-07-301-1/+1
| | | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add support for using API_OPENGL_COREJordan Justen2012-07-301-2/+4
| | | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make more consistent use of _mesa_is_{user,winsys}_fbo()Paul Berry2012-07-261-4/+4
| | | | | | | | | | A lot of code was still differentiating between between winsys and user fbos by testing the fbo's name against zero. This converts everything in core mesa, the state tracker, and src/mesa/program over to use _mesa_is_user_fbo() and _mesa_is_winsys_fbo(). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa context: generate an error for uninstalled context functionsJordan Justen2012-07-241-1/+4
| | | | | | | | | | | | | For 'non-legacy' contexts we will want to generate an error if an uninstalled function is called. The effect of this change will be that we can avoid installing legacy functions, and they will then generate an error as needed for deprecated functions in GL >= 3.1. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Remove _mesa_sqrt* in favor of plain sqrtMatt Turner2012-07-211-2/+0
| | | | | | | | | | Temporarily disabled since 2003 (see 386578c5b). This saves us from calling sqrt() 128 times to generate the sqrttab in one_time_init(). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: implement glGet queries and error handling for ARB_transform_feedback3Marek Olšák2012-07-121-0/+1
| | | | Acked-by: Ian Romanick <[email protected]>
* mesa: rename MaxTransformFeedbackSeparateAttribs to MaxTransformFeedbackBuffersMarek Olšák2012-06-281-1/+1
| | | | | | | | | | | | This is a cleanup for ARB_transform_feedback3, where GL_MAX_TRANSFORM_FEEDBACK_BUFFERS is introduced for interleaved attribs and has the same meaning as GL_MAX_.._SEPARATE_ATTRIBS for separate attribs. Also, the maximum number of TFB buffers is reduced from 32 to 4, which makes this patch useful even without the extension. I don't know of any hardware which can do more than 4. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add state and getters for the GL_ARB_uniform_buffer_object maximums.Eric Anholt2012-06-211-0/+9
| | | | | | | Fixes piglit GL_ARB_uniform_buffer_object/minmax. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Keep a computed value for dual source blend func with each buffer.Eric Anholt2012-05-231-17/+7
| | | | | | | | | The i965 driver needed this as well for hardware setup, so instead of duplicating the logic, just save it off. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: add PrimitiveRestartInSoftware to gl_context.ConstJordan Justen2012-05-171-0/+3
| | | | | | | | | | | If set, then the VBO module will handle all primitive restart scenarios before calling the driver draw_prims. Software primitive restart support is disabled by default. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: do FLUSH_VERTICES() in _mesa_flush/finish()Brian Paul2012-05-111-2/+4
| | | | | | | This was being done in the _mesa_Flush/Finish() calls but if there was an internal call to _mesa_flush/finish() the FLUSH_VERTICES() wouldn't happen. Looks like only the intel and radeon drivers made such calls in MakeCurrent().
* mesa: add gl_context::NewDriverState and use it for vertex arraysMarek Olšák2012-05-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use the same flag to notify the driver. Since we've run out of bits in NewState and NewState is for core Mesa anyway, we need to find another way. This patch is the first to start decoupling the state flags meant only for core Mesa and those only for drivers. The idea is to have two flag sets: - gl_context::NewState - used by core Mesa only - gl_context::NewDriverState - used by drivers only (the flags are defined by the driver and opaque to core Mesa) It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module that the user changed vertex arrays, and the vbo module in turn sets a driver-specific flag to notify the driver that it should update its vertex array bindings. The driver decides which bits of NewDriverState should be set and stores them in gl_context::DriverFlags. Then, Core Mesa can do this: ctx->NewDriverState |= ctx->DriverFlags.NewArray; This patch implements this behavior and adapts st/mesa. DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS. Core Mesa only sets NewDriverState. It's the driver's responsibility to read it whenever it wants and reset it to 0. Reviewed-by: Brian Paul <[email protected]>
* mesa: move unrefs of array objects earlier in _mesa_free_context_data()Brian Paul2012-04-191-3/+3
| | | | | | | | | | If a non-default array object was bound at context destruction time we'd try to unreference the array object after it was already deleted in _mesa_free_varray_data(). Now do the unref first. Fixes a regression from commit 86f53e6d6bd07e2bc3ffcadeb9a4418fbae06e0b. Reviewed-by: José Fonseca <[email protected]>
* mesa: Use array object constructor.Mathias Fröhlich2012-04-181-1/+2
| | | | | | | | This change uses the array object factory for gl_array_objects. This prevents crashes when deriving from gl_array_object. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: add support for ARB_blend_func_extended (v4)Dave Airlie2012-04-131-0/+36
| | | | | | | | | | | | | | | | | | | | Add implementations of the two API functions, Add a new strings to uint mapping for index bindings Add the blending mode validation for SRC1 + SRC_ALPHA_SATURATE Add get for MAX_DUAL_SOURCE_DRAW_BUFFERS v2: Add check in valid_to_render to address case in spec ERRORS. v3: Add index to ir.h so this patch compiles on its own fixup comment v4: fixup Brian's comments The GLSL patch will setup the indices. Signed-off-by: Dave Airlie <[email protected]>
* mesa: implement the last of GL_ARB_debug_outputnobled2012-03-101-0/+2
| | | | | | Store client-defined message IDs in a hash table, and sort them by severity into three linked lists so they can be selected by severity level later.
* mesa: add infrastructure for GL_ARB_debug_outputnobled2012-03-101-0/+1
| | | | Marek v2: don't add the extension to extensions.c yet
* mesa: remove STENCIL_BITS useBrian Paul2012-02-241-1/+1
|
* mesa: remove last of MAX_WIDTH, MAX_HEIGHTBrian Paul2012-02-241-3/+3
| | | | | Define new MAX_VIEWPORT_WIDTH/HEIGHT and MAX_RENDERBUFFER_SIZE values instead.
* mesa: move/fix MAX_WIDTH/HEIGHT-related assertionsBrian Paul2012-02-241-9/+4
| | | | | | Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for swrast. Reviewed-by: José Fonseca <[email protected]>
* mesa: use new _mesa_reference_shared_state() functionBrian Paul2012-02-011-15/+13
| | | | | | | | | This cleans up the reference counting of shared context state. The next patch will use this to fix an actual bug. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.Mathias Fröhlich2011-12-281-2/+0
| | | | | | | | | Since commit 82b9661894315362f857192439bdcbc9db090387 and 34eae1c72a9b3a8eb0634cda52fca0208cd2f40d vbo support is mandatory for all drivers. So, remove the remaining FEATURE_ARB_vertex_buffer_object guards. Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: Make gl_program::InputsRead 64 bits.Mathias Fröhlich2011-11-291-1/+1
| | | | | | | | | Make gl_program::InputsRead a 64 bits bitfield. Adapt the intel and radeon driver to handle a 64 bits InputsRead value. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: move ElementArrayBufferObj to gl_array_objectYuanhan Liu2011-11-291-1/+0
| | | | | | | | | | | | | | | According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at page 515, the element buffer object is listed in vertex array object. So, move the ElementArrayBufferObj inside gl_array_object to make element buffer object per-vao. This would fix most of(3 left) intel oglc vao test fail NOTE: this is a candidate for the 7.11 branch. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Simplify uniform debug logging logicIan Romanick2011-10-181-19/+3
| | | | | | | | | This simplificiation was enabled by the earlier refactors that eliminated the references to the assembly shaders stored in the gl_shader_program structure. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgramIan Romanick2011-10-071-2/+1
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgramIan Romanick2011-10-071-2/+1
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgramIan Romanick2011-10-071-1/+1
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Allow overriding GLSL version with environment variableChad Versace2011-09-281-0/+1
| | | | | | | | | | | | | | Override the context's GLSL version if the environment variable MESA_GLSL_VERSION_OVERRIDE is set. Valid values for MESA_GLSL_VERSION_OVERRIDE are integers, such as "130". MESA_GLSL_VERSION_OVERRIDE has the same behavior as INTEL_GLSL_VERSION, except that it applies to all drivers, not just Intel's. Since the former supercedes the latter, this patch disables the latter. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* Hardcode the default value of ctx->Const.MaxClipPlanes to 6.Paul Berry2011-09-201-1/+1
| | | | | | | | | | | Previously this value was set to MAX_CLIP_PLANES, which is defined to be 6. But MAX_CLIP_PLANES needs to be increased to 8 to support GLSL-1.30-compliant drivers. This patch hard-codes the default value of ctx->Const.MaxClipPlanes to 6, so that when MAX_CLIP_PLANES is increased, it won't affect drivers that do not support 8 clip planes. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename FreeTexImageData to FreeTextureImageBuffer.Eric Anholt2011-08-291-1/+1
| | | | | | | | This was produced by sed, except for one hunk in driverfuncs.c where trailing whitespace was dropped. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: refactor, create _mesa_update_draw_buffers() helperBrian Paul2011-06-161-11/+2
| | | | | Move this code out of _mesa_make_current() and put it into a helper function.
* mesa: updated comments in _make_current()Brian Paul2011-06-161-8/+5
|
* Squashed commit of the following:Brian Paul2011-04-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 864fe253b04105b7469e5f7b064dc37637b944f8 Author: Brian Paul <[email protected]> Date: Thu Apr 21 20:13:07 2011 -0600 mesa: s/exec/disp/ in _mesa_init_histogram_dispatch() This function isn't normally compiled (FEATURE_histogram). commit f4bf45e2b94b582cacd19cdca873c5be627e4250 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:58 2011 -0600 mesa: hook up GL_ARB_robustness dispatch functions ...and advertise the extension. Signed-off-by: Brian Paul <[email protected]> commit 2b89e38e5f572dc40cebc06381ae7c5d04386998 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:58 2011 -0600 mesa: regenerated API files for GL_ARB_robustness Signed-off-by: Brian Paul <[email protected]> commit 5d5ebfb7135cec9d833adef86cbf4d0f3d9beca8 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 glapi: add ARB_robustness xml Signed-off-by: Brian Paul <[email protected]> commit 0159d1d6d99f4bbc18381dc2081c20d3aff17ac9 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: implement GL_ARB_robustness functions Signed-off-by: Brian Paul <[email protected]> commit 938fd71f4c4742f274922d53492a7290ab8d9c9b Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: add context fields for GL_ARB_robustness Signed-off-by: Brian Paul <[email protected]> commit 72075137bc79e65be03dac7e97b6dba93c3a86a4 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: standardize more bounds-checking error messages Signed-off-by: Brian Paul <[email protected]> commit 32a3fc23746db49da903fbc08afa0135af3007d2 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: standardize some bounds-checking error messages Signed-off-by: Brian Paul <[email protected]> commit cecbf1f4d164207de373dec0cadee2e84e1f9656 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: add more bounds-checking support for client memory buffers Signed-off-by: Brian Paul <[email protected]> commit edc895b52383d5bd274422db56adead1d81daf5f Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: add bounds-checking support for client memory buffers Signed-off-by: Brian Paul <[email protected]> commit 3a96ef28a538f158a219b406cd090dee70470c85 Author: nobled <[email protected]> Date: Thu Apr 21 07:53:57 2011 -0600 mesa: use is_bufferobj() helper function Signed-off-by: Brian Paul <[email protected]>
* mesa: 80-column wrapping and whitespace fixesBrian Paul2011-04-131-4/+6
|
* mesa: core support for GL_ARB_texture_buffer_objectBrian Paul2011-04-051-0/+1
| | | | No GLSL or driver support yet.
* mesa: move location of some geometry program limitsBrian Paul2011-03-111-8/+10
| | | | | | | The gl_program_constants struct is for limits that are applicable to any/all shader stages. Move the geometry shader-only fields into the gl_constants struct. Remove redundant MaxGeometryUniformComponents field too.
* mesa: added gl_program_constants::MaxAddressOffsetBrian Paul2011-03-021-0/+1
| | | | See https://bugs.freedesktop.org/show_bug.cgi?id=29418
* mesa: remove _mesa_create_context_for_api()Brian Paul2011-02-081-21/+5
| | | | Just add the gl_api parameter to _mesa_create_context().
* mesa: remove _mesa_initialize_context_for_api()Brian Paul2011-02-081-27/+8
| | | | Just add the gl_api parameter to _mesa_initialize_context().
* mesa: Set correct values for range/precision of shader integer typesIan Romanick2011-01-201-2/+11
|
* mesa: implement glGetShaderPrecisionFormat()Brian Paul2011-01-191-0/+10
| | | | | Drivers should override the default range/precision info as needed. No drivers do this yet.
* mesa: do a debug check of _mesa_format_to_type_and_comps()Brian Paul2011-01-111-0/+5
| | | | | | | Make sure that all formats are handled in this function. It's easy to miss this function when adding new pixel formats. See also http://bugs.freedesktop.org/show_bug.cgi?id=31544