[Mesa-dev] [PATCH v2 23/24] mesa: refactor GetUniformIndices

Martin Peres martin.peres at linux.intel.com
Mon Apr 13 07:29:48 PDT 2015


On 01/04/15 15:14, Tapani Pälli wrote:
> Use _mesa_program_resource_index to get indices.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>   src/mesa/main/uniforms.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
> index 0c16641..f4de1df 100644
> --- a/src/mesa/main/uniforms.c
> +++ b/src/mesa/main/uniforms.c
> @@ -986,9 +986,9 @@ _mesa_GetUniformIndices(GLuint program,
>      }
>   
>      for (i = 0; i < uniformCount; i++) {
> -      unsigned offset;
> -      uniformIndices[i] = _mesa_get_uniform_location(shProg,
> -						     uniformNames[i], &offset);
> +      struct gl_program_resource *res =
> +         _mesa_program_resource_find_name(shProg, GL_UNIFORM, uniformNames[i]);
> +      uniformIndices[i] = _mesa_program_resource_index(shProg, res);
>      }
>   }
>   

This should indeed be faster

Reviewed-by: Martin Peres <martin.peres at linux.intel.com>


More information about the mesa-dev mailing list