[Mesa-stable] [Mesa-dev] [PATCH] glsl: Initialize gl_shader_program::EmptyUniformLocations.

Tapani Pälli tapani.palli at intel.com
Tue Mar 1 05:42:46 UTC 2016


Reviewed-by: Tapani Palli <tapani.palli at intel.com>

On 02/29/2016 09:12 PM, Matt Turner wrote:
> Commit 65dfb30 added exec_list EmptyUniformLocations, but only
> initialized the list if ARB_explicit_uniform_location was enabled,
> leading to crashes if the extension was not available.
>
> Cc: "11.2" <mesa-stable at lists.freedesktop.org>
> ---
>   src/compiler/glsl/linker.cpp | 1 -
>   src/mesa/main/shaderobj.c    | 2 ++
>   2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
> index 5326bfd..3039232 100644
> --- a/src/compiler/glsl/linker.cpp
> +++ b/src/compiler/glsl/linker.cpp
> @@ -3180,7 +3180,6 @@ check_explicit_uniform_locations(struct gl_context *ctx,
>         }
>      }
>
> -   exec_list_make_empty(&prog->EmptyUniformLocations);
>      struct empty_uniform_block *current_block = NULL;
>
>      for (unsigned i = 0; i < prog->NumUniformRemapTable; i++) {
> diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
> index 203ccef..9a4eb6b 100644
> --- a/src/mesa/main/shaderobj.c
> +++ b/src/mesa/main/shaderobj.c
> @@ -240,6 +240,8 @@ init_shader_program(struct gl_shader_program *prog)
>
>      prog->TransformFeedback.BufferMode = GL_INTERLEAVED_ATTRIBS;
>
> +   exec_list_make_empty(&prog->EmptyUniformLocations);
> +
>      prog->InfoLog = ralloc_strdup(prog, "");
>   }
>
>


More information about the mesa-stable mailing list