diff options
author | Luca Rood <dev@lucarood.com> | 2017-07-11 13:52:04 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-07-11 14:03:27 +0300 |
commit | 0a57597aff8c513b1f75e91cfeca3fd04ab9d7b1 (patch) | |
tree | 2dffa18b737bce13845a2b48c146f0179ec6e4b2 /source/blender/draw/intern/draw_cache_impl_mesh.c | |
parent | 64890a62cdce0f5fb11a48b1d51710c13bb5c702 (diff) |
Temporary fix for crash related to VBO update on shader change
This frees the whole mesh batch cache, instead of only the required
parts, as freeing specific parts of a cache is currently causing
crashes.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 66a946ef4a1..ae0e62809bb 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -1599,14 +1599,9 @@ void DRW_mesh_batch_cache_dirty(Mesh *me, int mode) cache->is_really_dirty = true; break; case BKE_MESH_BATCH_DIRTY_SHADING: - GWN_VERTBUF_DISCARD_SAFE(cache->shaded_triangles_data); - if (cache->shaded_triangles) { - for (int i = 0; i < cache->mat_len; ++i) { - GWN_BATCH_DISCARD_SAFE(cache->shaded_triangles[i]); - } - } - - MEM_SAFE_FREE(cache->shaded_triangles); + /* TODO: This should only update UV and tangent data, + * and not free the entire cache. */ + cache->is_really_dirty = true; break; default: BLI_assert(0); |