Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions impeller/renderer/backend/vulkan/allocator_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ static constexpr vk::ImageUsageFlags ToVKImageUsageFlags(
}

if (mode != StorageMode::kDeviceTransient) {
// TODO (https://github.com/flutter/flutter/issues/121634):
// Add transfer usage flags to support blit passes
// Add transfer usage flags to support blit passes only if image isn't
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this outdated comment as I was looking for image usage flags. These flags are for allocated texture sources. The issue was with images that were wrapped swapchain images.

// device transient.
vk_usage |= vk::ImageUsageFlagBits::eTransferSrc |
vk::ImageUsageFlagBits::eTransferDst;
}
Expand Down
5 changes: 4 additions & 1 deletion impeller/renderer/backend/vulkan/swapchain_impl_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ SwapchainImplVK::SwapchainImplVK(const std::shared_ptr<Context>& context,
: caps.maxImageCount // max zero means no limit
);
swapchain_info.imageArrayLayers = 1u;
swapchain_info.imageUsage = vk::ImageUsageFlagBits::eColorAttachment;
// Swapchain images are primarily used as color attachments (via resolve) or
// blit targets.
swapchain_info.imageUsage = vk::ImageUsageFlagBits::eColorAttachment |
vk::ImageUsageFlagBits::eTransferDst;
swapchain_info.preTransform = vk::SurfaceTransformFlagBitsKHR::eIdentity;
swapchain_info.compositeAlpha = composite.value();
// If we set the clipped value to true, Vulkan expects we will never read back
Expand Down