aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-08-11 21:22:25 +0200
committermarha <marha@users.sourceforge.net>2014-08-11 21:22:25 +0200
commit8e27619ab489dece35cc4bec86950ee7729cd309 (patch)
treeab59dbc661e00c12ed4777cf9d0d37393c4163aa /mesalib/src/mesa/main/uniforms.c
parentffc99ce2402fe5c9a6eb8fcf193e8e9472fd993b (diff)
parentfdbedba4d50e1b28b0249c83ba11c029f096e400 (diff)
downloadvcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.gz
vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.tar.bz2
vcxsrv-8e27619ab489dece35cc4bec86950ee7729cd309.zip
Merge remote-tracking branch 'origin/released'
Conflicts: libxcb/src/c_client.py mesalib/include/GL/glext.h mesalib/include/GL/glxext.h mesalib/src/glsl/.gitignore mesalib/src/mesa/drivers/dri/common/xmlconfig.h mesalib/src/mesa/main/.gitignore xorg-server/Xext/xvmain.c xorg-server/dix/dispatch.c xorg-server/hw/xfree86/common/compiler.h
Diffstat (limited to 'mesalib/src/mesa/main/uniforms.c')
-rw-r--r--mesalib/src/mesa/main/uniforms.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/uniforms.c b/mesalib/src/mesa/main/uniforms.c
index f450173af..0d0cbf57e 100644
--- a/mesalib/src/mesa/main/uniforms.c
+++ b/mesalib/src/mesa/main/uniforms.c
@@ -932,7 +932,8 @@ _mesa_GetUniformLocation(GLuint programObj, const GLcharARB *name)
shProg->UniformStorage[index].atomic_buffer_index != -1)
return -1;
- return _mesa_uniform_merge_location_offset(shProg, index, offset);
+ /* location in remap table + array element offset */
+ return shProg->UniformStorage[index].remap_location + offset;
}
GLuint GLAPIENTRY
@@ -1089,18 +1090,38 @@ _mesa_GetActiveUniformBlockiv(GLuint program,
params[0] = strlen(block->Name) + 1;
return;
- case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
- params[0] = block->NumUniforms;
+ case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: {
+ unsigned count = 0;
+
+ for (i = 0; i < block->NumUniforms; i++) {
+ unsigned offset;
+ const int idx =
+ _mesa_get_uniform_location(ctx, shProg,
+ block->Uniforms[i].IndexName,
+ &offset);
+ if (idx != -1)
+ count++;
+ }
+
+ params[0] = count;
return;
+ }
+
+ case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: {
+ unsigned count = 0;
- case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:
for (i = 0; i < block->NumUniforms; i++) {
unsigned offset;
- params[i] = _mesa_get_uniform_location(ctx, shProg,
- block->Uniforms[i].IndexName,
- &offset);
+ const int idx =
+ _mesa_get_uniform_location(ctx, shProg,
+ block->Uniforms[i].IndexName,
+ &offset);
+
+ if (idx != -1)
+ params[count++] = idx;
}
return;
+ }
case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
params[0] = shProg->UniformBlockStageIndex[MESA_SHADER_VERTEX][uniformBlockIndex] != -1;