anv/image: Remove the offset parameter from image_view_init
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 31 Mar 2016 16:32:05 +0000 (09:32 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 8 Apr 2016 22:58:45 +0000 (15:58 -0700)
The only place we were using this was in meta_blit2d which always creates a
new image anyway so we can just use the image offset.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_meta_blit.c
src/intel/vulkan/anv_meta_blit2d.c
src/intel/vulkan/anv_meta_clear.c
src/intel/vulkan/anv_meta_resolve.c
src/intel/vulkan/anv_private.h

index 759c8612005c0cfa707b7d71a66efdfab6f86bd2..db1096253160cdfd952888dd447882512da40df3 100644 (file)
@@ -464,7 +464,6 @@ anv_image_view_init(struct anv_image_view *iview,
                     struct anv_device *device,
                     const VkImageViewCreateInfo* pCreateInfo,
                     struct anv_cmd_buffer *cmd_buffer,
-                    uint32_t offset,
                     VkImageUsageFlags usage_mask)
 {
    ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
@@ -495,7 +494,7 @@ anv_image_view_init(struct anv_image_view *iview,
 
    iview->image = image;
    iview->bo = image->bo;
-   iview->offset = image->offset + surface->offset + offset;
+   iview->offset = image->offset + surface->offset;
 
    iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask;
    iview->vk_format = pCreateInfo->format;
@@ -614,7 +613,7 @@ anv_CreateImageView(VkDevice _device,
    if (view == NULL)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
-   anv_image_view_init(view, device, pCreateInfo, NULL, 0, ~0);
+   anv_image_view_init(view, device, pCreateInfo, NULL, ~0);
 
    *pView = anv_image_view_to_handle(view);
 
index 218499a878731851a1ddc9de006195e6b03cb6ec..b726b94c3cd71407ea66d2dd74863c563ef6691f 100644 (file)
@@ -384,7 +384,7 @@ void anv_CmdBlitImage(
                .layerCount = 1
             },
          },
-         cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
+         cmd_buffer, VK_IMAGE_USAGE_SAMPLED_BIT);
 
       const VkOffset3D dest_offset = {
          .x = pRegions[r].dstOffsets[0].x,
@@ -434,7 +434,7 @@ void anv_CmdBlitImage(
                .layerCount = 1
             },
          },
-         cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+         cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
 
       meta_emit_blit(cmd_buffer,
                      src_image, &src_iview,
index 49646dd03743d48283a4d6f1a8a61c6b85038a14..68ade55d8eab02e8a8da3b8ebfa6cc6d06ba324f 100644 (file)
@@ -131,7 +131,7 @@ create_iview(struct anv_cmd_buffer *cmd_buffer,
     * creating a dummy memory object etc. so there's really no point.
     */
    anv_image_from_handle(*img)->bo = surf->bo;
-   anv_image_from_handle(*img)->offset = surf->base_offset;
+   anv_image_from_handle(*img)->offset = surf->base_offset + offset;
 
    anv_image_view_init(iview, cmd_buffer->device,
                        &(VkImageViewCreateInfo) {
@@ -146,7 +146,7 @@ create_iview(struct anv_cmd_buffer *cmd_buffer,
                              .baseArrayLayer = 0,
                              .layerCount = 1
                           },
-                       }, cmd_buffer, offset, usage);
+                       }, cmd_buffer, usage);
 }
 
 struct blit2d_src_temps {
index a24e59950be2facf8129618d206352cad8d0dd4b..a03701c684b0df1c3e34efbded1e8c017752a80a 100644 (file)
@@ -813,7 +813,7 @@ anv_cmd_clear_image(struct anv_cmd_buffer *cmd_buffer,
                      .layerCount = 1
                   },
                },
-               cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+               cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
 
             VkFramebuffer fb;
             anv_CreateFramebuffer(device_h,
index 3e7c7d39ba55bc1bb18a52d22e835c2857348566..8c1bdc06f8484c674bc68515137f8c1b3aa0e452 100644 (file)
@@ -758,7 +758,7 @@ void anv_CmdResolveImage(
                   .layerCount = 1,
                },
             },
-            cmd_buffer, 0, VK_IMAGE_USAGE_SAMPLED_BIT);
+            cmd_buffer, VK_IMAGE_USAGE_SAMPLED_BIT);
 
          struct anv_image_view dest_iview;
          anv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -775,7 +775,7 @@ void anv_CmdResolveImage(
                   .layerCount = 1,
                },
             },
-            cmd_buffer, 0, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
+            cmd_buffer, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
 
          VkFramebuffer fb_h;
          anv_CreateFramebuffer(device_h,
index a394fe8a683b52050dd9825c2b0da2a6edf8b2a4..99d3934ddda169f20bff4760175a45aec1e0b196 100644 (file)
@@ -1667,7 +1667,6 @@ void anv_image_view_init(struct anv_image_view *view,
                          struct anv_device *device,
                          const VkImageViewCreateInfo* pCreateInfo,
                          struct anv_cmd_buffer *cmd_buffer,
-                         uint32_t offset,
                          VkImageUsageFlags usage_mask);
 
 struct anv_buffer_view {