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:
authorClément Foucault <foucault.clem@gmail.com>2019-05-08 00:21:16 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-08 18:52:48 +0300
commit0030e4da7073d62561cca508330ab150b37ee6eb (patch)
treec1d25b9a92ed3aeb4f9c3bee03e32de7e721a7f4 /source/blender/draw/intern/draw_cache_impl_metaball.c
parent05b0f52aa78344a4a74b816fd1d025aa344ec28c (diff)
DRW: Make batch validation run first during iteration
This reduces the cost of querying the batches to the batch cache.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_metaball.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_metaball.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_metaball.c b/source/blender/draw/intern/draw_cache_impl_metaball.c
index 432c5092274..60f15338412 100644
--- a/source/blender/draw/intern/draw_cache_impl_metaball.c
+++ b/source/blender/draw/intern/draw_cache_impl_metaball.c
@@ -98,12 +98,16 @@ static void metaball_batch_cache_init(MetaBall *mb)
cache->is_manifold = false;
}
-static MetaBallBatchCache *metaball_batch_cache_get(MetaBall *mb)
+void DRW_mball_batch_cache_validate(MetaBall *mb)
{
if (!metaball_batch_cache_valid(mb)) {
metaball_batch_cache_clear(mb);
metaball_batch_cache_init(mb);
}
+}
+
+static MetaBallBatchCache *metaball_batch_cache_get(MetaBall *mb)
+{
return mb->batch_cache;
}