Update the VAO internal state on Array._DrawVAO instead of
Array.VAO. Also the VAO internal state update gets triggered now
by a change of Array._DrawVAO instead of the _NEW_ARRAY state flag.
Also no driver looks at any VAO's NewArrays value from within
the Driver.UpdateState callback. So it should be safe to move
this update into the _mesa_set_draw_vao method.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
{
/* Make sure we do not run into problems with shared objects */
assert(!vao->SharedAndImmutable || vao->NewArrays == 0);
{
/* Make sure we do not run into problems with shared objects */
assert(!vao->SharedAndImmutable || vao->NewArrays == 0);
+
+ /*
+ * Stay tuned, the next series scans for duplicate bindings in this
+ * function. So that drivers can easily know the minimum unique set
+ * of bindings.
+ */
- if (new_state & _NEW_ARRAY)
- _mesa_update_vao_derived_arrays(ctx, ctx->Array.VAO);
-
out:
new_prog_state |= update_program_constants(ctx);
out:
new_prog_state |= update_program_constants(ctx);
*/
ctx->Driver.UpdateState(ctx);
ctx->NewState = 0;
*/
ctx->Driver.UpdateState(ctx);
ctx->NewState = 0;
- ctx->Array.VAO->NewArrays = 0x0;
struct gl_vertex_array_object **ptr = &ctx->Array._DrawVAO;
if (*ptr != vao) {
_mesa_reference_vao_(ctx, ptr, vao);
struct gl_vertex_array_object **ptr = &ctx->Array._DrawVAO;
if (*ptr != vao) {
_mesa_reference_vao_(ctx, ptr, vao);
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
- } else if (vao->NewArrays) {
+ }
+
+ if (vao->NewArrays) {
+ _mesa_update_vao_derived_arrays(ctx, vao);
+ vao->NewArrays = 0;
+
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
}
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
}
assert(!_mesa_is_bufferobj(exec->vtx.bufferobj) ||
(vao_enabled & ~vao->VertexAttribBufferMask) == 0);
assert(!_mesa_is_bufferobj(exec->vtx.bufferobj) ||
(vao_enabled & ~vao->VertexAttribBufferMask) == 0);
- _mesa_update_vao_derived_arrays(ctx, vao);
- vao->NewArrays = 0;
-
_mesa_set_draw_vao(ctx, vao, _vbo_get_vao_filter(mode));
/* The exec VAO is not immutable, so we need to set manually */
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
_mesa_set_draw_vao(ctx, vao, _vbo_get_vao_filter(mode));
/* The exec VAO is not immutable, so we need to set manually */
ctx->NewDriverState |= ctx->DriverFlags.NewArray;