vbo/dlist: remove vbo_save_vertex_store::bufferobj
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 10 Aug 2021 17:11:32 +0000 (19:11 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 9 Sep 2021 14:42:16 +0000 (16:42 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12646>

src/mesa/vbo/vbo_save.c
src/mesa/vbo/vbo_save.h
src/mesa/vbo/vbo_save_api.c

index 5a5829e..6a045c6 100644 (file)
@@ -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;
index 89b2f49..19c78e8 100644 (file)
@@ -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 */
index 27c3a61..01f5498 100644 (file)
@@ -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);
 }