<div dir="ltr"><div>Cool.  1-3 are</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 9, 2018 at 7:09 AM Alejandro Piñeiro <<a href="mailto:apinheiro@igalia.com">apinheiro@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The offset compute was working fine for the case of attrib_slots=1,<br>
and updating the offset for the following varying.<br>
<br>
But in the case of attrib_slots=2 (so dvec3/4), we are basically<br>
splitting the comp_slots needed in two outputs. In that case we can't<br>
add to the offset the full size of the type.<br>
<br>
v2: added assert and some parenthesis to improve readability (Jason)<br>
---<br>
 src/compiler/nir/nir_gather_xfb_info.c | 7 ++++++-<br>
 1 file changed, 6 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/compiler/nir/nir_gather_xfb_info.c b/src/compiler/nir/nir_gather_xfb_info.c<br>
index f8d4cd833c7..f4f597da4f5 100644<br>
--- a/src/compiler/nir/nir_gather_xfb_info.c<br>
+++ b/src/compiler/nir/nir_gather_xfb_info.c<br>
@@ -81,7 +81,12 @@ add_var_xfb_outputs(nir_xfb_info *xfb,<br>
          output->component_mask = (comp_mask >> (s * 4)) & 0xf;<br>
<br>
          (*location)++;<br>
-         *offset += comp_slots * 4;<br>
+         /* attrib_slots would be only > 1 for doubles. On that case<br>
+          * comp_slots will be a multiple of 2, so the following doesn't need<br>
+          * to use DIV_ROUND_UP or similar<br>
+          */<br>
+         assert(comp_slots % attrib_slots == 0);<br>
+         *offset += (comp_slots / attrib_slots) * 4;<br>
       }<br>
    }<br>
 }<br>
-- <br>
2.14.1<br>
<br>
</blockquote></div>