vbo/dlist: don't store prim_store

This is not used anywhere, so we can drop it from vbo_save_context.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-08-12 08:58:03 +02:00
parent f5aa98579a
commit 2c6e8bab1b
4 changed files with 5 additions and 20 deletions

View File

@ -797,11 +797,6 @@ vbo_destroy_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *nod
for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm)
_mesa_reference_vao(ctx, &node->VAO[vpm], NULL);
if (--node->cold->prim_store->refcount == 0) {
free(node->cold->prim_store->prims);
free(node->cold->prim_store);
}
if (node->merged.mode) {
free(node->merged.mode);
free(node->merged.start_counts);

View File

@ -60,11 +60,9 @@ void vbo_save_destroy( struct gl_context *ctx )
_mesa_reference_vao(ctx, &save->VAO[vpm], NULL);
if (save->prim_store) {
if ( --save->prim_store->refcount == 0 ) {
free(save->prim_store->prims);
free(save->prim_store);
save->prim_store = NULL;
}
free(save->prim_store->prims);
free(save->prim_store);
save->prim_store = NULL;
}
if (save->vertex_store) {
free(save->vertex_store->buffer_in_ram);

View File

@ -82,8 +82,6 @@ struct vbo_save_vertex_list {
struct _mesa_prim *prims;
GLuint prim_count;
GLuint min_index, max_index;
struct vbo_save_primitive_store *prim_store;
} *cold;
};
@ -160,7 +158,6 @@ struct vbo_save_primitive_store {
struct _mesa_prim *prims;
GLuint used;
GLuint size;
GLuint refcount;
};

View File

@ -177,7 +177,6 @@ alloc_prim_store(int prim_count)
store->size = MAX2(prim_count, VBO_SAVE_PRIM_SIZE);
store->prims = calloc(store->size, sizeof(struct _mesa_prim));
store->used = 0;
store->refcount = 1;
return store;
}
@ -423,10 +422,8 @@ realloc_storage(struct gl_context *ctx, int prim_count, int vertex_count)
}
if (prim_count >= 0) {
if (--save->prim_store->refcount == 0) {
free(save->prim_store->prims);
free(save->prim_store);
}
free(save->prim_store->prims);
free(save->prim_store);
save->prim_store = alloc_prim_store(prim_count);
}
}
@ -537,8 +534,6 @@ compile_vertex_list(struct gl_context *ctx)
node->cold->prims = save->prims;
node->cold->ib.obj = NULL;
node->cold->prim_count = save->prim_count;
node->cold->prim_store = save->prim_store;
node->cold->prim_store->refcount++;
if (save->no_current_update) {
node->cold->current_data = NULL;