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

Nanley Chery nanleychery at gmail.com
Wed Mar 1 22:30:29 UTC 2017


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

diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index 7853ec7dd9..53535a4bcd 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -623,6 +623,10 @@ void anv_UpdateDescriptorSets(
                .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
                .image_view = iview,
                .sampler = sampler,
+               .aux_usage =
+                  anv_layout_to_aux_usage(&device->info, iview->image,
+                                          iview->aspect_mask,
+                                          write->pImageInfo[j].imageLayout),
             };
          }
          break;
@@ -637,6 +641,10 @@ void anv_UpdateDescriptorSets(
             desc[j] = (struct anv_descriptor) {
                .type = write->descriptorType,
                .image_view = iview,
+               .aux_usage =
+                  anv_layout_to_aux_usage(&device->info, iview->image,
+                                          iview->aspect_mask,
+                                          write->pImageInfo[j].imageLayout),
             };
          }
          break;
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index f86972dfb2..984f5c79a8 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.12.0



More information about the mesa-dev mailing list