Work around glGenerateMipmap on macOS;

This commit is contained in:
bjorn 2018-09-05 03:48:44 -07:00
parent a5b9d267d0
commit ddba19efad
1 changed files with 8 additions and 0 deletions

View File

@ -1075,7 +1075,15 @@ void lovrTextureReplacePixels(Texture* texture, TextureData* textureData, int x,
}
if (texture->mipmaps) {
#if defined(__APPLE__) || defined(EMSCRIPTEN) // glGenerateMipmap doesn't work on big cubemap textures on macOS
if (texture->type != TEXTURE_CUBE || width < 2048) {
glGenerateMipmap(texture->target);
} else {
glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, 0);
}
#else
glGenerateMipmap(texture->target);
#endif
}
}
}