Mesa (master): mesa: Flag early if we modify a SharedAndImmutable VAO.
Mathias Fröhlich
frohlich at kemper.freedesktop.org
Fri Mar 23 19:54:21 UTC 2018
Module: Mesa
Branch: master
Commit: 1a131aaf4b03502980ea109c44531da8f965ecaa
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a131aaf4b03502980ea109c44531da8f965ecaa
Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date: Thu Mar 22 05:34:09 2018 +0100
mesa: Flag early if we modify a SharedAndImmutable 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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 69a08a646f..5df38a14f0 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -162,6 +162,7 @@ _mesa_vertex_attrib_binding(struct gl_context *ctx,
GLuint bindingIndex, bool flush_vertices)
{
struct gl_array_attributes *array = &vao->VertexAttrib[attribIndex];
+ assert(!vao->SharedAndImmutable);
if (array->BufferBindingIndex != bindingIndex) {
const GLbitfield array_bit = VERT_BIT(attribIndex);
@@ -197,6 +198,7 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
GLintptr offset, GLsizei stride, bool flush_vertices)
{
assert(index < ARRAY_SIZE(vao->BufferBinding));
+ assert(!vao->SharedAndImmutable);
struct gl_vertex_buffer_binding *binding = &vao->BufferBinding[index];
if (binding->BufferObj != vbo ||
@@ -233,6 +235,7 @@ vertex_binding_divisor(struct gl_context *ctx,
{
struct gl_vertex_buffer_binding *binding =
&vao->BufferBinding[bindingIndex];
+ assert(!vao->SharedAndImmutable);
if (binding->InstanceDivisor != divisor) {
FLUSH_VERTICES(ctx, _NEW_ARRAY);
@@ -333,6 +336,7 @@ _mesa_update_array_format(struct gl_context *ctx,
struct gl_array_attributes *const array = &vao->VertexAttrib[attrib];
GLint elementSize;
+ assert(!vao->SharedAndImmutable);
assert(size <= 4);
elementSize = _mesa_bytes_per_vertex_attrib(size, type);
@@ -1097,6 +1101,7 @@ _mesa_enable_vertex_array_attrib(struct gl_context *ctx,
gl_vert_attrib attrib, bool flush_vertices)
{
assert(attrib < ARRAY_SIZE(vao->VertexAttrib));
+ assert(!vao->SharedAndImmutable);
if (!vao->VertexAttrib[attrib].Enabled) {
/* was disabled, now being enabled */
@@ -1186,6 +1191,7 @@ _mesa_disable_vertex_array_attrib(struct gl_context *ctx,
gl_vert_attrib attrib, bool flush_vertices)
{
assert(attrib < ARRAY_SIZE(vao->VertexAttrib));
+ assert(!vao->SharedAndImmutable);
if (vao->VertexAttrib[attrib].Enabled) {
/* was enabled, now being disabled */
More information about the mesa-commit
mailing list