aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-12-31 15:37:54 -0800
committerNanley Chery <[email protected]>2016-03-03 11:24:45 -0800
commit654f79a04512502df96d9e6ce99ac0f95516d193 (patch)
treea44855b9909cf1066ae690f9396bd5a8fc4a41e6 /src/intel
parentd1e48b994565c1d6c1cfa546ba7ab09145c12601 (diff)
anv/meta: Add the beginnings of a blitter API
This API is designed to be an abstraction that sits between the VkCmdCopy commands and the hardware. The idea is that it is simple enough that it *should* be implementable using the blitter but with enough extra data that we can implement it with the 3-D pipeline efficiently. One design objective is to allow the user to supply enough information that we can handle most blit operations with a single draw call even if they require copying multiple rectangles.
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_meta.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_meta.h b/src/intel/vulkan/anv_meta.h
index d33e9e6d8ba..f5dac12a04a 100644
--- a/src/intel/vulkan/anv_meta.h
+++ b/src/intel/vulkan/anv_meta.h
@@ -70,6 +70,54 @@ anv_meta_get_iview_layer(const struct anv_image *dest_image,
const VkImageSubresourceLayers *dest_subresource,
const VkOffset3D *dest_offset);
+struct anv_meta_blit2d_surf {
+ struct anv_bo *bo;
+ enum isl_tiling tiling;
+
+ /** Base offset to the start of the image */
+ uint64_t base_offset;
+
+ uint32_t offset_x;
+ uint32_t offset_y;
+
+ /** The size of a unit in bytes. (Usually texel size) */
+ uint8_t units;
+
+ /** Stride between rows in bytes. */
+ uint32_t stride;
+
+ /** Possible vertical stride in rows.
+ *
+ * This is a hint to the blit engine that tells it that it can, if it
+ * wants, split the surface into v_stride tall chunks. The user makes
+ * the guarantee that no rectangles it passes in will every cross a
+ * v_stride boundary. A v_stride value of 0 indicates that the user
+ * cannot make such a guarantee.
+ */
+ uint32_t v_stride;
+};
+
+struct anv_meta_blit2d_rect {
+ uint32_t src_x, src_y;
+ uint32_t dst_x, dst_y;
+ uint32_t width, height;
+};
+
+static void
+anv_meta_begin_blit2d(struct anv_cmd_buffer *cmd_buffer,
+ struct anv_meta_saved_state *save);
+
+static void
+anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer,
+ struct anv_meta_blit2d_surf *src,
+ struct anv_meta_blit2d_surf *dst,
+ unsigned num_rects,
+ struct anv_meta_blit2d_rect *rects);
+
+static void
+anv_meta_end_blit2d(struct anv_cmd_buffer *cmd_buffer,
+ struct anv_meta_saved_state *save);
+
#ifdef __cplusplus
}
#endif