diff --git a/include/platform/FrontendFeatures.h b/include/platform/FrontendFeatures.h index d9eec66bc..2c0ad3381 100644 --- a/include/platform/FrontendFeatures.h +++ b/include/platform/FrontendFeatures.h @@ -44,6 +44,11 @@ struct FrontendFeatures : angle::FeatureSetBase "On Windows Intel OpenGL drivers TexImage sometimes seems to interact " "with the Framebuffer", &members}; + + angle::Feature scalarizeVecAndMatConstructorArgs = { + "scalarize_vec_and_mat_constructor_args", angle::FeatureCategory::FrontendWorkarounds, + "Always rewrite vec/mat constructors to be consistent", &members, + "http://crbug.com/398694"}; }; inline FrontendFeatures::FrontendFeatures() = default; diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp index ccccc0740..fe7cbfd13 100644 --- a/src/libANGLE/Display.cpp +++ b/src/libANGLE/Display.cpp @@ -1350,6 +1350,7 @@ void Display::initializeFrontendFeatures() { // Enable on all Impls mFrontendFeatures.loseContextOnOutOfMemory.enabled = true; + mFrontendFeatures.scalarizeVecAndMatConstructorArgs.enabled = true; mImplementation->initializeFrontendFeatures(&mFrontendFeatures); diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp index b1007310d..29f9097bf 100644 --- a/src/libANGLE/Shader.cpp +++ b/src/libANGLE/Shader.cpp @@ -22,6 +22,7 @@ #include "libANGLE/ResourceManager.h" #include "libANGLE/renderer/GLImplFactory.h" #include "libANGLE/renderer/ShaderImpl.h" +#include "platform/FrontendFeatures.h" namespace gl { @@ -342,6 +343,11 @@ void Shader::compile(const Context *context) options |= SH_VALIDATE_LOOP_INDEXING; } + if (context->getFrontendFeatures().scalarizeVecAndMatConstructorArgs.enabled) + { + options |= SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS; + } + mCurrentMaxComputeWorkGroupInvocations = context->getCaps().maxComputeWorkGroupInvocations; ASSERT(mBoundCompiler.get());