aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Introduce a globally-available minify() macro.Eric Anholt2013-04-211-0/+6
| | | | | | This matches u_minify()'s behavior, for consistency. Reviewed-by: Brian Paul <[email protected]>
* mesa: Generalize TexStorage allocator between swrast and intel.Eric Anholt2013-04-212-0/+35
| | | | | | | | | | This should be reusable for other non-gallium drivers, so we can make the extension always be available. v2: Add a more detailed comment than the old function had (recommended by Brian). Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: Add performance debug for meta code.Eric Anholt2013-04-211-0/+10
| | | | | | | | I noticed a fallback in regnum through sysprof, and wanted a nicer way to get information about it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: enable GL_ARB_texture_float if TEXTURE_FLOAT_ENABLED is definedBrian Paul2013-04-181-1/+3
| | | | | | | | | Per message on mesa-users list, this wasn't working before. Note: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: generate glGetInteger/Boolean/Float/Doublev() code for all APIsBrian Paul2013-04-171-23/+3
| | | | | | | | | | | No longer pass -a flag to the get_hash_generate.py script to specify OpenGL, ES1, ES2, etc. This updates the autoconf, scons and android build files too (so we can bisect). This is the last of the API-dependent conditional compilation in core Mesa. Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove mfeatures.hBrian Paul2013-04-171-53/+0
| | | | | | No longer needed. Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-1795-99/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove FEATURE_remap_table from remap.[ch]Brian Paul2013-04-172-40/+0
| | | | | | It was always defined. Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove gl_context::_TriangleCapsBrian Paul2013-04-171-5/+0
| | | | | | No longer used anywhere. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_LIGHT_TWOSIDE flagBrian Paul2013-04-176-58/+0
| | | | | | v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_UNFILLED flagBrian Paul2013-04-174-18/+2
| | | | | | | Use alternate code in intel, r200, radeon drivers. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_SMOOTH flagBrian Paul2013-04-174-7/+2
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_STIPPLE flagBrian Paul2013-04-174-6/+1
| | | | | | | Make it a local macro for the i915 driver. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_OFFSET flagBrian Paul2013-04-173-26/+1
| | | | | | | Make it a local macro for the i915 driver. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_POINT_ATTEN flagBrian Paul2013-04-174-17/+2
| | | | | | | For the i915 driver, make it a local macro. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_POINT_SMOOTH flagBrian Paul2013-04-174-6/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_LINE_STIPPLE flagBrian Paul2013-04-174-12/+1
| | | | | | | For the i915 driver, make it a local macro. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_SEPARATE_SPECULAR flagBrian Paul2013-04-173-18/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused DD_LINE_SMOOTH flagBrian Paul2013-04-174-6/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add a macro to bitset for determining bitset size.Eric Anholt2013-04-121-2/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: Don't leak gl_context::BeginEnd at context destructionIan Romanick2013-04-121-0/+1
| | | | | | | | | | | The other dispatch tables (Exec and Save) are freed, but BeginEnd is never freed. This was found by inspection why investigating the leak of shared state in _mesa_initialize_context. NOTE: This is a candidate for stable branches Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Don't leak shared state when context initialization failsIan Romanick2013-04-121-0/+1
| | | | | | | | | | | | | | | | | Back up at line 1017 (not shown in patch), we add a reference to the shared state. Several places after that may divert to the error handler, but, as far as I can tell, nothing ever unreferences the shared state. Fixes issue identified by Klocwork analysis: Resource acquired to 'shared->TexMutex' at line 1012 may be lost here. Also there is one similar error on line 1087. NOTE: This is a candidate for the stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: NULL check the pointer before trying to dereference itIan Romanick2013-04-121-2/+2
| | | | | | | | | | | | | | | | | | | Duh. Fixes issues identified by Klocwork analysis: Pointer 'table' returned from call to function 'calloc' at line 115 may be NULL and will be dereferenced at line 117. and Suspicious dereference of pointer 'table' before NULL check at line 119. NOTE: This is a candidate for the stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove old comment about FEATURE_GLBrian Paul2013-04-091-2/+1
| | | | Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove #ifdef FEATURE_ES2, add some comments insteadBrian Paul2013-04-091-2/+9
| | | | Reviewed-by: Jordan Justen <[email protected]>
* mesa: update derived framebuffer state in GetMultisamplefvMarek Olšák2013-04-101-0/+5
| | | | | | This makes sure that ctx->DrawBuffer->Visual.samples is up-to-date. Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix glGet queries depending on derived framebuffer state (v2)Marek Olšák2013-04-102-7/+26
| | | | | | | | | | | | | "ctx->DrawBuffer->Visual" might be invalid if (NewState &_NEW_BUFFERS) != 0. v2: also fix: - RGBA_INTEGER_MODE_EXT - RGBA_FLOAT_MODE_ARB (also check API support) - FRAMEBUFFER_SRGB_CAPABLE_EXT NOTE: This is a candidate for stable branches. Reviewed-by: Eric Anholt <[email protected]>
* glsl: Fix ir_print_visitor's handling of interpolation qualifiers.Paul Berry2013-04-091-1/+2
| | | | | | | | | | | This patch updates the interp[] array to match the enum glsl_interp_qualifier. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> v2: Add a STATIC_ASSERT to make sure the array is the correct size. This required adding INTERP_QUALIFIER_COUNT to the enum.
* mesa: allow drivers not to expose ARB_color_buffer_float in GL core profileMarek Olšák2013-04-066-9/+36
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: move updating clamp control derived state out of mesa_update_state_lockedMarek Olšák2013-04-064-36/+40
| | | | | | | | | It has 2 dependencies: glClampColor and the framebuffer, we might just as well do the update where those two are changed. v2: cosmetic changes from Brian's email Reviewed-by: Brian Paul <[email protected]>
* mesa: don't set _ClampFragmentColor to TRUE if it has no effectMarek Olšák2013-04-068-9/+29
| | | | | | | | This should reduce shader recompilations with drivers that emulate fragment color clamping, because we want the clamping to be enabled only if there is a signed normalized or floating-point colorbuffer. Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor clamping controls, get rid of _ClampReadColorMarek Olšák2013-04-067-30/+58
| | | | | | v2: cosmetic changes from Brian's email Reviewed-by: Brian Paul <[email protected]>
* mesa: Add new ctx->Stencil._WriteEnabled derived state flag.Kenneth Graunke2013-04-042-0/+6
| | | | | | | | | | | i965 needs to know whether stencil writes are enabled in several places, and gets the test wrong sometimes. While we could create a function to compute this, it seems generally useful enough to warrant a new piece of derived state. Also, all the plumbing is already in place. NOTE: This is a candidate for stable branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* Avoid spurious GCC warnings in STATIC_ASSERT() macro.Paul Berry2013-04-041-1/+1
| | | | | | | | | | | | | GCC 4.8 now warns about typedefs that are local to a scope and not used anywhere within that scope. This produced spurious warnings with the STATIC_ASSERT() macro (which used a typedef to provoke a compile error in the event of an assertion failure). This patch switches to a simpler technique that avoids the warning. v2: Avoid GCC-specific syntax. Also update p_compiler.h. Reviewed-by: Kenneth Graunke <[email protected]>
* ACTIVE_UNIFORM_MAX_LENGTH should include 3 extra characters for arrays.Haixia Shi2013-04-011-2/+4
| | | | | | | | | | | | | | | | | If the active uniform is an array, then the length of the uniform name should include the three extra characters for the "[0]" suffix, which is required by the GL 4.2 spec to be appended to the uniform name in glGetActiveUniform(). This avoids the situation where the output buffer does not have enough space to hold the "[0]" suffix, resulting in an incomplete array specification like "foobar[0". NOTE: This is a candidate for the 9.1 branch. Change-Id: I41e87ba347a7169eec8c575596cc3416adbe0728 Signed-off-by: Haixia Shi <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove platform checks around __builtin_ffs, __builtin_ffsllBrian Paul2013-04-011-6/+0
| | | | | | | | | | | Use the __builtin_ffs, __builtin_ffsll functions whenever we have GCC, not just for specific platforms. Fixes Solaris build. Note: This is a candidate for the stable branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62868 Signed-off-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: fix texture storage multisample prototypes harder.Dave Airlie2013-04-012-4/+4
| | | | | | I just noticed the warnings since I fixed the other bit. Signed-off-by: Dave Airlie <[email protected]>
* mesa: allow multisample texture targets in [Get]TexParameter*Chris Forbes2013-03-311-1/+87
| | | | | | | | | | | | | | | | | | | | ARB_texture_storage_multisample allows texture parameters to be queried for TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY targets. Some parameters may also be set, with the following exceptions: - TEXTURE_BASE_LEVEL may not be set to a nonzero value; generates INVALID_OPERATION - any state which appears in the `per-sampler` state table may not be set; generates INVALID_OPERATION V2: Don't introduce bogus handling of TEXTURE_MAX_LEVEL Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: improve reported function name in Tex*MultisampleChris Forbes2013-03-311-16/+14
| | | | | | | | | Now that there are 4 variants, just pass the function name into teximagemultisample rather than reconstructing it. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add enable bit for ARB_texture_storage_multisampleChris Forbes2013-03-312-0/+2
| | | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glapi: add definition of ARB_texture_storage_multisampleChris Forbes2013-03-313-2/+33
| | | | | | | | | | Adds XML for the extension, dispatch_sanity enabling, and the two new entrypoints. These are both implemented by calling the shared teximagemultisample() with immutable=GL_TRUE. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add support for immutable textures to teximagemultisample()Chris Forbes2013-03-311-3/+28
| | | | | | | | | | | | | | | | | | The new entrypoints will come later, but this adds the actual logic for supporting immutable multisample textures: - The immutability flag is set as desired. - Attempting to modify an immutable multisample texture produces INVALID_OPERATION. Note: The extension spec does not mention adding this behavior to TexImage*Multisample, but it seems like the reasonable thing to do. V2: - Cover missing error cases (unsized formats; texture object zero) Signed-off-by: Chris Forbes <[email protected]> [V1] Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: extract _mesa_is_legal_tex_storage_format helperChris Forbes2013-03-312-17/+23
| | | | | | | This is about to be used in teximagemultisample() when immutable=true. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Delete VERT_ATTRIB_GENERIC_NV and VERT_BIT_GENERIC_NV macros.Kenneth Graunke2013-03-301-10/+0
| | | | | | | | These haven't been used since we deleted NV_vertex_program support. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Implement ARB_texture_query_lodDave Airlie2013-03-292-0/+2
| | | | | | | | | | | | | | | | | | | v2 [mattst88]: - Rebase. - #define GL_ARB_texture_query_lod to 1. - Remove comma after ir_lod in ir.h for MSVC. - Handled ir_lod in ir_hv_accept.cpp, ir_rvalue_visitor.cpp, opt_tree_grafting.cpp. - Rename textureQueryLOD to textureQueryLod, see https://www.khronos.org/bugzilla/show_bug.cgi?id=821 - Fix ir_reader of (lod ...). v3 [mattst88]: - Rename textureQueryLod to textureQueryLOD, pending resolution of Khronos 821. - Add ir_lod case to ir_to_mesa.cpp. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: provide default implementation of QuerySamplesForFormatChris Forbes2013-03-292-0/+19
| | | | | | | | | | | | | | Previously at least i915 failed to provide an implementation, but exposed ARB_internalformat_query anyway, leading to crashes when QueryInternalformativ was called. Default implementation just returns 1 for everything, so is suitable for any driver which does not support multisampling. V2: - Move from intel to core mesa. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: only check sample count if we actually wanted multisamplingChris Forbes2013-03-271-9/+10
| | | | | | | | | | | | | Fixes various test fallout from 90b5a2425a on Pineview, which claims to support ARB_internalformat_query but doesn't actually provide the driverfunc. That driver is still broken [GetInternalformativ will still segfault!] but it was silly to be going through the sample count logic in the nonmultisampling case at all. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: use _mesa_check_sample_count() for multisample texturesChris Forbes2013-03-242-30/+33
| | | | | | | | | | | | | | | | | | Extends _mesa_check_sample_count() to properly support the TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY targets, which have subtly different limits than renderbuffers. This resolves the remaining TODO in the implementation of TexImage*DMultisample. V2: - Don't introduce spurious block. - Do this in multisample.c instead. - Fix typo in error message. - Inline spec quotes Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: helper for checking renderbuffer sample countChris Forbes2013-03-243-3/+69
| | | | | | | | | | | | | | | | | | | Pulls the checking of the sample count into a helper function, and extends the existing logic to include the interactions with both ARB_texture_multisample and ARB_internalformat_query. _mesa_check_sample_count() checks a desired sample count against a a combination of target/internalformat, and returns the error enum to be produced, if any. Unfortunately the conditions are messy and the errors vary. V2: - Tidy up spurious block. - Move _mesa_check_sample_count() to multisample.c instead; It doesn't really belong in fbobject.c or teximage.c. - Inlined spec quotes Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: allow internalformat_query with multisample texture targetsChris Forbes2013-03-242-6/+10
| | | | | | | | | | | | | | | | Now that we support ARB_texture_multisample, there are multiple targets accepted for this query, and they may have target-dependent limits, so pass the target to the driverfunc. For example, the sampling hardware may not be able to do general texelFetch() for some format/sample count combination, but the driver may still be able to implement a reasonable resolve operation, so it can be supported for renderbuffers. V2: - Don't break Gallium compile. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>