Merge pull request #1039 from KhronosGroup/fix-1038

Workaround GCC 9 bug.
This commit is contained in:
Hans-Kristian Arntzen 2019-06-24 11:10:12 +02:00 committed by GitHub
commit 9c57364f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,13 @@ static const char *vector_swizzle(int vecsize, int index)
{ ".x", ".y", ".z", ".w" }, { ".x", ".y", ".z", ".w" },
{ ".xy", ".yz", ".zw", nullptr }, { ".xy", ".yz", ".zw", nullptr },
{ ".xyz", ".yzw", nullptr, nullptr }, { ".xyz", ".yzw", nullptr, nullptr },
#if defined(__GNUC__) && (__GNUC__ == 9)
// This works around a GCC 9 bug, see details in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90947.
// This array ends up being compiled as all nullptrs, tripping the assertions below.
{ "", nullptr, nullptr, "$" },
#else
{ "", nullptr, nullptr, nullptr }, { "", nullptr, nullptr, nullptr },
#endif
}; };
assert(vecsize >= 1 && vecsize <= 4); assert(vecsize >= 1 && vecsize <= 4);