vbo/dlist: rework vertex_store management
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 1 Sep 2021 09:28:49 +0000 (11:28 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 9 Sep 2021 14:42:16 +0000 (16:42 +0200)
commitcc57156dce0f4abf7ee4c1e741ac03d6864a14b4
tree677337fa005f1bf89d1e193dab0baa50866438dc
parent9863fe5a023043c3941106f6e2a34cfaf04383f7
vbo/dlist: rework vertex_store management

Simplify the whole thing:
- keep a single function (grow_vertex_storage) that extends the array
- call it when the array is full (in ATTR_UNION) or at the beginning of
  a primitive when the vertex count is known to avoid multiple reallocations.
- allocate save->vertex_store in vbo_save_NewList if needed

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>
src/mesa/vbo/vbo_save_api.c