<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 2:59 AM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">From: Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>><br>
<br>
---<br>
</span> src/compiler/nir/nir_lower_load_const_to_scalar.c | 7 +++++--<br>
 1 file changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/nir_lower_load_const_to_scalar.c b/src/compiler/nir/nir_lower_load_const_to_scalar.c<br>
index d290c30..aae2f7c 100644<br>
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c<br>
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c<br>
@@ -49,8 +49,11 @@ lower_load_const_instr_scalar(nir_load_const_instr *lower)<br>
<span class="">    nir_ssa_def *loads[4];<br>
    for (unsigned i = 0; i < lower->def.num_components; i++) {<br>
       nir_load_const_instr *load_comp =<br>
</span>-         nir_load_const_instr_create(b.shader, 1, 32);<br>
<span class="">-      load_comp->value.u32[0] = lower->value.u32[i];<br>
</span>+         nir_load_const_instr_create(b.shader, 1, lower->def.bit_size);<br>
<span class="im HOEnZb">+      if (lower->def.bit_size == 64)<br>
+         load_comp->value.f64[0] = lower->value.f64[i];<br>
+      else<br>
+         load_comp->value.u32[0] = lower->value.u32[i];<br></span></blockquote><div><br></div><div>Could we please throw an assert in here that it's only 32 or 64.  I want this to be easy to find when we start supporting 16-bit floats.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="im HOEnZb">
</span><div class="HOEnZb"><div class="h5">       nir_builder_instr_insert(&b, &load_comp->instr);<br>
       loads[i] = &load_comp->def;<br>
    }<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" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>