[Bug 89580] Implement a NIR -> vec4 pass

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue May 26 05:27:28 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=89580

--- Comment #16 from Iago Toral <itoral at igalia.com> ---
Hi Jason,

I have tracked most of our current piglit failures (>800 test fails, a few
crashes and a GPU hang) to this loop in get_mul_for_src
(nir_opt_peephole_ffma.c) when trying to produce a multiply-add operation:

    for (unsigned i = 0; i < 4; i++) {
      if (!(alu->dest.write_mask & (1 << i)))
         break;

      swizzle[i] = swizzle[src->swizzle[i]];
   }

Does this early break look correct to you? If I remove it I don't see any
piglit regressions but I get  >800 piglit new tests passes with our nir->vec4
pass (including a gpu hang and a number of crashes).

In a debug session I see that we are doing a multiply with only one component
on both operands and and the add uses all 4 components. Because the mul part
only uses one channel it has a writemask of 1, which triggers the early break
in the loop, producing an output swizzle of 0123 instead of 0000 (which is the
swizzle we get without the early break). This looks strange to me, because
src.swizzle which represents the swizzle of the mul operation as source to the
add operation, is 0000. In this particular case that leads to a crash later on
because we end up using that swizzle to compute the following for operand 1 of
the multiply-add:

ffma->src[1].swizzle = 0123
ffma->src[1]->src.ssa->num_components = 1

which then breaks this assertion in validate_alu_src:

      if (nir_alu_instr_channel_used(instr, index, i))
         assert(src->swizzle[i] < num_components);

It seems clear that the swizzle we get for ffma->src[1] is not right and we
would expect 0000 here. Removing the early break fixes that along with a whole
lot of other issues, but I wonder if that is a proper fix or just a workaround
to something else lurking somewhere else... What do you think?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20150526/77a95454/attachment-0001.html>


More information about the intel-3d-bugs mailing list