Skip to content

Commit

Permalink
Merge pull request #73524 from clayjohn/GL-occluder
Browse files Browse the repository at this point in the history
Avoid unnecessary binding of occlusion polygon vertex array
  • Loading branch information
akien-mga authored Feb 18, 2023
2 parents 1f4f73f + 5bbf5b8 commit 37589ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gles3/rasterizer_canvas_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1951,11 +1951,12 @@ void RasterizerCanvasGLES3::occluder_polygon_set_shape(RID p_occluder, const Vec
glBufferData(GL_ELEMENT_ARRAY_BUFFER, 3 * lc * sizeof(uint16_t), indices.ptr(), GL_STATIC_DRAW);
glBindVertexArray(0);
} else {
glBindVertexArray(oc->vertex_array);
glBindBuffer(GL_ARRAY_BUFFER, oc->vertex_buffer);
glBufferData(GL_ARRAY_BUFFER, lc * 6 * sizeof(float), geometry.ptr(), GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, oc->index_buffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, 3 * lc * sizeof(uint16_t), indices.ptr(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
}

Expand Down

0 comments on commit 37589ed

Please sign in to comment.