radv: handle z offset for 3d image <-> buffer copies.
authorDave Airlie <airlied@redhat.com>
Tue, 7 Mar 2017 00:30:01 +0000 (00:30 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 7 Mar 2017 04:02:00 +0000 (04:02 +0000)
This fixes:
dEQP-VK.pipeline.render_to_image.3d.huge.depth.r8g8b8a8_unorm

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_meta_copy.c

index 5473764dd19d57a19b94c991bde0ea2aedafa6a4..54dadde788d9fb0fd27ac636f08fbe0caf7864eb 100644 (file)
@@ -169,6 +169,8 @@ meta_copy_buffer_to_image(struct radv_cmd_buffer *cmd_buffer,
                        .pitch = buf_extent_el.width,
                };
 
+               if (image->type == VK_IMAGE_TYPE_3D)
+                       img_bsurf.layer = img_offset_el.z;
                /* Loop through each 3D or array slice */
                unsigned num_slices_3d = img_extent_el.depth;
                unsigned num_slices_array = pRegions[r].imageSubresource.layerCount;
@@ -276,6 +278,8 @@ meta_copy_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
                        .pitch = buf_extent_el.width,
                };
 
+               if (image->type == VK_IMAGE_TYPE_3D)
+                       img_info.layer = img_offset_el.z;
                /* Loop through each 3D or array slice */
                unsigned num_slices_3d = img_extent_el.depth;
                unsigned num_slices_array = pRegions[r].imageSubresource.layerCount;