[Mesa-dev] [PATCH 05/10] radv/meta: split copyimage api into api and meta function

Dave Airlie airlied at gmail.com
Thu Dec 8 00:18:44 UTC 2016


From: Dave Airlie <airlied at redhat.com>

This make it easier to add multiple queues later.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_meta_copy.c | 34 +++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/src/amd/vulkan/radv_meta_copy.c b/src/amd/vulkan/radv_meta_copy.c
index 4c01eb7..6333e5c 100644
--- a/src/amd/vulkan/radv_meta_copy.c
+++ b/src/amd/vulkan/radv_meta_copy.c
@@ -306,18 +306,13 @@ void radv_CmdCopyImageToBuffer(
 				  regionCount, pRegions);
 }
 
-void radv_CmdCopyImage(
-	VkCommandBuffer                             commandBuffer,
-	VkImage                                     srcImage,
-	VkImageLayout                               srcImageLayout,
-	VkImage                                     destImage,
-	VkImageLayout                               destImageLayout,
-	uint32_t                                    regionCount,
-	const VkImageCopy*                          pRegions)
+static void
+meta_copy_image(struct radv_cmd_buffer *cmd_buffer,
+		struct radv_image *src_image,
+		struct radv_image *dest_image,
+		uint32_t regionCount,
+		const VkImageCopy *pRegions)
 {
-	RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
-	RADV_FROM_HANDLE(radv_image, src_image, srcImage);
-	RADV_FROM_HANDLE(radv_image, dest_image, destImage);
 	struct radv_meta_saved_state saved_state;
 
 	/* From the Vulkan 1.0 spec:
@@ -397,3 +392,20 @@ void radv_CmdCopyImage(
 
 	radv_meta_restore(&saved_state, cmd_buffer);
 }
+
+void radv_CmdCopyImage(
+	VkCommandBuffer                             commandBuffer,
+	VkImage                                     srcImage,
+	VkImageLayout                               srcImageLayout,
+	VkImage                                     destImage,
+	VkImageLayout                               destImageLayout,
+	uint32_t                                    regionCount,
+	const VkImageCopy*                          pRegions)
+{
+	RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
+	RADV_FROM_HANDLE(radv_image, src_image, srcImage);
+	RADV_FROM_HANDLE(radv_image, dest_image, destImage);
+
+	meta_copy_image(cmd_buffer, src_image, dest_image,
+			regionCount, pRegions);
+}
-- 
2.7.4



More information about the mesa-dev mailing list