<p dir="ltr"><br>
On Apr 12, 2016 1:06 AM, "Samuel Iglesias Gonsálvez" <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>> wrote:<br>
><br>
> Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
> ---<br>
>  src/compiler/nir/nir_builder.h             | 15 ++++++++-------<br>
>  src/compiler/nir/nir_lower_system_values.c |  2 +-<br>
>  src/compiler/nir/nir_lower_tex.c           |  2 +-<br>
>  3 files changed, 10 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h<br>
> index 38a1cf7..84fc9bf 100644<br>
> --- a/src/compiler/nir/nir_builder.h<br>
> +++ b/src/compiler/nir/nir_builder.h<br>
> @@ -89,10 +89,11 @@ nir_ssa_undef(nir_builder *build, unsigned num_components, unsigned bit_size)<br>
>  }<br>
><br>
>  static inline nir_ssa_def *<br>
> -nir_build_imm(nir_builder *build, unsigned num_components, nir_const_value value)<br>
> +nir_build_imm(nir_builder *build, unsigned num_components,<br>
> +              nir_const_value value, unsigned bit_size)</p>
<p dir="ltr">Quick fly-by comment: can we keep num_components and bit_size together and leave value as the last argument. The two sizes are kind of a logical pair and them being separated be the value parameter seems wrong.</p>
<p dir="ltr">>  {<br>
>     nir_load_const_instr *load_const =<br>
> -      nir_load_const_instr_create(build->shader, num_components, 32);<br>
> +      nir_load_const_instr_create(build->shader, num_components, bit_size);<br>
>     if (!load_const)<br>
>        return NULL;<br>
><br>
> @@ -111,7 +112,7 @@ nir_imm_float(nir_builder *build, float x)<br>
>     memset(&v, 0, sizeof(v));<br>
>     v.f32[0] = x;<br>
><br>
> -   return nir_build_imm(build, 1, v);<br>
> +   return nir_build_imm(build, 1, v, 32);<br>
>  }<br>
><br>
>  static inline nir_ssa_def *<br>
> @@ -125,7 +126,7 @@ nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)<br>
>     v.f32[2] = z;<br>
>     v.f32[3] = w;<br>
><br>
> -   return nir_build_imm(build, 4, v);<br>
> +   return nir_build_imm(build, 4, v, 32);<br>
>  }<br>
><br>
>  static inline nir_ssa_def *<br>
> @@ -136,7 +137,7 @@ nir_imm_int(nir_builder *build, int x)<br>
>     memset(&v, 0, sizeof(v));<br>
>     v.i32[0] = x;<br>
><br>
> -   return nir_build_imm(build, 1, v);<br>
> +   return nir_build_imm(build, 1, v, 32);<br>
>  }<br>
><br>
>  static inline nir_ssa_def *<br>
> @@ -150,14 +151,14 @@ nir_imm_ivec4(nir_builder *build, int x, int y, int z, int w)<br>
>     v.i32[2] = z;<br>
>     v.i32[3] = w;<br>
><br>
> -   return nir_build_imm(build, 4, v);<br>
> +   return nir_build_imm(build, 4, v, 32);<br>
>  }<br>
><br>
>  static inline nir_ssa_def *<br>
>  nir_imm_uint(nir_builder *build, unsigned x)<br>
>  {<br>
>     nir_const_value v = { { .u32 = {x, 0, 0, 0} } };<br>
> -   return nir_build_imm(build, 1, v);<br>
> +   return nir_build_imm(build, 1, v, 32);<br>
>  }<br>
><br>
>  static inline nir_ssa_def *<br>
> diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c<br>
> index 2d3ccd7..8362619 100644<br>
> --- a/src/compiler/nir/nir_lower_system_values.c<br>
> +++ b/src/compiler/nir/nir_lower_system_values.c<br>
> @@ -75,7 +75,7 @@ convert_block(nir_block *block, void *void_state)<br>
>              nir_load_system_value(b, nir_intrinsic_load_local_invocation_id, 0);<br>
><br>
>           sysval = nir_iadd(b, nir_imul(b, group_id,<br>
> -                                          nir_build_imm(b, 3, local_size)),<br>
> +                                          nir_build_imm(b, 3, local_size, 32)),<br>
>                                local_id);<br>
>           break;<br>
>        }<br>
> diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c<br>
> index 4999603..47a3786 100644<br>
> --- a/src/compiler/nir/nir_lower_tex.c<br>
> +++ b/src/compiler/nir/nir_lower_tex.c<br>
> @@ -232,7 +232,7 @@ get_zero_or_one(nir_builder *b, nir_alu_type type, uint8_t swizzle_val)<br>
>           v.u32[0] = v.u32[1] = v.u32[2] = v.u32[3] = 1;<br>
>     }<br>
><br>
> -   return nir_build_imm(b, 4, v);<br>
> +   return nir_build_imm(b, 4, v, 32);<br>
>  }<br>
><br>
>  static void<br>
> --<br>
> 2.5.0<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>