[Mesa-dev] [PATCH] nir/search: Include 8 and 16-bit support in construct_value

Jason Ekstrand jason at jlekstrand.net
Thu Mar 1 17:15:50 UTC 2018


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

I think they make sense as two separate patches.  I've updated my patch
title to say that it's only for match_value and I'll push both once Jenkins
is done with them.

On Thu, Mar 1, 2018 at 9:06 AM, Jose Maria Casanova Crespo <
jmcasanova at igalia.com> wrote:

> ---
>  src/compiler/nir/nir_search.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
> index c7c52ae320d..28b36b2b863 100644
> --- a/src/compiler/nir/nir_search.c
> +++ b/src/compiler/nir/nir_search.c
> @@ -525,6 +525,9 @@ construct_value(const nir_search_value *value,
>        case nir_type_float:
>           load->def.name = ralloc_asprintf(load, "%f", c->data.d);
>           switch (bitsize->dest_size) {
> +         case 16:
> +            load->value.u16[0] = _mesa_float_to_half(c->data.d);
> +            break;
>           case 32:
>              load->value.f32[0] = c->data.d;
>              break;
> @@ -539,6 +542,12 @@ construct_value(const nir_search_value *value,
>        case nir_type_int:
>           load->def.name = ralloc_asprintf(load, "%" PRIi64, c->data.i);
>           switch (bitsize->dest_size) {
> +         case 8:
> +            load->value.i8[0] = c->data.i;
> +            break;
> +         case 16:
> +            load->value.i16[0] = c->data.i;
> +            break;
>           case 32:
>              load->value.i32[0] = c->data.i;
>              break;
> @@ -553,6 +562,12 @@ construct_value(const nir_search_value *value,
>        case nir_type_uint:
>           load->def.name = ralloc_asprintf(load, "%" PRIu64, c->data.u);
>           switch (bitsize->dest_size) {
> +         case 8:
> +            load->value.u8[0] = c->data.u;
> +            break;
> +         case 16:
> +            load->value.u16[0] = c->data.u;
> +            break;
>           case 32:
>              load->value.u32[0] = c->data.u;
>              break;
> --
> 2.14.3
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180301/2c82fcee/attachment.html>


More information about the mesa-dev mailing list