aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: treat Color._AdvancedBlendMode as enumErik Faye-Lund2020-07-171-1/+2
| | | | | | | Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Gert Wollny <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516>
* mesa: do not use bitfields for advanced-blend stateErik Faye-Lund2020-07-171-1/+1
| | | | | | | Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Gert Wollny <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5516>
* mesa/main: use p_atomic_inc_return instead of lockingErik Faye-Lund2020-07-161-6/+2
| | | | | | | | | | There's no good reason for using a mutex here, as we have a simpler primitive; atomic integers. So let's use that instead, to simplify things a bit. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5901>
* mesa: change dsa texture error codes for GL 4.6Dave Airlie2020-07-161-15/+25
| | | | | | | | | | | | | | GL 4.6 changed error code for when the effective target of the texture is illegal. Since it's not an illegal enum they modified it to be an illegal operation. However the CTS test for this is missing support for two cases, I'm chasing that up, but I expect this will cause a CTS regression for anyone who runs this test. I'm leaning on the side of being compliant rather than passing the test until the test is fixed. Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5896>
* mesa: add bool param to _mesa_free_context_dataPierre-Eric Pelloux-Prayer2020-07-152-4/+5
| | | | | | | | The param controls whether _mesa_destroy_debug_output should be called or not. No functional changes; this will be used by the next commit. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5789>
* mesa: rename _mesa_free_errors_dataPierre-Eric Pelloux-Prayer2020-07-153-3/+3
| | | | | | | | Use the _mesa_init_XXX / _mesa_destroy_XXX pattern to clearly associate the 2 functions. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5789>
* mesa/main: use call_once instead of open-codingErik Faye-Lund2020-07-141-13/+3
| | | | | | | We already have a utility for this, so let's use that instead. Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5879>
* mesa/main: factor out one-time-init into a helperErik Faye-Lund2020-07-141-43/+52
| | | | | | | This will make the next commit a bit cleaner. Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5879>
* glsl: lower mediump temporaries to 16 bits except structures (v2)Marek Olšák2020-07-071-0/+6
| | | | | | | | | | | Without this, NIR contains non-lowerable 32-bit phis for mediump variables. Structures are not lowered yet. v2: add the LowerPrecisionTemporaries option Reviewed-by: Alyssa Rosenzweig <[email protected]> (v1) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>
* mesa/version: only enable GL4.1 with correct limits.Dave Airlie2020-07-061-0/+2
| | | | | | | | | | I haven't tested all the limits, but these two should be enough for driver writers to realise. I've also submitted a minmax test for piglit to test this. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5727>
* mesa/glformats: make _mesa_gles_error_check_format_and_type() more consistentEric Engestrom2020-07-041-25/+25
| | | | | | | | | | | | | Let's consistently use the following code format instead of relying on falling through to `default`: if (!req) return GL_INVALID_OPERATION; break; Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5729>
* mesa: update fallthrough comment so gcc can see itTimothy Arceri2020-07-021-1/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: fix unintended fallthrough in glIsEnabled()Timothy Arceri2020-07-021-0/+2
| | | | | | Fixes: 08fae07f5246 ("mesa: Handle GL_TEXTURE_GEN_STR_OES in _mesa_Enable()") Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: add missing fallthrough comment to teximage.cTimothy Arceri2020-07-021-0/+1
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: add fallthrough comments to COPY_SZ_4V()Timothy Arceri2020-07-021-8/+8
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: add fallthrough comments to get.cTimothy Arceri2020-07-021-0/+86
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: add fallthrough comments to glformats.cTimothy Arceri2020-07-021-0/+3
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: fix fallthrough in glformatsTimothy Arceri2020-07-021-3/+4
| | | | | | | | | | | | | | | | Before 908f817918fb this would fallthrough to GL_INVALID_OPERATION if the validation condition was not met. But since that change it will now only return GL_INVALID_OPERATION if !_mesa_has_EXT_texture_compression_bptc(ctx) is true. This seems unintended. Here we fix up the fallthrough and add the fallthrough comment so this doesn't happen again. Fixes: 908f817918fb ("mesa: expose EXT_texture_compression_bptc in GLES") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3005 Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa/get: fix enum16 big-endian getting.Dave Airlie2020-07-011-9/+10
| | | | | | | | | | | | These values were getting casted up to 32-bit, but then extracted via 16-bit pointer later. Just store via 16-bit. Fixes a lot of piglit on s390 Fixes: f96a69f916ae ("mesa: replace GLenum with GLenum16 in common structures (v4)"); Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
* glsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13Marek Olšák2020-06-231-0/+5
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5459>
* glthread: handle ARB_vertex_attrib_bindingMarek Olšák2020-06-234-26/+403
| | | | | | | | | This handles ARB_vertex_attrib_binding for vertex uploads correctly. Before this, the extension might have led to crashes if non-VBO vertex attribs were present. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5303>
* glthread: rename non_vbo_attrib_mask -> user_buffer_mask, attribs -> buffersMarek Olšák2020-06-233-106/+106
| | | | | | | just a cleanup, no change in behavior Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5303>
* mesa: Add PrimitiveRestartFixedIndex to gl_constantsNeil Roberts2020-06-222-1/+9
| | | | | | | | | | | | This is a fine-grained subset of the NV_primitive_restart extension that only uses the fixed indices provided by GLES 3.0. There’s no public extension to advertise this behaviour so the bool is added to gl_constants instead of gl_extensions. Reviewed-by: Eric Anholt <[email protected]> Reviewed by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5559>
* mesa/main: fix inverted conditionErik Faye-Lund2020-06-181-1/+1
| | | | | | | | | | | I accidentally got one of the conditions wrong here. Sorry for the mixup. See ttps://gitlab.freedesktop.org/mesa/mesa/-/issues/3134 for details. Fixes: b112e62ba48 ("mesa/main: do not allow MESA_ycbcr_texture enums on gles") Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5532>
* mesa/gles3: add support for GL_EXT_shader_group_voteDave Airlie2020-06-161-0/+1
| | | | | | | | This is the GLES equivalent to ARB_shader_group_vote. Passes: KHR-GLES31.core.shader_group_vote.* Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5490>
* mesa: Fix NetBSD compiler macro.Vinson Lee2020-06-031-1/+1
| | | | | | | | | Reported-by: Rafał Mikrut <[email protected]> Fixes: a63b90712aad ("mesa: also check for __NetBSD__") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3015 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5191>
* glsl: lower mediump partial derivativesMarek Olšák2020-06-021-0/+1
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002>
* glsl: lower mediump integer types to int16 and uint16Marek Olšák2020-06-021-1/+2
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002>
* glthread: don't upload for glDraw inside a display list and always syncMarek Olšák2020-05-302-17/+54
| | | | | | | | | | | | | Let the vbo module handle it, not glthread. This handles functions set in vbo_initialize_save_dispatch. Fixes: 2840bc3065b ("glthread: upload non-VBO vertices and indices for non-Indirect non-IBM draws") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3001 Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Dieter Nützel <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5246>
* mesa: Use SATURATEAlyssa Rosenzweig2020-05-264-7/+7
| | | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
* st/mesa: Clear texture's views when texture is removed from Shared->TexObjectsDanylo Piliaiev2020-05-252-0/+10
| | | | | | | | | | | | | If texture is shared between several contexts, calling glDeleteTextures will remove it from ctx->Shared->TexObjects - which makes impossible for contexts, when destroyed, to release their views to this texture. Which leaves dangling pointers to destroyed contexts. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2960 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5106>
* mesa: Fix double-lock of Shared->FrameBuffers and usage of wrong mutexDanylo Piliaiev2020-05-221-8/+1
| | | | | | | | | Fixes: 7534c536ca0f4b2b123200f421460094034f37a3 Fixes: 8cfb3e4ee57070ff45e7534a986a20c5fd649dc7 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3024 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5160>
* mesa: Add matrix utility functions to load matricesIan Romanick2020-05-142-15/+31
| | | | | | | | | | | | These are basically DSA versions of glLoadIdentity() and glLoadMatrix() that are available for internal Mesa use. text data bss dec hex filename 12243574 1344936 1290748 14879258 e30a1a before/lib64/dri/i965_dri.so 12243486 1344936 1290748 14879170 e309c2 after/lib64/dri/i965_dri.so Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/856>
* glthread: stop using GLenum16 to get correct GL errors for out-of-bounds enumsMarek Olšák2020-05-131-6/+6
| | | | | | | Reported by Ian Romanick. Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5016>
* glthread: Fix use of alloca() without #include "c99_alloca.h"Jon Turney2020-05-121-0/+2
| | | | | | | | | | | | | | | ../src/mesa/main/glthread_draw.c: In function ‘_mesa_marshal_MultiDrawElementsBaseVertex’: ../src/mesa/main/glthread_draw.c:812:36: error: implicit declaration of function ‘alloca’; did you mean ‘malloc’? [-Werror=implicit-function-declaration] 812 | const GLvoid **out_indices = alloca(sizeof(indices[0]) * draw_count); | ^~~~~~ | malloc ../src/mesa/main/glthread_draw.c:812:36: error: initialization of ‘const GLvoid **’ {aka ‘const void **’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion] cc1: some warnings being treated as errors Include c99_alloca.h to portably make the alloca() prototype available. Fixes: 2840bc30 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4920>
* gallium: add a new cap PIPE_CAP_GLSL_ZERO_INITPierre-Eric Pelloux-Prayer2020-05-051-2/+6
| | | | | | | Allows driver to select a zero init mode between the 3 possible values. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
* mesa: extend GLSLZeroInit semanticsPierre-Eric Pelloux-Prayer2020-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new way to zero-init variables but keep the old one to not break any existing behavior. With this change GLSLZeroInit becomes an integer, with the following possible values: - 0: no 0 init - 1: current behavior - 2: new behavior. Similar to 1, except ir_var_function_out type are 0 initialized but ir_var_shader_out. The rationale behind 2 is: zero initializing ir_var_shader_out can prevent some optimization where out variables are completely eliminated when not written to. On the other hand, zero initializing "ir_var_function_out" has no effect on correct shaders but typically helps shadertoy since the main function is: void mainImage(out vec4 fragColor) { ... } So with this change we're sure that fragColor will always get a value. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4607>
* compiler/glsl: explicitly store NumUniformBlocksErik Faye-Lund2020-05-051-0/+1
| | | | | | | | | | | It's not great to use shader_info for this information, because it might have gone through lowering of uniforms to UBOs, which can change the number of UBOs. So let's make sure we know the size of the UniformBlocks array from when the shader was linked instead. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4734>
* mesa: add gl_coontext::ForceIntegerTexNearestPierre-Eric Pelloux-Prayer2020-05-054-16/+43
| | | | | | | | | | | | | Some applications incorrectly use GL_LINEAR* values for integers texture. copyimage.c already implemented a tolerance for such app in prepare_target_err. This commit adds a boolean that will treat GL_LINEAR* filters as GL_NEAREST for integer textures. CC: 20.1 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>
* mesa: check draw buffer completeness on glClearBufferfv/glClearBufferuivDmitriy Nester2020-05-041-0/+12
| | | | | | | | | | | | | | | | From OpenGL 4.6, section 9.4.4 "Effects of Framebuffer Completeness on Framebuffer Operations", page 332: "An INVALID_FRAMEBUFFER_OPERATION error is generated by attempts to render to or read from a framebuffer which is not framebuffer complete. This error is generated regardless of whether fragments are actually read from or written to the framebuffer. For example, it is generated when a rendering command is called and the framebuffer is incomplete, even if RASTERIZER_DISCARD is enabled." Signed-off-by: Dmytro Nester <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4833>
* glthread: Add GLAPIENTRY to _mesa_marshal_MultiDrawArrays.Jose Fonseca2020-05-011-1/+1
| | | | | | Fixes MSVC build. Trivial. Fixes: 2840bc3065b9e991b2c5880a2ee02e2458a758c4
* glthread: upload non-VBO vertices and indices for non-Indirect non-IBM drawsMarek Olšák2020-04-303-0/+990
| | | | | | This is basically the same thing u_vbuf does. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: handle gl{Push,Pop}ClientAttrib{DefaultEXT} for glthread statesMarek Olšák2020-04-302-0/+105
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: handle POS vs GENERIC0 aliasingMarek Olšák2020-04-302-3/+10
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: initialize VAOs properlyMarek Olšák2020-04-303-0/+33
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: track primitive restart stateMarek Olšák2020-04-303-0/+63
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: track instance divisor changesMarek Olšák2020-04-302-11/+35
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: track pointers and strides for Pointer & EXT_dsa attrib functionsMarek Olšák2020-04-302-12/+59
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: don't use atomics for refcounting to decrease overhead on AMD ZenMarek Olšák2020-04-302-1/+33
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
* glthread: do glBufferSubData as unsynchronized upload + GPU copyMarek Olšák2020-04-304-2/+138
| | | | | | | | | | | | 1. glthread has a private upload buffer (as struct gl_buffer_object *) 2. the new function glInternalBufferSubDataCopyMESA is used to execute the copy (the source buffer parameter type is struct gl_buffer_object * as GLintptr) Now glthread can handle arbitrary glBufferSubData sizes without syncing. This is a good exercise for uploading data outside of the driver thread. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>