diff options
Diffstat (limited to 'source/blender/gpu/GPU_buffers.h')
-rw-r--r-- | source/blender/gpu/GPU_buffers.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h index 9009c134837..552bad2b0d6 100644 --- a/source/blender/gpu/GPU_buffers.h +++ b/source/blender/gpu/GPU_buffers.h @@ -41,7 +41,8 @@ struct PBVH; /* Buffers for drawing from PBVH grids. */ typedef struct GPU_PBVH_Buffers GPU_PBVH_Buffers; -/* build */ +/* Build must be called once before using the other functions, used every time + * mesh topology changes. Threaded. */ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3], const struct MPoly *mpoly, const struct MLoop *mloop, @@ -54,8 +55,13 @@ GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(int totgrid, unsigned int **grid_h GPU_PBVH_Buffers *GPU_pbvh_bmesh_buffers_build(bool smooth_shading); -/* update */ +/* Free part of data for update. Not thread safe, must run in OpenGL main thread. */ +void GPU_pbvh_bmesh_buffers_update_free(GPU_PBVH_Buffers *buffers); +void GPU_pbvh_grid_buffers_update_free(GPU_PBVH_Buffers *buffers, + const struct DMFlagMat *grid_flag_mats, + int *grid_indices); +/* Update mesh buffers without topology changes. Threaded. */ enum { GPU_PBVH_BUFFERS_SHOW_MASK = (1 << 1), GPU_PBVH_BUFFERS_SHOW_VCOL = (1 << 1), @@ -85,6 +91,12 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers, const struct CCGKey *key, const int update_flags); +/* Finish update. Not thread safe, must run in OpenGL main thread. */ +void GPU_pbvh_buffers_update_flush(GPU_PBVH_Buffers *buffers); + +/* Free buffers. Not thread safe, must run in OpenGL main thread. */ +void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers); + /* draw */ struct GPUBatch *GPU_pbvh_buffers_batch_get(GPU_PBVH_Buffers *buffers, bool fast, bool wires); @@ -92,8 +104,4 @@ short GPU_pbvh_buffers_material_index_get(GPU_PBVH_Buffers *buffers); bool GPU_pbvh_buffers_has_mask(GPU_PBVH_Buffers *buffers); -void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers); - -void GPU_pbvh_fix_linking(void); - #endif |