mesa: keep the current VAO also set as _DrawVAO
authorMarek Olšák <marek.olsak@amd.com>
Fri, 18 Nov 2022 22:04:50 +0000 (17:04 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Dec 2022 19:15:34 +0000 (19:15 +0000)
commit50a367f8f700adf89a685db25f2e0ce874526f8f
tree127167cea27e11005f8b593201886d664b1997e9
parentb205d7663bd04c51a7b417688b9286ec86ea611d
mesa: keep the current VAO also set as _DrawVAO

This removes setting _DrawVAO from all glDraw* functions that draw
primitives because now _DrawVAO is always equal to the current VAO.

glEnd, glRasterPos, and the slow display list path now have to save
_DrawVAO before changing it, and restore it after they are done.

This also removes _EmptyVAO, which becomes unused because we no longer
bind "no VAO" into _DrawVAO.

Rules:
- only glBindVertexArray and non-glDraw* paths should call
  _mesa_set_draw_vao, other places shouldn't
- only draws should call _mesa_update_vao_state, other places shouldn't

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>
src/mesa/main/arrayobj.c
src/mesa/main/attrib.c
src/mesa/main/context.c
src/mesa/main/draw.c
src/mesa/main/draw.h
src/mesa/main/mtypes.h
src/mesa/main/varray.c
src/mesa/state_tracker/st_cb_rasterpos.c
src/mesa/vbo/vbo_exec_draw.c
src/mesa/vbo/vbo_save_draw.c