From c2557a5652af4c20b5c5df1f22f34c3cd1e259b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 18 Nov 2022 18:43:19 -0500 Subject: [PATCH] mesa: don't call _mesa_update_vao_derived_arrays for dynamic VAOs 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 Part-of: --- src/mesa/main/arrayobj.c | 5 +---- src/mesa/main/draw.c | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 58d78fec..98bfefb 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -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; diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c index b1f9421..3ea9c62 100644 --- a/src/mesa/main/draw.c +++ b/src/mesa/main/draw.c @@ -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; -- 2.7.4