GPU: Cleanup: Rename vbo to ibo for index buffers
authorClément Foucault <foucault.clem@gmail.com>
Sat, 8 Dec 2018 14:53:23 +0000 (15:53 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Mon, 10 Dec 2018 18:02:17 +0000 (19:02 +0100)
source/blender/gpu/GPU_element.h
source/blender/gpu/intern/gpu_element.c

index 9d2458ef1aae38105658d7eb5d13b793653e7493..c16a3d8b4a1c7f4a29683c7d4129b2da54fbf84e 100644 (file)
@@ -53,7 +53,7 @@ typedef struct GPUIndexBuf {
        uint max_index;
        uint base_index;
 #endif
-       uint32_t vbo_id; /* 0 indicates not yet sent to VRAM */
+       uint32_t ibo_id; /* 0 indicates not yet sent to VRAM */
        bool use_prim_restart;
 } GPUIndexBuf;
 
index b8ce4faabea065a6d4727e26447b0397a4312078..5efb193c3adec7d151d3c5db1fa51a8b26cd992f 100644 (file)
@@ -284,14 +284,14 @@ void GPU_indexbuf_build_in_place(GPUIndexBufBuilder *builder, GPUIndexBuf *elem)
        elem->gl_index_type = convert_index_type_to_gl(elem->index_type);
 #endif
 
-       if (elem->vbo_id == 0) {
-               elem->vbo_id = GPU_buf_alloc();
+       if (elem->ibo_id == 0) {
+               elem->ibo_id = GPU_buf_alloc();
        }
        /* send data to GPU */
        /* GL_ELEMENT_ARRAY_BUFFER changes the state of the last VAO bound,
         * so we use the GL_ARRAY_BUFFER here to create a buffer without
         * interfering in the VAO state. */
-       glBindBuffer(GL_ARRAY_BUFFER, elem->vbo_id);
+       glBindBuffer(GL_ARRAY_BUFFER, elem->ibo_id);
        glBufferData(GL_ARRAY_BUFFER, GPU_indexbuf_size_get(elem), builder->data, GL_STATIC_DRAW);
 
        /* discard builder (one-time use) */
@@ -302,13 +302,13 @@ void GPU_indexbuf_build_in_place(GPUIndexBufBuilder *builder, GPUIndexBuf *elem)
 
 void GPU_indexbuf_use(GPUIndexBuf *elem)
 {
-       glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elem->vbo_id);
+       glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elem->ibo_id);
 }
 
 void GPU_indexbuf_discard(GPUIndexBuf *elem)
 {
-       if (elem->vbo_id) {
-               GPU_buf_free(elem->vbo_id);
+       if (elem->ibo_id) {
+               GPU_buf_free(elem->ibo_id);
        }
        MEM_freeN(elem);
 }