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

Nanley Chery nanleychery at gmail.com
Tue Feb 28 01:20:16 UTC 2017


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



More information about the mesa-dev mailing list