[Mesa-dev] [PATCH] glsl: don't try to lower non-gl builtins as if they were gl_FragData

Marek Olšák maraeo at gmail.com
Sat Jul 2 12:25:27 UTC 2016


Cc stable?

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Sat, Jul 2, 2016 at 1:13 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> If a shader has an output array, it will get treated as though it were
> gl_FragData and rewritten into gl_out_FragData instances. We only want
> this to happen on the actual gl_FragData and not everything else.
>
> This is a small part of the problem pointed out by the below bug.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96765
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/compiler/glsl/opt_dead_builtin_varyings.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/opt_dead_builtin_varyings.cpp b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
> index 7feea3b..a28887f 100644
> --- a/src/compiler/glsl/opt_dead_builtin_varyings.cpp
> +++ b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
> @@ -85,7 +85,8 @@ public:
>     {
>        ir_variable *var = ir->variable_referenced();
>
> -      if (!var || var->data.mode != this->mode || !var->type->is_array())
> +      if (!var || var->data.mode != this->mode || !var->type->is_array() ||
> +          !is_gl_identifier(var->name))
>           return visit_continue;
>
>        /* Only match gl_FragData[], not gl_SecondaryFragDataEXT[] */
> --
> 2.7.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list