anv: Add offset parameter to anv_image_view_init()
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 27 Jan 2016 02:53:21 +0000 (18:53 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 27 Jan 2016 23:12:42 +0000 (15:12 -0800)
This is the offset of the tile that contains the mip specified by
isl_surf_get_image_intratile_offset_el(). Used to draw to/from the
specified mip.

src/vulkan/anv_image.c
src/vulkan/anv_meta.c
src/vulkan/anv_meta_clear.c
src/vulkan/anv_private.h

index 8b2003587ac7873e7d1e35e9ac1ca6df4e5eaa2e..6c1c92d61c67ea49a359302295a377cdd447998e 100644 (file)
@@ -483,7 +483,8 @@ void
 anv_image_view_init(struct anv_image_view *iview,
                     struct anv_device *device,
                     const VkImageViewCreateInfo* pCreateInfo,
-                    struct anv_cmd_buffer *cmd_buffer)
+                    struct anv_cmd_buffer *cmd_buffer,
+                    uint32_t offset)
 {
    ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
    const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange;
@@ -513,7 +514,7 @@ anv_image_view_init(struct anv_image_view *iview,
 
    iview->image = image;
    iview->bo = image->bo;
-   iview->offset = image->offset + surface->offset;
+   iview->offset = image->offset + surface->offset + offset;
 
    iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask;
    iview->vk_format = pCreateInfo->format;
@@ -608,7 +609,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);
+   anv_image_view_init(view, device, pCreateInfo, NULL, 0);
 
    *pView = anv_image_view_to_handle(view);
 
index 0b0adfc224f67a60a2e9c29a09eca77baab46154..3faabc159c4ad4cf6348d7db956182ae5c5364f2 100644 (file)
@@ -798,7 +798,7 @@ do_buffer_copy(struct anv_cmd_buffer *cmd_buffer,
             .layerCount = 1
          },
       },
-      cmd_buffer);
+      cmd_buffer, 0);
 
    struct anv_image_view dest_iview;
    anv_image_view_init(&dest_iview, cmd_buffer->device,
@@ -815,7 +815,7 @@ do_buffer_copy(struct anv_cmd_buffer *cmd_buffer,
             .layerCount = 1,
          },
       },
-      cmd_buffer);
+      cmd_buffer, 0);
 
    meta_emit_blit(cmd_buffer,
                   anv_image_from_handle(src_image),
@@ -1058,7 +1058,7 @@ void anv_CmdCopyImage(
                .layerCount = pRegions[r].dstSubresource.layerCount,
             },
          },
-         cmd_buffer);
+         cmd_buffer, 0);
 
       const VkOffset3D dest_offset = {
          .x = pRegions[r].dstOffset.x,
@@ -1102,7 +1102,7 @@ void anv_CmdCopyImage(
                   .layerCount = 1
                },
             },
-            cmd_buffer);
+            cmd_buffer, 0);
 
          meta_emit_blit(cmd_buffer,
                         src_image, &src_iview,
@@ -1162,7 +1162,7 @@ void anv_CmdBlitImage(
                .layerCount = 1
             },
          },
-         cmd_buffer);
+         cmd_buffer, 0);
 
       const VkOffset3D dest_offset = {
          .x = pRegions[r].dstOffsets[0].x,
@@ -1213,7 +1213,7 @@ void anv_CmdBlitImage(
                .layerCount = 1
             },
          },
-         cmd_buffer);
+         cmd_buffer, 0);
 
       meta_emit_blit(cmd_buffer,
                      src_image, &src_iview,
@@ -1326,7 +1326,7 @@ void anv_CmdCopyBufferToImage(
                   .layerCount = 1,
                },
             },
-            cmd_buffer);
+            cmd_buffer, 0);
 
          uint32_t img_x = 0;
          uint32_t img_y = 0;
@@ -1360,7 +1360,7 @@ void anv_CmdCopyBufferToImage(
                   .layerCount = 1
                },
             },
-            cmd_buffer);
+            cmd_buffer, img_o);
 
          const VkExtent3D img_extent_el = meta_region_extent_el(dest_image->vk_format,
                                                       &pRegions[r].imageExtent);
@@ -1440,7 +1440,7 @@ void anv_CmdCopyImageToBuffer(
                .layerCount = pRegions[r].imageSubresource.layerCount,
             },
          },
-         cmd_buffer);
+         cmd_buffer, 0);
 
       struct anv_image *dest_image =
          make_image_for_buffer(vk_device, destBuffer, buffer_format,
@@ -1476,7 +1476,7 @@ void anv_CmdCopyImageToBuffer(
                   .layerCount = 1
                },
             },
-            cmd_buffer);
+            cmd_buffer, 0);
 
          meta_emit_blit(cmd_buffer,
                         anv_image_from_handle(srcImage),
index ac369e9f9be2747be6c409bce8f4c875cc86c8b7..da234fcbdf10c7e5df88ea3f30e0088bae2418f7 100644 (file)
@@ -838,7 +838,7 @@ anv_cmd_clear_image(struct anv_cmd_buffer *cmd_buffer,
                      .layerCount = 1
                   },
                },
-               cmd_buffer);
+               cmd_buffer, 0);
 
             VkFramebuffer fb;
             anv_CreateFramebuffer(device_h,
index 79af4102e3f8b696030049ab1410a9a3027aa3cf..a6f24b55dca225798596207abbdc0843194f6c3d 100644 (file)
@@ -1609,7 +1609,8 @@ anv_image_get_surface_for_aspect_mask(struct anv_image *image,
 void anv_image_view_init(struct anv_image_view *view,
                          struct anv_device *device,
                          const VkImageViewCreateInfo* pCreateInfo,
-                         struct anv_cmd_buffer *cmd_buffer);
+                         struct anv_cmd_buffer *cmd_buffer,
+                         uint32_t offset);
 
 void
 anv_fill_image_surface_state(struct anv_device *device, struct anv_state state,