<p dir="ltr"><br>
On Apr 23, 2016 3:46 AM, "Pohjolainen, Topi" <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> wrote:<br>
><br>
> On Fri, Apr 22, 2016 at 04:19:08PM -0700, Jason Ekstrand wrote:<br>
> > Instead of having a virtual member function for getting the WM/PS kernel,<br>
> > we simply add fields for prog_data and the kernel to brw_blorp_parms and<br>
> > always make sure those get set as part of the different constructors.<br>
> > ---<br>
> >  src/mesa/drivers/dri/i965/brw_blorp.cpp       | 12 ++-----<br>
> >  src/mesa/drivers/dri/i965/brw_blorp.h         | 19 +++++-----<br>
> >  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  | 12 ++-----<br>
> >  src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 50 ++++++++++++---------------<br>
> >  src/mesa/drivers/dri/i965/gen6_blorp.cpp      | 25 ++++++--------<br>
> >  src/mesa/drivers/dri/i965/gen7_blorp.cpp      | 28 +++++++--------<br>
> >  src/mesa/drivers/dri/i965/gen8_blorp.cpp      | 18 ++++------<br>
> >  7 files changed, 68 insertions(+), 96 deletions(-)<br>
> ><br>
> > diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp<br>
> > index ce09b09..9dbbd83 100644<br>
> > --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp<br>
> > +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp<br>
> > @@ -165,10 +165,11 @@ brw_blorp_params::brw_blorp_params(unsigned num_varyings,<br>
> >       depth_format(0),<br>
> >       hiz_op(GEN6_HIZ_OP_NONE),<br>
> >       fast_clear_op(0),<br>
> > -     use_wm_prog(false),<br>
> >       num_varyings(num_varyings),<br>
> >       num_draw_buffers(num_draw_buffers),<br>
> > -     num_layers(num_layers)<br>
> > +     num_layers(num_layers),<br>
> > +     wm_prog_kernel(BRW_BLORP_NO_WM_PROG),<br>
> > +     wm_prog_data(NULL)<br>
> >  {<br>
> >     color_write_disable[0] = false;<br>
> >     color_write_disable[1] = false;<br>
> > @@ -354,10 +355,3 @@ brw_hiz_op_params::brw_hiz_op_params(struct intel_mipmap_tree *mt,<br>
> >     default:                    unreachable("not reached");<br>
> >     }<br>
> >  }<br>
> > -<br>
> > -uint32_t<br>
> > -brw_hiz_op_params::get_wm_prog(struct brw_context *brw,<br>
> > -                               brw_blorp_prog_data **prog_data) const<br>
> > -{<br>
> > -   return 0;<br>
> > -}<br>
> > diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h<br>
> > index 79dc59a..4981afd 100644<br>
> > --- a/src/mesa/drivers/dri/i965/brw_blorp.h<br>
> > +++ b/src/mesa/drivers/dri/i965/brw_blorp.h<br>
> > @@ -229,6 +229,7 @@ struct brw_blorp_prog_data<br>
> >     bool persample_msaa_dispatch;<br>
> >  };<br>
> ><br>
> > +#define BRW_BLORP_NO_WM_PROG 1<br>
><br>
> So in other words any offset other than one is regarded as valid? I was<br>
> wondering if could drop this and use the existence of wm_prog_data to tell<br>
> if there is kernel available or not. At least in current form valid kernel<br>
> always has prog_data and vice versa.</p>
<p dir="ltr">I thought about that and would be happy to make the change If you wanted.  I just couldn't decide which I thought was cleaner.</p>
<p dir="ltr">> In general I like the patch.<br>
</p>