[Mesa-dev] [PATCH 7/8] nir/spirv: cast shift operand to u32

Jason Ekstrand jason at jlekstrand.net
Mon Jul 16 15:24:14 UTC 2018


Do we need to do something similar for specialization constants?

On Mon, Jul 16, 2018 at 7:28 AM Karol Herbst <kherbst at redhat.com> wrote:

> Signed-off-by: Karol Herbst <kherbst at redhat.com>
> ---
>  src/compiler/spirv/vtn_alu.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c
> index 5db6c7f0a87..d6f149d12e9 100644
> --- a/src/compiler/spirv/vtn_alu.c
> +++ b/src/compiler/spirv/vtn_alu.c
> @@ -743,6 +743,16 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
>           src[1] = tmp;
>        }
>
> +      switch (op) {
> +      case nir_op_ishl:
> +      case nir_op_ishr:
> +      case nir_op_ushr:
> +         src[1] = nir_u2u32(&b->nb, src[1]);
> +         break;
> +      default:
> +         break;
> +      }
> +
>        val->ssa->def = nir_build_alu(&b->nb, op, src[0], src[1], src[2],
> src[3]);
>        break;
>     } /* default */
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180716/19acecbf/attachment.html>


More information about the mesa-dev mailing list