Commit 0056151c by Tim Van Patten Committed by Commit Bot

Fix call to getImageFormatFeatureBits() in SurfaceVk.cpp

The function getImageFormatFeatureBits() was recently refactored which changed its parameters. One call to this function in SurfaceVk.cpp is underneath a #if ANGLE_ENABLE_OVERLAY though, so it was missed. This CL updates the call to getImageFormatFeatureBits() with the correct paramater as well as moves the code outside of the #if and into a normal conditional to prevent similar issues in the future. Bug: angleproject:5438 Change-Id: I499c25d98e4e22b5e1bb14e6e6c9ef378d77307f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2626348 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 72c58a86
......@@ -165,6 +165,12 @@ angle::Result InitImageHelper(DisplayVk *displayVk,
}
} // namespace
#if defined(ANGLE_ENABLE_OVERLAY)
constexpr bool kEnableOverlay = ANGLE_ENABLE_OVERLAY;
#else
constexpr bool kEnableOverlay = false;
#endif
SurfaceVk::SurfaceVk(const egl::SurfaceState &surfaceState) : SurfaceImpl(surfaceState) {}
SurfaceVk::~SurfaceVk() = default;
......@@ -948,15 +954,16 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context,
// We need transfer src for reading back from the backbuffer.
VkImageUsageFlags imageUsageFlags = kSurfaceVkColorImageUsageFlags;
#if ANGLE_ENABLE_OVERLAY
// We need storage image for compute writes (debug overlay output).
VkFormatFeatureFlags featureBits =
renderer->getImageFormatFeatureBits(nativeFormat, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
if ((featureBits & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0)
if (kEnableOverlay)
{
imageUsageFlags |= VK_IMAGE_USAGE_STORAGE_BIT;
VkFormatFeatureFlags featureBits = renderer->getImageFormatFeatureBits(
format.actualImageFormatID, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
if ((featureBits & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0)
{
imageUsageFlags |= VK_IMAGE_USAGE_STORAGE_BIT;
}
}
#endif
VkSwapchainCreateInfoKHR swapchainInfo = {};
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