From: Tapani Pälli Date: Thu, 12 Mar 2015 11:33:25 +0000 (+0200) Subject: mesa: refactor GetActiveUniformBlockName X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45637e9c1f47df8cc8284b39b18f6b5f2e14aae9;p=mesa.git mesa: refactor GetActiveUniformBlockName Use _mesa_get_program_resource_name to get name. Signed-off-by: Tapani Pälli Reviewed-by: Martin Peres --- 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