mesa: remove unused code using _mesa_prim
authorMarek Olšák <marek.olsak@amd.com>
Sun, 14 Aug 2022 04:35:41 +0000 (00:35 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 26 Sep 2022 22:58:16 +0000 (22:58 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

src/mesa/main/context.c
src/mesa/main/dd.h
src/mesa/main/draw.c
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_draw.h
src/mesa/vbo/vbo.h
src/mesa/vbo/vbo_exec.c
src/mesa/vbo/vbo_minmax_index.c

index f5b7d16..c8b17b7 100644 (file)
@@ -1189,7 +1189,6 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output)
 
    free(ctx->Const.SpirVExtensions);
    free(ctx->tmp_draws);
-   free(ctx->tmp_prims);
 }
 
 
index a9c714f..37e37b7 100644 (file)
@@ -65,7 +65,6 @@ struct gl_transform_feedback_object;
 struct gl_vertex_array_object;
 struct ati_fragment_shader;
 struct util_queue_monitoring;
-struct _mesa_prim;
 struct _mesa_index_buffer;
 struct pipe_draw_info;
 struct pipe_draw_start_count_bias;
index 82277b4..62646fc 100644 (file)
@@ -944,26 +944,6 @@ get_temp_draws(struct gl_context *ctx, unsigned primcount)
    return ctx->tmp_draws;
 }
 
-static inline struct _mesa_prim *
-get_temp_prims(struct gl_context *ctx, unsigned primcount)
-{
-   if (primcount > ctx->num_tmp_prims) {
-      struct _mesa_prim *tmp =
-         realloc(ctx->tmp_prims, primcount * sizeof(ctx->tmp_prims[0]));
-
-      if (tmp) {
-         ctx->tmp_prims = tmp;
-         ctx->num_tmp_prims = primcount;
-      } else {
-         _mesa_error(ctx, GL_OUT_OF_MEMORY, "can't alloc tmp_prims");
-         free(ctx->tmp_prims); /* realloc doesn't free on failure */
-         ctx->tmp_prims = NULL;
-         ctx->num_tmp_prims = 0;
-      }
-   }
-   return ctx->tmp_prims;
-}
 /**
  * Check that element 'j' of the array has reasonable data.
  * Map VBO if needed.
index 44c9cf7..f6eb1a4 100644 (file)
@@ -3675,9 +3675,7 @@ struct gl_context
    bool shader_builtin_ref;
 
    struct pipe_draw_start_count_bias *tmp_draws;
-   struct _mesa_prim *tmp_prims;
    unsigned num_tmp_draws;
-   unsigned num_tmp_prims;
 };
 
 #ifndef NDEBUG
index c0d5cc1..684d267 100644 (file)
@@ -37,7 +37,6 @@
 #include "main/glheader.h"
 
 struct _mesa_index_buffer;
-struct _mesa_prim;
 struct gl_context;
 struct st_context;
 
index 9e47b49..bc5510f 100644 (file)
@@ -227,13 +227,6 @@ vbo_get_minmax_index_mapped(unsigned count, unsigned index_size,
                             const void *indices,
                             unsigned *min_index, unsigned *max_index);
 
-void
-vbo_get_minmax_indices(struct gl_context *ctx, const struct _mesa_prim *prim,
-                       const struct _mesa_index_buffer *ib,
-                       GLuint *min_index, GLuint *max_index, GLuint nr_prims,
-                       bool primitive_restart,
-                       unsigned restart_index);
-
 bool
 vbo_get_minmax_indices_gallium(struct gl_context *ctx,
                                struct pipe_draw_info *info,
index 22b9464..b01e2aa 100644 (file)
@@ -204,7 +204,7 @@ vbo_merge_draws(struct gl_context *ctx, bool in_dlist,
       if (begin1 == 1 && (in_dlist || ctx->Line.StippleFlag))
          return false;
 
-      /* _mesa_prim::end is irrelevant at this point and is only used
+      /* end is irrelevant at this point and is only used
        * before this function is called.
        */
    }
index 68633b4..cae07c6 100644 (file)
@@ -353,48 +353,6 @@ vbo_get_minmax_index(struct gl_context *ctx, struct gl_buffer_object *obj,
 }
 
 /**
- * Compute min and max elements for nr_prims
- */
-void
-vbo_get_minmax_indices(struct gl_context *ctx,
-                       const struct _mesa_prim *prims,
-                       const struct _mesa_index_buffer *ib,
-                       GLuint *min_index,
-                       GLuint *max_index,
-                       GLuint nr_prims,
-                       bool primitive_restart,
-                       unsigned restart_index)
-{
-   GLuint tmp_min, tmp_max;
-   GLuint i;
-   GLuint count;
-
-   *min_index = ~0;
-   *max_index = 0;
-
-   for (i = 0; i < nr_prims; i++) {
-      const struct _mesa_prim *start_prim;
-
-      start_prim = &prims[i];
-      count = start_prim->count;
-      /* Do combination if possible to reduce map/unmap count */
-      while ((i + 1 < nr_prims) &&
-             (prims[i].start + prims[i].count == prims[i+1].start)) {
-         count += prims[i+1].count;
-         i++;
-      }
-      vbo_get_minmax_index(ctx, ib->obj, ib->ptr,
-                           (ib->obj ? (GLintptr)ib->ptr : 0) +
-                           (start_prim->start << ib->index_size_shift),
-                           count, 1 << ib->index_size_shift,
-                           primitive_restart, restart_index,
-                           &tmp_min, &tmp_max);
-      *min_index = MIN2(*min_index, tmp_min);
-      *max_index = MAX2(*max_index, tmp_max);
-   }
-}
-
-/**
  * Same as vbo_get_minmax_index, but using gallium draw structures.
  */
 bool