Commit 32ede717 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

venus: enable wsi ownership transfer



We internally replace VK_IMAGE_LAYOUT_PRESENT_SRC_KHR by
VK_IMAGE_LAYOUT_GENERAL, and rely on wsi to do ownership transfers.
Signed-off-by: Chia-I Wu's avatarChia-I Wu <olvaffe@gmail.com>
parent 52e1dd84
Pipeline #313913 waiting for manual action with stages
in 8 seconds
......@@ -772,6 +772,9 @@ vn_CmdCopyImageToBuffer(VkCommandBuffer commandBuffer,
vn_command_buffer_from_handle(commandBuffer);
size_t cmd_size;
if (srcImageLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
srcImageLayout = VK_IMAGE_LAYOUT_GENERAL;
cmd_size = vn_sizeof_vkCmdCopyImageToBuffer(commandBuffer, srcImage,
srcImageLayout, dstBuffer,
regionCount, pRegions);
......@@ -948,8 +951,6 @@ vn_get_intercepted_barriers(struct vn_command_buffer *cmd,
const VkImageMemoryBarrier *img_barriers,
uint32_t count)
{
/* XXX drop the #ifdef after fixing common wsi */
#ifdef ANDROID
bool has_present_src = false;
for (uint32_t i = 0; i < count; i++) {
if (img_barriers[i].oldLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR ||
......@@ -983,9 +984,6 @@ vn_get_intercepted_barriers(struct vn_command_buffer *cmd,
barriers[i].newLayout = VK_IMAGE_LAYOUT_GENERAL;
}
return barriers;
#else
return img_barriers;
#endif
}
void
......
......@@ -18,15 +18,12 @@
static bool
vn_render_pass_has_present_src(const VkRenderPassCreateInfo *create_info)
{
/* XXX drop the #ifdef after fixing common wsi */
#ifdef ANDROID
for (uint32_t i = 0; i < create_info->attachmentCount; i++) {
const VkAttachmentDescription *att = &create_info->pAttachments[i];
if (att->initialLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR ||
att->finalLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
return true;
}
#endif
return false;
}
......@@ -34,15 +31,12 @@ vn_render_pass_has_present_src(const VkRenderPassCreateInfo *create_info)
static bool
vn_render_pass_has_present_src2(const VkRenderPassCreateInfo2 *create_info)
{
/* XXX drop the #ifdef after fixing common wsi */
#ifdef ANDROID
for (uint32_t i = 0; i < create_info->attachmentCount; i++) {
const VkAttachmentDescription2 *att = &create_info->pAttachments[i];
if (att->initialLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR ||
att->finalLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
return true;
}
#endif
return false;
}
......
......@@ -76,6 +76,8 @@ vn_wsi_init(struct vn_physical_device *physical_dev)
if (result != VK_SUCCESS)
return result;
physical_dev->wsi_device.ownership_transfer = true;
if (physical_dev->base.base.supported_extensions
.EXT_image_drm_format_modifier)
physical_dev->wsi_device.supports_modifiers = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment