Merge pull request #73524 from clayjohn/GL-occluder

Avoid unnecessary binding of occlusion polygon vertex array
This commit is contained in:
Rémi Verschelde 2023-02-18 16:19:44 +01:00 committed by GitHub
commit 37589edf17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}
}