<div dir="ltr"><div><div><div>Topi,<br><br></div>There are some patches in this branch:<br><br><a href="https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/i965-blorp-ds">https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/i965-blorp-ds</a><br><br></div>That I intend to send or squash in as part of a v2. Feel free to look at them and/or review preemptively.<br><br></div>--Jason<br><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 9, 2016 at 11:00 PM, Pohjolainen, Topi <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Sun, Oct 09, 2016 at 10:52:52PM -0700, Jason Ekstrand wrote:<br>
> On Oct 9, 2016 10:48 PM, "Pohjolainen, Topi"<br>
</span><span class="gmail-">> <[1]<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a><wbr>> wrote:<br>
> ><br>
> > On Fri, Oct 07, 2016 at 09:41:08PM -0700, Jason Ekstrand wrote:<br>
</span>> > > Signed-off-by: Jason Ekstrand <[2]<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
<div><div class="gmail-h5">> > > ---<br>
> > > src/intel/blorp/blorp.h | 10 ++++++++<br>
> > > src/intel/blorp/blorp_clear.c | 58<br>
> ++++++++++++++++++++++++++++++<wbr>+++++++++++++<br>
> > > 2 files changed, 68 insertions(+)<br>
> > ><br>
> > > diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h<br>
> > > index 480f1bb..263d194 100644<br>
> > > --- a/src/intel/blorp/blorp.h<br>
> > > +++ b/src/intel/blorp/blorp.h<br>
> > > @@ -134,6 +134,16 @@ blorp_clear(struct blorp_batch *batch,<br>
> > > const bool color_write_disable[4]);<br>
> > ><br>
> > > void<br>
> > > +blorp_clear_depth_stencil(<wbr>struct blorp_batch *batch,<br>
> > > + const struct blorp_surf *depth,<br>
> > > + const struct blorp_surf *stencil,<br>
> > > + uint32_t level, uint32_t start_layer,<br>
> > > + uint32_t num_layers,<br>
> > > + uint32_t x0, uint32_t y0, uint32_t x1,<br>
> uint32_t y1,<br>
> > > + bool clear_depth, float depth_value,<br>
> > > + bool clear_stencil, uint8_t<br>
> stencil_value);<br>
> > > +<br>
> > > +void<br>
> > > blorp_ccs_resolve(struct blorp_batch *batch,<br>
> > > struct blorp_surf *surf, enum isl_format<br>
> format);<br>
> > ><br>
> > > diff --git a/src/intel/blorp/blorp_clear.<wbr>c<br>
> b/src/intel/blorp/blorp_clear.<wbr>c<br>
> > > index a8f29fd..1d6bf1c 100644<br>
> > > --- a/src/intel/blorp/blorp_clear.<wbr>c<br>
> > > +++ b/src/intel/blorp/blorp_clear.<wbr>c<br>
> > > @@ -306,6 +306,64 @@ blorp_clear(struct blorp_batch *batch,<br>
> > > }<br>
> > ><br>
> > > void<br>
> > > +blorp_clear_depth_stencil(<wbr>struct blorp_batch *batch,<br>
> > > + const struct blorp_surf *depth,<br>
> > > + const struct blorp_surf *stencil,<br>
> > > + uint32_t level, uint32_t start_layer,<br>
> > > + uint32_t num_layers,<br>
> > > + uint32_t x0, uint32_t y0, uint32_t x1,<br>
> uint32_t y1,<br>
> > > + bool clear_depth, float depth_value,<br>
> > > + bool clear_stencil, uint8_t<br>
> stencil_value)<br>
> > > +{<br>
> > > + struct blorp_params params;<br>
> > > + blorp_params_init(¶ms);<br>
> > > +<br>
> > > + params.x0 = x0;<br>
> > > + params.y0 = y0;<br>
> > > + params.x1 = x1;<br>
> > > + params.y1 = y1;<br>
> > > +<br>
> > > + while (num_layers > 0) {<br>
> > > + params.num_layers = num_layers;<br>
> > > +<br>
> > > + if (clear_stencil) {<br>
> > > + brw_blorp_surface_info_init(<wbr>batch->blorp,<br>
> ¶ms.stencil, stencil,<br>
> > > + level, start_layer,<br>
> > > + ISL_FORMAT_UNSUPPORTED,<br>
> true);<br>
> > > + params.stencil_ref = stencil_value;<br>
> > > +<br>
> > > + params.dst.surf.samples = params.stencil.surf.samples;<br>
> > > + params.dst.surf.logical_<wbr>level0_px =<br>
> > > + params.stencil.surf.logical_<wbr>level0_px;<br>
> > > +<br>
> > > + if (params.stencil.view.array_len < params.num_layers)<br>
> > > + params.num_layers = params.stencil.view.array_len;<br>
> > > + }<br>
> > > +<br>
> > > + if (clear_depth) {<br>
> > > + brw_blorp_surface_info_init(<wbr>batch->blorp, ¶ms.depth,<br>
> depth,<br>
> > > + level, start_layer,<br>
> > > + ISL_FORMAT_UNSUPPORTED,<br>
> true);<br>
> > > + params.z = depth_value;<br>
> > > + params.depth_format =<br>
> > > + isl_format_get_depth_format(<wbr>depth->surf->format,<br>
> false);<br>
> > > +<br>
> > > + params.dst.surf.samples = params.depth.surf.samples;<br>
> > > + params.dst.surf.logical_<wbr>level0_px =<br>
> > > + params.depth.surf.logical_<wbr>level0_px;<br>
> > > +<br>
> > > + if (params.depth.view.array_len < params.num_layers)<br>
> > > + params.num_layers = params.depth.view.array_len;<br>
> ><br>
> > Stencil already does the same, could we add an assert here:<br>
> ><br>
> > assert(!clear_stencil ||<br>
> > params.depth.view.array_len ==<br>
> > params.stencil.view.array_len)<br>
><br>
> Sure.<br>
><br>
> ><br>
> > Moreover, I thought that start_layer + num_layers <= view.array_len<br>
> should<br>
> > always apply. You seem to explicitly prepare for that not to hold.<br>
> Could you<br>
> > give an example?<br>
><br>
> I had to do this recently with the other clears as well. Sandy Bridge<br>
> has a max of 512 layers for rendering. In the surface_info_init<br>
> function, we clamp as needed and this ensures that 16k-slice textures<br>
> get 32 draw calls.<br>
<br>
</div></div>Ah, right, that makes sense. How would you feel we added that as comment?<br>
<br>
/* Sandy Bridge has a max of 512 layers for rendering. In the<br>
* surface_info_init function, we clamp as needed and this ensures that<br>
* 16k-slice textures get 32 draw calls.<br>
*/<br>
assert(start_layer + num_layers <= view.array_len || gen == 6);<br>
<br>
Otherwise:<br>
<br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
<span class="gmail-"><br>
><br>
> > > + }<br>
> > > +<br>
> > > + batch->blorp->exec(batch, ¶ms);<br>
> > > +<br>
> > > + start_layer += params.num_layers;<br>
> > > + num_layers -= params.num_layers;<br>
> > > + }<br>
> > > +}<br>
> > > +<br>
> > > +void<br>
> > > blorp_ccs_resolve(struct blorp_batch *batch,<br>
> > > struct blorp_surf *surf, enum isl_format format)<br>
> > > {<br>
> > > --<br>
> > > 2.5.0.400.gff86faf<br>
> > ><br>
> > > ______________________________<wbr>_________________<br>
> > > mesa-dev mailing list<br>
</span>> > > [3]<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.<wbr>org</a><br>
> > > [4]<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.<wbr>org/mailman/listinfo/mesa-dev</a><br>
><br>
> References<br>
><br>
> 1. mailto:<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.<wbr>com</a><br>
> 2. mailto:<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a><br>
> 3. mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.<wbr>freedesktop.org</a><br>
> 4. <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div></div></div></div></div></div>