anv/meta: Add function to create anv_meta_blit2d_surf from anv_image
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 2 Mar 2016 07:15:35 +0000 (23:15 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 3 Mar 2016 19:25:10 +0000 (11:25 -0800)
v2: Keep pitch in units of bytes (Jason)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/intel/vulkan/anv_meta_blit.c

index bef66751a7f122dfb15c0026e6910f89a0e15042..044998d0f5617edce1cbb55da332d51d58c643e3 100644 (file)
@@ -417,6 +417,19 @@ vk_format_for_size(int bs)
    }
 }
 
+static struct anv_meta_blit2d_surf
+blit_surf_for_image(const struct anv_image* image,
+                    const struct isl_surf *img_isl_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),
+   };
+}
+
 void
 anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer,
                 struct anv_meta_blit2d_surf *src,