<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 26, 2016 at 3:59 PM, Vinson Lee <span dir="ltr"><<a href="mailto:vlee@freedesktop.org" target="_blank">vlee@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, May 26, 2016 at 3:40 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> There's no good reason for it to be a struct of an anonymous union.<br>
><br>
> Cc: Vinson Lee <<a href="mailto:vlee@freedesktop.org">vlee@freedesktop.org</a>><br>
> ---<br>
> src/compiler/nir/nir.h | 16 +++++++---------<br>
> src/compiler/nir/nir_constant_expressions.py | 2 +-<br>
> 2 files changed, 8 insertions(+), 10 deletions(-)<br>
><br>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
> index 008f4db..a166a0d 100644<br>
> --- a/src/compiler/nir/nir.h<br>
> +++ b/src/compiler/nir/nir.h<br>
> @@ -1266,15 +1266,13 @@ nir_tex_instr_src_index(nir_tex_instr *instr, nir_tex_src_type type)<br>
> return -1;<br>
> }<br>
><br>
> -typedef struct {<br>
> - union {<br>
> - float f32[4];<br>
> - double f64[4];<br>
> - int32_t i32[4];<br>
> - uint32_t u32[4];<br>
> - int64_t i64[4];<br>
> - uint64_t u64[4];<br>
> - };<br>
> +typedef union {<br>
> + float f32[4];<br>
> + double f64[4];<br>
> + int32_t i32[4];<br>
> + uint32_t u32[4];<br>
> + int64_t i64[4];<br>
> + uint64_t u64[4];<br>
> } nir_const_value;<br>
><br>
> typedef struct {<br>
> diff --git a/src/compiler/nir/nir_constant_expressions.py b/src/compiler/nir/nir_constant_expressions.py<br>
> index e36dc48..96d5255 100644<br>
> --- a/src/compiler/nir/nir_constant_expressions.py<br>
> +++ b/src/compiler/nir/nir_constant_expressions.py<br>
> @@ -270,7 +270,7 @@ static nir_const_value<br>
> evaluate_${name}(unsigned num_components, unsigned bit_size,<br>
> nir_const_value *_src)<br>
> {<br>
> - nir_const_value _dst_val = { { {0, 0, 0, 0} } };<br>
> + nir_const_value _dst_val = { {0, } };<br>
><br>
> switch (bit_size) {<br>
> % for bit_size in [32, 64]:<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
<br>
</div></div>Fixes Bugzilla 96221 for me.<br>
<br>
Tested-by: Vinson Lee <<a href="mailto:vlee@freedesktop.org">vlee@freedesktop.org</a>><br></blockquote><div><br></div><div>Thanks! <br></div></div><br></div></div>