From 9c337fcfe2a46b2ccfb8a4960b7af0eac5c615de Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 3 Dec 2019 08:27:55 +0100 Subject: Fix T72130: Wireframe Visible After Disabling The lines index buffer can contain all edges (edit mode) or only loose edges (object mode). When switching between these modes the wrong content of the index buffer can be used. This patch will clear the lines index buffer when a `loose_edges` is requested. Making sure it is always up to date. Note that this is supporting an exising hack where the IBO is truncated during the creation. We should find a different way how to solve these kind of issues. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6349 --- source/blender/draw/intern/draw_cache_inline.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_inline.h') diff --git a/source/blender/draw/intern/draw_cache_inline.h b/source/blender/draw/intern/draw_cache_inline.h index 12dc0a47a68..f14d23dafcf 100644 --- a/source/blender/draw/intern/draw_cache_inline.h +++ b/source/blender/draw/intern/draw_cache_inline.h @@ -72,8 +72,10 @@ BLI_INLINE void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo) if (*ibo == NULL) { *ibo = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf"); } - GPU_batch_vao_cache_clear(batch); - batch->elem = *ibo; + if (batch != NULL) { + GPU_batch_vao_cache_clear(batch); + batch->elem = *ibo; + } } BLI_INLINE bool DRW_ibo_requested(GPUIndexBuf *ibo) -- cgit v1.2.3