Godot Engine – Multi-platform 2D and 3D game engine
Use the element buffer binding point for index buffers when calling mesh_surface_update_index_region
Clay Johncf020f75af0d
diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cppindex 9d8cdc25e07..e61e4215002 100644--- a/drivers/gles3/storage/mesh_storage.cpp+++ b/drivers/gles3/storage/mesh_storage.cpp@@ -591,9 +591,9 @@ void MeshStorage::mesh_surface_update_index_region(RID p_mesh, int p_surface, inERR_FAIL_COND(p_offset + data_size > mesh->surfaces[p_surface]->index_buffer_size);const uint8_t *r = p_data.ptr();- glBindBuffer(GL_ARRAY_BUFFER, mesh->surfaces[p_surface]->index_buffer);- glBufferSubData(GL_ARRAY_BUFFER, p_offset, data_size, r);- glBindBuffer(GL_ARRAY_BUFFER, 0);+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh->surfaces[p_surface]->index_buffer);+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, p_offset, data_size, r);+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);}void MeshStorage::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) {