mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 16:18:06 +02:00
mesa: refactor GetUniformBlockIndex
Use _mesa_program_resource_index to get index. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
This commit is contained in:
parent
1b256eb0ec
commit
7c154bbe60
1 changed files with 6 additions and 6 deletions
|
|
@ -938,7 +938,6 @@ _mesa_GetUniformBlockIndex(GLuint program,
|
|||
const GLchar *uniformBlockName)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint i;
|
||||
struct gl_shader_program *shProg;
|
||||
|
||||
if (!ctx->Extensions.ARB_uniform_buffer_object) {
|
||||
|
|
@ -951,12 +950,13 @@ _mesa_GetUniformBlockIndex(GLuint program,
|
|||
if (!shProg)
|
||||
return GL_INVALID_INDEX;
|
||||
|
||||
for (i = 0; i < shProg->NumUniformBlocks; i++) {
|
||||
if (!strcmp(shProg->UniformBlocks[i].Name, uniformBlockName))
|
||||
return i;
|
||||
}
|
||||
struct gl_program_resource *res =
|
||||
_mesa_program_resource_find_name(shProg, GL_UNIFORM_BLOCK,
|
||||
uniformBlockName);
|
||||
if (!res)
|
||||
return GL_INVALID_INDEX;
|
||||
|
||||
return GL_INVALID_INDEX;
|
||||
return _mesa_program_resource_index(shProg, res);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue