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
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-06-11 12:36:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-06-11 14:55:02 +0300
commit228ba8475a17b2d0d87e5ef1f6b026027c1406cf (patch)
tree5ecf993c9133076a44f8103fd13117389976f78f /source
parent0ec2e7ad53422746e6e39f15d72c0febb77ec630 (diff)
DRW: Add cache reset.
This is a temporary solution to the use of the shared cache. Ideally this cache should be per gl drawing context.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/intern/draw_cache.c11
-rw-r--r--source/blender/draw/intern/draw_cache.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index 36a98d6cec3..a8d2c2a3642 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -112,6 +112,17 @@ void DRW_shape_cache_free(void)
}
}
+void DRW_shape_cache_reset(void)
+{
+ uint i = sizeof(SHC) / sizeof(Gwn_Batch *);
+ Gwn_Batch **batch = (Gwn_Batch **)&SHC;
+ while (i--) {
+ if (*batch) {
+ gwn_batch_vao_cache_clear(*batch);
+ }
+ batch++;
+ }
+}
/* -------------------------------------------------------------------- */
diff --git a/source/blender/draw/intern/draw_cache.h b/source/blender/draw/intern/draw_cache.h
index 871da9203ca..e7ab847d42e 100644
--- a/source/blender/draw/intern/draw_cache.h
+++ b/source/blender/draw/intern/draw_cache.h
@@ -33,6 +33,7 @@ struct Object;
struct PTCacheEdit;
void DRW_shape_cache_free(void);
+void DRW_shape_cache_reset(void);
/* 3D cursor */
struct Gwn_Batch *DRW_cache_cursor_get(bool crosshair_lines);