summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
diff options
context:
space:
mode:
authorMathias Fröhlich <[email protected]>2018-03-16 06:34:35 +0100
committerMathias Fröhlich <[email protected]>2018-03-22 04:58:52 +0100
commitd3c604e12e1e2ef1e562f51e529ba18bae2d9af1 (patch)
treed78452e323095b1f2054a5cad37fc8e9634a9ded /src/mesa/main/state.c
parentc4c56ff303e39f55e7940b33e8afeafa80b26280 (diff)
mesa: Update VAO internal state when setting the _DrawVAO.
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 <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r--src/mesa/main/state.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 6dd7a7ec075..e523bccd0ce 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -360,9 +360,6 @@ _mesa_update_state_locked( struct gl_context *ctx )
update_program(ctx);
}
- if (new_state & _NEW_ARRAY)
- _mesa_update_vao_derived_arrays(ctx, ctx->Array.VAO);
-
out:
new_prog_state |= update_program_constants(ctx);
@@ -377,7 +374,6 @@ _mesa_update_state_locked( struct gl_context *ctx )
*/
ctx->Driver.UpdateState(ctx);
ctx->NewState = 0;
- ctx->Array.VAO->NewArrays = 0x0;
}
@@ -496,8 +492,14 @@ _mesa_set_draw_vao(struct gl_context *ctx, struct gl_vertex_array_object *vao,
struct gl_vertex_array_object **ptr = &ctx->Array._DrawVAO;
if (*ptr != vao) {
_mesa_reference_vao_(ctx, ptr, vao);
+
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;
}