[Mesa-dev] [PATCH 03/22] mesa/main: add NULL name check when searching for a resource name

Timothy Arceri tarceri at itsqueeze.com
Thu May 3 02:36:09 UTC 2018


Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 18/04/18 00:36, Alejandro PiƱeiro wrote:
> Since ARB_gl_spirv name reflection can be missing. piglit
> shader_runner does several resource checking, so this commit is useful
> to get even the more simple piglit tests running without crashing on
> SPIR-V mode.
> ---
>   src/mesa/main/shader_query.cpp | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
> index 86064a98b97..11ecd71c575 100644
> --- a/src/mesa/main/shader_query.cpp
> +++ b/src/mesa/main/shader_query.cpp
> @@ -533,6 +533,11 @@ _mesa_program_resource_find_name(struct gl_shader_program *shProg,
>   
>         /* Resource basename. */
>         const char *rname = _mesa_program_resource_name(res);
> +
> +      /* Since ARB_gl_spirv lack of name reflections is a possibility */
> +      if (rname == NULL)
> +         continue;
> +
>         unsigned baselen = strlen(rname);
>         unsigned baselen_without_array_index = baselen;
>         const char *rname_last_square_bracket = strrchr(rname, '[');
> 


More information about the mesa-dev mailing list