[Mesa-dev] [PATCH 1/2] linker: Wrap access of producer_var with a NULL check

Jordan Justen jordan.l.justen at intel.com
Mon Dec 1 17:25:21 PST 2014


On 2014-12-01 15:46:10, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> producer_var could be NULL if consumer_var is not NULL and
> consumer_is_fs is false.  This will occur when the procuder is NULL and

typo: procuder

Series Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

> the consumer is the geometry shader for a program that contains only a
> geometry shader.  This will occur starting with the next patch.
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: pavol at klacansky.com
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
> ---
>  src/glsl/link_varyings.cpp | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> index 1866ab2..43da2c6 100644
> --- a/src/glsl/link_varyings.cpp
> +++ b/src/glsl/link_varyings.cpp
> @@ -835,9 +835,11 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
>         * regardless of where they appear.  We can trivially satisfy that
>         * requirement by changing the interpolation type to flat here.
>         */
> -      producer_var->data.centroid = false;
> -      producer_var->data.sample = false;
> -      producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
> +      if (producer_var) {
> +         producer_var->data.centroid = false;
> +         producer_var->data.sample = false;
> +         producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
> +      }
>  
>        if (consumer_var) {
>           consumer_var->data.centroid = false;
> -- 
> 1.8.1.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list