Mesa (master): mesa: Flag _NEW_ARRAY only if we are changing ctx->Array.VAO.

Mathias Fröhlich frohlich at kemper.freedesktop.org
Thu May 17 18:27:20 UTC 2018


Module: Mesa
Branch: master
Commit: 984cb4e512f47fe6682f51985a0722c95e21f446
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=984cb4e512f47fe6682f51985a0722c95e21f446

Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date:   Sun May 13 09:18:57 2018 +0200

mesa: Flag _NEW_ARRAY only if we are changing ctx->Array.VAO.

For the VAO internal helper functions that may be called
with a non current VAO, flag the _NEW_ARRAY state only
if it is the current ctx->Array.VAO.

Reviewed-by: Brian Paul <brianp at vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>

---

 src/mesa/main/varray.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 4859f16050..a3e1aebb76 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -178,7 +178,8 @@ _mesa_vertex_attrib_binding(struct gl_context *ctx,
       array->BufferBindingIndex = bindingIndex;
 
       vao->NewArrays |= vao->_Enabled & array_bit;
-      ctx->NewState |= _NEW_ARRAY;
+      if (vao == ctx->Array.VAO)
+         ctx->NewState |= _NEW_ARRAY;
    }
 }
 
@@ -213,7 +214,8 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
          vao->VertexAttribBufferMask |= binding->_BoundArrays;
 
       vao->NewArrays |= vao->_Enabled & binding->_BoundArrays;
-      ctx->NewState |= _NEW_ARRAY;
+      if (vao == ctx->Array.VAO)
+         ctx->NewState |= _NEW_ARRAY;
    }
 }
 
@@ -235,7 +237,8 @@ vertex_binding_divisor(struct gl_context *ctx,
    if (binding->InstanceDivisor != divisor) {
       binding->InstanceDivisor = divisor;
       vao->NewArrays |= vao->_Enabled & binding->_BoundArrays;
-      ctx->NewState |= _NEW_ARRAY;
+      if (vao == ctx->Array.VAO)
+         ctx->NewState |= _NEW_ARRAY;
    }
 }
 
@@ -345,7 +348,8 @@ _mesa_update_array_format(struct gl_context *ctx,
    array->_ElementSize = elementSize;
 
    vao->NewArrays |= vao->_Enabled & VERT_BIT(attrib);
-   ctx->NewState |= _NEW_ARRAY;
+   if (vao == ctx->Array.VAO)
+      ctx->NewState |= _NEW_ARRAY;
 }
 
 /**
@@ -1080,7 +1084,9 @@ _mesa_enable_vertex_array_attrib(struct gl_context *ctx,
       const GLbitfield array_bit = VERT_BIT(attrib);
       vao->_Enabled |= array_bit;
       vao->NewArrays |= array_bit;
-      ctx->NewState |= _NEW_ARRAY;
+
+      if (vao == ctx->Array.VAO)
+         ctx->NewState |= _NEW_ARRAY;
 
       /* Update the map mode if needed */
       if (array_bit & (VERT_BIT_POS|VERT_BIT_GENERIC0))
@@ -1165,7 +1171,9 @@ _mesa_disable_vertex_array_attrib(struct gl_context *ctx,
       const GLbitfield array_bit = VERT_BIT(attrib);
       vao->_Enabled &= ~array_bit;
       vao->NewArrays |= array_bit;
-      ctx->NewState |= _NEW_ARRAY;
+
+      if (vao == ctx->Array.VAO)
+         ctx->NewState |= _NEW_ARRAY;
 
       /* Update the map mode if needed */
       if (array_bit & (VERT_BIT_POS|VERT_BIT_GENERIC0))




More information about the mesa-commit mailing list