[Mesa-stable] [Mesa-dev] [PATCH] st/mesa: fix up result_src.type when doing i2u/u2i conversions

Kenneth Graunke kenneth at whitecape.org
Tue Feb 16 08:31:31 UTC 2016


On Tuesday, February 16, 2016 2:13:59 AM PST Ilia Mirkin wrote:
> Even though it's a no-op, it's important to keep track of the type so
> that we can pick the properly-signed op later on.
> 
> This fixes dEQP-GLES3.functional.shaders.precision.uint.highp_div_fragment,
> which ended up using IDIV instead of UDIV.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/
state_tracker/st_glsl_to_tgsi.cpp
> index db00fbd..943582d 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -1979,6 +1979,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
>     case ir_unop_u2i:
>        /* Converting between signed and unsigned integers is a no-op. */
>        result_src = op[0];
> +      result_src.type = result_dst.type;
>        break;
>     case ir_unop_b2i:
>        if (native_integers) {
> 

Good catch!  result_src and result_dst both have the type of the
expression result (i.e. unsigned for i2u), and that's what we want
for the result.  Not the operand type.

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


More information about the mesa-stable mailing list