<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 3:00 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>
Found while testing UBO loads in scenarios like this:<br>
<br>
(assign (x) (var_ref vec_ctor)<br>
(expression float d2f<br>
(expression double ubo_load (constant uint (0)) (constant uint (0)))))<br>
<br>
Without this patch, the src expression of d2f would be evaluated to a bitsize<br>
of 32, which is not correct and would hit an assert in nir_validate.<br>
---<br>
src/compiler/nir/glsl_to_nir.cpp | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp<br>
</span>index c77b430..8c75843 100644<br>
--- a/src/compiler/nir/glsl_to_nir.cpp<br>
+++ b/src/compiler/nir/glsl_to_nir.cpp<br>
@@ -1190,6 +1190,7 @@ nir_visitor::evaluate_rvalue(ir_rvalue* ir)<br>
<div class="HOEnZb"><div class="h5"> load_instr->dest.ssa.bit_size = glsl_get_bit_size(ir->type->base_type);<br>
}<br>
<br>
+ this->result->bit_size = glsl_get_bit_size(ir->type->base_type);<br></div></div></blockquote><div><br></div><div>I don't think this is the correct solution. Make everything 32-bit and then stomp it various places to fix bugs. We need to make every instance if init_ssa_dest do the right thing (I would recommend doing a full audit). In particular, add_instr probably needs a bit_size parameter.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
return this->result;<br>
}<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>