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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user