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_lattice.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_lattice.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_lattice.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c
index b5223bc047c..8b3864684b5 100644
--- a/source/blender/draw/intern/draw_cache_impl_lattice.c
+++ b/source/blender/draw/intern/draw_cache_impl_lattice.c
@@ -340,12 +340,16 @@ static void lattice_batch_cache_init(Lattice *lt)
cache->is_dirty = false;
}
-static LatticeBatchCache *lattice_batch_cache_get(Lattice *lt)
+void DRW_lattice_batch_cache_validate(Lattice *lt)
{
if (!lattice_batch_cache_valid(lt)) {
lattice_batch_cache_clear(lt);
lattice_batch_cache_init(lt);
}
+}
+
+static LatticeBatchCache *lattice_batch_cache_get(Lattice *lt)
+{
return lt->batch_cache;
}