aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/draw.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove exec="dynamic" from Draw functions that are not really dynamicMarek Olšák2020-04-271-112/+73
| | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* Replace IS_INF_OR_NAN with util_is_inf_or_nanDylan Baker2020-04-211-2/+2
| | | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* mesa: remove no longer needed _mesa_is_bufferobj functionMarek Olšák2020-04-061-11/+11
| | | | | | | | | | All buffers have Name != 0. Note that there is no longer the pointer dereference to get Name, so it's faster. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
* mesa: don't ever bind NullBufferObj for glBindBuffer targetsMarek Olšák2020-04-061-1/+2
| | | | | | | | Since VAOs don't use NullBufferObj for vertex attribs anymore, let's remove more uses of NullBufferObj. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
* mesa: don't ever set NullBufferObj in gl_vertex_array_bindingMarek Olšák2020-04-061-2/+2
| | | | | | | | | | This improves performance by 5% in the game "torcs", FPS: 98.83 -> 103.73 It does a lot of glPush/PopClientAttrib, which exacerbates the overhead of setting NullBufferObj. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
* mesa: don't unroll glMultiDrawElements with user indices for galliumMarek Olšák2020-03-111-6/+12
| | | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>
* mesa: deduplicate draw indirect functionsMarek Olšák2020-03-041-121/+36
| | | | | Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* mesa: optimize get_index_sizeMarek Olšák2020-03-041-16/+9
| | | | | Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* mesa: remove _mesa_index_buffer::index_size in favor of index_size_shiftMarek Olšák2020-03-041-4/+0
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Suggested-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* mesa: replace some index_size multiplications and divisions with shiftsMarek Olšák2020-03-041-6/+6
| | | | | | Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* mesa: add index_size_shift = log2(index_size) into _mesa_index_bufferMarek Olšák2020-03-041-18/+25
| | | | | | | | for faster division Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* mesa: fix incorrect prim.begin/end for glMultiDrawElementsMarek Olšák2020-02-281-2/+2
| | | | | | | | | This has no effect on Gallium, but it affects tnl. Cc: 19.3 20.0 <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa: optimize glMultiDrawArrays, call Draw only once (v2)Marek Olšák2020-02-281-16/+22
| | | | | | | v2: use the macros Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa: don't unroll glMultiDrawElements if one count is 0Marek Olšák2020-02-281-10/+0
| | | | | | | | let the driver skip or submit an empty draw call. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa: clean up glMultiDrawElements code, use alloca for small draw count (v2)Marek Olšák2020-02-281-18/+38
| | | | | | | | | v2: use calloc, add reusable macros Reviewed-by: Mathias Fröhlich <[email protected]> (v1) Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa: move num_instances and base_instance out of _mesa_primMarek Olšák2020-02-281-15/+8
| | | | | | | | They are never used by multi draws and internal draws. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa: remove redundant _mesa_prim::is_indexedMarek Olšák2020-02-281-3/+0
| | | | | | | Instead, check (ib != NULL) like all other drivers. Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa: remove unused "indirect" parameter from Driver.DrawMarek Olšák2020-02-281-5/+5
| | | | | Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* mesa/draw: Make sure all the unused fields are initialized to zeroIan Romanick2020-02-191-11/+10
| | | | | | | | | | | | | | | | | | | | | | | Not initializing prim.indexed caused a few thousand failures on Intel drivers. I also compared the generated assembly with this change and before a6d31589097. The code is still somewhat improved, which I am assuming was the original goal. _mesa_DrawArrays, for example, appears to drop an instruction or two... though the body of the function is only one byte shorter. MR !3591 will eventually delete the uninitialized fields. However, I believe that explicitly initializing the whole thing is more future proof. This ensures that if someone adds fields in the future, they will also be initialized. Once the extra fields are removed, the two implementations should generate idential code. Fixes: a6d31589097 ("mesa: don't use memset in glDrawArrays") Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3870> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3870>
* mesa: don't use memset in glDrawArraysMarek Olšák2020-02-181-1/+1
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3861>
* mesa: remove unused _mesa_draw_indirectMarek Olšák2020-02-141-72/+0
| | | | | | | All drivers that expose ARB_draw_indirect also set the driver callback. Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
* mesa: don't use bitfields in _mesa_primMarek Olšák2020-02-111-3/+0
| | | | | | | | This is better. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>
* mesa: remove unused _mesa_prim::is_indirectMarek Olšák2020-02-111-6/+0
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>
* mesa/main: avoid warning when casting offset to pointerErik Faye-Lund2019-08-151-1/+1
| | | | | | | | This generates a warning on some 64-bit systems, so let's cast to a properly sized integer first. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: drop some p_compiler.h typesLionel Landwerlin2019-08-091-2/+2
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* mesa: Use mapping tools in debug prints.Mathias Fröhlich2019-03-151-45/+12
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Factor out struct gl_vertex_format.Mathias Fröhlich2018-11-211-6/+7
| | | | | | | | | | | | | | | | Factor out struct gl_vertex_format from array attributes. The data type is supposed to describe the type of a vertex element. At this current stage the data type is only used with the VAO, but actually is useful in various other places. Due to the bitfields being used, special care needs to be taken for the glGet code paths. v2: Change unsigned char -> GLubyte. Use struct assignment for struct gl_vertex_format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use the gl_vertex_array_object::Enabled bitfield.Mathias Fröhlich2018-11-211-11/+9
| | | | | | | | | | Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove needless indirection in some draw functions.Mathias Fröhlich2018-11-021-123/+41
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Collect all the draw functions in draw.{h,c}.Mathias Fröhlich2018-11-011-0/+43
| | | | | | | | Some of these functions were distributed across different implementation and header files. Put them at a central place. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa/vbo: Move _vbo_draw_indirect -> _mesa_draw_indirectMathias Fröhlich2018-11-011-0/+74
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.cMathias Fröhlich2018-11-011-0/+2145
The array type draw is no longer directly dependent on the vbo module. Thus move array type draws into mesa/main/draw.c. Rename symbols starting with vbo_* to _mesa_* and apply some reindenting to make it consistent. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>