mesa: optimize initialization of new VAOs
authorMarek Olšák <marek.olsak@amd.com>
Sun, 22 Mar 2020 00:18:02 +0000 (20:18 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 6 Apr 2020 14:27:59 +0000 (10:27 -0400)
commita0a0c68150b4dbba469c62159a327ae9465f6016
tree9bae5b98e11c883794c7116f2f79463bc056ffd0
parentdbdd0149ed5b28730a31ebc2bc49f8e955523bbb
mesa: optimize initialization of new VAOs

Precompute the default state in gl_context, and just copy it when we create
a VAO.

This also helps glPushClientAttrib function, which always creates a VAO,
which has a substantial CPU overhead in profiles.

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