summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo
Commit message (Collapse)AuthorAgeFilesLines
* vbo: Remove unused vbo_save_context::wrap_count.Mathias Fröhlich2018-03-011-1/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove unused vbo_save_vertex_list::dangling_attr_ref.Mathias Fröhlich2018-03-012-3/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: replace some API_OPENGL_CORE checks with _mesa_is_desktop_glMarek Olšák2018-02-231-2/+2
| | | | | | | This is more accurate with respect to the compatibility profile. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Make use of _DrawVAO from the dlist code.Mathias Fröhlich2018-02-234-93/+144
| | | | | | | | | Finally use an internal VAO to execute display list draws. Avoid duplicate state validation for display list draws. Remove client arrays previously used exclusively for display lists. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Make use of _DrawVAO from immediate mode drawMathias Fröhlich2018-02-235-104/+78
| | | | | | | | | Finally use an internal VAO to execute immediate mode draws. Avoid duplicate state validation for immediate mode draws. Remove client arrays previously used exclusively for immediate mode draws. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Implement tool functions for vbo specific VAO setup.Mathias Fröhlich2018-02-232-2/+55
| | | | | | | | Correct VBO_MATERIAL_SHIFT value. The functions will be used next in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Use _DrawVAO for array type draw commands.Mathias Fröhlich2018-02-233-73/+100
| | | | | | | | | | | | | | | | Switch over to use the _DrawVAO for all the array type draws. The _DrawVAO needs to be set before we enter _mesa_update_state, so move setting the draw method in front of the first call to _mesa_update_state which is in turn called from the *validate*Draw* calls. Using the gl_vertex_array_object::_Enabled bitmask, gl_vertex_program_state::_VPMode and gl_vertex_array_object::_AttributeMapMode we can already set varying_vp_inputs before we call _mesa_update_state the first time. Thus remove duplicate state validation. v2: Update comments. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Implement method to track the inputs array.Mathias Fröhlich2018-02-234-0/+122
| | | | | | | | | | | | | Provided the _DrawVAO and the derived state that is maintained if we have the _DrawVAO set, implement a method to incrementally update the array of gl_vertex_array input pointers. v2: Add some more comments. Rename _vbo_array_init to _vbo_init_inputs. Rename vbo_context::arrays to vbo_context::draw_arrays. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Remove get_vp_mode() and enum vp_mode.Mathias Fröhlich2018-02-231-27/+0
| | | | | | | Is now unused. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Use _VPMode instead of get_vp_mode().Mathias Fröhlich2018-02-234-11/+14
| | | | | | | | At those places where we used get_vp_mode() use gl_vertex_program_state::_VPMode instead. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: add a comment on vbo_draw_transform_feedback()Brian Paul2018-02-081-0/+8
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: improve comments on vbo_draw_func()Brian Paul2018-02-081-4/+5
| | | | | | | And rename a parameter name. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: rename gl_vertex_array_object::_VertexAttrib -> _VertexArrayBrian Paul2018-02-061-1/+1
| | | | | | | | | Since the type is gl_vertex_array. Update comment to explain that these arrays are only used by the VBO module. Also rename some local variables in _mesa_update_vao_derived_arrays(). Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: Move vbo_rebase into its only caller module tnl.Mathias Fröhlich2018-02-062-262/+0
| | | | | Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use atomics for buffer objects reference counts.Mathias Fröhlich2018-02-061-4/+4
| | | | | | | | | | | | | | | | | | | The mutex is currently used for reference counting and updating the minmax index cache. The change uses atomics directly for reference counting and the mutex for the minmax cache. This is safe since the reference count is not modified beside in _mesa_reference_buffer_object where atomics aim to be used. While using the minmax cache, the calling code holds a reference to the buffer object. Thus unreferencing or even referencing the buffer object does not need to be serialized with accessing the minmax cache. The change reduces the time _mesa_reference_buffer_object_ takes by about a factor of two when looking at perf results for some of my favorite use cases. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: provide 64bits support to print_draw_arraysAndres Gomez2018-02-061-2/+19
| | | | | | | Cc: Mathias Fröhlich <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: take into account the size when printing VAO elementsAndres Gomez2018-02-061-1/+1
| | | | | | | | | | | | | When using print_draw_arrays for debugging, we were printing an "n" amount of vertex but that meant not to print all the size in the "n" vertex, depending on the stride used. Now we print the whole size in the "n" vertex. Cc: Mathias Fröhlich <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: print first element of the VAO when the binding stride is 0Andres Gomez2018-02-061-3/+4
| | | | | | | Cc: Mathias Fröhlich <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: Simplify input array distribution for dlist type draws.Mathias Fröhlich2018-02-011-46/+8
| | | | | | | | Using the newly introduced VAO array maps, we can simplify vbo_bind_vertex_list. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Simplify input array distribution for imm type draws.Mathias Fröhlich2018-02-011-66/+15
| | | | | | | | Using the newly introduced VAO array maps, we can simplify vbo_exec_bind_arrays. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Simplify input array distribution for array type draws.Mathias Fröhlich2018-02-011-83/+27
| | | | | | | | Using the newly introduced VAO state variable, we can simplify recalculate_input_bindings. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Use static const VERT_ATTRIB->VBO_ATTRIB maps.Mathias Fröhlich2018-02-016-35/+99
| | | | | | | | | | | | Instead of each context having its own map instance for this purpose, use a global static const map. v2: s,unsigned char,GLubyte,g s,_VP_MODE_MAX,VP_MODE_MAX,g Change comment style. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Put materials at the end of the generic block.Mathias Fröhlich2018-02-013-16/+16
| | | | | | | | | | | | | | | | | | | The materials are now moved to the end of the generic attributes block to the range 4-15. Before, the way the position and generic 0 attribute is handled was dependent on the presence and kind of the currently attached vertex program. With this change the way the position attribute and the generic 0 attribute is treated only depends on the enabled flag of those two arrays. This will later help to untangle the update dependencies between enabled arrays and shader inputs. v2: s,VERT_ATTRIB_MAT_OFFSET,VERT_ATTRIB_MAT0,g Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use defines for the aliased material array attributes.Mathias Fröhlich2018-02-014-13/+20
| | | | | | | | | | Instead of just assuming that the material attributes just overlap with the generic attributes 0-12, give them symbolic defines so that we can easier move them to an other range. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: Correctly handle attribute offsets in dlist draw.Mathias Fröhlich2018-02-013-31/+36
| | | | | | | | | | | | | | | | | | | When executing a display list draw, for the offset list to be correct, the offset computation needs to accumulate all attribute size values in order. Specifically, if we are shuffling around the position and generic0 attributes, we may violate the order or if we do not walk the generic vbo attributes we may skip some of the attributes. Even if this is an unlikely usecase we can fix this use case by precomputing the offsets on the full attribute list and store the full offset list in the display list node. v2: Formatting fix v3: Rebase Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* vbo: change an argument in vbo_draw_indirect_prims()Brian Paul2018-02-011-5/+12
| | | | | | | | | | In vbo_draw_indirect_prims() pass the 'indirect_data' argument to vbo->draw_prims(). All the callers are passing ctx->DrawIndirectBuffer so this should be no functional change. Add a (temporary) assertion to be sure. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: add comments on the VBO draw function typedefsBrian Paul2018-02-011-2/+55
| | | | | | | | | And rename indirect_params -> indirect_draw_count_buffer and indirect_params_offset -> indirect_draw_count_offset to be more specific. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/drawcount/drawcount_offsetBrian Paul2018-02-011-12/+16
| | | | | | | | | This parameter (from the glMultiDrawArraysIndirectCountARB function) is poorly named. It's an offset into the buffer which contains the number of primitives to draw. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: use vbo local var for draw call in vbo_save_playback_vertex_list()Brian Paul2018-02-011-7/+7
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: replace GLenum with GLenum16 in common structures (v4)Marek Olšák2018-01-294-4/+8
| | | | | | | | | | | | | v2: - fix glGet* - also use GLenum16 for DrawBuffers v3: - rebase to top of tree (BrianP) and incorporate Ian's suggestions v4: - fix a GLenum16 bug in VBO/save code, add some STATIC_ASSERT()s gl_context = 152432 -> 136840 bytes vbo_context = 22096 -> 20608 bytes Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()Brian Paul2018-01-294-41/+6
| | | | | | | | | | | | | | | | | The arrays specified by ctx->Array._DrawArrays are used for all vertex drawing via vbo_context::draw_prims(). Different arrays are used for immediate mode, vertex arrays, display lists, etc. Changing from one to another requires updating derived/driver array state. Before, we indirectly specifid the arrays with the gl_draw_method values. Now we just directly specify the arrays instead. This is simpler and will allow a subsequent display list optimization. In the future, it might make sense to get rid of ctx->Array._DrawArrays entirely and just pass the arrays as another parameter to vbo_context::draw_prims(). Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/[0]/[VERT_ATTRIB_POS]/ in recalculate_input_bindings()Brian Paul2018-01-291-3/+3
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: add new VBO_ATTRIBS_ masks to vbo_attrib.hBrian Paul2018-01-291-0/+15
| | | | | | These will be used in a later patch. Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/VBO_ATTRIB_INDEX/VBO_ATTRIB_COLOR_INDEX/Brian Paul2018-01-292-12/+13
| | | | | | | | To match the VERT_ATTRIB_COLOR_INDEX name. Give a name to the previously anonymous enum of VBO_ATTRIB_x values. Update the comment on the enum. Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: minor clean-ups in vbo_exec.hBrian Paul2018-01-291-5/+6
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/_API_NOOP_H/VBO_NOOP_H/ in vbo_noop.hBrian Paul2018-01-291-3/+3
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: whitespace/formatting fixes in vbo_exec.hBrian Paul2018-01-291-15/+18
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: move, rename vp_mode enums, get_program_mode() functionBrian Paul2018-01-295-22/+27
| | | | | | | Instead of NONE/ARB use FF/SHADER. Move the enum declaration to vbo_private.h where it's used. Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: s/cl/array/ in vbo_context.cBrian Paul2018-01-291-15/+15
| | | | | | I think 'cl' used to mean client array. Reviewed-by: Mathias Fröhlich <[email protected]>
* vbo: fix incorrect min/max_index values in display list draw callBrian Paul2018-01-243-3/+8
| | | | | | | | | | | | | | This fixes another regression from commit 8e4efdc895ea ("vbo: optimize some display list drawing"). The problem was the min_index, max_index values passed to the vbo drawing function were not computed to compensate for the biased prim::start values. https://bugs.freedesktop.org/show_bug.cgi?id=104746 https://bugs.freedesktop.org/show_bug.cgi?id=104742 https://bugs.freedesktop.org/show_bug.cgi?id=104690 Tested-by: Clayton Craft <[email protected]> Fixes: 8e4efdc895ea ("vbo: optimize some display list drawing") Reviewed-by: Emil Velikov <[email protected]>
* vbo: whitespace/formatting fixes in vbo_split_inplace.cBrian Paul2018-01-241-104/+111
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: whitespace/formatting fixes in vbo.hBrian Paul2018-01-241-44/+68
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo/i965: move vbo_all_varyings_in_vbos() to brw_draw.cBrian Paul2018-01-242-13/+0
| | | | | | | | It's only used in brw_draw_prims(). s/GLboolean/bool/, etc. Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: remove unused vbo_any_varyings_in_vbos() functionBrian Paul2018-01-242-13/+0
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: remove unneeded #includesBrian Paul2018-01-244-5/+0
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: remove vbo_context.h and change includes to use vbo.h insteadBrian Paul2018-01-2411-72/+1
| | | | | | Now vbo.h is the public interface to the VBO module. Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: move remaining items from vbo_context.h to vbo.hBrian Paul2018-01-246-43/+34
| | | | | | | Non-VBO sources files sometimes included vbo.h while others included vbo_context.h. We're moving all public types, functions to the former. Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: move VBO-private types, prototypes, etc. into new vbo_private.h headerBrian Paul2018-01-2412-165/+227
| | | | | | | Things which should not be used outside the VBO module. More public/private clean-ups coming. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: use new _vbo_install_exec_vtxfmt() functionBrian Paul2018-01-242-0/+14
| | | | | | Instead of reaching into the vbo_context object in vtxfmt.c Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: move vbo_sizeof_ib_type() into vbo_exec_array.cBrian Paul2018-01-242-23/+24
| | | | | | It's only used in this one file. Reviewed-by: Roland Scheidegger <[email protected]>