Commit 5fac02c8 by Jamie Madill Committed by Commit Bot

Revert "Vulkan: Fix incorrect exposure of sRGB extensions"

This reverts commit abcabb47. Reason for revert: Failed on CQ and build passed, see bug. Bug: angleproject:5394 Original change's description: > Vulkan: Fix incorrect exposure of sRGB extensions > > When we check to see what formats we can reinterpret for sRGB > extensions, we need to make sure we can match the image usage > flags as well. If the original format supports framebuffer > attachment usage, we need to make sure that the reinterpreted > format can support it as well. > > Bug: angleproject:5309 > Change-Id: I7e84d01004504f854a3e22227e99b1740ed1a2b2 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2549156 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=syoussefi@chromium.org,jmadill@chromium.org,m.maiya@samsung.com Change-Id: I211802eb17deff3399ec680eeae4c4ff33e52d9d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:5309 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2557567Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 8a657ff9
...@@ -157,6 +157,8 @@ constexpr const char *kSkippedMessages[] = { ...@@ -157,6 +157,8 @@ constexpr const char *kSkippedMessages[] = {
// http://anglebug.com/5304 // http://anglebug.com/5304
"VUID-vkCmdDraw-magFilter-04553", "VUID-vkCmdDraw-magFilter-04553",
"VUID-vkCmdDrawIndexed-magFilter-04553", "VUID-vkCmdDrawIndexed-magFilter-04553",
// http://anglebug.com/5309
"VUID-VkImageViewCreateInfo-usage-02652",
// http://anglebug.com/5336 // http://anglebug.com/5336
"UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension", "UNASSIGNED-BestPractices-vkCreateDevice-specialuse-extension",
// http://anglebug.com/5331 // http://anglebug.com/5331
...@@ -2180,13 +2182,6 @@ bool RendererVk::hasLinearImageFormatFeatureBits(VkFormat format, ...@@ -2180,13 +2182,6 @@ bool RendererVk::hasLinearImageFormatFeatureBits(VkFormat format,
return hasFormatFeatureBits<&VkFormatProperties::linearTilingFeatures>(format, featureBits); return hasFormatFeatureBits<&VkFormatProperties::linearTilingFeatures>(format, featureBits);
} }
VkFormatFeatureFlags RendererVk::getLinearImageFormatFeatureBits(
VkFormat format,
const VkFormatFeatureFlags featureBits) const
{
return getFormatFeatureBits<&VkFormatProperties::linearTilingFeatures>(format, featureBits);
}
VkFormatFeatureFlags RendererVk::getImageFormatFeatureBits( VkFormatFeatureFlags RendererVk::getImageFormatFeatureBits(
VkFormat format, VkFormat format,
const VkFormatFeatureFlags featureBits) const const VkFormatFeatureFlags featureBits) const
...@@ -2287,26 +2282,6 @@ bool RendererVk::hasFormatFeatureBits(VkFormat format, const VkFormatFeatureFlag ...@@ -2287,26 +2282,6 @@ bool RendererVk::hasFormatFeatureBits(VkFormat format, const VkFormatFeatureFlag
return IsMaskFlagSet(getFormatFeatureBits<features>(format, featureBits), featureBits); return IsMaskFlagSet(getFormatFeatureBits<features>(format, featureBits), featureBits);
} }
bool RendererVk::haveSameFormatFeatureBits(VkFormat fmt1, VkFormat fmt2) const
{
if (fmt1 == VK_FORMAT_UNDEFINED || fmt2 == VK_FORMAT_UNDEFINED)
{
return false;
}
constexpr VkFormatFeatureFlags kImageUsageFeatureBits =
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
VkFormatFeatureFlags fmt1LinearFeatureBits =
getLinearImageFormatFeatureBits(fmt1, kImageUsageFeatureBits);
VkFormatFeatureFlags fmt1OptimalFeatureBits =
getImageFormatFeatureBits(fmt1, kImageUsageFeatureBits);
return hasLinearImageFormatFeatureBits(fmt2, fmt1LinearFeatureBits) &&
hasImageFormatFeatureBits(fmt2, fmt1OptimalFeatureBits);
}
angle::Result RendererVk::cleanupGarbage(Serial lastCompletedQueueSerial) angle::Result RendererVk::cleanupGarbage(Serial lastCompletedQueueSerial)
{ {
std::lock_guard<std::mutex> lock(mGarbageMutex); std::lock_guard<std::mutex> lock(mGarbageMutex);
......
...@@ -161,9 +161,6 @@ class RendererVk : angle::NonCopyable ...@@ -161,9 +161,6 @@ class RendererVk : angle::NonCopyable
// device (first time only). // device (first time only).
bool hasLinearImageFormatFeatureBits(VkFormat format, bool hasLinearImageFormatFeatureBits(VkFormat format,
const VkFormatFeatureFlags featureBits) const; const VkFormatFeatureFlags featureBits) const;
VkFormatFeatureFlags getLinearImageFormatFeatureBits(
VkFormat format,
const VkFormatFeatureFlags featureBits) const;
VkFormatFeatureFlags getImageFormatFeatureBits(VkFormat format, VkFormatFeatureFlags getImageFormatFeatureBits(VkFormat format,
const VkFormatFeatureFlags featureBits) const; const VkFormatFeatureFlags featureBits) const;
bool hasImageFormatFeatureBits(VkFormat format, const VkFormatFeatureFlags featureBits) const; bool hasImageFormatFeatureBits(VkFormat format, const VkFormatFeatureFlags featureBits) const;
...@@ -297,8 +294,6 @@ class RendererVk : angle::NonCopyable ...@@ -297,8 +294,6 @@ class RendererVk : angle::NonCopyable
void outputVmaStatString(); void outputVmaStatString();
bool haveSameFormatFeatureBits(VkFormat fmt1, VkFormat fmt2) const;
angle::Result cleanupGarbage(Serial lastCompletedQueueSerial); angle::Result cleanupGarbage(Serial lastCompletedQueueSerial);
angle::Result submitFrame(vk::Context *context, angle::Result submitFrame(vk::Context *context,
......
...@@ -2582,8 +2582,7 @@ angle::Result TextureVk::initImage(ContextVk *contextVk, ...@@ -2582,8 +2582,7 @@ angle::Result TextureVk::initImage(ContextVk *contextVk,
: vk::ConvertToSRGB(imageFormat); : vk::ConvertToSRGB(imageFormat);
VkImageFormatListCreateInfoKHR formatListInfo = {}; VkImageFormatListCreateInfoKHR formatListInfo = {};
if (renderer->getFeatures().supportsImageFormatList.enabled && if (renderer->getFeatures().supportsImageFormatList.enabled)
renderer->haveSameFormatFeatureBits(imageFormat, imageListFormat))
{ {
mRequiresMutableStorage = true; mRequiresMutableStorage = true;
......
...@@ -50,9 +50,6 @@ bool HasShaderImageAtomicsSupport(const RendererVk *rendererVk, ...@@ -50,9 +50,6 @@ bool HasShaderImageAtomicsSupport(const RendererVk *rendererVk,
return hasImageAtomicSupport && hasBufferAtomicSupport; return hasImageAtomicSupport && hasBufferAtomicSupport;
} }
// Checks to see if each format can be reinterpreted to an equivalent format in a different
// colorspace. If all supported formats can be reinterpreted, it returns true. Formats which are not
// supported at all are ignored and not counted as failures.
bool FormatReinterpretationSupported(const std::vector<GLenum> &optionalSizedFormats, bool FormatReinterpretationSupported(const std::vector<GLenum> &optionalSizedFormats,
const RendererVk *rendererVk, const RendererVk *rendererVk,
bool checkLinearColorspace) bool checkLinearColorspace)
...@@ -67,14 +64,18 @@ bool FormatReinterpretationSupported(const std::vector<GLenum> &optionalSizedFor ...@@ -67,14 +64,18 @@ bool FormatReinterpretationSupported(const std::vector<GLenum> &optionalSizedFor
VkFormat reinterpretedFormat = checkLinearColorspace VkFormat reinterpretedFormat = checkLinearColorspace
? vk::ConvertToLinear(vkFormat.vkImageFormat) ? vk::ConvertToLinear(vkFormat.vkImageFormat)
: vk::ConvertToSRGB(vkFormat.vkImageFormat); : vk::ConvertToSRGB(vkFormat.vkImageFormat);
ASSERT(reinterpretedFormat != VK_FORMAT_UNDEFINED);
if (!rendererVk->haveSameFormatFeatureBits(vkFormat.vkImageFormat, reinterpretedFormat)) constexpr uint32_t kBitsSampleFilter =
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
if (!rendererVk->hasImageFormatFeatureBits(reinterpretedFormat, kBitsSampleFilter))
{ {
return false; return false;
} }
} }
} }
return true; return 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