[Mesa-dev] [PATCH 08/18] anv/descriptor_set: Store aux usage of sampled image descriptors

Jason Ekstrand jason at jlekstrand.net
Tue Feb 28 05:00:15 UTC 2017


Why store aux usage and not the just image layout?  It doesn't really
matter whether we call layout_to_aux_usage here or when we emit the binding
tables.  I'm just wondering why you made the choice this way.

On Feb 27, 2017 5:20 PM, "Nanley Chery" <nanleychery at gmail.com> wrote:

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
 src/intel/vulkan/anv_descriptor_set.c | 10 ++++++++++
 src/intel/vulkan/anv_private.h        |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_
descriptor_set.c
index 7853ec7dd9..369698174e 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -623,6 +623,11 @@ void anv_UpdateDescriptorSets(
                .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
                .image_view = iview,
                .sampler = sampler,
+               .aux_usage =
+                  anv_layout_to_aux_usage(device->info.gen, iview->image,
+                                          iview->aspect_mask,
+                                          write->pImageInfo[j].imageLayout,
+                                          write->pImageInfo[j].
imageLayout),
             };
          }
          break;
@@ -637,6 +642,11 @@ void anv_UpdateDescriptorSets(
             desc[j] = (struct anv_descriptor) {
                .type = write->descriptorType,
                .image_view = iview,
+               .aux_usage =
+                  anv_layout_to_aux_usage(device->info.gen, iview->image,
+                                          iview->aspect_mask,
+                                          write->pImageInfo[j].imageLayout,
+                                          write->pImageInfo[j].
imageLayout),
             };
          }
          break;
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index b51c6a643d..42f884d7b0 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -897,6 +897,11 @@ struct anv_descriptor {
       struct {
          struct anv_image_view *image_view;
          struct anv_sampler *sampler;
+
+         /* Used to determine whether or not we need the surface state to
have
+          * the auxiliary buffer enabled.
+          */
+         enum isl_aux_usage aux_usage;
       };

       struct anv_buffer_view *buffer_view;
--
2.11.1

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170227/7e22d043/attachment.html>


More information about the mesa-dev mailing list