diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 00:21:16 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 18:52:48 +0300 |
commit | 0030e4da7073d62561cca508330ab150b37ee6eb (patch) | |
tree | c1d25b9a92ed3aeb4f9c3bee03e32de7e721a7f4 /source/blender/draw/intern/draw_cache_impl_curve.c | |
parent | 05b0f52aa78344a4a74b816fd1d025aa344ec28c (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_curve.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_curve.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index a417d64cf41..663fbf647a6 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -474,12 +474,16 @@ static void curve_batch_cache_init(Curve *cu) cache->is_dirty = false; } -static CurveBatchCache *curve_batch_cache_get(Curve *cu) +void DRW_curve_batch_cache_validate(Curve *cu) { if (!curve_batch_cache_valid(cu)) { curve_batch_cache_clear(cu); curve_batch_cache_init(cu); } +} + +static CurveBatchCache *curve_batch_cache_get(Curve *cu) +{ return cu->batch_cache; } |