summaryrefslogtreecommitdiff
path: root/drivers/gles3/rasterizer_scene_gles3.cpp
diff options
context:
space:
mode:
authorMalcolm Nixon <Malcolm.nixon@gmail.com>2022-12-10 10:08:01 -0500
committerMalcolm Nixon <Malcolm.nixon@gmail.com>2022-12-10 10:28:17 -0500
commitdeb2adf4bd2258bfcef7892e3672983711eed4ab (patch)
treefc364f8bfe00b9205d118f08c4a0bfe2484d2aad /drivers/gles3/rasterizer_scene_gles3.cpp
parent1ac7e5a3343ef9f4ecc7c494f7212b7c718520c8 (diff)
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.
Diffstat (limited to 'drivers/gles3/rasterizer_scene_gles3.cpp')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 247b89658a..b75fdf5f71 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2210,10 +2210,13 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
glBindVertexArray(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;
- 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) {
// Bind index each time so we can use LODs
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_array_gl);