anv: Make image_get_surface_for_aspect_mask const
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 31 Aug 2016 00:49:32 +0000 (17:49 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 13 Sep 2016 19:40:12 +0000 (12:40 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_meta_copy.c
src/intel/vulkan/anv_private.h

index 63b8c86f5c33c1c82491ec9c4dad3aeb5606ee62..3ab11e749cac2a88681f94264377b4af25f8d02c 100644 (file)
@@ -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:
index 6a9f9c4b9af38ab1eec6be6946c41352d9121dd2..3f548e69867605216941702038af5f4629a7e673 100644 (file)
@@ -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);
index a01aeba21201f05a71041dd94a73ce2e38c36e00..a083f93fc640a1915454ddb95cd09407dbd9ba7a 100644 (file)
@@ -1753,8 +1753,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,