Put the vertex sampler offset firmly at TEXTURE16
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Sun, 26 Apr 2020 22:35:13 -0400
changeset 1251 cee4402d5ab8
parent 1250 30f8b128b906
child 1252 ed07dd994125
Put the vertex sampler offset firmly at TEXTURE16
mojoshader_opengl.c
--- 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