mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
mesa: remove unused code using _mesa_prim
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
This commit is contained in:
parent
59af6be199
commit
303f867e32
8 changed files with 1 additions and 75 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
#include "main/glheader.h"
|
||||
|
||||
struct _mesa_index_buffer;
|
||||
struct _mesa_prim;
|
||||
struct gl_context;
|
||||
struct st_context;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -352,48 +352,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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue