diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-11 02:58:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-13 15:20:24 +0300 |
commit | ac60a67b3f6eacbcff5b5c4716fd5e3902511a29 (patch) | |
tree | 486054624ca8c881751b2569cc872b37fb0b8695 /source/blender/draw/intern | |
parent | efc97b3919ea4fd46b9d2e931ca3fea27e7ea31c (diff) |
Cleanup: GPU: Remove Batch vao cache reset
This is done at drawtime automatically.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 12 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache.h | 1 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_inline.h | 6 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 3 |
4 files changed, 2 insertions, 20 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 46b7a88b2a6..4d7440a3276 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -152,18 +152,6 @@ void DRW_shape_cache_free(void) } } -void DRW_shape_cache_reset(void) -{ - uint i = sizeof(SHC) / sizeof(GPUBatch *); - GPUBatch **batch = (GPUBatch **)&SHC; - while (i--) { - if (*batch) { - GPU_batch_vao_cache_clear(*batch); - } - batch++; - } -} - /* -------------------------------------------------------------------- */ /** \name Procedural Batches * \{ */ diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h index 2a7448ce877..7164a477d8a 100644 --- a/source/blender/draw/intern/draw_cache.h +++ b/source/blender/draw/intern/draw_cache.h @@ -33,7 +33,6 @@ struct VolumeGrid; struct bGPDstroke; void DRW_shape_cache_free(void); -void DRW_shape_cache_reset(void); /* 3D cursor */ struct GPUBatch *DRW_cache_cursor_get(bool crosshair_lines); diff --git a/source/blender/draw/intern/draw_cache_inline.h b/source/blender/draw/intern/draw_cache_inline.h index 0d24f2e450b..0f0e1785a2a 100644 --- a/source/blender/draw/intern/draw_cache_inline.h +++ b/source/blender/draw/intern/draw_cache_inline.h @@ -72,8 +72,7 @@ BLI_INLINE void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo) *ibo = GPU_indexbuf_calloc(); } if (batch != NULL) { - GPU_batch_vao_cache_clear(batch); - batch->elem = *ibo; + GPU_batch_elembuf_set(batch, *ibo, false); } } @@ -92,8 +91,7 @@ BLI_INLINE void DRW_vbo_request(GPUBatch *batch, GPUVertBuf **vbo) if (batch != NULL) { /* HACK set first vbo if not init. */ if (batch->verts[0] == NULL) { - GPU_batch_vao_cache_clear(batch); - batch->verts[0] = *vbo; + GPU_batch_vertbuf_add(batch, *vbo); } else { /* HACK: bypass assert */ diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 4a5e07476a9..e436424b460 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2824,7 +2824,6 @@ void DRW_opengl_context_enable_ex(bool restore) if (!G.background) { immActivate(); } - BLF_batch_reset(); } } } @@ -2888,13 +2887,11 @@ void DRW_gpu_render_context_enable(void *re_gpu_context) BLI_assert(!BLI_thread_is_main()); GPU_context_active_set(re_gpu_context); - DRW_shape_cache_reset(); /* XXX fix that too. */ } /* Needs to be called BEFORE DRW_opengl_render_context_disable() */ void DRW_gpu_render_context_disable(void *UNUSED(re_gpu_context)) { - DRW_shape_cache_reset(); /* XXX fix that too. */ GPU_context_active_set(NULL); } |