diff options
author | Dave Airlie <[email protected]> | 2016-11-23 12:59:55 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-02-27 05:42:16 +1000 |
commit | f695735ed61ea2f11f0fdf032a8ad2c99b6b064c (patch) | |
tree | f15f9f19ed80a64e59e2ad754f610e8e6b343aec /src/amd/vulkan/radv_meta_copy.c | |
parent | 336b05c49a6c6ce915bbd6629da17321ecb72bee (diff) |
vulkan/wsi/radv: add initial prime support (v1.1)
This is a complete rewrite of my previous rfc patches.
This adds the ability to present to a different GPU that rendering
using a driver side operation that can copy from the tiled to
linear shared image.
This does prime support completely in the swapchain present code,
and each queue has a precreated command buffer for each image
and for the each queue family. This means presenting should work
on graphics and compute queues and transfer in the future.
v1.1: initialise needs_linear_copy in swapchain.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Tested-by: Mike Lothian <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_copy.c')
-rw-r--r-- | src/amd/vulkan/radv_meta_copy.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_meta_copy.c b/src/amd/vulkan/radv_meta_copy.c index 2bd20b5ed27..5473764dd19 100644 --- a/src/amd/vulkan/radv_meta_copy.c +++ b/src/amd/vulkan/radv_meta_copy.c @@ -430,3 +430,23 @@ void radv_CmdCopyImage( meta_copy_image(cmd_buffer, src_image, dest_image, regionCount, pRegions); } + +void radv_blit_to_prime_linear(struct radv_cmd_buffer *cmd_buffer, + struct radv_image *image, + struct radv_image *linear_image) +{ + struct VkImageCopy image_copy = { 0 }; + + image_copy.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + image_copy.srcSubresource.layerCount = 1; + + image_copy.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + image_copy.dstSubresource.layerCount = 1; + + image_copy.extent.width = image->extent.width; + image_copy.extent.height = image->extent.height; + image_copy.extent.depth = 1; + + meta_copy_image(cmd_buffer, image, linear_image, + 1, &image_copy); +} |