<p dir="ltr"><br>
On Jul 16, 2015 4:35 PM, "Jordan Justen" <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>> wrote:<br>
><br>
> On 2015-07-16 13:59:45, Jason Ekstrand wrote:<br>
> > On Jul 16, 2015 2:00 PM, "Jordan Justen" <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
> > wrote:<br>
> > ><br>
> > > This prevents an assertion failure in brw_fs_live_variables.cpp,<br>
> > > fs_live_variables::setup_one_write: Assertion `var < num_vars' failed.<br>
> ><br>
> > Best guess is that you should just fix regs_read to return the right value<br>
> > (1 in this case). Most other send instructions use mlen but that may not<br>
> > be needed tour CS_TERMINATE.<br>
><br>
> I think regs_read will fix a similar assert in setup_one_read. The MOV<br>
> will still hit the setup_one_write assert. Should I be generating the<br>
> MOV differently?<br>
><br>
> For example<br>
><br>
> bld.group(8, 0).exec_all().MOV(payload, g0);</p>
<p dir="ltr">Yes, that's how we need to do the MOV.</p>
<p dir="ltr">Out of curiosity, why are you emitting a MOV at all and not just calling CS_TERMINATE with g0 directly?<br>
--Jason</p>
<p dir="ltr">> works in combo with an update to regs_read.<br>
><br>
> -Jordan<br>
><br>
> > > Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
> > > Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
> > > ---<br>
> > > src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 7 ++++---<br>
> > > 1 file changed, 4 insertions(+), 3 deletions(-)<br>
> > ><br>
> > > diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> > b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> > > index 94d6a58..62dfb9a 100644<br>
> > > --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> > > +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp<br>
> > > @@ -1960,11 +1960,12 @@ fs_visitor::emit_cs_terminate()<br>
> > > */<br>
> > > struct brw_reg g0 = retype(brw_vec8_grf(0, 0),<br>
> > BRW_REGISTER_TYPE_UD);<br>
> > > fs_reg payload = fs_reg(GRF, alloc.allocate(1),<br>
> > BRW_REGISTER_TYPE_UD);<br>
> > > - bld.exec_all().MOV(payload, g0);<br>
> > > + const fs_builder bld8 = bld.group(8, 0);<br>
> > > + bld8.exec_all().MOV(payload, g0);<br>
> > ><br>
> > > /* Send a message to the thread spawner to terminate the thread. */<br>
> > > - fs_inst *inst = bld.exec_all()<br>
> > > - .emit(CS_OPCODE_CS_TERMINATE, reg_undef,<br>
> > payload);<br>
> > > + fs_inst *inst = bld8.exec_all()<br>
> > > + .emit(CS_OPCODE_CS_TERMINATE, reg_undef,<br>
> > payload);<br>
> > > inst->eot = true;<br>
> > > }<br>
> > ><br>
> > > --<br>
> > > 2.1.4<br>
> > ><br>
</p>