mesa: don't call _mesa_update_vao_derived_arrays for dynamic VAOs
authorMarek Olšák <marek.olsak@amd.com>
Fri, 18 Nov 2022 23:43:19 +0000 (18:43 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Dec 2022 19:15:34 +0000 (19:15 +0000)
This just moves the exit into the caller. There is nothing else in
_mesa_update_vao_derived_arrays that dynamic VAOs care about.

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/draw.c

index 58d78fe..98bfefb 100644 (file)
@@ -517,6 +517,7 @@ void
 _mesa_update_vao_derived_arrays(struct gl_context *ctx,
                                 struct gl_vertex_array_object *vao)
 {
+   assert(!vao->IsDynamic);
    /* Make sure we do not run into problems with shared objects */
    assert(!vao->SharedAndImmutable || (!vao->NewVertexBuffers && !vao->NewVertexElements));
 
@@ -542,10 +543,6 @@ _mesa_update_vao_derived_arrays(struct gl_context *ctx,
    /* VBO array bits. */
    const GLbitfield vbos = vao->VertexAttribBufferMask;
 
-   /* Fast path when the VAO is updated too often. */
-   if (vao->IsDynamic)
-      return;
-
    /* More than 4 updates turn the VAO to dynamic. */
    if (ctx->Const.AllowDynamicVAOFastPath && ++vao->NumUpdates > 4) {
       vao->IsDynamic = true;
index b1f9421..3ea9c62 100644 (file)
@@ -153,7 +153,8 @@ _mesa_update_vao_state(struct gl_context *ctx, GLbitfield filter)
    ctx->Array.NewVAO = false;
 
    if (vao->NewVertexBuffers || vao->NewVertexElements) {
-      _mesa_update_vao_derived_arrays(ctx, vao);
+      if (!vao->IsDynamic)
+         _mesa_update_vao_derived_arrays(ctx, vao);
       new_vertex_buffers |= vao->NewVertexBuffers;
       new_vertex_elements |= vao->NewVertexElements;
       vao->NewVertexBuffers = false;