Set index buffer at the right time;

Just a small ordering issue with previous commit.
This commit is contained in:
bjorn 2019-06-29 20:39:01 -07:00
parent 6256acfc6d
commit e3e930d6cc
1 changed files with 4 additions and 4 deletions

View File

@ -702,15 +702,15 @@ void lovrGraphicsFlush() {
if (batch->type == BATCH_MESH) {
lovrMeshSetAttributeEnabled(batch->draw.mesh, "lovrDrawID", batch->params.mesh.instances <= 1);
} else {
if (batch->draw.mesh == state.instancedMesh && batch->draw.instances <= 1) {
batch->draw.mesh = state.mesh;
}
if (batch->indexed) {
lovrMeshSetIndexBuffer(batch->draw.mesh, state.buffers[STREAM_INDEX], bufferCount[STREAM_INDEX], sizeof(uint16_t), 0);
} else {
lovrMeshSetIndexBuffer(batch->draw.mesh, NULL, 0, 0, 0);
}
if (batch->draw.mesh == state.instancedMesh && batch->draw.instances <= 1) {
batch->draw.mesh = state.mesh;
}
}
lovrGpuDraw(&batch->draw);