Commit 8930f182 by Charlie Lao Committed by Commit Bot

Vulkan: Add feature flag to fallback rotation to use driver uniform

It appears that older Qualcomm driver has some serious performance issue with specialization constant. This does not happen with latest development driver. This adds a feature flag to pick driver uniform path for older driver. Bug: b/173636783 Change-Id: Ia494fedbb1e0e69fbd8c44f8457c1bc30bc9fa4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2547809Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
parent 6bdeacb1
...@@ -447,6 +447,13 @@ struct FeaturesVk : FeatureSetBase ...@@ -447,6 +447,13 @@ struct FeaturesVk : FeatureSetBase
Feature emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures, Feature emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures,
"Emulate 270-degree prerotation.", &members, "Emulate 270-degree prerotation.", &members,
"http://anglebug.com/4901"}; "http://anglebug.com/4901"};
// Whether we should use driver uniforms over specialization constants for some shader
// modifications like yflip and rotation.
Feature forceDriverUniformOverSpecConst = {
"forceDriverUniformOverSpecConst", FeatureCategory::VulkanWorkarounds,
"Forces using driver uniforms instead of specialization constants.", &members,
"http://issuetracker.google.com/173636783"};
}; };
inline FeaturesVk::FeaturesVk() = default; inline FeaturesVk::FeaturesVk() = default;
......
...@@ -1738,7 +1738,8 @@ void RendererVk::initFeatures(DisplayVk *displayVk, ...@@ -1738,7 +1738,8 @@ void RendererVk::initFeatures(DisplayVk *displayVk,
return; return;
} }
constexpr uint32_t kPixel2DriverWithRelaxedPrecision = 0x801EA000; constexpr uint32_t kPixel2DriverWithRelaxedPrecision = 0x801EA000;
constexpr uint32_t kPixel4DriverWithWorkingSpecConstSupport = 0x80201000;
bool isAMD = IsAMD(mPhysicalDeviceProperties.vendorID); bool isAMD = IsAMD(mPhysicalDeviceProperties.vendorID);
bool isIntel = IsIntel(mPhysicalDeviceProperties.vendorID); bool isIntel = IsIntel(mPhysicalDeviceProperties.vendorID);
...@@ -1953,6 +1954,12 @@ void RendererVk::initFeatures(DisplayVk *displayVk, ...@@ -1953,6 +1954,12 @@ void RendererVk::initFeatures(DisplayVk *displayVk,
ANGLE_FEATURE_CONDITION(&mFeatures, supportsShaderImageFloat32Atomics, ANGLE_FEATURE_CONDITION(&mFeatures, supportsShaderImageFloat32Atomics,
mShaderAtomicFloatFeature.shaderImageFloat32Atomics == VK_TRUE); mShaderAtomicFloatFeature.shaderImageFloat32Atomics == VK_TRUE);
// http://issuetracker.google.com/173636783 Qualcomm driver appears having issues with
// specialization constant
ANGLE_FEATURE_CONDITION(&mFeatures, forceDriverUniformOverSpecConst,
isQualcomm && mPhysicalDeviceProperties.driverVersion <
kPixel4DriverWithWorkingSpecConstSupport);
// The compute shader used to generate mipmaps uses a 256-wide workgroup. This path is only // The compute shader used to generate mipmaps uses a 256-wide workgroup. This path is only
// enabled on devices that meet this minimum requirement. Furthermore, // enabled on devices that meet this minimum requirement. Furthermore,
// VK_IMAGE_USAGE_STORAGE_BIT is detrimental to performance on many platforms, on which this // VK_IMAGE_USAGE_STORAGE_BIT is detrimental to performance on many platforms, on which this
......
...@@ -73,7 +73,10 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte ...@@ -73,7 +73,10 @@ std::shared_ptr<WaitableCompileEvent> ShaderVk::compile(const gl::Context *conte
compileOptions |= SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION; compileOptions |= SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION;
// Let compiler use specialized constant for pre-rotation. // Let compiler use specialized constant for pre-rotation.
compileOptions |= SH_USE_ROTATION_SPECIALIZATION_CONSTANT; if (!contextVk->getFeatures().forceDriverUniformOverSpecConst.enabled)
{
compileOptions |= SH_USE_ROTATION_SPECIALIZATION_CONSTANT;
}
if (contextVk->getFeatures().enablePreRotateSurfaces.enabled || if (contextVk->getFeatures().enablePreRotateSurfaces.enabled ||
contextVk->getFeatures().emulatedPrerotation90.enabled || contextVk->getFeatures().emulatedPrerotation90.enabled ||
......
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