Remove usage of VAO, which does not work in GLES2
This commit is contained in:
parent
25b98e4842
commit
f3cb236f9d
3 changed files with 7 additions and 12 deletions
|
@ -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);
|
glDrawElements(GL_TRIANGLES, cc->len * 3, GL_UNSIGNED_SHORT, 0);
|
||||||
|
|
||||||
instance = instance->next;
|
instance = instance->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindVertexArray(0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||||
}
|
}
|
||||||
void RasterizerCanvasGLES2::reset_canvas() {
|
void RasterizerCanvasGLES2::reset_canvas() {
|
||||||
|
|
||||||
|
|
|
@ -4247,7 +4247,6 @@ RID RasterizerStorageGLES2::canvas_light_occluder_create() {
|
||||||
co->index_id = 0;
|
co->index_id = 0;
|
||||||
co->vertex_id = 0;
|
co->vertex_id = 0;
|
||||||
co->len = 0;
|
co->len = 0;
|
||||||
glGenVertexArrays(1, &co->array_id);
|
|
||||||
|
|
||||||
return canvas_occluder_owner.make_rid(co);
|
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
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind
|
||||||
|
|
||||||
co->len = lc;
|
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)
|
if (co->vertex_id)
|
||||||
glDeleteBuffers(1, &co->vertex_id);
|
glDeleteBuffers(1, &co->vertex_id);
|
||||||
|
|
||||||
glDeleteVertexArrays(1, &co->array_id);
|
|
||||||
|
|
||||||
canvas_occluder_owner.free(p_rid);
|
canvas_occluder_owner.free(p_rid);
|
||||||
memdelete(co);
|
memdelete(co);
|
||||||
|
|
||||||
|
|
|
@ -1179,7 +1179,6 @@ public:
|
||||||
|
|
||||||
struct CanvasOccluder : public RID_Data {
|
struct CanvasOccluder : public RID_Data {
|
||||||
|
|
||||||
GLuint array_id; // 0 means, unconfigured
|
|
||||||
GLuint vertex_id; // 0 means, unconfigured
|
GLuint vertex_id; // 0 means, unconfigured
|
||||||
GLuint index_id; // 0 means, unconfigured
|
GLuint index_id; // 0 means, unconfigured
|
||||||
PoolVector<Vector2> lines;
|
PoolVector<Vector2> lines;
|
||||||
|
|
Loading…
Reference in a new issue