mirror of https://github.com/bjornbytes/lovr.git
Fix primitive restart overflow for u32 indices;
This commit is contained in:
parent
d14af4a79c
commit
40b8b8da7c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue