mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
vbo/dlist: remove vbo_save_vertex_store::bufferobj
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:
parent
f9d12bf50e
commit
f5aa98579a
3 changed files with 3 additions and 23 deletions
|
|
@ -67,7 +67,6 @@ void vbo_save_destroy( struct gl_context *ctx )
|
|||
}
|
||||
}
|
||||
if (save->vertex_store) {
|
||||
_mesa_reference_buffer_object(ctx, &save->vertex_store->bufferobj, NULL);
|
||||
free(save->vertex_store->buffer_in_ram);
|
||||
free(save->vertex_store);
|
||||
save->vertex_store = NULL;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,6 @@ _vbo_save_get_vertex_count(const struct vbo_save_vertex_list *node)
|
|||
#define VBO_SAVE_INDEX_SIZE (32 * 1024)
|
||||
|
||||
struct vbo_save_vertex_store {
|
||||
struct gl_buffer_object *bufferobj;
|
||||
fi_type *buffer_in_ram;
|
||||
GLuint buffer_in_ram_size;
|
||||
GLuint used; /**< Number of 4-byte words used in buffer */
|
||||
|
|
|
|||
|
|
@ -145,22 +145,9 @@ alloc_vertex_store(struct gl_context *ctx, int vertex_count)
|
|||
* user. Perhaps there could be a special number for internal
|
||||
* buffers:
|
||||
*/
|
||||
vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, VBO_BUF_ID);
|
||||
if (vertex_store->bufferobj) {
|
||||
vertex_store->buffer_in_ram_size = size * sizeof(GLfloat);
|
||||
vertex_store->buffer_in_ram = malloc(vertex_store->buffer_in_ram_size);
|
||||
save->out_of_memory = vertex_store->buffer_in_ram == NULL;
|
||||
save->out_of_memory =
|
||||
!ctx->Driver.BufferData(ctx,
|
||||
GL_ARRAY_BUFFER_ARB,
|
||||
size * sizeof(GLfloat),
|
||||
NULL, GL_STATIC_DRAW_ARB,
|
||||
GL_MAP_WRITE_BIT,
|
||||
vertex_store->bufferobj);
|
||||
}
|
||||
else {
|
||||
save->out_of_memory = GL_TRUE;
|
||||
}
|
||||
vertex_store->buffer_in_ram_size = size * sizeof(GLfloat);
|
||||
vertex_store->buffer_in_ram = malloc(vertex_store->buffer_in_ram_size);
|
||||
save->out_of_memory = vertex_store->buffer_in_ram == NULL;
|
||||
|
||||
if (save->out_of_memory) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "internal VBO allocation");
|
||||
|
|
@ -178,11 +165,6 @@ free_vertex_store(struct gl_context *ctx,
|
|||
struct vbo_save_vertex_store *vertex_store)
|
||||
{
|
||||
free(vertex_store->buffer_in_ram);
|
||||
|
||||
if (vertex_store->bufferobj) {
|
||||
_mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL);
|
||||
}
|
||||
|
||||
free(vertex_store);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue