Remove usage of VAO, which does not work in GLES2

This commit is contained in:
Juan Linietsky 2018-12-20 17:27:40 -03:00
parent 25b98e4842
commit f3cb236f9d
3 changed files with 7 additions and 12 deletions

View File

@ -1368,14 +1368,19 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons
}
}
glBindVertexArray(cc->array_id);
glBindBuffer(GL_ARRAY_BUFFER, cc->vertex_id);
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cc->index_id);
glDrawElements(GL_TRIANGLES, cc->len * 3, GL_UNSIGNED_SHORT, 0);
instance = instance->next;
}
}
glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
void RasterizerCanvasGLES2::reset_canvas() {

View File

@ -4247,7 +4247,6 @@ RID RasterizerStorageGLES2::canvas_light_occluder_create() {
co->index_id = 0;
co->vertex_id = 0;
co->len = 0;
glGenVertexArrays(1, &co->array_id);
return canvas_occluder_owner.make_rid(co);
}
@ -4342,12 +4341,6 @@ void RasterizerStorageGLES2::canvas_light_occluder_set_polylines(RID p_occluder,
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind
co->len = lc;
glBindVertexArray(co->array_id);
glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id);
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id);
glBindVertexArray(0);
}
}
@ -4570,8 +4563,6 @@ bool RasterizerStorageGLES2::free(RID p_rid) {
if (co->vertex_id)
glDeleteBuffers(1, &co->vertex_id);
glDeleteVertexArrays(1, &co->array_id);
canvas_occluder_owner.free(p_rid);
memdelete(co);

View File

@ -1179,7 +1179,6 @@ public:
struct CanvasOccluder : public RID_Data {
GLuint array_id; // 0 means, unconfigured
GLuint vertex_id; // 0 means, unconfigured
GLuint index_id; // 0 means, unconfigured
PoolVector<Vector2> lines;