Mute errors on surface->index_array_len == 0 in the GLES3 renderer

This error is generated whenever rendering collision debug meshes.
There's no reason why this should be treated as an error as index-less
meshes are supported and used across the engine.

(cherry picked from commit 1dd98baaa6)
This commit is contained in:
Daniel Rakos 2019-01-12 15:44:20 +01:00 committed by Rémi Verschelde
parent 3433017354
commit 618290ba46
1 changed files with 17 additions and 15 deletions

View File

@ -3771,10 +3771,10 @@ PoolVector<uint8_t> RasterizerStorageGLES3::mesh_surface_get_index_array(RID p_m
Surface *surface = mesh->surfaces[p_surface]; Surface *surface = mesh->surfaces[p_surface];
ERR_FAIL_COND_V(surface->index_array_len == 0, PoolVector<uint8_t>());
PoolVector<uint8_t> ret; PoolVector<uint8_t> ret;
ret.resize(surface->index_array_byte_size); ret.resize(surface->index_array_byte_size);
if (surface->index_array_byte_size > 0) {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_id); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_id);
#if defined(GLES_OVER_GL) || defined(__EMSCRIPTEN__) #if defined(GLES_OVER_GL) || defined(__EMSCRIPTEN__)
@ -3793,6 +3793,8 @@ PoolVector<uint8_t> RasterizerStorageGLES3::mesh_surface_get_index_array(RID p_m
#endif #endif
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
return ret; return ret;
} }