Fix primitive restart overflow for u32 indices;
@@ -491,8 +491,8 @@ static void lovrGpuBindMesh(Mesh* mesh, Shader* shader, int divisorMultiplier) {
if (mesh->indexBuffer && mesh->indexCount > 0) {
lovrGpuBindBuffer(BUFFER_INDEX, mesh->indexBuffer->id);
lovrBufferFlush(mesh->indexBuffer);
-#ifdef LOVR_GL
- uint32_t primitiveRestart = (1 << (mesh->indexSize * 8)) - 1;
+#ifndef LOVR_GL
+ uint32_t primitiveRestart = mesh->indexSize == 4 ? 0xffffffff : 0xffff;
if (state.primitiveRestart != primitiveRestart) {
state.primitiveRestart = primitiveRestart;
glPrimitiveRestartIndex(primitiveRestart);
