Mesa (master): vbo: Remove the now unused vbo draw path.

Mathias Fröhlich frohlich at kemper.freedesktop.org
Sat Mar 31 04:35:43 UTC 2018


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

Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date:   Sun Mar 25 19:16:54 2018 +0200

vbo: Remove the now unused vbo draw path.

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

---

 src/mesa/drivers/common/driverfuncs.c |  2 +-
 src/mesa/main/state.c                 | 12 ++-------
 src/mesa/vbo/vbo.h                    | 20 ---------------
 src/mesa/vbo/vbo_context.c            | 47 -----------------------------------
 src/mesa/vbo/vbo_exec.c               |  8 ------
 src/mesa/vbo/vbo_exec.h               |  4 ---
 src/mesa/vbo/vbo_private.h            |  7 ------
 7 files changed, 3 insertions(+), 97 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 2ddfdb5efa..11134b69e9 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -121,7 +121,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
    driver->NewATIfs = NULL;
 
    /* Draw functions */
-   driver->Draw = _vbo_draw;
+   driver->Draw = NULL;
    driver->DrawIndirect = _vbo_draw_indirect;
 
    /* simple state commands */
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index fb97165db9..be8f3f302c 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -459,21 +459,13 @@ _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;
-}
-
-
-static void
 set_vertex_processing_mode(struct gl_context *ctx, gl_vertex_processing_mode m)
 {
    if (ctx->VertexProgram._VPMode == m)
       return;
 
    /* On change we may get new maps into the current values */
-   set_new_array(ctx);
+   ctx->NewDriverState |= ctx->DriverFlags.NewArray;
 
    /* Finally memorize the value */
    ctx->VertexProgram._VPMode = m;
@@ -532,7 +524,7 @@ _mesa_set_draw_vao(struct gl_context *ctx, struct gl_vertex_array_object *vao,
       new_array = true;
 
    if (new_array)
-      set_new_array(ctx);
+      ctx->NewDriverState |= ctx->DriverFlags.NewArray;
 
    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 db136f9445..13f77d9db3 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -187,14 +187,6 @@ struct split_limits
 
 
 void
-_vbo_draw(struct gl_context *ctx, const struct _mesa_prim *prims,
-               GLuint nr_prims, const struct _mesa_index_buffer *ib,
-               GLboolean index_bounds_valid, GLuint min_index, GLuint max_index,
-               struct gl_transform_feedback_object *tfb_vertcount,
-               unsigned tfb_stream, struct gl_buffer_object *indirect);
-
-
-void
 _vbo_draw_indirect(struct gl_context *ctx, GLuint mode,
                         struct gl_buffer_object *indirect_data,
                         GLsizeiptr indirect_offset, unsigned draw_count,
@@ -231,9 +223,6 @@ void
 vbo_always_unmap_buffers(struct gl_context *ctx);
 
 void
-vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func);
-
-void
 vbo_sw_primitive_restart(struct gl_context *ctx,
                          const struct _mesa_prim *prim,
                          GLuint nr_prims,
@@ -261,15 +250,6 @@ 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_context.c b/src/mesa/vbo/vbo_context.c
index 54cbab0c14..b8c28ceffb 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -186,7 +186,6 @@ _vbo_CreateContext(struct gl_context *ctx)
    init_legacy_currval(ctx);
    init_generic_currval(ctx);
    init_mat_currval(ctx);
-   _vbo_init_inputs(&vbo->draw_arrays);
 
    /* make sure all VBO_ATTRIB_ values can fit in an unsigned byte */
    STATIC_ASSERT(VBO_ATTRIB_MAX <= 255);
@@ -235,52 +234,6 @@ _vbo_DestroyContext(struct gl_context *ctx)
 
 
 void
-vbo_set_draw_func(struct gl_context *ctx, vbo_draw_func func)
-{
-   struct vbo_context *vbo = vbo_context(ctx);
-   vbo->draw_prims = func;
-}
-
-
-/**
- * Examine the enabled vertex arrays to set the exec->array.inputs[] values.
- * These will point to the arrays to actually use for drawing.  Some will
- * be user-provided arrays, other will be zero-stride const-valued arrays.
- */
-static void
-vbo_bind_arrays(struct gl_context *ctx)
-{
-   struct vbo_context *vbo = vbo_context(ctx);
-   struct vbo_exec_context *exec = &vbo->exec;
-
-   _mesa_set_drawing_arrays(ctx, vbo->draw_arrays.inputs);
-
-   if (exec->array.recalculate_inputs) {
-      /* Finally update the inputs array */
-      _vbo_update_inputs(ctx, &vbo->draw_arrays);
-      exec->array.recalculate_inputs = GL_FALSE;
-   }
-
-   assert(ctx->NewState == 0);
-   assert(ctx->Array._DrawVAO->NewArrays == 0);
-}
-
-
-void
-_vbo_draw(struct gl_context *ctx, const struct _mesa_prim *prims,
-               GLuint nr_prims, const struct _mesa_index_buffer *ib,
-               GLboolean index_bounds_valid, GLuint min_index, GLuint max_index,
-               struct gl_transform_feedback_object *tfb_vertcount,
-               unsigned tfb_stream, struct gl_buffer_object *indirect)
-{
-   struct vbo_context *vbo = vbo_context(ctx);
-   vbo_bind_arrays(ctx);
-   vbo->draw_prims(ctx, prims, nr_prims, ib, index_bounds_valid,
-                   min_index, max_index, tfb_vertcount, tfb_stream, indirect);
-}
-
-
-void
 _vbo_draw_indirect(struct gl_context *ctx, GLuint mode,
                         struct gl_buffer_object *indirect_data,
                         GLsizeiptr indirect_offset, unsigned draw_count,
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index f9cf8355ed..b23747aa39 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -127,7 +127,6 @@ vbo_exec_init(struct gl_context *ctx)
    /* 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;
 }
 
@@ -244,13 +243,6 @@ 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;
diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index 07ab5cc837..853fc68c96 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -109,10 +109,6 @@ struct vbo_exec_context
       struct vbo_exec_eval2_map map2[VERT_ATTRIB_MAX];
    } eval;
 
-   struct {
-      GLboolean recalculate_inputs;
-   } array;
-
    /* Which flags to set in vbo_exec_begin_vertices() */
    GLbitfield begin_vertices_flags;
 
diff --git a/src/mesa/vbo/vbo_private.h b/src/mesa/vbo/vbo_private.h
index 90d8ed4570..7cc64ecdbc 100644
--- a/src/mesa/vbo/vbo_private.h
+++ b/src/mesa/vbo/vbo_private.h
@@ -46,18 +46,11 @@ struct _mesa_prim;
 struct vbo_context {
    struct gl_vertex_buffer_binding binding;
    struct gl_array_attributes current[VBO_ATTRIB_MAX];
-   /* The array of inputs used for _DrawVAO draws. */
-   struct vbo_inputs draw_arrays;
 
    struct gl_vertex_array_object *VAO;
 
    struct vbo_exec_context exec;
    struct vbo_save_context save;
-
-   /* Callback into the driver.  This must always succeed, the driver
-    * is responsible for initiating any fallback actions required:
-    */
-   vbo_draw_func draw_prims;
 };
 
 




More information about the mesa-commit mailing list