Commit dce09168 by James Darpinian Committed by Commit Bot

Enable unfold_short_circuits workaround on Apple.

Bug: angleproject:3957 Change-Id: I49ba77b2daeed01a2b668fc68c26663e87997ad5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1838421Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
parent fb568849
......@@ -348,6 +348,13 @@ struct FeaturesGL : FeatureSetBase
"rgb_dxt1_textures_sample_zero_alpha", FeatureCategory::OpenGLWorkarounds,
"Sampling BLACK texels from RGB DXT1 textures returns transparent black on Mac.", &members,
"http://anglebug.com/3729"};
// Mac incorrectly executes both sides of && and || expressions when they should short-circuit.
Feature unfoldShortCircuits = {
"unfold_short_circuits", FeatureCategory::OpenGLWorkarounds,
"Mac incorrectly executes both sides of && and || expressions when they should "
"short-circuit.",
&members, "http://anglebug.com/482"};
};
inline FeaturesGL::FeaturesGL() = default;
......
......@@ -338,6 +338,11 @@ std::shared_ptr<WaitableCompileEvent> ShaderGL::compile(const gl::Context *conte
additionalOptions |= SH_ADD_BASE_VERTEX_TO_VERTEX_ID;
}
if (features.unfoldShortCircuits.enabled)
{
additionalOptions |= SH_UNFOLD_SHORT_CIRCUIT;
}
options |= additionalOptions;
auto workerThreadPool = context->getWorkerThreadPool();
......
......@@ -1562,6 +1562,8 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
IsApple() || (IsWindows() && isAMD))
ANGLE_FEATURE_CONDITION(features, rgbDXT1TexturesSampleZeroAlpha, IsApple())
ANGLE_FEATURE_CONDITION(features, unfoldShortCircuits, IsApple())
}
void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
......
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