summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: minor clean-ups in st_update_renderbuffer_surface()Brian Paul2017-04-261-9/+8
| | | | | | | | Remove unneeded parens. Add const qualifiers. Move var decls closer to where they're used. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Neha Bhende<[email protected]>
* st/glsl_to_tgsi: disable the merge registers pass conditionallySamuel Pitoiset2017-04-261-1/+6
| | | | | | | | | | | | | | | | | | | | | The main goal of this pass to merge temporary registers in order to reduce the total number of registers and also to produce optimal TGSI code. In fact, compilers seem to be confused when temporary variables are already merged, maybe because it's done too early in the process. Skipping the pass, reduce both the register pressure and the code size, at least for Nouveau and RadeonSI because they have a real backend compiler. Found by luck while fixing an issue in the TGSI dead code elimination pass which affects tex instructions with bindless samplers. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: tidy up left over APPLE_vertex_array_object semanticsTimothy Arceri2017-04-264-43/+9
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: inline bind_vertex_array() helperTimothy Arceri2017-04-261-17/+6
| | | | | | The previous commit removed the only other user of this function. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: drop APPLE_vertex_array_object supportTimothy Arceri2017-04-267-69/+18
| | | | | | | | | | | | | | | | | | | | | Shared context support for VAOs was dropped in 0b2750620b65. From the ARB_vertex_array_object spec: "This extension differs from GL_APPLE_vertex_array_object in that client memory cannot be accessed through a non-zero vertex array object. It also differs in that vertex array objects are explicitly not sharable between contexts." Nobody should be using this extension over ARB_vertex_array_object anymore so just drop it rather than adding locking back just for VAOs created from these functions. For reference the Nvidia blob doesn't expose this extension. Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: Remove unused variable 'options'Matt Turner2017-04-251-2/+0
| | | | Should have been removed in commit ad55b1a7701a
* mesa: use locked version of HashWalk for xfb objectsTimothy Arceri2017-04-251-2/+2
| | | | | | | | | | | | From Chapter 5 'Shared Objects and Multiple Contexts' of the OpenGL 4.5 spec: "Objects which contain references to other objects include framebuffer, program pipeline, query, transform feedback, and vertex array objects. Such objects are called container objects and are not shared" Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: create locked version of HashWalkTimothy Arceri2017-04-252-8/+31
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: remove now unused GLSL IR optimisationsTimothy Arceri2017-04-244-888/+0
| | | | | | | These are no longer used since the previous commit. Acked-by: Elie Tournier <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: remove GLSL IR optimisation loopTimothy Arceri2017-04-241-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IVB is running into some spilling issues in piglit with the loop removed. However those tests are not really reflective of a real world use case, also fp64 is brand new to IVB so we leave the spilling issues to be resolved at a later time. Run time for shader-db on my machine goes from ~795 seconds to ~665 seconds. shader-db results BDW: total instructions in shared programs: 12969459 -> 12968891 (-0.00%) instructions in affected programs: 1463154 -> 1462586 (-0.04%) helped: 3622 HURT: 3326 total cycles in shared programs: 246453572 -> 246504318 (0.02%) cycles in affected programs: 208842622 -> 208893368 (0.02%) helped: 24029 HURT: 35407 total loops in shared programs: 2931 -> 2931 (0.00%) loops in affected programs: 0 -> 0 helped: 0 HURT: 0 total spills in shared programs: 14560 -> 14498 (-0.43%) spills in affected programs: 2270 -> 2208 (-2.73%) helped: 17 HURT: 2 total fills in shared programs: 19671 -> 19632 (-0.20%) fills in affected programs: 2060 -> 2021 (-1.89%) helped: 17 HURT: 2 LOST: 17 GAINED: 40 Most of the hurt shaders are 1-2 instructions, with what looks like a max of 7. I've looked at the worst cycles regressions and as far as I can tell its just a scheduling difference. Acked-by: Elie Tournier <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: replace _mesa_index_buffer::type with index_sizeMarek Olšák2017-04-2220-94/+94
| | | | | | | This avoids repeated translations of the enum. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: validate sampler type across the whole programTimothy Arceri2017-04-223-5/+28
| | | | | | | | | | | 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
* mesa: don't lock hashtables that are not shared across contextsTimothy Arceri2017-04-225-15/+16
| | | | | | | | | | | | | | | | | | | From Chapter 5 'Shared Objects and Multiple Contexts' of the OpenGL 4.5 spec: "Objects which contain references to other objects include framebuffer, program pipeline, query, transform feedback, and vertex array objects. Such objects are called container objects and are not shared" For we leave locking in place for framebuffer objects because the EXT fbo extension allowed sharing. We could maybe just replace the hash with an ordinary hash table but for now this should remove most of the unnecessary locking. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Remove deleteFlag pattern from container objects.Matt Turner2017-04-222-6/+2
| | | | | | | | This pattern was only useful when we used mutex locks, which the previous commit removed. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Remove unnecessary locking from container objects.Matt Turner2017-04-224-19/+0
| | | | | | | | | | | | | | | | | | | From Chapter 5 'Shared Objects and Multiple Contexts' of the OpenGL 4.5 spec: "Objects which contain references to other objects include framebuffer, program pipeline, query, transform feedback, and vertex array objects. Such objects are called container objects and are not shared" For we leave locking in place for framebuffer objects because the EXT fbo extension allowed sharing. V2: (Timothy Arceri) - rebased and dropped changes to framebuffer objects Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: remove fallback RefCount == 0 patternTimothy Arceri2017-04-226-59/+25
| | | | | | | | We should never get here if this is 0 unless there is a bug. Replace the check with an assert. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl: make use of glsl_type::is_float()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_double()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_boolean()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_record()Samuel Pitoiset2017-04-212-3/+3
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: make use of glsl_type::is_array()Samuel Pitoiset2017-04-211-1/+1
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* mesa/glthread: correctly compare thread handlesEmil Velikov2017-04-211-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]>
* st/mesa: use one big translation table in st_pipe_vertex_formatMarek Olšák2017-04-201-242/+228
| | | | | | | for lower overhead. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: check in advance in st_draw_vbo whether the bitmap cache is emptyMarek Olšák2017-04-201-1/+3
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: put the bitmap_cache structure inside st_contextMarek Olšák2017-04-203-43/+36
| | | | | | | | This is nicer on caches, and the next commit will need to access the structure from a different place. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: inline and optimize st_invalidate_readpix_cacheMarek Olšák2017-04-202-10/+11
| | | | | Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: invalidate the readpix cache in st_indirect_draw_vboMarek Olšák2017-04-201-0/+2
| | | | | | Cc: <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: fold u_trim_pipe_prim call from st/mesa to driversMarek Olšák2017-04-201-10/+2
| | | | | | | Most drivers don't need it and shouldn't need it because it can't be used in some cases (indirect draws, primitive restart, count from streamout). Reviewed-by: Brian Paul <[email protected]>
* mesa: print target string in glBindTexture() error messageBrian Paul2017-04-191-1/+2
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix Windows build error related to getuid()Brian Paul2017-04-191-2/+6
| | | | | | getuid() and geteuid() are not present on Windows. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: automake: honour the vdpau header install locationEmil Velikov2017-04-191-0/+1
| | | | | | | | | | | | | | If VDPAU is installed in the non-default location, we'll fail to find the headers and error at build time. ../../src/gallium/include/state_tracker/vdpau_dmabuf.h:37:25: fatal error: vdpau/vdpau.h: No such file or directory #include <vdpau/vdpau.h> ^ Fixes: faba96bc60b ("st/vdpau: add new interop interface") Cc: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support to glVertexAttribDivisor()Timothy Arceri2017-04-191-8/+10
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/vbo: add KHR_no_error support to DrawElements*() functionsTimothy Arceri2017-04-191-23/+73
| | | | | | V2: move MESA_VERBOSE checks back into the common code path. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/vbo: add KHR_no_error support to vbo_exec_DrawArrays*()Timothy Arceri2017-04-191-10/+39
| | | | | | V2: add missing FLUSH_CURRENT() to no_error path Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/vbo: move some Draw checks out of validationTimothy Arceri2017-04-192-41/+108
| | | | | | | These checks do not generate any errors. Move them so we can add KHR_no_error support and still make sure we do these checks. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: add KHR_no_error support to *Pointer() functionsTimothy Arceri2017-04-191-116/+236
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: add KHR_no_error support to some callers of validate_array_format()Timothy Arceri2017-04-191-63/+73
| | | | | | | The only caller we don't update is update_arrays(), we leave that to the following commit. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: rename update_array_format() -> validate_array_format()Timothy Arceri2017-04-191-26/+45
| | | | | | | | | | We also move _mesa_update_array_format() into the caller. This gets these functions ready for KHR_no_error support. V2: Updated function comment as suggested by Brian. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: create get_array_format() helperTimothy Arceri2017-04-191-11/+20
| | | | | | | | This will help us split array validation from array update. V2: add const to ctx param Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/varray: split update_array() into validate_array() and update_array()Timothy Arceri2017-04-191-14/+41
| | | | | | This will be used for adding KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support to glUniform*() functionsTimothy Arceri2017-04-191-23/+50
| | | | | | | V2: restore lost comment, add static to validate_uniform(), simplify array offset logic. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabledTimothy Arceri2017-04-191-0/+11
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add _mesa_is_no_error_enabled() helperTimothy Arceri2017-04-191-0/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add env var to force enable the KHR_no_error ctx flagTimothy Arceri2017-04-191-0/+6
| | | | | | | V2: typo know -> known V3: add security check (Suggested by Nicolai) Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: expose KHR_no_errorTimothy Arceri2017-04-191-0/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* vbo: fix gl_DrawID handling in glMultiDrawArraysNicolai Hähnle2017-04-191-6/+15
| | | | | | | | Fixes a bug in KHR-GL45.shader_draw_parameters_tests.ShaderMultiDrawArraysParameters. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* mesa: move glMultiDrawArrays to vbo and fix error handlingNicolai Hähnle2017-04-195-18/+126
| | | | | | | | | | | | | | | | 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]>
* mesa: extract need_xfb_remaining_prims_checkNicolai Hähnle2017-04-191-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]>
* mesa: fix remaining xfb prims check for GLES with multiple instancesNicolai Hähnle2017-04-191-1/+1
| | | | | | | | Found by inspection. Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: add st_convert_sampler()Samuel Pitoiset2017-04-182-12/+36
| | | | | | | | | Similar to st_convert_image(), will be useful for bindless. While we are at it, rename convert_sampler() to convert_sampler_from_unit() and make 'st' a const argument. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>