--- a/mojoshader_opengl.c Sun Apr 26 10:02:35 2020 -0700
+++ b/mojoshader_opengl.c Sun Apr 26 22:35:13 2020 -0400
@@ -1721,7 +1721,12 @@
GLint maxTextures;
GLint maxVertexTextures;
ctx->glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextures);
- maxVertexTextures = ((maxTextures - 16) < 4) ? (maxTextures - 16) : 4;
+ if (maxTextures > 20)
+ maxTextures = 20;
+ if (maxTextures > 16)
+ maxVertexTextures = maxTextures - 16;
+ else
+ maxVertexTextures = 0;
ctx->vertex_sampler_offset = maxTextures - maxVertexTextures;
#endif