[Mesa-dev] [PATCH v2 07/25] spirv: add double support to SpvOpCompositeExtract
Jason Ekstrand
jason at jlekstrand.net
Mon Jan 2 18:11:19 UTC 2017
On Fri, Dec 16, 2016 at 6:48 AM, Juan A. Suarez Romero <jasuarez at igalia.com>
wrote:
> From: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
>
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
> src/compiler/spirv/spirv_to_nir.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/spirv/spirv_to_nir.c
> b/src/compiler/spirv/spirv_to_nir.c
> index 5126dc9..60cc988 100644
> --- a/src/compiler/spirv/spirv_to_nir.c
> +++ b/src/compiler/spirv/spirv_to_nir.c
> @@ -1166,8 +1166,12 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
> val->constant = *c;
> } else {
> unsigned num_components = glsl_get_vector_elements(type);
> + unsigned bit_size = glsl_get_bit_size(type);
> for (unsigned i = 0; i < num_components; i++)
> - val->constant->values[0].u32[i] =
> (*c)->values[col].u32[elem + i];
> + if (bit_size == 64)
> + val->constant->values[0].u64[i] =
> (*c)->values[col].u64[elem + i];
> + else
>
assert(bit_size == 32);
> + val->constant->values[0].u32[i] =
> (*c)->values[col].u32[elem + i];
> }
> } else {
> struct vtn_value *insert =
> @@ -1177,8 +1181,12 @@ vtn_handle_constant(struct vtn_builder *b, SpvOp
> opcode,
> *c = insert->constant;
> } else {
> unsigned num_components = glsl_get_vector_elements(type);
> + unsigned bit_size = glsl_get_bit_size(type);
> for (unsigned i = 0; i < num_components; i++)
> - (*c)->values[col].u32[elem + i] =
> insert->constant->values[0].u32[i];
> + if (bit_size == 64)
> + (*c)->values[col].u64[elem + i] =
> insert->constant->values[0].u64[i];
> + else
>
same here
> + (*c)->values[col].u32[elem + i] =
> insert->constant->values[0].u32[i];
> }
> }
> break;
> --
> 2.9.3
>
> _______________________________________________
> 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/20170102/adde583f/attachment.html>
More information about the mesa-dev
mailing list