diff options
author | marha <marha@users.sourceforge.net> | 2014-11-29 12:44:10 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-11-29 12:44:10 +0100 |
commit | 0dbe845b2f4ba08924d6fcb9634d09dc3dde13d6 (patch) | |
tree | 4fc0c706447f18bc522bb503273ec9e10f6c2ba5 /mesalib/src/mesa/main/uniforms.c | |
parent | d17578910169acabae7e67a3da8f26b5ed608ce6 (diff) | |
parent | d6d5581d5fba846c8476ad4d593da662306765d7 (diff) | |
download | vcxsrv-0dbe845b2f4ba08924d6fcb9634d09dc3dde13d6.tar.gz vcxsrv-0dbe845b2f4ba08924d6fcb9634d09dc3dde13d6.tar.bz2 vcxsrv-0dbe845b2f4ba08924d6fcb9634d09dc3dde13d6.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
xorg-server/hw/xwin/winclip.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winfont.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winwindow.c
Diffstat (limited to 'mesalib/src/mesa/main/uniforms.c')
-rw-r--r-- | mesalib/src/mesa/main/uniforms.c | 22 |
1 files changed, 18 insertions, 4 deletions
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); |