diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-16 17:46:14 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-17 19:05:57 +0300 |
commit | 9bb70e59b89423070c065f6b120b563bad47113b (patch) | |
tree | 9f855014adfb262492c4b52d49670ae93e617077 /source/blender | |
parent | 36cc42e79673bb15afeacdb674d925d8f8140046 (diff) |
Curve Batch Cache: Fix issue with cd_used
cd_used needs to be the combination of generated data.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_curve.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index f8508a54661..ecdbdcf094f 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -909,7 +909,10 @@ void DRW_curve_batch_cache_create_requested(Object *ob) memset(cache->surf_per_mat[i], 0, sizeof(*cache->surf_per_mat[i])); } } - cache->cd_used = cache->cd_needed; + if ((cache->cd_used & cache->cd_needed) != cache->cd_needed) { + cache->cd_used |= cache->cd_needed; + cache->cd_needed = 0; + } /* Init batches and request VBOs & IBOs */ if (DRW_batch_requested(cache->batch.surfaces, GPU_PRIM_TRIS)) { @@ -1021,14 +1024,14 @@ void DRW_curve_batch_cache_create_requested(Object *ob) curve_create_edit_curves_nor(rdata, cache->edit.curves_nor); } + curve_render_data_free(rdata); + #ifdef DEBUG /* Make sure all requested batches have been setup. */ for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) { BLI_assert(!DRW_batch_requested(((GPUBatch **)&cache->batch)[i], 0)); } #endif - - curve_render_data_free(rdata); } /** \} */ |