summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: update comment on delete_shader_program()Brian Paul2015-01-051-2/+3
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: rearrange error handling in glProgramParameteri()Brian Paul2015-01-051-15/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix error strings in shaderapi.cBrian Paul2015-01-051-2/+2
| | | | | | | The _mesa_-prefixed function names should not appear in GL error messages. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove __SSE4_1__ guards from sse_minmax.c.Matt Turner2014-12-291-3/+0
| | | | | | See commit e07c9a288. Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: remove support for GCC older than 4.1.0Timothy Arceri2014-12-171-1/+1
| | | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-By: Jose Fonseca <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* main: remove extern C around #includes in ff_fragment_shader.cppBrian Paul2014-12-161-5/+3
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: move #include of mtypes.h outside __cplusplus checkBrian Paul2014-12-161-2/+1
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: put extern "C" in header filesBrian Paul2014-12-164-0/+41
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* util/hash_table: Rework the API to know about hashingJason Ekstrand2014-12-141-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the hash_table API required the user to do all of the hashing of keys as it passed them in. Since the hashing function is intrinsically tied to the comparison function, it makes sense for the hash table to know about it. Also, it makes for a somewhat clumsy API as the user is constantly calling hashing functions many of which have long names. This is especially bad when the standard call looks something like _mesa_hash_table_insert(ht, _mesa_pointer_hash(key), key, data); In the above case, there is no reason why the hash table shouldn't do the hashing for you. We leave the option for you to do your own hashing if it's more efficient, but it's no longer needed. Also, if you do do your own hashing, the hash table will assert that your hash matches what it expects out of the hashing function. This should make it harder to mess up your hashing. v2: change to call the old entrypoint "pre_hashed" rather than "with_hash", like cworth's equivalent change upstream (change by anholt, acked-in-general by Jason). Signed-off-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove obsolete comment on _mesa_ClearColor()Brian Paul2014-12-121-4/+0
|
* mesa: whitespace fixes, 80-column wrapping in texobj.cBrian Paul2014-12-121-21/+33
|
* mesa: whitespace, line wrap fixes in clear.cBrian Paul2014-12-121-8/+11
|
* mesa: use build flag to ensure stack is realigned on x86Timothy Arceri2014-12-101-3/+0
| | | | | | | | | | | | | | | | | Nowadays GCC assumes stack pointer is 16-byte aligned even on 32-bits, but that is an assumption OpenGL drivers (or any dynamic library for that matter) can't afford to make as there are many closed- and open- source application binaries out there that only assume 4-byte stack alignment. V4: fix comment and indentation V3: move all sse4.1 build flag config to the same location and add comment as to why we need to do the realign V2: use $target_cpu rather than $host_cpu and setup build flags in config rather than makefile https://bugs.freedesktop.org/show_bug.cgi?id=86788 Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Matt Turner <[email protected]> CC: "10.4" <[email protected]>
* main: return two minor digits for ES shading language versionSamuel Iglesias Gonsalvez2014-12-091-1/+1
| | | | | | | | | | | | | | | For OpenGL ES 3.0 spec, the minor number for SHADING_LANGUAGE_VERSION is always two digits, matching the OpenGL ES Shading Language Specification release number. For example, this query might return the string "3.00". This patch fixes the following dEQP test: dEQP-GLES3.functional.state_query.string.shading_language_version No piglit regression observed. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Recompute LegalTypesMask if the GL API has changedIago Toral Quiroga2014-12-092-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code computes ctx->Array.LegalTypesMask just once, however, computing this needs to consider ctx->API so we need to make sure that the API for that context has not changed if we intend to reuse the result. The context API can change, at least, if we go through _mesa_meta_begin, since that will always force API_OPENGL_COMPAT until we call _mesa_meta_end. If any operation in between these two calls triggers a call to update_array_format, then we might be caching a value for LegalTypesMask that will not be right once we have called _mesa_meta_end and restored the context API. Fixes the following 179 dEQP tests in i965: dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.* dEQP-GLES3.functional.vertex_arrays.single_attribute.normalize.fixed.* dEQP-GLES3.functional.vertex_arrays.single_attribute.output_types.fixed.* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_draw.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_draw.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_draw.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_copy.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_copy.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_copy.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_read.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_read.*fixed* dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_read.*fixed* dEQP-GLES3.functional.vertex_arrays.multiple_attributes.input_types.3_*fixed2* dEQP-GLES3.functional.draw.random.{2,18,28,68,83,106,109,156,181,191} Reviewed-by: Brian Paul <[email protected]>
* mesa: Returns zero samples when querying GL_NUM_SAMPLE_COUNTS when internal ↵Eduardo Lima Mitev2014-12-091-23/+34
| | | | | | | | | | | format is integer From GL ES 3.0 specification, section 6.1.15 Internal Format Queries (page 236), multisampling is not supported for signed and unsigned integer internal formats. Fixes 19 dEQP tests under 'dEQP-GLES3.functional.state_query.internal_format.*'. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0Eduardo Lima Mitev2014-12-091-0/+6
| | | | | | | | | | | | GL_RGB and GL_RGBA are valid internal formats on a GLES3 profile. See "Table 1. Unsized Internal Formats" at https://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml. Fixes 2 dEQP tests: - dEQP-GLES3.functional.state_query.internal_format.rgb_samples - dEQP-GLES3.functional.state_query.internal_format.rgba_samples Reviewed-by: Brian Paul <[email protected]>
* mesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO ↵Eduardo Lima Mitev2014-12-091-0/+8
| | | | | | | | | | | | invalidation under GLES3 In OpenGL and OpenGL-ES 3+, GL_DEPTH_STENCIL_ATTACHMENT is a valid attachment point for the family of functions that invalidate a framebuffer object (e.g, glInvalidateFramebuffer, glInvalidateSubFramebuffer, etc). Currently, a GL_INVALID_ENUM error is emitted for this attachment point. Fixes 21 dEQP test failures under 'dEQP-GLES3.functional.fbo.invalidate.*'. Reviewed-by: Ian Romanick <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2014-12-083-6/+5
| | | | | | | See commit 2b7a972e for the Coccinelle script. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Remove useless checks for NULL before freeingMatt Turner2014-12-081-5/+2
| | | | | | | See commits 5067506e and b6109de3 for the Coccinelle script. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Don't optimize min/max into saturate when EmitNoSat is setAbdiel Janulgue2014-12-081-0/+1
| | | | | | | v3: Fix multi-line comment format (Ian) Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Abdiel Janulgue <[email protected]>
* mesa: Add a source parameter to _mesa_gl_debug.Matt Turner2014-12-053-2/+6
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Ensure stack is realigned on x86.José Fonseca2014-12-051-0/+3
| | | | | | | | | | | | | | | | | | | | Nowadays GCC assumes stack pointer is 16-byte aligned even on 32-bits, but that is an assumption OpenGL drivers (or any dynamic library for that matter) can't afford to make as there are many closed- and open- source application binaries out there that only assume 4-byte stack alignment. This fix uses force_align_arg_pointer GCC attribute, and is only a stop-gap measure. The right fix would be to pass -mstackrealign or -mincoming-stack-boundary=2 to all source fails that use any -msse* option, as there is no way to guarantee if/when GCC will decide to spill SSE registers to the stack. https://bugs.freedesktop.org/show_bug.cgi?id=86788 Reviewed-by: Brian Paul <[email protected]>
* mesa: Use current Mesa coding style in check_valid_to_renderIan Romanick2014-12-021-25/+24
| | | | | | | This makes some others patches (still in my local tree) a bit cleaner. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use unreachable instead of assert in check_valid_to_renderIan Romanick2014-12-021-1/+1
| | | | | | | This is generally the prefered style these days. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Silence unused parameter warnings in _mesa_validate_Draw functionsIan Romanick2014-12-022-14/+10
| | | | | | | | | | | | | | | | ../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawElements': ../../src/mesa/main/api_validate.c:376:37: warning: unused parameter 'basevertex' [-Wunused-parameter] ../../src/mesa/main/api_validate.c: In function '_mesa_validate_MultiDrawElements': ../../src/mesa/main/api_validate.c:394:65: warning: unused parameter 'basevertex' [-Wunused-parameter] ../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawRangeElements': ../../src/mesa/main/api_validate.c:452:35: warning: unused parameter 'basevertex' [-Wunused-parameter] ../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawArrays': ../../src/mesa/main/api_validate.c:473:25: warning: unused parameter 'start' [-Wunused-parameter] ../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawElementsInstanced': ../../src/mesa/main/api_validate.c:590:44: warning: unused parameter 'basevertex' [-Wunused-parameter] Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor common validation code to validate_DrawElements_commonIan Romanick2014-12-021-125/+43
| | | | | | | | | | | | | | Most of the code in _mesa_validate_DrawElements, _mesa_validate_DrawRangeElements, and _mesa_validate_DrawElementsInstanced was the same. Refactor this out to common code. As a side-effect, a bug in _mesa_validate_DrawElementsInstanced was fixed. Previously this function would not generate an error when check_valid_to_render failed if numInstances was 0. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Generate GL_INVALID_OPERATION when drawing w/o a VAO in core profileIan Romanick2014-12-021-1/+9
| | | | | | | | GL 3-ish versions of the spec are less clear that an error should be generated here, so Ken (and I during review) just missed it in 1afe335. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix height error check for 1D array texturesBrian Paul2014-12-021-1/+1
| | | | | | | | height=0 is legal for 1D array textures (as depth=0 is legal for 2D arrays). Fixes new piglit ext_texture_array-errors test. Cc: "10.3 10.4" <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* main, glsl: Bump max known desktop glsl version to 4.50Jordan Justen2014-12-011-0/+6
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: fix arithmetic error in _mesa_compute_compressed_pixelstore()Brian Paul2014-12-011-1/+1
| | | | | | | | We need parenthesis around the expression which computes the number of blocks per row. Reviewed-by: Matt Turner <[email protected]> Cc: "10.3 10.4" <[email protected]>
* mesa: some improvements for print_list()Brian Paul2014-12-012-69/+84
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: inline/remove _mesa_polygon_stipple()Brian Paul2014-12-012-32/+10
| | | | | | Was not called from any other place. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix Get(GL_TRANSPOSE_CURRENT_MATRIX_ARB) to transposeChris Forbes2014-11-241-1/+1
| | | | | | | | | This was just returning the same value as GL_CURRENT_MATRIX_ARB. Spotted while investigating something else in apitrace. Signed-off-by: Chris Forbes <[email protected]> Cc: "10.3 10.4" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix function name in GetActiveUniformName errorChris Forbes2014-11-231-1/+1
| | | | Signed-off-by: Chris Forbes <[email protected]>
* mesa/main: Fix tmp_row memory leak in texstore_rgba_integer.Siavash Eliasi2014-11-181-1/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* Revert "mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__."Emil Velikov2014-11-151-3/+0
| | | | | | | | | | | | | | | | | This reverts commit 8d3f739383fbdf671752fdec707f1c2b9b2aa6a3. In the last commit we've updated our check to determine if the actual code is buildable, rather than if the compiler acknowledges the option. I.e. did anyone provide -mno-sse4.1 vs is my compiler too old. Now this code will never be attemped to be build, in both cases. Confirmed by building mesa with export CFLAGS='-march=native -mno-sse4.1' ./configure && make Tested-by: David Heidelberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i915: Use L8A8 instead of I8 to simulate A8 on gen2Ville Syrjälä2014-11-131-0/+3
| | | | | | | | | | | | | | | | Gen2 doesn't support the A8 texture format. Currently the driver substitutes it with I8, but that results in incorrect RGB values. Use A8L8 instead. We end up wasting a bit of memory, but at least we should get the correct results. v2: Handle the fallback in _mesa_choose_tex_format() and also do it for all alpha formats that currently accept A8 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72819 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80050 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38873 Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]>
* mesa: Remove _mesa_max_buffer_indexIan Romanick2014-11-102-52/+0
| | | | | | | It appears to be completely unused since f9be8543 (February 2012). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Uniform logging is very, very unlikelyIan Romanick2014-11-101-2/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Don't check for API_OPENGLES in _mesa_uniform_matrixIan Romanick2014-11-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | There are no uniforms in OpenGL ES 1.x, so we can't even get to this code in that API. Also, reorder the checks. First check that transpose is true, then check whether or not that is legal in the current API. transpose should never be true in an ES2 context, so this gets one check (the more expensive one) out of the main path. Valgrind callgrind results for a trace of Tesseract: _mesa_UniformMatrix4fv _mesa_UniformMatrix3fv Before (64-bit): 96,119,025 24,240,510 After (64-bit): 90,726,569 22,926,662 _mesa_UniformMatrix4fv _mesa_UniformMatrix3fv Before (32-bit): 132,434,452 29,051,808 After (32-bit): 126,658,112 27,989,316 Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Rework array error checks in validate_uniform_parametersIan Romanick2014-11-101-19/+22
| | | | | | | | | | | | | | | | | | | | | | Before ARB_explicit_uniform_location, Mesa's location encoding allowed locations for non-array types that had non-zero array indices. Basically, part of the location was the uniform and part was the array index. This meant that some checks had to occur for arrays and non-arrays. This is no longer possible, we the checks can be split up. Valgrind callgrind results for a trace of Tesseract: _mesa_Uniform4fv _mesa_Uniform4f _mesa_Uniform1i Before (64-bit): 50,499,557 17,487,316 686,227 After (64-bit): 50,023,791 17,274,432 684,293 _mesa_Uniform4fv _mesa_Uniform4f _mesa_Uniform1i Before (32-bit): 62,968,039 21,732,380 828,147 After (32-bit): 62,373,967 21,490,756 826,223 Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Get some gl_shader_program::LinkStatus checking out of the main pathIan Romanick2014-11-101-6/+19
| | | | | | | | | | I really wanted to remove 'shProg != NULL' as well, but that would have required adding a dummy program as the default program. That seemed like more churn than removing one test was worth. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Rework location == -1 error checkingIan Romanick2014-11-101-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Only one caller wanted to generate an error when location == -1, so move the error generation to that caller. There will be more callers in the future that do not want to generate errors. Move the location == -1 check later in validate_uniform_parameters. As currently implemented, glUniform1iv(-1, -1, data) would not generate an error, but it should due to count being < 0. The location that I have moved it to will make more sense with the next commit. Valgrind callgrind results for a trace of Tesseract: _mesa_Uniform4fv _mesa_Uniform4f _mesa_Uniform1i Before (64-bit): 51,241,217 17,740,162 689,181 After (64-bit): 50,499,557 17,487,316 686,227 _mesa_Uniform4fv _mesa_Uniform4f _mesa_Uniform1i Before (32-bit): 63,940,605 21,987,918 831,065 After (32-bit): 62,968,039 21,732,380 828,147 Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Minor clean ups in _mesa_uniformIan Romanick2014-11-101-23/+9
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Remove GLSL_TYPE_SAMPLER checkIan Romanick2014-11-101-2/+1
| | | | | | | | | Noting the assertion just a few lines earlier, returnType cannot be GLSL_TYPE_SAMPLER. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: Pass the data that _mesa_uniform actually wantsIan Romanick2014-11-103-119/+54
| | | | | | | | | | The GL_ enums were previously used because glsl_types.h couldn't be used in C code. That was fixed some time ago (and uniforms.c already includes glsl_types.h), so this is no longer necessary. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* glsl: Add infrastructure for "hidden" uniforms.Kenneth Graunke2014-11-062-2/+5
| | | | | | | | | | | | | | | In the compiler, we'd like to generate implicit uniforms for internal use. These should not be visible via the GL uniform introspection API. To support that, we add a new ir_variable::how_declared value of ir_var_hidden, and plumb that through to gl_uniform_storage. v2 (idr): Fix some memory management issues in move_hidden_uniforms_to_end. The comment block on the function has more details. Signed-off-by: Kenneth Graunke <[email protected]> Signed-off-by: Ian Romanick <[email protected]>
* mesa: Add SSE 4.1 optimisation for glDrawElements.Timothy Arceri2014-11-062-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes use of SSE 4.1 to speed up compute of min and max elements. Callgrind cpu usage results from pts benchmarks: Openarena 0.8.8: 3.67% -> 1.03% UrbanTerror: 2.36% -> 0.81% V5: - actually make use of the optimisation in android (Emil Velikov) - set a better array size limit for using SSE and added TODO V4: - fixed bugs with incrementing pointer and updating counters V3: - Removed sse_minmax.c from Makefile.sources - handle the first few values without SSE until the pointer is aligned and use _mm_load_si128 rather than _mm_loadu_si128 - guard the call to the SSE code better at build time V2: - removed GL* types - use _mm_store_si128() rather than _mm_store_ps() - add runtime check for SSE - use aligned attribute for local mix/max - bunch of tidyups Reviewed-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Timothy Arceri <[email protected]>
* mesa: Silence unused parameter warning in check_context_limits in non-debug ↵Ian Romanick2014-11-051-0/+2
| | | | | | | | | | builds ../../src/mesa/main/context.c: In function 'check_context_limits': ../../src/mesa/main/context.c:733:41: warning: unused parameter 'ctx' [-Wunused-parameter] Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>