<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 28, 2017 at 5:56 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Nov 27, 2017 at 07:05:54PM -0800, Jason Ekstrand wrote:<br>
> ---<br>
>  src/intel/vulkan/anv_blorp.c       | 38 ++++++++++++++++++++++--------<wbr>--------<br>
>  src/intel/vulkan/anv_private.h     |  9 +++++----<br>
>  src/intel/vulkan/genX_cmd_<wbr>buffer.c | 11 ++++++-----<br>
>  3 files changed, 33 insertions(+), 25 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c<br>
> index f10adf0..da273d6 100644<br>
> --- a/src/intel/vulkan/anv_blorp.c<br>
> +++ b/src/intel/vulkan/anv_blorp.c<br>
> @@ -1568,26 +1568,30 @@ anv_image_copy_to_shadow(<wbr>struct anv_cmd_buffer *cmd_buffer,<br>
>     blorp_batch_finish(&batch);<br>
>  }<br>
><br>
> -void<br>
> -anv_gen8_hiz_op_resolve(<wbr>struct anv_cmd_buffer *cmd_buffer,<br>
> -                        const struct anv_image *image,<br>
> -                        enum blorp_hiz_op op)<br>
> +static enum blorp_hiz_op<br>
> +isl_to_blorp_hiz_op(enum isl_aux_op isl_op)<br>
>  {<br>
> -   assert(image);<br>
> +   switch (isl_op) {<br>
> +   case ISL_AUX_OP_FAST_CLEAR:   return BLORP_HIZ_OP_DEPTH_CLEAR;<br>
> +   case ISL_AUX_OP_FULL_RESOLVE: return BLORP_HIZ_OP_DEPTH_RESOLVE;<br>
> +   case ISL_AUX_OP_AMBIGUATE:    return BLORP_HIZ_OP_HIZ_RESOLVE;<br>
> +   default:<br>
> +      unreachable("Unsupported HiZ aux op");<br>
> +   }<br>
> +}<br>
><br>
> +void<br>
> +anv_image_hiz_op(struct anv_cmd_buffer *cmd_buffer,<br>
> +                 const struct anv_image *image,<br>
> +                 VkImageAspectFlagBits aspect, uint32_t level,<br>
> +                 uint32_t base_layer, uint32_t layer_count,<br>
> +                 enum isl_aux_op hiz_op)<br>
> +{<br>
> +   assert(aspect == VK_IMAGE_ASPECT_DEPTH_BIT);<br>
> +   assert(base_layer + layer_count <= anv_image_aux_layers(image, aspect, 0));<br>
>     assert(anv_image_aspect_to_<wbr>plane(image->aspects,<br>
>                                      VK_IMAGE_ASPECT_DEPTH_BIT) == 0);<br>
><br>
> -   /* Don't resolve depth buffers without an auxiliary HiZ buffer and<br>
> -    * don't perform such a resolve on gens that don't support it.<br>
> -    */<br>
> -   if (cmd_buffer->device->info.gen < 8 ||<br>
> -       image->planes[0].aux_usage != ISL_AUX_USAGE_HIZ)<br>
> -      return;<br>
> -<br>
> -   assert(op == BLORP_HIZ_OP_HIZ_RESOLVE ||<br>
> -          op == BLORP_HIZ_OP_DEPTH_RESOLVE);<br>
> -<br>
>     struct blorp_batch batch;<br>
>     blorp_batch_init(&cmd_buffer-><wbr>device->blorp, &batch, cmd_buffer, 0);<br>
><br>
> @@ -1597,7 +1601,9 @@ anv_gen8_hiz_op_resolve(struct anv_cmd_buffer *cmd_buffer,<br>
>                                  ISL_AUX_USAGE_HIZ, &surf);<br>
>     surf.clear_color.f32[0] = ANV_HZ_FC_VAL;<br>
><br>
> -   blorp_hiz_op(&batch, &surf, 0, 0, 1, op);<br>
> +   blorp_hiz_op(&batch, &surf, level, base_layer, layer_count,<br>
> +                isl_to_blorp_hiz_op(hiz_op));<br>
> +<br>
>     blorp_batch_finish(&batch);<br>
>  }<br>
><br>
> diff --git a/src/intel/vulkan/anv_<wbr>private.h b/src/intel/vulkan/anv_<wbr>private.h<br>
> index dc44ab6..5dd95a3 100644<br>
> --- a/src/intel/vulkan/anv_<wbr>private.h<br>
> +++ b/src/intel/vulkan/anv_<wbr>private.h<br>
> @@ -2530,10 +2530,11 @@ anv_can_sample_with_hiz(const struct gen_device_info * const devinfo,<br>
>  }<br>
><br>
>  void<br>
> -anv_gen8_hiz_op_resolve(<wbr>struct anv_cmd_buffer *cmd_buffer,<br>
> -                        const struct anv_image *image,<br>
> -                        enum blorp_hiz_op op);<br>
> -<br>
> +anv_image_hiz_op(struct anv_cmd_buffer *cmd_buffer,<br>
> +                 const struct anv_image *image,<br>
> +                 VkImageAspectFlagBits aspect, uint32_t level,<br>
> +                 uint32_t base_layer, uint32_t layer_count,<br>
> +                 enum isl_aux_op hiz_op);<br>
>  void<br>
>  anv_image_mcs_op(struct anv_cmd_buffer *cmd_buffer,<br>
>                   const struct anv_image *image,<br>
> diff --git a/src/intel/vulkan/genX_cmd_<wbr>buffer.c b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> index 2e7a2cc..0c1ae83 100644<br>
> --- a/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> +++ b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
> @@ -388,19 +388,20 @@ transition_depth_buffer(struct anv_cmd_buffer *cmd_buffer,<br>
>        anv_layout_to_aux_usage(&cmd_<wbr>buffer->device->info, image,<br>
>                                VK_IMAGE_ASPECT_DEPTH_BIT, final_layout);<br>
><br>
> -   enum blorp_hiz_op hiz_op;<br>
> +   enum isl_aux_op hiz_op;<br>
>     if (hiz_enabled && !enable_hiz) {<br>
> -      hiz_op = BLORP_HIZ_OP_DEPTH_RESOLVE;<br>
> +      hiz_op = ISL_AUX_OP_FULL_RESOLVE;<br>
>     } else if (!hiz_enabled && enable_hiz) {<br>
> -      hiz_op = BLORP_HIZ_OP_HIZ_RESOLVE;<br>
> +      hiz_op = ISL_AUX_OP_AMBIGUATE;<br>
>     } else {<br>
>        assert(hiz_enabled == enable_hiz);<br>
>        /* If the same buffer will be used, no resolves are necessary. */<br>
> -      hiz_op = BLORP_HIZ_OP_NONE;<br>
> +      hiz_op = ISL_AUX_OP_NONE;<br>
>     }<br>
><br>
>     if (hiz_op != BLORP_HIZ_OP_NONE)<br>
<br>
</div></div>                    ISL_AUX_OP_NONE<span class=""><br></span></blockquote><div><br></div><div>Thanks!  Fixed locally.  Fortunately, it was never a problem because both are 0 but it's a good catch none the less.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> -      anv_gen8_hiz_op_resolve(cmd_<wbr>buffer, image, hiz_op);<br>
> +      anv_image_hiz_op(cmd_buffer, image, VK_IMAGE_ASPECT_DEPTH_BIT,<br>
> +                       0, 0, 1, hiz_op);<br>
>  }<br>
><br>
>  #define MI_PREDICATE_SRC0  0x2400<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</span>> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <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>