Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2019-12-03 10:27:55 +0300
committerJeroen Bakker <jeroen@blender.org>2019-12-04 17:17:09 +0300
commit9c337fcfe2a46b2ccfb8a4960b7af0eac5c615de (patch)
treed85b5e66174d01ef509fa49745fecf70a9043955 /source/blender/draw/intern/draw_cache_inline.h
parent186d74020e50f894982fb678434716dc2646171b (diff)
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
Diffstat (limited to 'source/blender/draw/intern/draw_cache_inline.h')
-rw-r--r--source/blender/draw/intern/draw_cache_inline.h6
1 files changed, 4 insertions, 2 deletions
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)