Skip to content
Snippets Groups Projects
Commit 30e57ba0 authored by Alexander Rose's avatar Alexander Rose
Browse files

bind elements buffer explicitely as it is not always recorded in the VAO

parent 6d14579a
No related branches found
No related tags found
No related merge requests found
......@@ -117,9 +117,11 @@ export function createRenderItem(ctx: Context, drawMode: DrawMode, shaderCode: S
program.setUniforms(uniformValues)
if (oesVertexArrayObject && vertexArray) {
oesVertexArrayObject.bindVertexArrayOES(vertexArray)
// TODO need to bind elements buffer explicitely since it is not always recorded in the VAO
if (elementsBuffer) elementsBuffer.bind()
} else {
program.bindAttributes(attributeBuffers)
if (elementsBuffer) elementsBuffer.bind()
program.bindAttributes(attributeBuffers)
}
program.bindTextures(textures)
if (elementsBuffer) {
......
......@@ -14,8 +14,8 @@ export function createVertexArray(ctx: Context, program: Program, attributeBuffe
if (oesVertexArrayObject) {
vertexArray = oesVertexArrayObject.createVertexArrayOES()
oesVertexArrayObject.bindVertexArrayOES(vertexArray)
program.bindAttributes(attributeBuffers)
if (elementsBuffer) elementsBuffer.bind()
program.bindAttributes(attributeBuffers)
ctx.vaoCount += 1
oesVertexArrayObject.bindVertexArrayOES(null!)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment