diff options
author | Tapani Pälli <[email protected]> | 2015-03-12 13:33:25 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2015-04-16 07:55:57 +0300 |
commit | 45637e9c1f47df8cc8284b39b18f6b5f2e14aae9 (patch) | |
tree | 315a6c169ded26f6b3898219123fb06e7a24e1b9 | |
parent | 284003e1f1b84f165f2cffdcec47bee972b12a8d (diff) |
mesa: refactor GetActiveUniformBlockName
Use _mesa_get_program_resource_name to get name.
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Martin Peres <[email protected]>
-rw-r--r-- | src/mesa/main/uniforms.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c index 078e433ec47..8872344e7bc 100644 --- a/src/mesa/main/uniforms.c +++ b/src/mesa/main/uniforms.c @@ -1168,7 +1168,6 @@ _mesa_GetActiveUniformBlockName(GLuint program, { GET_CURRENT_CONTEXT(ctx); struct gl_shader_program *shProg; - struct gl_uniform_block *block; if (!ctx->Extensions.ARB_uniform_buffer_object) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetActiveUniformBlockiv"); @@ -1187,18 +1186,11 @@ _mesa_GetActiveUniformBlockName(GLuint program, if (!shProg) return; - if (uniformBlockIndex >= shProg->NumUniformBlocks) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetActiveUniformBlockiv(block index %u >= %u)", - uniformBlockIndex, shProg->NumUniformBlocks); - return; - } - - block = &shProg->UniformBlocks[uniformBlockIndex]; - - if (uniformBlockName) { - _mesa_copy_string(uniformBlockName, bufSize, length, block->Name); - } + if (uniformBlockName) + _mesa_get_program_resource_name(shProg, GL_UNIFORM_BLOCK, + uniformBlockIndex, bufSize, length, + uniformBlockName, + "glGetActiveUniformBlockName"); } void GLAPIENTRY |