diff options
author | Ian Romanick <[email protected]> | 2013-01-22 00:23:24 -0500 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-25 09:07:35 -0500 |
commit | 90b1dd03e52d125c95007e174028d17e5a01c336 (patch) | |
tree | d7bd28d805c7b88891a98cc9087e0a33a4d18964 /src/mesa | |
parent | 11d42de681d07884efd7f5b09bd639ee4423093b (diff) |
glsl: Add gl_uniform_buffer_variable::IndexName field
glGetUniformIndices requires that the block instance index not be
present in the name of queried uniforms. However,
gl_uniform_buffer_variable::Name will include the instance index. The
IndexName field is added to handle this difference.
Note that currently IndexName will always point to the same string as
Name. This will change soon.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Carl Worth <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/mtypes.h | 13 | ||||
-rw-r--r-- | src/mesa/main/uniforms.c | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4c7cc6099ca..9078475c623 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2273,6 +2273,19 @@ typedef enum struct gl_uniform_buffer_variable { char *Name; + + /** + * Name of the uniform as seen by glGetUniformIndices. + * + * glGetUniformIndices requires that the block instance index \b not be + * present in the name of queried uniforms. + * + * \note + * \c gl_uniform_buffer_variable::IndexName and + * \c gl_uniform_buffer_variable::Name may point to identical storage. + */ + char *IndexName; + const struct glsl_type *Type; unsigned int Offset; GLboolean RowMajor; diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index 62c85b3c0f5..d902407a077 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -695,7 +695,7 @@ _mesa_GetActiveUniformBlockiv(GLuint program, for (i = 0; i < block->NumUniforms; i++) { unsigned offset; params[i] = _mesa_get_uniform_location(ctx, shProg, - block->Uniforms[i].Name, + block->Uniforms[i].IndexName, &offset); } return; |