mesa: compute _PipeFormat and _ElementSize after checking if the format changed
authorMarek Olšák <marek.olsak@amd.com>
Mon, 12 Dec 2022 05:45:11 +0000 (00:45 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 18 Dec 2022 19:35:59 +0000 (14:35 -0500)
commit8e89f07fc85e7c53a58c76d01661e25573da4aae
tree02b3dcb5a6dc0b15c74823f7a75be34a9a0147a7
parent6a8c1d504339f9c011422aef3dd06b407502ece5
mesa: compute _PipeFormat and _ElementSize after checking if the format changed

Split _mesa_set_vertex_format into 2 functions and set the derived fields
after we know that the format is different.

This skips _PipeFormat and _ElementSize recomputation every time we get
gl*Pointer with the same format.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
src/mesa/main/varray.c