diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-02-18 16:19:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-18 16:19:44 +0100 |
commit | 37589edf17320312ed7531261bd633ed7c5563a1 (patch) | |
tree | 99fedb03bf587f76b72616ff51f7b8005994bf17 /drivers | |
parent | 1f4f73f8602f61ef43d3dc0b99bedd1614e48283 (diff) | |
parent | 5bbf5b8e720dc65cec8f38c6a9ced1e2eec84d17 (diff) |
Merge pull request #73524 from clayjohn/GL-occluder
Avoid unnecessary binding of occlusion polygon vertex array
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 2a524e8c3a..aadc71c5b8 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -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); } } |