vbo/dlist: reallocate the vertex buffer on vertex upgrade
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 14 Sep 2021 08:14:04 +0000 (10:14 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 17 Sep 2021 07:42:19 +0000 (09:42 +0200)
commit4c0b8254a2ee2cf220cf5fa8be914814b4c37791
treec3ffb01b0077de2cf2d06822647622cdbf583f1b
parentbeb7ed2b8945e97cd7c5ab816a741be2e2bfb76e
vbo/dlist: reallocate the vertex buffer on vertex upgrade

upgrade_vertex copies save->copied.nr vertices to the vertex buffer,
so we need to make sure it has enough space to accomodate them.

This commit also drops the usage of COPY_CLEAN_4V_TYPE_AS_UNION in
this function because it always writes 4-components for all attributes,
but our buffer might be smaller. Instead, only write the needed
components.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5353
Fixes: cc57156dce0 ("vbo/dlist: rework vertex_store management")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12849>
src/mesa/vbo/vbo_save_api.c