mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 11:01:17 +00:00
Free surface vertex_buffers after vertex_arrays due dependencies
This commit is contained in:
parent
79077e6c10
commit
824ece9d89
1 changed files with 3 additions and 3 deletions
|
|
@ -3578,15 +3578,15 @@ void RendererStorageRD::mesh_instance_set_blend_shape_weight(RID p_mesh_instance
|
||||||
|
|
||||||
void RendererStorageRD::_mesh_instance_clear(MeshInstance *mi) {
|
void RendererStorageRD::_mesh_instance_clear(MeshInstance *mi) {
|
||||||
for (uint32_t i = 0; i < mi->surfaces.size(); i++) {
|
for (uint32_t i = 0; i < mi->surfaces.size(); i++) {
|
||||||
if (mi->surfaces[i].vertex_buffer.is_valid()) {
|
|
||||||
RD::get_singleton()->free(mi->surfaces[i].vertex_buffer);
|
|
||||||
}
|
|
||||||
if (mi->surfaces[i].versions) {
|
if (mi->surfaces[i].versions) {
|
||||||
for (uint32_t j = 0; j < mi->surfaces[i].version_count; j++) {
|
for (uint32_t j = 0; j < mi->surfaces[i].version_count; j++) {
|
||||||
RD::get_singleton()->free(mi->surfaces[i].versions[j].vertex_array);
|
RD::get_singleton()->free(mi->surfaces[i].versions[j].vertex_array);
|
||||||
}
|
}
|
||||||
memfree(mi->surfaces[i].versions);
|
memfree(mi->surfaces[i].versions);
|
||||||
}
|
}
|
||||||
|
if (mi->surfaces[i].vertex_buffer.is_valid()) {
|
||||||
|
RD::get_singleton()->free(mi->surfaces[i].vertex_buffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mi->surfaces.clear();
|
mi->surfaces.clear();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue