Mesa (master): mesa: rework vbo_exec_init()

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Jun 8 23:14:02 UTC 2017


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

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Wed Jun  7 12:43:27 2017 +1000

mesa: rework vbo_exec_init()

Here we make some assumptions about the AEcontext and set the
recalculate bools directly.

Some formating fixes are also made while we are here.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/api_arrayelt.c |  7 +++++++
 src/mesa/main/api_arrayelt.h |  1 +
 src/mesa/vbo/vbo_exec.c      | 18 ++++++++++--------
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c
index 46175e4cc7..8eb523dd52 100644
--- a/src/mesa/main/api_arrayelt.c
+++ b/src/mesa/main/api_arrayelt.c
@@ -94,6 +94,13 @@ TYPE_IDX(GLenum t)
 }
 
 
+bool
+_ae_is_state_dirty(struct gl_context *ctx)
+{
+   return AE_CONTEXT(ctx)->NewState;
+}
+
+
 #define NUM_TYPES 8
 
 
diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h
index 03cd9ecbd5..9ae79a94b7 100644
--- a/src/mesa/main/api_arrayelt.h
+++ b/src/mesa/main/api_arrayelt.h
@@ -34,6 +34,7 @@
 extern GLboolean _ae_create_context( struct gl_context *ctx );
 extern void _ae_destroy_context( struct gl_context *ctx );
 extern void _ae_invalidate_state( struct gl_context *ctx, GLbitfield new_state );
+extern bool _ae_is_state_dirty(struct gl_context *ctx);
 extern void GLAPIENTRY _ae_ArrayElement( GLint elt );
 
 /* May optionally be called before a batch of element calls:
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 4db4f4088b..de8461f1fc 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -34,24 +34,26 @@
 
 
 
-void vbo_exec_init( struct gl_context *ctx )
+void
+vbo_exec_init(struct gl_context *ctx)
 {
    struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
 
    exec->ctx = ctx;
 
-   /* Initialize the arrayelt helper
-    */
-   if (!ctx->aelt_context &&
-       !_ae_create_context( ctx )) 
-      return;
+   /* aelt_context should have been created by the caller */
+   assert(ctx->aelt_context);
 
-   vbo_exec_vtx_init( exec );
+   vbo_exec_vtx_init(exec);
 
    ctx->Driver.NeedFlush = 0;
    ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
 
-   vbo_exec_invalidate_state( ctx, ~0 );
+   /* The aelt_context state should still be dirty from its creation */
+   assert(_ae_is_state_dirty(ctx));
+
+   exec->array.recalculate_inputs = GL_TRUE;
+   exec->eval.recalculate_maps = GL_TRUE;
 }
 
 




More information about the mesa-commit mailing list