summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: validate sampler type across the whole programTimothy Arceri2017-04-242-5/+23
| | | | | | | | | | | | Currently we were only making sure types were the same within a single stage. This looks to have regressed with 953a0af8e3f73. Fixes: 953a0af8e3f73 ("mesa: validate sampler uniforms during gluniform calls") Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> https://bugs.freedesktop.org/show_bug.cgi?id=97524 (cherry picked from commit d682f8aa8e0edd166166f87fcd774dd2d57b4180)
* mesa/glthread: correctly compare thread handlesEmil Velikov2017-04-241-1/+1
| | | | | | | | | | | | | | As mentioned in the manual - comparing pthread_t handles via the C comparison operator is incorrect and pthread_equal() should be used instead. Cc: Timothy Arceri <[email protected]> Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to process GL commands.") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Plamena Manolova <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (cherry picked from commit 52df318d61f4892dbbaa8f0da4787f25caf1b0d1)
* mesa: move glMultiDrawArrays to vbo and fix error handlingNicolai Hähnle2017-04-243-18/+58
| | | | | | | | | | | | | | | | | When any count[i] is negative, we must skip all draws. Moving to vbo makes the subsequent change easier. v2: - provide the function in all contexts, including GLES - adjust validation accordingly to include the xfb check v3: - fix mix-up of pre- and post-xfb prim count (Nils Wallménius) Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 42d5465b9ba85b4918b9e6fb57994720e3c8a80b)
* mesa: extract need_xfb_remaining_prims_checkNicolai Hähnle2017-04-241-20/+28
| | | | | | | | | The same logic needs to be applied to glMultiDrawArrays. Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 756e9ebbdd84018382908d3556973a62dbda09ca)
* mesa: fix remaining xfb prims check for GLES with multiple instancesNicolai Hähnle2017-04-241-1/+1
| | | | | | | | | Found by inspection. Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit ea9a8940cadb30ac8d72a26b82bdb54872c0e199)
* glsl: delay optimisations on individual shaders when cache is availableTimothy Arceri2017-04-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | Due to a max limit of 65,536 entries on the index table that we use to decide if we can skip compiling individual shaders, it is very likely we will have collisions. To avoid doing too much work when the linked program may be in the cache this patch delays calling the optimisations until link time. Improves cold cache start-up times on Deus Ex by ~20 seconds. When deleting the cache index to simulate a worst case scenario of collisions in the index, warm cache start-up time improves by ~45 seconds. V2: fix indentation, make sure to call optimisations on cache fallback, make sure optimisations get called for XFB. Tested-by: Grazvydas Ignotas <[email protected]> Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove some unused functions in the perf monitor areaSamuel Pitoiset2017-04-131-27/+0
| | | | | | | | | | | | | | | | | | Fixes the following Clang warnings. main/performance_monitor.c:157:1: warning: unused function 'index_to_queryid' [-Wunused-function] index_to_queryid(GLuint index) ^ main/performance_monitor.c:163:1: warning: unused function 'queryid_valid' [-Wunused-function] queryid_valid(const struct gl_context *ctx, GLuint queryid) ^ main/performance_monitor.c:169:1: warning: unused function 'counterid_to_index' [-Wunused-function] counterid_to_index(GLuint counterid) ^ 3 warnings generated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove unused clamp_float_to_uint() and clamp_half_to_uint()Samuel Pitoiset2017-04-131-15/+0
| | | | | | | | | | | | | | | Fixes the following Clang warnings. main/pack.c:470:1: warning: unused function 'clamp_float_to_uint' [-Wunused-function] clamp_float_to_uint(GLfloat f) ^ main/pack.c:477:1: warning: unused function 'clamp_half_to_uint' [-Wunused-function] clamp_half_to_uint(GLhalfARB h) ^ 2 warnings generated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove unused _mesa_unmarshal_BindBufferBase()Samuel Pitoiset2017-04-131-8/+0
| | | | | | | | | | | | | Fixes the following Clang warning. main/marshal.c:209:1: warning: unused function '_mesa_unmarshal_BindBufferBase' [-Wunused-function] _mesa_unmarshal_BindBufferBase(struct gl_context *ctx, const struct marshal_cmd_BindBufferBase *cmd) ^ 1 warning generated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: use pre_hashed version of search for the mesa hash tableTimothy Arceri2017-04-121-2/+6
| | | | | | | The key is just an unsigned int so there is never any real hashing done. Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix typo and add assert() to _mesa_attach_renderbuffer_without_ref()Timothy Arceri2017-04-111-1/+3
| | | | | This function should only be used with a "freshly created" renderbuffer so assert RefCount is 1.
* mesa: use single memcpy when strides match in glReadPixels, texstore codeBartosz Tomczyk2017-04-102-9/+21
| | | | | | v2: fix indentation Reviewed-by: Brian Paul <[email protected]>
* mesa: create _mesa_attach_renderbuffer_without_ref() helperTimothy Arceri2017-04-102-8/+40
| | | | | | | | | | | | | | | This will be used to take ownership of freashly created renderbuffers, avoiding the need to call the reference function which requires locking. V2: dereference any existing fb attachments and actually attach the new rb. v3: split out validation and attachment type/complete setting into a shared static function. Reviewed-by: Emil Velikov <[email protected]> Tested-by: Bartosz Tomczyk <[email protected]>
* mesa/main/ff_frag: Use compressed TexEnv Combine state.Gustaw Smolarczyk2017-04-081-231/+104
| | | | | | | | Along the way, add missing GL_ONE source support and drop non-existing GL_ZERO and GL_ONE operand support. Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Use compressed fog mode.Gustaw Smolarczyk2017-04-081-17/+1
| | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main: Maintain compressed TexEnv Combine state.Gustaw Smolarczyk2017-04-082-0/+186
| | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main: Maintain compressed fog mode.Gustaw Smolarczyk2017-04-083-0/+24
| | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Don't retrieve format if not necessary.Gustaw Smolarczyk2017-04-081-9/+6
| | | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Use gl_texture_object::TargetIndex.Gustaw Smolarczyk2017-04-081-2/+1
| | | | | | | Instead of computing it once again using _mesa_tex_target_to_index. Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Store nr_enabled_units only once.Gustaw Smolarczyk2017-04-081-2/+4
| | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Simplify get_fp_input_mask.Gustaw Smolarczyk2017-04-081-56/+55
| | | | | | | | | | | Change it into filter_fp_input_mask transform function that instead of returning a mask, transforms input. Also, simplify the case of vertex program handling by assuming that fp_inputs is always a combination of VARYING_BIT_COL* and VARYING_BIT_TEX*. Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Don't bother with VARYING_BIT_FOGC.Gustaw Smolarczyk2017-04-081-3/+1
| | | | | | | It's not used. Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Remove unused struct.Gustaw Smolarczyk2017-04-081-8/+0
| | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Reduce the size of nr_enabled_units.Gustaw Smolarczyk2017-04-081-1/+1
| | | | | | | | Since it holds values from 0 to 8, 4 bits will suffice. Signed-off-by: Gustaw Smolarczyk <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Remove enabled_units.Gustaw Smolarczyk2017-04-081-3/+1
| | | | | | | | | Its only usage is easily replaced by nr_enabled_units. As for cache key part, unit[i].enabled should be enough. Signed-off-by: Gustaw Smolarczyk <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/main/ff_frag: Use correct constant.Gustaw Smolarczyk2017-04-081-1/+1
| | | | | | | | | | Since fixed-function shaders are restricted to MAX_TEXTURE_COORD_UNITS texture units, use this constant instead of MAX_TEXTURE_UNITS. This reduces the array size from 32 to 8. Signed-off-by: Gustaw Smolarczyk <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: simplify and optimise vertex bindings trackingTimothy Arceri2017-04-081-5/+3
| | | | | | | | We only need to update it if something changes. Also _mesa_bind_vertex_buffer() will update the mask when binding to a NULL or default buffer so no need to do that update here. Reviewed-by: Juan A. Suarez Romero <[email protected]>
* mesa: fix renderbuffer leakTimothy Arceri2017-04-071-1/+1
| | | | | | | | | | | We don't need to call _mesa_reference_renderbuffer() for the first assignment as refCount starts at 1. For swrast we work around the fact we will indirectly call _mesa_reference_renderbuffer() by resetting refCount to 0. Fixes: 32141e53d1520 (mesa: tidy up renderbuffer RefCount initialisation) Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa/main: simplify _mesa_IsRenderbuffer()Samuel Pitoiset2017-04-071-7/+6
| | | | | | | _mesa_lookup_renderbuffer() already checks if 'id' is non-zero. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: stop abstracting texture object hashtable lockingTimothy Arceri2017-04-073-23/+5
| | | | | | | This doesn't do anything useful so just remove it. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: stop abstracting buffer object hashtable lockingTimothy Arceri2017-04-073-31/+12
| | | | | | | This doesn't do anything useful so just remove it. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: use internal function when deleting buffersTimothy Arceri2017-04-061-16/+16
| | | | | | | This avoids validation and looking up the buffer target for a second time. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: rework bind_buffer_object()Timothy Arceri2017-04-061-18/+16
| | | | | | | | This allows internal users to pass buffer objects directly and allows for KHR_no_error support to be more easily added. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: small texstate tidy upTimothy Arceri2017-04-061-4/+5
| | | | | | | | Possibly more efficient, either way it makes the code easier to follow. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: tidy up renderbuffer RefCount initialisationTimothy Arceri2017-04-062-2/+1
| | | | | | | | | | | 42aaa548 changed the renderbuffer initialisation of RefCount from 1 to 0. This is inconsitent with how we use RefCount elsewhere. Also every driver implementation of NewRenderbuffer() calls _mesa_init_renderbuffer() so its safe to set it there. Reviewed-by: Brian Paul <[email protected]>
* mesa: add GL_ARB_shader_ballot boilerplateNicolai Hähnle2017-04-052-0/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: implement sparse buffer commitmentNicolai Hähnle2017-04-052-0/+76
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: implement sparse storage buffer allocationNicolai Hähnle2017-04-051-6/+23
| | | | | | | v2: - spec quote and style (Ian) Reviewed-by: Marek Olšák <[email protected]>
* mesa: implement SPARSE_BUFFER_PAGE_SIZE_ARBNicolai Hähnle2017-04-053-0/+7
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add GL_ARB_sparse_buffer boilerplateNicolai Hähnle2017-04-055-0/+25
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Replace program locks with atomic inc/dec.Matt Turner2017-04-051-1/+0
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Require mipmap completeness for glCopyImageSubData(), sometimes.Kenneth Graunke2017-04-041-2/+23
| | | | | | | | | | This patch makes glCopyImageSubData require mipmap completeness when the texture object's built-in sampler object has a mipmapping MinFilter. Fixes (on i965): dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data Reviewed-by: Roland Scheidegger <[email protected]>
* mesa/glthread: Avoid unnecessary batch reallocationBartosz Tomczyk2017-04-041-6/+9
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: fix misaligned address accessBartosz Tomczyk2017-04-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Address sanitizer reports lot of misaligned access: SUMMARY: AddressSanitizer: undefined-behavior main/marshal.c:276:31 in main/marshal.c:276:31: runtime error: load of misaligned address 0x631000104866 for type 'const GLuint' (aka 'const unsigned int'), which requires 4 byte alignment 0x631000104866: note: pointer points here 92 88 00 00 00 00 00 00 4a 03 0c 00 93 88 00 00 00 00 00 00 02 01 0c 00 40 8d 00 00 00 00 00 00 ^ SUMMARY: AddressSanitizer: undefined-behavior main/marshal_generated.c:28725:12 in main/marshal_generated.c:28726:12: runtime error: member access within misaligned address 0x6310003fc874 for type 'struct marshal_cmd_VertexAttribPointer', which requires 8 byte alignment 0x6310003fc874: note: pointer points here 01 00 00 00 7a 02 20 00 00 00 00 00 be be be be be be be be be be be be be be be be be be be be ^ SUMMARY: AddressSanitizer: undefined-behavior main/marshal_generated.c:28726:12 in main/marshal_generated.c:28726:12: runtime error: store to misaligned address 0x6310003fc87c for type 'GLint' (aka 'int'), which requires 8 byte alignment 0x6310003fc87c: note: pointer points here 00 00 00 00 be be be be be be be be be be be be be be be be be be be be be be be be be be be be Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: Call unmarshal_batch directly in glthread_finishBartosz Tomczyk2017-04-031-12/+32
| | | | | | | | Call it directly when batch queue is empty. This avoids costly thread synchronisation. This commit improves performance of games that have previously regressed with mesa_glthread=true. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: disable glthread when DEBUG_OUTPUT_SYNCHRONOUS is enabledTimothy Arceri2017-04-032-0/+45
| | | | | | | | | | | | | We could re-enable it also but I haven't tested that yet, and I'm not sure we care much anyway. V2: don't disable it from with the call itself. We need a custom marshalling function or we get stuck waiting for thread to finish. V3: tidy up redundant code copied from generated version. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: Fix memset in formatquery.cEdward O'Callaghan2017-04-021-1/+2
| | | | | | | | | v2: We explicitly set each member to -1 over using a confusing memset(). Signed-off-by: Edward O'Callaghan <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add support for GL_NV_fill_rectangleLyude2017-03-314-2/+26
| | | | | | | | | | | | | | | | Since we don't have the bits required to support this in OpenGLES yet, this only enables support for Desktop OpenGL Signed-off-by: Lyude <[email protected]> Changes since v1: - Simply _mesa_PolygonMode() a little bit - Fix formatting in OpenGL spec excerpts - Move polygon mode checking into _mesa_valid_to_render() Changes since v3: - Improve error message for invalid drawings with GL_FILL_RECTANGLE_NV Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: remove MESA_GLSL=optTimothy Arceri2017-03-312-10/+7
| | | | | | | | | This is unused. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove MESA_GLSL=no_opts env optionTimothy Arceri2017-03-312-10/+7
| | | | | | | | | | | | This is confusing because is only applys to GL_ARB_vertex/fragment_program, and because of that its also not very useful. If someone requires this for debugging they can just make an ad-hoc code change. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>