Skip to content

Commit

Permalink
Put the vertex sampler offset firmly at TEXTURE16
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Apr 27, 2020
1 parent 2a5c99e commit c136bde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mojoshader_opengl.c
Expand Up @@ -1721,7 +1721,12 @@ MOJOSHADER_glContext *MOJOSHADER_glCreateContext(const char *profile,
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

Expand Down

0 comments on commit c136bde

Please sign in to comment.