On Tue, Dec 5, 2017 at 4:11 PM, Nanley Chery <nanleych...@gmail.com> wrote:

> On Mon, Nov 27, 2017 at 07:05:53PM -0800, Jason Ekstrand wrote:
> > If the function gets passed ANV_AUX_USAGE_DEFAULT, it still has the old
> > behavior of setting ISL_AUX_USAGE_NONE for depth/stencil which is what
> > we want for blits/copies.
> > ---
> >  src/intel/vulkan/anv_blorp.c | 22 ++++++----------------
> >  1 file changed, 6 insertions(+), 16 deletions(-)
> >
> > diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> > index 7c8a673..f10adf0 100644
> > --- a/src/intel/vulkan/anv_blorp.c
> > +++ b/src/intel/vulkan/anv_blorp.c
> > @@ -193,12 +193,13 @@ get_blorp_surf_for_anv_image(const struct
> anv_device *device,
> >  {
> >     uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
> >
> > -   if (aux_usage == ANV_AUX_USAGE_DEFAULT)
> > +   if (aux_usage == ANV_AUX_USAGE_DEFAULT) {
> >        aux_usage = image->planes[plane].aux_usage;
> >
> > -   if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT ||
> > -       aux_usage == ISL_AUX_USAGE_HIZ)
> > -      aux_usage = ISL_AUX_USAGE_NONE;
> > +      if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT ||
> > +          aux_usage == ISL_AUX_USAGE_HIZ)
>
> I think the predicate no longer needs a check on the aspect. If the
> aspect is stencil the aux_usage will either be NONE or HIZ. If the
> aux_usage HIZ it'll be caught by the aux_usage check. If it's NONE
> there's no work to be done.


Done.  I've also added a comment:

      /* Blorp copies and blits can't handle HiZ so disable it by default */

Either way, this patch is
> Reviewed-by: Nanley Chery <nanley.g.ch...@intel.com>
>

Thanks!


>
> > +         aux_usage = ISL_AUX_USAGE_NONE;
> > +   }
> >
> >     const struct anv_surface *surface = &image->planes[plane].surface;
> >     *blorp_surf = (struct blorp_surf) {
> > @@ -1593,18 +1594,7 @@ anv_gen8_hiz_op_resolve(struct anv_cmd_buffer
> *cmd_buffer,
> >     struct blorp_surf surf;
> >     get_blorp_surf_for_anv_image(cmd_buffer->device,
> >                                  image, VK_IMAGE_ASPECT_DEPTH_BIT,
> > -                                ISL_AUX_USAGE_NONE, &surf);
> > -
> > -   /* Manually add the aux HiZ surf */
> > -   surf.aux_surf = &image->planes[0].aux_surface.isl,
> > -   surf.aux_addr = (struct blorp_address) {
> > -      .buffer = image->planes[0].bo,
> > -      .offset = image->planes[0].bo_offset +
> > -                image->planes[0].aux_surface.offset,
> > -      .mocs = cmd_buffer->device->default_mocs,
> > -   };
> > -   surf.aux_usage = ISL_AUX_USAGE_HIZ;
> > -
>
> Thanks for getting rid of that!
>
> > +                                ISL_AUX_USAGE_HIZ, &surf);
> >     surf.clear_color.f32[0] = ANV_HZ_FC_VAL;
> >
> >     blorp_hiz_op(&batch, &surf, 0, 0, 1, op);
> > --
> > 2.5.0.400.gff86faf
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to