diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h index cc6dd2cde..9326177ca 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h @@ -50,6 +50,8 @@ typedef struct token_list token_list_t; typedef union YYSTYPE { + // Could be int, but results in some bugs with parsing of #version directives + // in Apple LLVM Compiler 4.2 when building for 32 bit. int ival; char *str; string_list_t *string_list; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp index 1b3dd078b..0a5e647cd 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp @@ -239,11 +239,6 @@ public: bool progress; }; -#if defined(__GNUC__) -// BK - 'gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2' -// If destroy_links is inlined code crashes in n->remove(). -__attribute__((noinline)) -#endif // defined(__GNUC__) static void destroy_links(exec_list *list, function *f) { diff --git a/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj b/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj index 6938d822f..0e267c74b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj +++ b/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../talloc;../../../include;../../mesa;../../mapi;../../../include/c99" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="3" @@ -113,7 +113,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../talloc;../../../include;../../mesa;../../mapi;../../../include/c99" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup" MinimalRebuild="false" ExceptionHandling="0" BasicRuntimeChecks="3" @@ -182,7 +182,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="../../talloc;../../../include;../../mesa;../../mapi;../../../include/c99" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup" ExceptionHandling="0" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -251,7 +251,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="../../talloc;../../../include;../../mesa;../../mapi;../../../include/c99" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup" ExceptionHandling="0" RuntimeLibrary="0" EnableFunctionLevelLinking="true" diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt index 14e94f70e..ad4d9acaf 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt @@ -1,19 +1,19 @@ -// Used to expose bugs in constant variable optimization, -// when variables were deemed constant not taking into -// account branches or previous dereferences of them. - -uniform float mode; -float func (float c) { - if (mode == 2.0) - return c; - if (mode == 3.0) - discard; - if (mode == 10.0) - c = 0.1; - return c; -} -void main() { - vec4 c = gl_FragCoord; - c.x = func(c.x); - gl_FragColor = c; -} +// Used to expose bugs in constant variable optimization, +// when variables were deemed constant not taking into +// account branches or previous dereferences of them. + +uniform float mode; +float func (float c) { + if (mode == 2.0) + return c; + if (mode == 3.0) + discard; + if (mode == 10.0) + c = 0.1; + return c; +} +void main() { + vec4 c = gl_FragCoord; + c.x = func(c.x); + gl_FragColor = c; +} diff --git a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp index 370ea4378..8b9546976 100644 --- a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp +++ b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp @@ -436,9 +436,9 @@ int main (int argc, const char** argv) float timeDelta = float(time1-time0)/CLOCKS_PER_SEC; if (errors != 0) - printf ("\n**** %i tests (%.2fsec), %i !!!FAILED!!!\n", tests, timeDelta, errors); + printf ("\n**** %i tests (%.2fsec), %i !!!FAILED!!!\n", (int)tests, timeDelta, (int)errors); else - printf ("\n**** %i tests (%.2fsec) succeeded\n", tests, timeDelta); + printf ("\n**** %i tests (%.2fsec) succeeded\n", (int)tests, timeDelta); // 3.25s // with builtin call linking, 3.84s