[Mesa-dev] [PATCH] glsl/ast: update rhs in addition to the var's constant_value

Kenneth Graunke kenneth at whitecape.org
Wed Aug 16 01:43:48 UTC 2017


On Tuesday, August 15, 2017 10:47:08 AM PDT Ilia Mirkin wrote:
> We continue in the code to do some more things with the rhs, including
> setting a constant initializer. If the type is wrong, this causes some
> confusion down the line, leading to assertions. This makes sure that the
> rhs processing continues to flow as-if the type was correct to start
> with (even though the state has been marked as an error state).
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101766
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/compiler/glsl/ast_to_hir.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index c338ad79ca..5181708852 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -4495,7 +4495,7 @@ process_initializer(ir_variable *var, ast_declaration *decl,
>        } else {
>           if (var->type->is_numeric()) {
>              /* Reduce cascading errors. */
> -            var->constant_value = type->qualifier.flags.q.constant
> +            rhs = var->constant_value = type->qualifier.flags.q.constant
>                 ? ir_constant::zero(state, var->type) : NULL;
>           }
>        }
> 

Looks good to me, thanks!

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170815/6bdeff44/attachment-0001.sig>


More information about the mesa-dev mailing list