<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 28, 2017 at 8:22 AM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Feb 27, 2017 at 09:00:15PM -0800, Jason Ekstrand wrote:<br>
> Why store aux usage and not the just image layout?  It doesn't really<br>
> matter whether we call layout_to_aux_usage here or when we emit the binding<br>
> tables.  I'm just wondering why you made the choice this way.<br>
><br>
<br>
</span>We store the aux_usage here instead of the layout because it makes the<br>
code in emit_binding_table() simpler and it's the only information<br>
needed from the layout when performing the sampling operation. As far as<br>
I can tell, propagating the image layout is only useful for implementing<br>
layout transitions. This is because the isl_aux_usage enum has no<br>
equivalent to VK_IMAGE_LAYOUT_UNDEFINED - a value that allows us to<br>
avoid resolve operations.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>That's reasonable.  I don't have much of an opinion either way.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-Nanley<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Feb 27, 2017 5:20 PM, "Nanley Chery" <<a href="mailto:nanleychery@gmail.com">nanleychery@gmail.com</a>> wrote:<br>
><br>
> Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
> ---<br>
>  src/intel/vulkan/anv_<wbr>descriptor_set.c | 10 ++++++++++<br>
>  src/intel/vulkan/anv_private.h        |  5 +++++<br>
>  2 files changed, 15 insertions(+)<br>
><br>
> diff --git a/src/intel/vulkan/anv_<wbr>descriptor_set.c b/src/intel/vulkan/anv_<br>
> descriptor_set.c<br>
> index 7853ec7dd9..369698174e 100644<br>
> --- a/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
> +++ b/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
> @@ -623,6 +623,11 @@ void anv_UpdateDescriptorSets(<br>
>                 .type = VK_DESCRIPTOR_TYPE_COMBINED_<wbr>IMAGE_SAMPLER,<br>
>                 .image_view = iview,<br>
>                 .sampler = sampler,<br>
> +               .aux_usage =<br>
> +                  anv_layout_to_aux_usage(<wbr>device->info.gen, iview->image,<br>
> +                                          iview->aspect_mask,<br>
> +                                          write->pImageInfo[j].<wbr>imageLayout,<br>
> +                                          write->pImageInfo[j].<br>
> imageLayout),<br>
>              };<br>
>           }<br>
>           break;<br>
> @@ -637,6 +642,11 @@ void anv_UpdateDescriptorSets(<br>
>              desc[j] = (struct anv_descriptor) {<br>
>                 .type = write->descriptorType,<br>
>                 .image_view = iview,<br>
> +               .aux_usage =<br>
> +                  anv_layout_to_aux_usage(<wbr>device->info.gen, iview->image,<br>
> +                                          iview->aspect_mask,<br>
> +                                          write->pImageInfo[j].<wbr>imageLayout,<br>
> +                                          write->pImageInfo[j].<br>
> imageLayout),<br>
>              };<br>
>           }<br>
>           break;<br>
> diff --git a/src/intel/vulkan/anv_<wbr>private.h b/src/intel/vulkan/anv_<wbr>private.h<br>
> index b51c6a643d..42f884d7b0 100644<br>
> --- a/src/intel/vulkan/anv_<wbr>private.h<br>
> +++ b/src/intel/vulkan/anv_<wbr>private.h<br>
> @@ -897,6 +897,11 @@ struct anv_descriptor {<br>
>        struct {<br>
>           struct anv_image_view *image_view;<br>
>           struct anv_sampler *sampler;<br>
> +<br>
> +         /* Used to determine whether or not we need the surface state to<br>
> have<br>
> +          * the auxiliary buffer enabled.<br>
> +          */<br>
> +         enum isl_aux_usage aux_usage;<br>
>        };<br>
><br>
>        struct anv_buffer_view *buffer_view;<br>
> --<br>
> 2.11.1<br>
><br>
> ______________________________<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>
</div></div></blockquote></div><br></div></div>