Commit 2611f98b by Charlie Lao Committed by Commit Bot

Vulkan: Add IMAGE_USE_STORAGE bit only if necessary.

The VK_IMAGE_USAGE_STORAGE_BIT has negative performance impact. Right now we needed for overlay widgets. This CL will only add the bit if we actually have widget enabled. Bug: b/157774833 Change-Id: I3027df886c9b34ccfd667152fa4fb090dfadb45b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2225810Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
parent 1df70f03
...@@ -864,6 +864,7 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context, ...@@ -864,6 +864,7 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context,
// We need transfer src for reading back from the backbuffer. // We need transfer src for reading back from the backbuffer.
VkImageUsageFlags imageUsageFlags = kSurfaceVKColorImageUsageFlags; VkImageUsageFlags imageUsageFlags = kSurfaceVKColorImageUsageFlags;
#if ANGLE_ENABLE_OVERLAY
// We need storage image for compute writes (debug overlay output). // We need storage image for compute writes (debug overlay output).
VkFormatFeatureFlags featureBits = VkFormatFeatureFlags featureBits =
renderer->getImageFormatFeatureBits(nativeFormat, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT); renderer->getImageFormatFeatureBits(nativeFormat, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
...@@ -871,6 +872,7 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context, ...@@ -871,6 +872,7 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context,
{ {
imageUsageFlags |= VK_IMAGE_USAGE_STORAGE_BIT; imageUsageFlags |= VK_IMAGE_USAGE_STORAGE_BIT;
} }
#endif
VkSwapchainCreateInfoKHR swapchainInfo = {}; VkSwapchainCreateInfoKHR swapchainInfo = {};
swapchainInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; swapchainInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
......
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