[Mesa-dev] [PATCH 25/33] anv: Make image_get_surface_for_aspect_mask const

Jason Ekstrand jason at jlekstrand.net
Wed Aug 31 21:22:44 UTC 2016


---
 src/intel/vulkan/anv_image.c     | 7 ++++---
 src/intel/vulkan/anv_meta_copy.c | 4 ++--
 src/intel/vulkan/anv_private.h   | 4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 63b8c86..3ab11e7 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -392,7 +392,7 @@ anv_image_view_init(struct anv_image_view *iview,
       break;
    }
 
-   struct anv_surface *surface =
+   const struct anv_surface *surface =
       anv_image_get_surface_for_aspect_mask(image, range->aspectMask);
 
    iview->image = image;
@@ -653,8 +653,9 @@ anv_DestroyBufferView(VkDevice _device, VkBufferView bufferView,
    anv_free2(&device->alloc, pAllocator, view);
 }
 
-struct anv_surface *
-anv_image_get_surface_for_aspect_mask(struct anv_image *image, VkImageAspectFlags aspect_mask)
+const struct anv_surface *
+anv_image_get_surface_for_aspect_mask(const struct anv_image *image,
+                                      VkImageAspectFlags aspect_mask)
 {
    switch (aspect_mask) {
    case VK_IMAGE_ASPECT_COLOR_BIT:
diff --git a/src/intel/vulkan/anv_meta_copy.c b/src/intel/vulkan/anv_meta_copy.c
index 6a9f9c4..3f548e6 100644
--- a/src/intel/vulkan/anv_meta_copy.c
+++ b/src/intel/vulkan/anv_meta_copy.c
@@ -278,9 +278,9 @@ void anv_CmdCopyImage(
       VkImageAspectFlags aspect = pRegions[r].srcSubresource.aspectMask;
 
       /* Create blit surfaces */
-      struct anv_surface *src_surf =
+      const struct anv_surface *src_surf =
          anv_image_get_surface_for_aspect_mask(src_image, aspect);
-      struct anv_surface *dst_surf =
+      const struct anv_surface *dst_surf =
          anv_image_get_surface_for_aspect_mask(dest_image, aspect);
       struct anv_meta_blit2d_surf b_src =
          blit_surf_for_image(src_image, src_surf);
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 816a081..2277010 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1756,8 +1756,8 @@ VkResult anv_image_create(VkDevice _device,
                           const VkAllocationCallbacks* alloc,
                           VkImage *pImage);
 
-struct anv_surface *
-anv_image_get_surface_for_aspect_mask(struct anv_image *image,
+const struct anv_surface *
+anv_image_get_surface_for_aspect_mask(const struct anv_image *image,
                                       VkImageAspectFlags aspect_mask);
 
 void anv_image_view_init(struct anv_image_view *view,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list