Commit 828acb39 by jchen10 Committed by Commit Bot

Enable ParallelCompile for Mac

Linked in parallel, GLSLTest_ES3.LargeNumberOfFloat4Parameters fails on the Mac asan bots. It looks a driver bug caused by handling some long GLSL expressions. This works around it by breaking down the expression in the test from: return a0 + a1 + ... + alast; to: vec4 sum = vec4(0, 0, 0, 0); sum += a0; sum += a1; ... sum += alast; return sum; This also fixes a CGLPixelFormat leak, although it's irrelevant to the bot failures. BUG=922936 BUG=angleproject:3087 BUG=angleproject:3047 Change-Id: I20249ada43e9dd226f582a568ed4ed50a0e4375d Reviewed-on: https://chromium-review.googlesource.com/c/1426430Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
parent 0c2c923e
...@@ -109,7 +109,11 @@ void DisplayCGL::terminate() ...@@ -109,7 +109,11 @@ void DisplayCGL::terminate()
DisplayGL::terminate(); DisplayGL::terminate();
mRenderer.reset(); mRenderer.reset();
if (mPixelFormat != nullptr)
{
CGLDestroyPixelFormat(mPixelFormat);
mPixelFormat = nullptr;
}
if (mContext != nullptr) if (mContext != nullptr)
{ {
CGLSetCurrentContext(nullptr); CGLSetCurrentContext(nullptr);
......
...@@ -1446,7 +1446,7 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround ...@@ -1446,7 +1446,7 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround
workarounds->dontRelinkProgramsInParallel = IsAndroid() || (IsWindows() && IsIntel(vendor)); workarounds->dontRelinkProgramsInParallel = IsAndroid() || (IsWindows() && IsIntel(vendor));
workarounds->disableWorkerContexts = true; workarounds->disableWorkerContexts = !IsApple();
} }
void ApplyWorkarounds(const FunctionsGL *functions, gl::Workarounds *workarounds) void ApplyWorkarounds(const FunctionsGL *functions, gl::Workarounds *workarounds)
......
...@@ -1911,13 +1911,8 @@ TEST_P(GLSLTest_ES3, AmbiguousFunctionCall2x2) ...@@ -1911,13 +1911,8 @@ TEST_P(GLSLTest_ES3, AmbiguousFunctionCall2x2)
// the function name being too long. // the function name being too long.
TEST_P(GLSLTest_ES3, LargeNumberOfFloat4Parameters) TEST_P(GLSLTest_ES3, LargeNumberOfFloat4Parameters)
{ {
// TODO(cwallez@chromium.org): crashing on Mac ASAN, see http://anglebug.com/3087
ANGLE_SKIP_TEST_IF(IsOSX());
std::stringstream vertexShaderStream; std::stringstream vertexShaderStream;
// This fails on Macos if the number of parameters is larger than 978 when linking in parallel. const unsigned int paramCount = 1024u;
// http://anglebug.com/3047
const unsigned int paramCount = (IsOSX() ? 978u : 1024u);
vertexShaderStream << "#version 300 es\n" vertexShaderStream << "#version 300 es\n"
"precision highp float;\n" "precision highp float;\n"
...@@ -1929,12 +1924,13 @@ TEST_P(GLSLTest_ES3, LargeNumberOfFloat4Parameters) ...@@ -1929,12 +1924,13 @@ TEST_P(GLSLTest_ES3, LargeNumberOfFloat4Parameters)
} }
vertexShaderStream << "vec4 aLast)\n" vertexShaderStream << "vec4 aLast)\n"
"{\n" "{\n"
" return "; " vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);\n";
for (unsigned int i = 0; i < paramCount; ++i) for (unsigned int i = 0; i < paramCount; ++i)
{ {
vertexShaderStream << "a" << i << " + "; vertexShaderStream << " sum += a" << i << ";\n";
} }
vertexShaderStream << "aLast;\n" vertexShaderStream << " sum += aLast;\n"
" return sum;\n "
"}\n" "}\n"
"void main()\n" "void main()\n"
"{\n" "{\n"
......
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