mirror of
https://github.com/godotengine/godot
synced 2024-10-14 12:14:54 +00:00
Invalidate the previous index array after calling glBindVertexArray, as this call clears the GL_ELEMEMT_ARRAY_BUFFER when changing the state.
Update rasterizer_scene_gles3.cpp Fix white-space to match godotengine checks.
This commit is contained in:
parent
1ac7e5a334
commit
deb2adf4bd
|
@ -2210,10 +2210,13 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
|
||||||
glBindVertexArray(vertex_array_gl);
|
glBindVertexArray(vertex_array_gl);
|
||||||
}
|
}
|
||||||
prev_vertex_array_gl = vertex_array_gl;
|
prev_vertex_array_gl = vertex_array_gl;
|
||||||
|
|
||||||
|
// Invalidate the previous index array
|
||||||
|
prev_index_array_gl = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool use_index_buffer = index_array_gl != 0;
|
bool use_index_buffer = index_array_gl != 0;
|
||||||
if (prev_index_array_gl != index_array_gl || prev_vertex_array_gl != vertex_array_gl) {
|
if (prev_index_array_gl != index_array_gl) {
|
||||||
if (index_array_gl != 0) {
|
if (index_array_gl != 0) {
|
||||||
// Bind index each time so we can use LODs
|
// Bind index each time so we can use LODs
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_array_gl);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_array_gl);
|
||||||
|
|
Loading…
Reference in a new issue