diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-06 17:40:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-06 23:13:06 +0300 |
commit | 7ffff04e4900ca284519900d12bd1490e218c4f4 (patch) | |
tree | d148ee3c5c286a45bc33f521c2c606e47dd43968 /source/blender/gpu/intern/gpu_buffers.c | |
parent | 98fc3f263cf18a1222d7ffe7dc0e1c0a1fa47ecd (diff) |
GPUVertBuf: Make GPUVertBuf private to the GPU module
This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
Diffstat (limited to 'source/blender/gpu/intern/gpu_buffers.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 83d70b32b7b..606af5b1a15 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -153,13 +153,14 @@ static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, uint vert_len) /* Initialize vertex buffer (match 'VertexBufferFormat'). */ buffers->vert_buf = GPU_vertbuf_create_with_format_ex(&g_vbo_id.format, GPU_USAGE_STATIC); } - if (buffers->vert_buf->data == NULL || buffers->vert_buf->vertex_len != vert_len) { + if (GPU_vertbuf_get_data(buffers->vert_buf) == NULL || + GPU_vertbuf_get_vertex_len(buffers->vert_buf) != vert_len) { /* Allocate buffer if not allocated yet or size changed. */ GPU_vertbuf_data_alloc(buffers->vert_buf, vert_len); } #endif - return buffers->vert_buf->data != NULL; + return GPU_vertbuf_get_data(buffers->vert_buf) != NULL; } static void gpu_pbvh_batch_init(GPU_PBVH_Buffers *buffers, GPUPrimType prim) @@ -1119,7 +1120,7 @@ void GPU_pbvh_buffers_update_flush(GPU_PBVH_Buffers *buffers) } /* Force flushing to the GPU. */ - if (buffers->vert_buf && buffers->vert_buf->data) { + if (buffers->vert_buf && GPU_vertbuf_get_data(buffers->vert_buf)) { GPU_vertbuf_use(buffers->vert_buf); } } |