From d6d5581d5fba846c8476ad4d593da662306765d7 Mon Sep 17 00:00:00 2001 From: marha Date: Sat, 25 Oct 2014 19:53:22 +0200 Subject: libXft mesa xserver pixman xkeyboard-config git update 25 Oct 2014 xserver commit 16a32c53f6e9ad1f3284d4596edfa33e9efb740e xkeyboard-config commit 0d4c3d9d891536aa1ec4f1fff5e3df51cfd2718d pixman commit 594e6a6c93e92fcfb495e987aec5617f6c37f467 libXft commit e8a83226bc10afb587f6f34daac44d2ef809c85e mesa commit 13862812dc910a4ef57cb72cb9fe777ce3c14515 --- mesalib/src/mesa/main/uniforms.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'mesalib/src/mesa/main/uniforms.c') diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c index 0d0cbf57e..c30710772 100644 --- a/mesalib/src/mesa/main/uniforms.c +++ b/mesalib/src/mesa/main/uniforms.c @@ -75,12 +75,26 @@ _mesa_update_shader_textures_used(struct gl_shader_program *shProg, memcpy(prog->SamplerUnits, shader->SamplerUnits, sizeof(prog->SamplerUnits)); memset(prog->TexturesUsed, 0, sizeof(prog->TexturesUsed)); + shProg->SamplersValidated = GL_TRUE; + for (s = 0; s < MAX_SAMPLERS; s++) { if (prog->SamplersUsed & (1 << s)) { GLuint unit = shader->SamplerUnits[s]; GLuint tgt = shader->SamplerTargets[s]; assert(unit < Elements(prog->TexturesUsed)); assert(tgt < NUM_TEXTURE_TARGETS); + + /* The types of the samplers associated with a particular texture + * unit must be an exact match. Page 74 (page 89 of the PDF) of the + * OpenGL 3.3 core spec says: + * + * "It is not allowed to have variables of different sampler + * types pointing to the same texture image unit within a program + * object." + */ + if (prog->TexturesUsed[unit] & ~(1 << tgt)) + shProg->SamplersValidated = GL_FALSE; + prog->TexturesUsed[unit] |= (1 << tgt); } } @@ -917,7 +931,7 @@ _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name) return -1; } - index = _mesa_get_uniform_location(ctx, shProg, name, &offset); + index = _mesa_get_uniform_location(shProg, name, &offset); if (index == GL_INVALID_INDEX) return -1; @@ -990,7 +1004,7 @@ _mesa_GetUniformIndices(GLuint program, for (i = 0; i < uniformCount; i++) { unsigned offset; - uniformIndices[i] = _mesa_get_uniform_location(ctx, shProg, + uniformIndices[i] = _mesa_get_uniform_location(shProg, uniformNames[i], &offset); } } @@ -1096,7 +1110,7 @@ _mesa_GetActiveUniformBlockiv(GLuint program, for (i = 0; i < block->NumUniforms; i++) { unsigned offset; const int idx = - _mesa_get_uniform_location(ctx, shProg, + _mesa_get_uniform_location(shProg, block->Uniforms[i].IndexName, &offset); if (idx != -1) @@ -1113,7 +1127,7 @@ _mesa_GetActiveUniformBlockiv(GLuint program, for (i = 0; i < block->NumUniforms; i++) { unsigned offset; const int idx = - _mesa_get_uniform_location(ctx, shProg, + _mesa_get_uniform_location(shProg, block->Uniforms[i].IndexName, &offset); -- cgit v1.2.3