summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_meta_copy.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-06-02 16:25:44 -0700
committerJason Ekstrand <[email protected]>2016-06-03 19:29:28 -0700
commit9313a568169bddabaac675361497efff4a0709d6 (patch)
tree245e3caba3ad6f7feeec8b606a8590c8315fb181 /src/intel/vulkan/anv_meta_copy.c
parent526a8de22d85bcdc3a46b2e16e0073527616d95d (diff)
anv/copy: Account for the anv_surface.offset when creating a blit2d_surf
This was causing problems if the user tried to copy to/from the stencil portion of a combined depth/stencil image. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Nanley Chery <[email protected]> Cc: "12.0" <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_meta_copy.c')
-rw-r--r--src/intel/vulkan/anv_meta_copy.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/intel/vulkan/anv_meta_copy.c b/src/intel/vulkan/anv_meta_copy.c
index ff560ce1e84..a5844f0299d 100644
--- a/src/intel/vulkan/anv_meta_copy.c
+++ b/src/intel/vulkan/anv_meta_copy.c
@@ -69,14 +69,14 @@ meta_region_offset_el(const struct anv_image *image,
static struct anv_meta_blit2d_surf
blit_surf_for_image(const struct anv_image* image,
- const struct isl_surf *img_isl_surf)
+ const struct anv_surface *surf)
{
return (struct anv_meta_blit2d_surf) {
.bo = image->bo,
- .tiling = img_isl_surf->tiling,
- .base_offset = image->offset,
- .bs = isl_format_get_layout(img_isl_surf->format)->bs,
- .pitch = isl_surf_get_row_pitch(img_isl_surf),
+ .tiling = surf->isl.tiling,
+ .base_offset = image->offset + surf->offset,
+ .bs = isl_format_get_layout(surf->isl.format)->bs,
+ .pitch = isl_surf_get_row_pitch(&surf->isl),
};
}
@@ -157,10 +157,10 @@ meta_copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer,
/* Create blit surfaces */
VkImageAspectFlags aspect = pRegions[r].imageSubresource.aspectMask;
- const struct isl_surf *img_isl_surf =
- &anv_image_get_surface_for_aspect_mask(image, aspect)->isl;
+ const struct anv_surface *img_surf =
+ anv_image_get_surface_for_aspect_mask(image, aspect);
struct anv_meta_blit2d_surf img_bsurf =
- blit_surf_for_image(image, img_isl_surf);
+ blit_surf_for_image(image, img_surf);
enum isl_format buf_format = anv_get_isl_format(&cmd_buffer->device->info,
image->vk_format, aspect,
VK_IMAGE_TILING_LINEAR);
@@ -186,7 +186,7 @@ meta_copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer,
while (slice_3d < num_slices_3d && slice_array < num_slices_array) {
/* Finish creating blit rect */
- isl_surf_get_image_offset_el(img_isl_surf,
+ isl_surf_get_image_offset_el(&img_surf->isl,
pRegions[r].imageSubresource.mipLevel,
pRegions[r].imageSubresource.baseArrayLayer
+ slice_array,
@@ -278,14 +278,14 @@ void anv_CmdCopyImage(
VkImageAspectFlags aspect = pRegions[r].srcSubresource.aspectMask;
/* Create blit surfaces */
- struct isl_surf *src_isl_surf =
- &anv_image_get_surface_for_aspect_mask(src_image, aspect)->isl;
- struct isl_surf *dst_isl_surf =
- &anv_image_get_surface_for_aspect_mask(dest_image, aspect)->isl;
+ struct anv_surface *src_surf =
+ anv_image_get_surface_for_aspect_mask(src_image, aspect);
+ 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_isl_surf);
+ blit_surf_for_image(src_image, src_surf);
struct anv_meta_blit2d_surf b_dst =
- blit_surf_for_image(dest_image, dst_isl_surf);
+ blit_surf_for_image(dest_image, dst_surf);
/**
* From the Vulkan 1.0.6 spec: 18.4 Copying Data Between Buffers and Images
@@ -317,14 +317,14 @@ void anv_CmdCopyImage(
while (slice_3d < num_slices_3d && slice_array < num_slices_array) {
/* Finish creating blit rect */
- isl_surf_get_image_offset_el(dst_isl_surf,
+ isl_surf_get_image_offset_el(&dst_surf->isl,
pRegions[r].dstSubresource.mipLevel,
pRegions[r].dstSubresource.baseArrayLayer
+ slice_array,
dst_offset_el.z + slice_3d,
&rect.dst_x,
&rect.dst_y);
- isl_surf_get_image_offset_el(src_isl_surf,
+ isl_surf_get_image_offset_el(&src_surf->isl,
pRegions[r].srcSubresource.mipLevel,
pRegions[r].srcSubresource.baseArrayLayer
+ slice_array,