free(ctx->Const.SpirVExtensions);
free(ctx->tmp_draws);
- free(ctx->tmp_prims);
}
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;
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.
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
#include "main/glheader.h"
struct _mesa_index_buffer;
-struct _mesa_prim;
struct gl_context;
struct st_context;
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,
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.
*/
}
}
/**
- * 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