Mesa (master): mesa: Set DriverFlags.NewArray together with vbo...recalculate_inputs.

Mathias Fröhlich frohlich at kemper.freedesktop.org
Thu Mar 22 04:25:07 UTC 2018


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

Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date:   Fri Mar 16 06:34:35 2018 +0100

mesa: Set DriverFlags.NewArray together with vbo...recalculate_inputs.

Both mean something very similar and are set at the same time now.
For that vbo module to be set from core mesa, implement a public vbo
module method to set that flag. In the longer term the flag should
vanish in favor of a driver flag of the appropriate driver.

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

---

 src/mesa/main/state.c   | 19 ++++++++++++++++---
 src/mesa/vbo/vbo.h      |  9 +++++++++
 src/mesa/vbo/vbo_exec.c |  7 +++++++
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index e523bccd0c..a6ae3b9001 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -458,6 +458,14 @@ _mesa_set_vp_override(struct gl_context *ctx, GLboolean flag)
 }
 
 
+static void
+set_new_array(struct gl_context *ctx)
+{
+   _vbo_set_recalculate_inputs(ctx);
+   ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+}
+
+
 /**
  * Update ctx->VertexProgram._VPMode.
  * This is to distinguish whether we're running
@@ -490,23 +498,28 @@ _mesa_set_draw_vao(struct gl_context *ctx, struct gl_vertex_array_object *vao,
                    GLbitfield filter)
 {
    struct gl_vertex_array_object **ptr = &ctx->Array._DrawVAO;
+   bool new_array = false;
    if (*ptr != vao) {
       _mesa_reference_vao_(ctx, ptr, vao);
 
-      ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+      new_array = true;
    }
 
    if (vao->NewArrays) {
       _mesa_update_vao_derived_arrays(ctx, vao);
       vao->NewArrays = 0;
 
-      ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+      new_array = true;
    }
 
    /* May shuffle the position and generic0 bits around, filter out unwanted */
    const GLbitfield enabled = filter & _mesa_get_vao_vp_inputs(vao);
    if (ctx->Array._DrawVAOEnabledAttribs != enabled)
-      ctx->NewDriverState |= ctx->DriverFlags.NewArray;
+      new_array = true;
+
+   if (new_array)
+      set_new_array(ctx);
+
    ctx->Array._DrawVAOEnabledAttribs = enabled;
    _mesa_set_varying_vp_inputs(ctx, enabled);
 }
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 42436e0fac..ef2bf9221a 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -293,6 +293,15 @@ struct vbo_inputs
 
 
 /**
+ * Set the recalculate_inputs flag.
+ * The method should in the longer run be replaced with listening for the
+ * DriverFlags.NewArray flag in NewDriverState. But for now ...
+ */
+void
+_vbo_set_recalculate_inputs(struct gl_context *ctx);
+
+
+/**
  * Initialize inputs.
  */
 void
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index c0b0a11fe5..f9cf8355ed 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -244,6 +244,13 @@ vbo_merge_prims(struct _mesa_prim *p0, const struct _mesa_prim *p1)
 
 
 void
+_vbo_set_recalculate_inputs(struct gl_context *ctx)
+{
+   vbo_context(ctx)->exec.array.recalculate_inputs = GL_TRUE;
+}
+
+
+void
 _vbo_init_inputs(struct vbo_inputs *inputs)
 {
    inputs->current = 0;




More information about the mesa-commit mailing list