[core] Make attribute binding more similar to uniform binding

This commit is contained in:
John Firebaugh
2016-10-29 14:51:07 -07:00
parent 687ee1e1c9
commit 36210fe4e9
60 changed files with 544 additions and 524 deletions

View File

@@ -486,17 +486,7 @@ void Context::draw(const Drawable& drawable) {
if (needAttributeBindings()) {
vertexBuffer = drawable.vertexBuffer;
elementBuffer = drawable.indexBuffer;
for (const auto& binding : drawable.attributeBindings) {
MBGL_CHECK_ERROR(glEnableVertexAttribArray(binding.location));
MBGL_CHECK_ERROR(glVertexAttribPointer(
binding.location,
binding.count,
static_cast<GLenum>(binding.type),
GL_FALSE,
static_cast<GLsizei>(drawable.vertexSize),
reinterpret_cast<GLvoid*>(binding.offset + (drawable.vertexSize * segment.vertexOffset))));
}
drawable.bindAttributes(segment.vertexOffset);
}
if (drawable.indexBuffer) {