aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save_api.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa/vbo: add some missing fallthrough commentsTimothy Arceri2020-07-021-0/+3
| | | | | Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
* mesa: extend _mesa_bind_vertex_buffer to take ownership of the buffer referenceMarek Olšák2020-04-271-1/+2
| | | | | | | | | This reduces overhead of _mesa_reference_buffer_object_ from 6% to 4% with glthread when profiling the game "torcs" with non-VBO data uploaded by glthread. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* mesa: add offset_is_int32 param into _mesa_bind_vertex_buffer for glthreadMarek Olšák2020-04-271-1/+1
| | | | | | | | glthread will pass signed integer offsets, so don't reset negative offsets to 0 there. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
* replace malloc macros in imports.h with u_memory.h versionsDylan Baker2020-04-211-0/+1
| | | | | | | 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: precompute _mesa_primitive_restart_index during state changesMarek Olšák2020-04-061-1/+1
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4466>
* mesa: remove no longer needed _mesa_is_bufferobj functionMarek Olšák2020-04-061-1/+1
| | | | | | | | | | 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>
* vbo: merge more primitive types for glBegin/End (v2)Marek Olšák2020-03-041-4/+3
| | | | | | | v2: clean it up more Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* vbo: deduplicate copy_vertices functionsMarek Olšák2020-03-041-66/+2
| | | | | | | | | There are some differences in exec, but those look like bug fixes not ported to vbo_save. Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4052>
* mesa: move num_instances and base_instance out of _mesa_primMarek Olšák2020-02-281-4/+0
| | | | | | | | 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: don't use bitfields in _mesa_primMarek Olšák2020-02-111-2/+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-2/+0
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>
* vbo: use the template for save GLvertexformat initializationMarek Olšák2020-02-041-151/+6
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3611>
* vbo: use the template for noop GLvertexformat initializationMarek Olšák2020-02-041-1/+1
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3611>
* mesa: Correct the is_vertex_position decision for dlists.Mathias Fröhlich2019-05-041-0/+14
| | | | | | | | | | | | We have to use _mesa_inside_dlist_begin_end instead of _mesa_inside_begin_end to see if we are inside a glBegin/glEnd block in case of display lists. So split the is_vertex_position function used in vertex attribute processing into a imm and dlist variant and use the appropriate _mesa_inside_begin_end variant. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Set CurrentSavePrimitive in vbo_save_NotifyBegin.Mathias Fröhlich2019-05-041-0/+2
| | | | | | | | | That seems to be lost somewhere. Is needed for correct outside begin/end detection in display list compilation. And is needed for correct aliasing in dlists restablished in the next changes. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove the _glapi_table argument from _mesa_array_element.Mathias Fröhlich2019-05-041-10/+7
| | | | | | | The value is now unused. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Fix GL_PRIMITIVE_RESTART_FIXED_INDEX in display list compiles.Mathias Fröhlich2019-03-151-5/+9
| | | | | | | | The maximum value primitive restart index is different for each index data type. Use the appropriate fixed restart index value. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Fix basevertex handling in display list compiles.Mathias Fröhlich2019-03-151-5/+12
| | | | | | | | | The standard requires that the primitive restart comparison happens before the basevertex value is added. Do this now, drop a reference to the standard why this happens at this place. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Replace _ae_{,un}map_vbos with _mesa_vao_{,un}map_arraysMathias Fröhlich2019-03-151-5/+7
| | | | | | | | | | Due to the use of bitmaps, the _mesa_vao_{,un}map_arrays functions should provide comparable runtime efficienty to the currently used _ae_{,un}map_vbos functions. So use this functions and enable further cleanup. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use _mesa_array_element in dlist save.Mathias Fröhlich2019-03-151-4/+19
| | | | | | | | | | Make use of the newly factored out _mesa_array_element function in display list compilation. For now that duplicates out the primitive restart logic. But that turns out to need a fix in display list handling anyhow. 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/+6
| | | | | | | | | | | | | | | | 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: Work with bitmasks when en/dis-abling VAO arrays.Mathias Fröhlich2018-11-211-1/+2
| | | | | | | | | | | For enabling or disabling VAO arrays it is now possible to change a set of arrays with a single call without the need to iterate the attributes. Make use of this technique in the vao module. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove gl_array_attributes::Enabled.Mathias Fröhlich2018-11-211-2/+0
| | | | | | | | | Now that all users go via the VAO Enabled bitfield, get rid of the Enabled boolean. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Rename gl_vertex_array_object::_Enabled -> Enabled.Mathias Fröhlich2018-11-211-2/+2
| | | | | | | | | Mark the up to now derived bitfield value now as primary value by removing the underscore. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Preserve vbo_save::no_current_update on primitive restart.Mathias Fröhlich2018-11-011-1/+2
| | | | | | | | | | With this change we preserve the no_current_update property when we observe a glPrimitiveRestart call. That means that we now also get the no_current_update optimization for display lists that are made out of indexed draws using primitive restart. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Make no_current_update an argument to vbo_save_NotifyBegin.Mathias Fröhlich2018-11-011-7/+7
| | | | | | | | | | | Instead of coding additional information into the primitive mode, make the only remaining flag there a direct argument to vbo_save_NotifyBegin. v2: Fix incorrect no_current_update in glRectf. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Move no_current_update out of _mesa_prim.Mathias Fröhlich2018-11-011-6/+4
| | | | | | | | | | | | | | | | The _mesa_prim::no_current_update flag should tell the compiled display list if the current attributes that are placed in the dlists vbo shall take a defined state past replay of a display list. Immediate mode draws compiled into display lists should set the current values. Array draws may leave the current values in undefined state. So finally this flag is not a property of every primitive but it is a property of the compiled display list and there it is a property of the last primitive compiled into the list. So move the flag out of _mesa_prim into vbo_save. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove VBO_SAVE_PRIM_WEAK from vbo_save_NotifyBegin calls.Mathias Fröhlich2018-11-011-5/+3
| | | | | | | | | | | | | | | | | Now looking at the implementation of vbo_save_NotifyBegin. The VBO_SAVE_PRIM_WEAK flag, delivered in the primitive mode argument to vbo_save_NotifyBegin, is not evaluated anymore. The two users of the mode argument are the primitive mode itself, where the VBO_SAVE_PRIM_WEAK bit is masked out to retrieve the underlying OpenGL primitive mode. The other user is to check for the VBO_SAVE_PRIM_NO_CURRENT_UPDATE bit which is different from VBO_SAVE_PRIM_WEAK. So, since vbo_save_NotifyBegin does not care about VBO_SAVE_PRIM_WEAK, we can savely remove it from the call arguments of vbo_save_NotifyBegin. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove set but not used weak field from _mesa_prim.Mathias Fröhlich2018-11-011-6/+1
| | | | | | | | The only reader of the weak field in _mesa_prim is pretty console printing. By that, remove the weak field from _mesa_prim. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove the VBO_SAVE_FALLBACK flag.Mathias Fröhlich2018-11-011-6/+2
| | | | | | | | | | | On finishing a display list playback the VBO_SAVE_FALLBACK bit is still kept in vbo_save_context::replay_flags. But examining replay_flags and the display list flags that feed this value the corresponding bit is never set these days anymore. So, since it is nowhere set or checked, we can safely remove it. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo_save: add support for doubles to display list codeDave Airlie2018-06-301-6/+12
| | | | | | Required for ARB_vertex_attrib_64bit compat profile support. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove flush_vertices argument from VAO methods.Mathias Fröhlich2018-05-171-3/+3
| | | | | | | The flush_vertices argument is now unused, remove it. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: rename api_validate.{c,h} -> draw_validate.{c,h}Timothy Arceri2018-04-241-1/+1
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65422
* vbo: MaxVertexAttribStride is not always setJakob Bornecrantz2018-03-301-1/+6
| | | | | | | This assert is hit on hardware which does not expose GL 4.4 or GLES 3.1. Reviewed-by: Mathias Fröhlich <[email protected]> Signed-off-by: Jakob Bornecrantz <[email protected]>
* vbo: Make sure the internal VAO's stay within limits.Mathias Fröhlich2018-03-231-0/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Try to reuse the same VAO more often for successive dlists.Mathias Fröhlich2018-03-031-3/+14
| | | | | | | | | | | The change tries to catch more opportunities to reuse the same set of VAO's when building up display lists. Instead of checking the offset with respect to the beginning of the vertex buffer object the change tries to apply this same optimization with respect to the previous display list node. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::vertex_size.Mathias Fröhlich2018-03-011-8/+6
| | | | | | | | Like before use local variables from compile_vertex_list instead. Remove vertex_size from struct vbo_save_vertex_list. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::buffer_offset.Mathias Fröhlich2018-03-011-15/+13
| | | | | | | | | | The buffer_offset is used in aligned_vertex_buffer_offset. But now that most of these decisions are done in compile_vertex_list we can work on local variables instead of struct members in the display list code. Clean that up and remove buffer_offset. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::start_vertex.Mathias Fröhlich2018-03-011-3/+0
| | | | | | | | Replace last use on replay with _vbo_save_get_{min,max}_index. Appart from that it is not used anymore. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::attrsz.Mathias Fröhlich2018-03-011-6/+4
| | | | | | | | Is not used anymore on replay, move the last use in display list compilation to the original array in the display list compiler. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::attrtype.Mathias Fröhlich2018-03-011-3/+1
| | | | | | | | Is not used anymore on replay, move the last use in display list compilation to the original array in the display list compiler. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove vbo_save_vertex_list::enabled.Mathias Fröhlich2018-03-011-2/+1
| | | | | | | Is not used anymore on replay. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Remove reference to the vertex_store from the dlist node.Mathias Fröhlich2018-03-011-11/+3
| | | | | | | | Since we now store a set of VAOs in the display list, use these object to get the reference to the VBO in several places. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Implement current values update in terms of the VAO.Mathias Fröhlich2018-03-011-8/+6
| | | | | | | | | Use the information already present in the VAO to update the current values after display list replay. Set GL_OUT_OF_MEMORY on allocation failure for the current value update storage. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Implement vbo_loopback_vertex_list in terms of the VAO.Mathias Fröhlich2018-03-011-24/+18
| | | | | | | | | | | Use the information already present in the VAO to replay a display list node using immediate mode draw commands. Use a hand full of helper methods that will be useful for the next patches also. v2: Insert asserts, constify local variables. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Use a local variable for the dlist offsets.Mathias Fröhlich2018-03-011-8/+7
| | | | | | | | The master value is now stored inside the VAO already present in struct vbo_save_vertex_list. Remove the unneeded copy from dlist storage. 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-011-1/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Make use of _DrawVAO from the dlist code.Mathias Fröhlich2018-02-231-6/+126
| | | | | | | | | 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: Correctly handle attribute offsets in dlist draw.Mathias Fröhlich2018-02-011-0/+19
| | | | | | | | | | | | | | | | | | | 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]>
* mesa: replace GLenum with GLenum16 in common structures (v4)Marek Olšák2018-01-291-0/+2
| | | | | | | | | | | | | 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]>