aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: avoid triggering assert in implementationLionel Landwerlin2019-12-171-0/+6
| | | | | | | | | | | | | | | | When tearing down a GL context with an active performance query, the implementation can be confused by a query marked active when it's being deleted. This shouldn't happen in the implementation because the context will already be idle. Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2235 Reviewed-by: Tapani Pälli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3115> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3115>
* main: Change u_mmAllocMem align2 from bytes (old API) to bits (new API)Kenneth Graunke2019-12-051-1/+1
| | | | | | | | | | | The main and Gallium implementations were recently merged, and the align2 parameter in the Gallium one is in bits. execmem.c expected bytes still. This led to every call here asserting. Fixes: b6fd679a9e("mesa/main/util: moving gallium u_mm to util, remove main/mm") Reviewed-by: Alejandro Piñeiro <[email protected]> Tested-by: Clayton Craft <[email protected]>
* mesa: Silence unused parameter warningIan Romanick2019-12-042-3/+3
| | | | | | | | | | | | | Unused since e4da8b9c331 ("mesa/compiler: rework tear down of builtin/types"). src/mesa/main/context.c: In function ‘_mesa_free_context_data’: src/mesa/main/context.c:1321:54: warning: unused parameter ‘destroy_compiler_types’ [-Wunused-parameter] 1321 | _mesa_free_context_data(struct gl_context *ctx, bool destroy_compiler_types) | ^ Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: Silence 'left shift of negative value' warning in BPTC compression codeIan Romanick2019-12-041-4/+3
| | | | | | | | | | | | | | src/util/format/../../mesa/main/texcompress_bptc_tmp.h:830:31: warning: left shift of negative value [-Wshift-negative-value] 830 | value |= (~(int32_t) 0) << n_bits; | ^~ v2: Rewrite to just shift left then shift right. Based on conversation with Neil in https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2792#note_320272, this should be fine. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> [v1] Reviewed-by: Neil Roberts <[email protected]>
* mesa/main/util: moving gallium u_mm to util, remove main/mmAlejandro Piñeiro2019-12-023-378/+6
| | | | | | | | | | | | | | | | | | | | Right now there are two copies of mm: * mesa/main/mm.[ch] * gallium/auxiliary/util/u_mm.[ch] At some point they splitted, and from the commit message it was not clear why it was not possible to have only one copy at a common place. Taking into account that was several years ago, Im assuming that it was not possible then. This change would allow to have one copy of the same code, and also being able to use that code out of mesa/main or gallium, if needed. This commit moves u_mm and removes mm, as u_mm has slightly more changes. Reviewed-by: Jose Fonseca <[email protected]>
* driconf, glsl: Add a vs_position_always_invariant optionKenneth Graunke2019-11-271-0/+3
| | | | | | | | | | | | | | | | | | | | Many applications use multi-pass rendering and require their vertex shader position to be computed the same way each time. Optimizations may consider, say, fusing a multiply-add based on global usage of an expression in a shader. But a second shader with the same expression may have different code, causing that optimization to make the other choice the second time around. The correct solution is for applications to mark their VS outputs 'invariant', indicating they need multiple shaders to compute that output in the same manner. However, most applications fail to do so. So, we add a new driconf option - vs_position_always_invariant - which forces the gl_Position output in vertex shaders to be marked invariant. Fixes: 7025dbe794b ("nir: Skip emitting no-op movs from the builder.") Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mapi: add GetInteger64vEXT with EXT_disjoint_timer_queryTapani Pälli2019-11-261-1/+3
| | | | | | | | | | | | | From EXT_disjoint_timer_query spec: "Interaction: This extension adds GetInteger64vEXT if OpenGL ES 3.0 is not supported" See https://github.com/KhronosGroup/OpenGL-Registry/issues/326. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable ARB_shading_language_includeTimothy Arceri2019-11-201-1/+1
| | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/999 Reviewed-by: Witold Baryluk <[email protected]>
* mesa: implement glCompileShaderIncludeARB()Timothy Arceri2019-11-201-3/+63
| | | | Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add shader include lookup support for relative pathsTimothy Arceri2019-11-201-10/+75
| | | | Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add support cursor support for relative path shader includesTimothy Arceri2019-11-202-0/+19
| | | | | | | | | | | | | This will allow us to continue searching the current path for relative shader includes. From the ARB_shading_language_include spec: "If it is quoted with double quotes in a previously included string, then the first search point will be the tree location where the previously included string had been found." Reviewed-by: Witold Baryluk <[email protected]>
* mesa: implement glDeleteNamedStringARB()Timothy Arceri2019-11-201-0/+25
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: split _mesa_lookup_shader_include() in twoTimothy Arceri2019-11-201-4/+14
| | | | | | | | The new local function lookup_shader_include() will be used by glDeleteNamedStringARB() in the following patch. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: implement glGetNamedStringivARB()Timothy Arceri2019-11-201-0/+28
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: implement glIsNamedStringARB()Timothy Arceri2019-11-201-1/+14
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: make error checking optional in _mesa_lookup_shader_include()Timothy Arceri2019-11-202-10/+19
| | | | | | | | | This will be usefull when implementing glIsNamedStringARB() which doesn't do error checking, it just returns false for invalid lookups instead. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: implement glGetNamedStringARB()Timothy Arceri2019-11-201-0/+22
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add glNamedStringARB() supportTimothy Arceri2019-11-201-0/+59
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add copy_string() helperTimothy Arceri2019-11-201-0/+20
| | | | | | | | This will be used by the various ARB_shading_language_include functions in the following patches. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add _mesa_lookup_shader_include() helperTimothy Arceri2019-11-202-0/+37
| | | | | | | This will be used both by the glsl compiler and the GL API. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add helper to validate tokenise shader include pathTimothy Arceri2019-11-201-0/+82
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add ARB_shading_language_include infrastructure to gl_shared_stateTimothy Arceri2019-11-204-0/+77
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* glsl: add infrastructure for ARB_shading_language_includeTimothy Arceri2019-11-201-0/+1
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: add ARB_shading_language_include stubsTimothy Arceri2019-11-203-6/+65
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Witold Baryluk <[email protected]>
* mesa: fix warning in 32 bits buildPierre-Eric Pelloux-Prayer2019-11-191-1/+1
| | | | | Fixes: febedee4f6c ("mesa: add EXT_dsa glGetVertexArray* 4 functions") Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable EXT_direct_state_accessPierre-Eric Pelloux-Prayer2019-11-191-0/+1
| | | | | | | | | | Always enabled; this doesn't require any driver work, it's just core mesa bits. quick_gl.txt is also updated because previously piglit ext_dsa tests were skipped. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_sparse_buffer NamedBufferPageCommitmentEXT functionPierre-Eric Pelloux-Prayer2019-11-193-0/+25
| | | | | | | The spec is unclear on how to handle the buffer argument so we reuse the logic from the EXT_direct_state_access spec. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_vertex_attrib_binding glVertexArray* functionsPierre-Eric Pelloux-Prayer2019-11-193-5/+120
| | | | | | | We can't simply alias ARB_direct_state_access functions because those fail if the vao has never been bound before. Reviewed-by: Marek Olšák <[email protected]>
* mesa: extend vertex_array_attrib_format to support EXT_dsaPierre-Eric Pelloux-Prayer2019-11-191-12/+6
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: implement ARB_texture_storage_multisample + EXT_dsa functionsPierre-Eric Pelloux-Prayer2019-11-193-2/+60
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_texture_buffer_range glTextureBufferRangeEXT functionPierre-Eric Pelloux-Prayer2019-11-193-1/+51
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_instanced_arrays EXT_dsa functionPierre-Eric Pelloux-Prayer2019-11-193-0/+52
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_clear_buffer_object named functionsPierre-Eric Pelloux-Prayer2019-11-193-2/+46
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_vertex_attrib_64bit VertexArrayVertexAttribLOffsetEXTPierre-Eric Pelloux-Prayer2019-11-193-0/+39
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_framebuffer_no_attachments named functionsPierre-Eric Pelloux-Prayer2019-11-193-2/+86
| | | | | | | | | | | The wording in ARB_framebuffer_no_attachments and EXT_direct_state_access is different. In the former framebuffer names must have been generated using glGenFramebuffers before using the named functions. In the latter framebuffer names have no such constraints, so we can't use the _mesa_lookup_framebuffer_dsa function. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Don't put sRGB formats in the array format table.Eric Anholt2019-11-151-8/+6
| | | | | | | | | | sRGB vs unorm was the only conflict case being guarded against in this function. Before the PIPE_FORMAT conversion, we always listed the unorm before the sRGB in the enums, but PIPE_FORMAT_A8B8G8R8_SRGB happens to be before _UNORM. We always want the unorm result here. Fixes: 807a800d8c3e ("mesa: Redefine MESA_FORMAT_* in terms of PIPE_FORMAT_*.") Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Handle GL_COLOR_INDEX in _mesa_format_from_format_and_type().Kenneth Graunke2019-11-151-0/+3
| | | | | | | | | | | Just return MESA_FORMAT_NONE to avoid triggering unreachable; there's really no sensible thing to return for this case anyway. This prevents regressions in the next commit, which makes st/mesa start using this function to find a reasonable format from GL format and type enums. Reviewed-by: Eric Anholt <[email protected]>
* mesa: allow bit queries for EXT_disjoint_timer_queryTapani Pälli2019-11-151-4/+14
| | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* Revert "mesa: allow bit queries for EXT_disjoint_timer_query"Tapani Pälli2019-11-141-14/+4
| | | | | | | This reverts commit 66d24a9ef705b8f9f15dab8059b63781f9fb28ca. This commit made Mesa CI red because commit depends on a Piglit test change.
* mesa: allow bit queries for EXT_disjoint_timer_queryTapani Pälli2019-11-141-4/+14
| | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2090 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* s/APIENTRY/GLAPIENTRY/ in teximage.cBrian Paul2019-11-121-1/+1
| | | | | | The later is the right symbol for entrypoint functions. Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: check framebuffer completeness only after state updateLionel Landwerlin2019-11-111-6/+6
| | | | | | | | | | | | The change made in 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv") correctly updated the state prior to checking the framebuffer completeness on glClearBufferiv but not in glClearBufferfi. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Fixes: 88d665830f27 ("mesa: check draw buffer completeness on glClearBufferfi/glClearBufferiv") Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/2072
* mesa: expose SPIR-V extensions in the Compatibility profile tooMarek Olšák2019-11-071-2/+2
| | | | | | | | | We would like to have GL 4.6 Compatibility too. The extensions don't support compatibility features, so no other changes are needed. Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: Redefine MESA_FORMAT_* in terms of PIPE_FORMAT_*.Eric Anholt2019-11-071-329/+271
| | | | | | | | | | | | | | | | | There are various places in Mesa where we would like to be able to have a shared format enum between Mesa and gallium (NIR compiler's image formats, for example, or mapping from gallium's formats to mesa's and vice versa in st_format.c). Rewriting all MESA_FORMAT to PIPE_FORMAT would be disruptive and possibly more work than it's worth (And I actually prefer MESA_FORMAT's name scheme), so for now just make it so that there's one shared set of enum values. The #defines here were generated by printing out from the tests/st_format.c round-tripping loop, with the exception of 8888 formats where I hand-edited the #defines to point at the corresponding gallium packed format define. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Prepare for the MESA_FORMAT_* enum to be sparse.Eric Anholt2019-11-073-4/+21
| | | | | | | | | To redefine MESA_FORMAT in terms of PIPE_FORMAT enums, we need to fix places where we iterated up to MESA_FORMAT_COUNT. I use _mesa_get_format_name(f) == NULL as the signal that it's not an enum value with a MESA_FORMAT. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Stop defining a full separate format for RGBA_UINT8.Eric Anholt2019-11-073-6/+7
| | | | | | | | | We have packed formats for RGBA and ABGR already, so we can just pack/unpack code. v2: Rebase on endianness macro rename Reviewed-by: Marek Olšák <[email protected]> (v1)
* mesa/imports: let the build system detect strtok_r()Eric Engestrom2019-11-051-1/+1
| | | | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2013 Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Prodea Alexandru-Liviu <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* mesa: fix call to _mesa_lookup_vao_errPierre-Eric Pelloux-Prayer2019-11-051-1/+1
| | | | | | Fixes: 3e842a0b0ea ("mesa: rework _mesa_lookup_vao_err to allow usage from EXT_dsa") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2055 Reviewed-by: Kenneth Graunke <[email protected]>
* util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIANDylan Baker2019-11-056-12/+12
| | | | | | | | | | | As requested by Tim. This was generated with: grep 'PIPE_ARCH_.*_ENDIAN' -rIl | xargs sed -ie 's@PIPE_ARCH_\(.*\)_ENDIAN@UTIL_ARCH_\1_ENDIAN@'g v2: - add this patch Reviewed-by: Eric Engestrom <[email protected]>
* mesa/main: delete now unused _mesa_little_endianDylan Baker2019-11-051-12/+0
| | | | Reviewed-by: Eric Engestrom <[email protected]>