summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* mesa: move FLUSH_VERTICES() call to metaTimothy Arceri2017-03-312-8/+3
| | | | | | | | There is no need for this to be in the common code. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix trailing whitespace in polygon.cLyude2017-03-301-3/+3
| | | | | Signed-off-by: Lyude <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Fix gross indenting in _mesa_PolygonMode()Lyude2017-03-301-5/+4
| | | | | Signed-off-by: Lyude <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/glthread: print out syncs when MARSHAL_MAX_CMD_SIZE is exceededTimothy Arceri2017-03-301-0/+13
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove dd_function_table::BindProgramMarek Olšák2017-03-294-57/+7
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't use _NEW_TEXTURE mainly in mesa/mainMarek Olšák2017-03-294-13/+15
| | | | | | | | v2: add missing %s Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: split _NEW_TEXTURE into _NEW_TEXTURE_OBJECT & _NEW_TEXTURE_STATEMarek Olšák2017-03-2913-45/+47
| | | | | | | | | | | | No performance testing has been done, because it makes sense to make this change regardless of that. Also, _NEW_TEXTURE is still used in many places, but the obvious occurences are replaced here. It's now possible to split _NEW_TEXTURE_OBJECT further. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: inline _mesa_update_textureMarek Olšák2017-03-293-22/+14
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/tests: Link main-test with CLOCK_LIB.Vinson Lee2017-03-271-1/+2
| | | | | | | | | | Fix 'make check' linking error with glibc < 2.17. CXXLD main-test ../../../../src/mesa/.libs/libmesa.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]>