diff --git a/3rdparty/glsl-optimizer/.gitignore b/3rdparty/glsl-optimizer/.gitignore index a60412b25..991ef389b 100644 --- a/3rdparty/glsl-optimizer/.gitignore +++ b/3rdparty/glsl-optimizer/.gitignore @@ -2,8 +2,11 @@ *.dll *.exe *.ilk +*.sdf +*.opensdf *.la *.lo +*.log *.o *.obj *.os @@ -17,6 +20,7 @@ *.tar *.tar.bz2 *.tar.gz +*.trs *.zip *~ depend @@ -36,11 +40,14 @@ config.py build libtool manifest.txt -Makefile.in .dir-locals.el .deps/ +.dirstamp .libs/ -/Makefile +Makefile +Makefile.in + +ipch *.pbxuser *.perspectivev3 @@ -65,3 +72,5 @@ glslopt glsl_compiler .settings/ .pydevproject + +build \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/.npmignore b/3rdparty/glsl-optimizer/.npmignore new file mode 100644 index 000000000..16686d204 --- /dev/null +++ b/3rdparty/glsl-optimizer/.npmignore @@ -0,0 +1,2 @@ +projects +tests diff --git a/3rdparty/glsl-optimizer/CMakeLists.txt b/3rdparty/glsl-optimizer/CMakeLists.txt index 9f400b82e..1215af7a3 100644 --- a/3rdparty/glsl-optimizer/CMakeLists.txt +++ b/3rdparty/glsl-optimizer/CMakeLists.txt @@ -17,11 +17,11 @@ else() endif() file(GLOB glcpp-library_sources src/glsl/glcpp/*.c) -file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c) -list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove}) +#file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c) +#list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove}) add_library(glcpp-library ${glcpp-library_sources}) -file(GLOB mesa_sources src/mesa/program/*.c) +file(GLOB mesa_sources src/mesa/program/*.c src/mesa/main/*.c) add_library(mesa ${mesa_sources}) file(GLOB glsl_sources src/glsl/*.cpp src/glsl/*.c) @@ -41,5 +41,5 @@ file(GLOB glslopt_sources contrib/glslopt/*.cpp) add_executable(glslopt ${glslopt_sources}) target_link_libraries(glslopt glsl_optimizer) -add_executable(glcpp src/glsl/glcpp/glcpp.c) -target_link_libraries(glcpp glsl_optimizer) \ No newline at end of file +#add_executable(glcpp src/glsl/glcpp/glcpp.c) +#target_link_libraries(glcpp glsl_optimizer) diff --git a/3rdparty/glsl-optimizer/Changelog.md b/3rdparty/glsl-optimizer/Changelog.md new file mode 100644 index 000000000..31fb93c89 --- /dev/null +++ b/3rdparty/glsl-optimizer/Changelog.md @@ -0,0 +1,60 @@ +GLSL optimizer Change Log +========================= + +2014 01 +------- + +Goodies: + +* Better optimization: vectorize assignments to individual vector channels. +* More OpenGL ES 2.0 conformant printing of complex for-loops (loop inductions printed + as += or ++; loop initializers inside loop body). + +Fixes: + +* Fixed array assignments sometimes appearing in pre-GLSL1.20 versions, especially with + complex loops that couldn't be unrolled. +* Fixed output of textureOffset and texelFetch. + +2013 12 +------- + +Goodies: + +* Optimized performance; was spending half of the time in stupid string code. +* Added glslopt_shader_get_stats to get *very* approximate shader complexity stats. +* Nicer printing of complicated for-loops. + +Fixes: + +* Fixed printing of struct initializers. + + +2013 11 +------- + +Goodies: + +* Better optimizations: CSE; `A+(-B) => A-B`; `!A || !B => !(A && B)`. +* Merged with upstream Mesa. + +Fixes: + +* Fixed location qualifiers, ES3.0 version printing, samplerCubeShadow sampling operations. + + +2013 10 +------- + +Goodies: + +* Initial OpenGL ES 3.0 support +* API to query shader input names; glslopt_shader_get_input_count and glslopt_shader_get_input_name + +Changes: + +* Xcode project files updated to Xcode 5 + +Fixes: + +* VS2013 fixes diff --git a/3rdparty/glsl-optimizer/README.md b/3rdparty/glsl-optimizer/README.md index 28f9c4856..aa89f1d3f 100644 --- a/3rdparty/glsl-optimizer/README.md +++ b/3rdparty/glsl-optimizer/README.md @@ -15,18 +15,24 @@ compiler; all this library does is spits out optimized GLSL back, and adds GLES handling to the optimizer. This GLSL optimizer is made for [Unity's](http://unity3d.com/) purposes and is built-in -in [Unity 3](http://unity3d.com/unity/whats-new/unity-3) and later. +starting with Unity 3.0. GLSL Optimizer is licensed according to the terms of the MIT license. +See badly maintained [change log](Changelog.md). + Usage ----- -Visual Studio 2008 (Windows, x86) and Xcode 4.5+ (Mac, i386) project files for a static -library are provided in `src/glsl/msvc/mesaglsl2.vcproj` and `src/glsl/xcode/mesaglsl2` +Visual Studio 2010 (Windows, x86/x64) and Xcode 5+ (Mac, i386) project files for a static +library are provided in `projects/vs2010/glsl_optimizer.sln` and `projects/xcode5/glsl_optimizer_lib` respectively. +> Note: only the VS and Xcode project files are maintained and should work at any time. +> There's also a cmake and gyp build system for Linux et al., and some stuff in contrib folder - +> all that may or might not work. + For Linux you can use cmake. Just type "cmake . && make" in the root directory. This will build the optimizer library and some executable binaries. @@ -44,9 +50,44 @@ Interface for the library is `src/glsl/glsl_optimizer.h`. General usage is: } glslopt_cleanup (ctx); + +Tests +----- + +There's a testing suite for catching regressions, see `tests` folder. In VS, build +and run `glsl_optimizer_tests` project; in Xcode use `projects/xcode5/glsl_optimizer_tests` +project. The test executable requires path to the `tests` folder as an argument. + +Each test comes as three text files; input, expected IR dump and expected optimized +GLSL dump. + +If you're making changes to the project and want pull requests accepted easier, I'd +appreciate if there would be no test suite regressions. If you are implementing a +feature, it would be cool to add tests to cover it as well! + + Notes ----- * GLSL versions 1.10 and 1.20 are supported. 1.10 is the default, use #version 120 to specify 1.20. -* GLSL ES version 1.00 is supported. +* GLSL ES versions 1.00 and 3.00 are supported. + + +Dev Notes +--------- + +Pulling Mesa upstream: + + git fetch upstream + git merge upstream/master + sh removeDeletedByUs.sh + # inspect files, git rm unneeded ones, fix conflicts etc. + # git commit + +Rebuilding flex/bison parsers: + +* When .y/.l files are changed, the parsers are *not* rebuilt automatically, +* Run ./generateParsers.sh to do that. You'll need bison & flex (on Mac, do "Install Command Line Tools" from Xcode) +* I use bison 2.3 and flex 2.5.35 (in OS X 10.8/10.9) + diff --git a/3rdparty/glsl-optimizer/binding.gyp b/3rdparty/glsl-optimizer/binding.gyp new file mode 100644 index 000000000..92ae42c6e --- /dev/null +++ b/3rdparty/glsl-optimizer/binding.gyp @@ -0,0 +1,25 @@ +{ + 'includes': [ + 'target_defaults.gypi', + ], + 'targets': [ + { + 'target_name': 'glslOptimizer', + 'dependencies': [ + 'src/glsl_optimizer_lib.gyp:*', + ], + 'sources': [ + 'src/node/binding.cpp', + 'src/node/compiler.cpp', + 'src/node/compiler.h', + 'src/node/shader.cpp', + 'src/node/shader.h', + ], + 'conditions': [ + ['OS=="win"', { + 'msvs_disabled_warnings': [4506], + }], + ], + } + ] +} diff --git a/3rdparty/glsl-optimizer/include/c99/stdbool.h b/3rdparty/glsl-optimizer/include/c99/stdbool.h index 304108217..53439550c 100644 --- a/3rdparty/glsl-optimizer/include/c99/stdbool.h +++ b/3rdparty/glsl-optimizer/include/c99/stdbool.h @@ -35,7 +35,8 @@ #define bool _Bool /* For compilers that don't have the builtin _Bool type. */ -#if (defined(_MSC_VER) || (__STDC_VERSION__ < 199901L && __GNUC__ < 3)) && !defined(_lint) +#if ((defined(_MSC_VER) && _MSC_VER < 1800) || \ + (defined __GNUC__&& __STDC_VERSION__ < 199901L && __GNUC__ < 3)) && !defined(_lint) typedef unsigned char _Bool; #endif diff --git a/3rdparty/glsl-optimizer/include/c99_compat.h b/3rdparty/glsl-optimizer/include/c99_compat.h new file mode 100644 index 000000000..429c60148 --- /dev/null +++ b/3rdparty/glsl-optimizer/include/c99_compat.h @@ -0,0 +1,145 @@ +/************************************************************************** + * + * Copyright 2007-2013 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef _C99_COMPAT_H_ +#define _C99_COMPAT_H_ + + +/* + * MSVC hacks. + */ +#if defined(_MSC_VER) + /* + * Visual Studio 2012 will complain if we define the `inline` keyword, but + * actually it only supports the keyword on C++. + * + * To avoid this the _ALLOW_KEYWORD_MACROS must be set. + */ +# if (_MSC_VER >= 1700) && !defined(_ALLOW_KEYWORD_MACROS) +# define _ALLOW_KEYWORD_MACROS +# endif + + /* + * XXX: MSVC has a `__restrict` keyword, but it also has a + * `__declspec(restrict)` modifier, so it is impossible to define a + * `restrict` macro without interfering with the latter. Furthermore the + * MSVC standard library uses __declspec(restrict) under the _CRTRESTRICT + * macro. For now resolve this issue by redefining _CRTRESTRICT, but going + * forward we should probably should stop using restrict, especially + * considering that our code does not obbey strict aliasing rules any way. + */ +# include +# undef _CRTRESTRICT +# define _CRTRESTRICT +#endif + + +/* + * C99 inline keyword + */ +#ifndef inline +# ifdef __cplusplus + /* C++ supports inline keyword */ +# elif defined(__GNUC__) +# define inline __inline__ +# elif defined(_MSC_VER) +# define inline __inline +# elif defined(__ICL) +# define inline __inline +# elif defined(__INTEL_COMPILER) + /* Intel compiler supports inline keyword */ +# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) +# define inline __inline +# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) + /* C99 supports inline keyword */ +# elif (__STDC_VERSION__ >= 199901L) + /* C99 supports inline keyword */ +# else +# define inline +# endif +#endif + + +/* + * C99 restrict keyword + * + * See also: + * - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html + */ +#ifndef restrict +# if (__STDC_VERSION__ >= 199901L) + /* C99 */ +# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) + /* C99 */ +# elif defined(__GNUC__) +# define restrict __restrict__ +# elif defined(_MSC_VER) +# define restrict __restrict +# else +# define restrict /* */ +# endif +#endif + + +/* + * C99 __func__ macro + */ +#ifndef __func__ +# if (__STDC_VERSION__ >= 199901L) + /* C99 */ +# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) + /* C99 */ +# elif defined(__GNUC__) +# if __GNUC__ >= 2 +# define __func__ __FUNCTION__ +# else +# define __func__ "" +# endif +# elif defined(_MSC_VER) +# if _MSC_VER >= 1300 +# define __func__ __FUNCTION__ +# else +# define __func__ "" +# endif +# else +# define __func__ "" +# endif +#endif + + +/* Simple test case for debugging */ +#if 0 +static inline const char * +test_c99_compat_h(const void * restrict a, + const void * restrict b) +{ + return __func__; +} +#endif + + +#endif /* _C99_COMPAT_H_ */ diff --git a/3rdparty/glsl-optimizer/license.txt b/3rdparty/glsl-optimizer/license.txt index 6ef971544..11a04bb6f 100644 --- a/3rdparty/glsl-optimizer/license.txt +++ b/3rdparty/glsl-optimizer/license.txt @@ -1,7 +1,7 @@ GLSL Optimizer is licensed according to the terms of the MIT license: Copyright (C) 1999-2007 Brian Paul All Rights Reserved. -Copyright (C) 2010-2011 Unity Technologies All Rights Reserved. +Copyright (C) 2010-2013 Unity Technologies All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/3rdparty/glsl-optimizer/package.json b/3rdparty/glsl-optimizer/package.json new file mode 100644 index 000000000..dcce14002 --- /dev/null +++ b/3rdparty/glsl-optimizer/package.json @@ -0,0 +1,21 @@ +{ + "name": "glsl-optimizer", + "version": "0.1.0", + "description": "GLSL optimizer", + "main": "build/Release/glslOptimizer.node", + "scripts": { + "install": "node-gyp rebuild" + }, + "repository": { + "type": "git", + "url": "https://github.com/donny-dont/glsl-optimizer.git" + }, + "keywords": [ + "glsl", + "webgl" + ], + "author": "Don Olmstead", + "license": "MIT", + "gypfile": true, + "readmeFilename": "README.md" +} diff --git a/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.sln b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln similarity index 77% rename from 3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.sln rename to 3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln index 06fa8ded8..c76389f1f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.sln +++ b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln @@ -1,12 +1,9 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mesaglsl2", "mesaglsl2.vcproj", "{B475A403-9D9B-410D-8A93-BA49FC4DD811}" +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_optimizer_lib", "glsl_optimizer_lib.vcxproj", "{B475A403-9D9B-410D-8A93-BA49FC4DD811}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_optimizer_tests", "..\..\..\tests\glsl_optimizer_tests.vcproj", "{BB382242-6EBB-445F-989C-B9BA61D17965}" - ProjectSection(ProjectDependencies) = postProject - {B475A403-9D9B-410D-8A93-BA49FC4DD811} = {B475A403-9D9B-410D-8A93-BA49FC4DD811} - EndProjectSection +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_optimizer_tests", "glsl_optimizer_tests.vcxproj", "{BB382242-6EBB-445F-989C-B9BA61D17965}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj new file mode 100644 index 000000000..4e573f9a4 --- /dev/null +++ b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj @@ -0,0 +1,365 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {B475A403-9D9B-410D-8A93-BA49FC4DD811} + glsl_optimizer_lib + Win32Proj + + + + StaticLibrary + Unicode + false + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + false + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + build/$(ProjectName)\$(Configuration)\ + build/$(ProjectName)\$(Configuration)\ + build/$(ProjectName)/$(Platform)/$(Configuration)\ + build/$(ProjectName)/$(Platform)/$(Configuration)\ + build/$(Platform)\$(Configuration)\ + build/$(Platform)\$(Configuration)\ + build/$(ProjectName)/$(Platform)/$(Configuration)\ + build/$(ProjectName)/$(Platform)/$(Configuration)\ + + + + Disabled + ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebug + false + + + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + %(ForcedIncludeFiles) + + + $(OutDir)$(ProjectName)-win32.lib + + + + + X64 + + + Disabled + ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebug + false + + + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + %(ForcedIncludeFiles) + + + $(OutDir)$(ProjectName)-x64.lib + + + + + MaxSpeed + true + ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) + + + MultiThreaded + true + false + + + Level3 + OldStyle + 4996;%(DisableSpecificWarnings) + %(ForcedIncludeFiles) + + + $(OutDir)$(ProjectName)-win32.lib + + + + + X64 + + + MaxSpeed + true + ../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions) + + + MultiThreaded + true + false + + + Level3 + OldStyle + 4996;%(DisableSpecificWarnings) + %(ForcedIncludeFiles) + + + $(OutDir)$(ProjectName)-x64.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + + + + + + + Document + true + true + true + true + + + Document + true + true + true + true + + + Document + true + true + true + true + + + Document + true + true + true + true + + + + + + + \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters new file mode 100644 index 000000000..69d49d115 --- /dev/null +++ b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters @@ -0,0 +1,497 @@ + + + + + {95543dab-5f63-41a8-8860-7e1659edc0b2} + + + {c4cf23cb-22b9-4496-9cf7-8b25dc1e405f} + + + {7ec0058a-15c6-427d-9fce-27af39000e81} + + + {28f43e08-dfe8-424d-886c-db6e2ee33957} + + + {fd238409-ea7e-4bbe-8566-d5b8e7330242} + + + {b58605f3-8f5a-4800-838c-a0a04d1bdc96} + + + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl\glcpp + + + src\glsl\glcpp + + + src\mesa\program + + + src\mesa\program + + + src\mesa\program + + + src\mesa\program + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\mesa\main + + + src\glsl + + + src\mesa\main + + + src\mesa\program + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl\glcpp + + + src\glsl\glcpp + + + src\glsl\glcpp + + + src\glsl\glcpp + + + src\mesa\program + + + src\mesa\main + + + src\mesa\main + + + src\mesa\program + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + src\glsl + + + + + + + + src\glsl + + + src\glsl + + + src\glsl\glcpp + + + src\glsl\glcpp + + + \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj new file mode 100644 index 000000000..d22325b3b --- /dev/null +++ b/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {BB382242-6EBB-445F-989C-B9BA61D17965} + glsl_optimizer_tests + Win32Proj + + + + Application + Unicode + false + + + Application + Unicode + + + Application + Unicode + false + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + build/$(ProjectName)/$(Configuration)\ + build/$(ProjectName)/$(Configuration)\ + true + false + false + build/$(ProjectName)/$(Platform)/$(Configuration)\ + build/$(ProjectName)/$(Platform)/$(Configuration)\ + true + false + false + build/$(ProjectName)/$(Configuration)\ + build/$(ProjectName)/$(Configuration)\ + false + false + false + build/$(ProjectName)/$(Platform)/$(Configuration)\ + build/$(ProjectName)/$(Platform)/$(Configuration)\ + false + false + false + + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + opengl32.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + + + + X64 + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + opengl32.lib;%(AdditionalDependencies) + true + Console + MachineX64 + + + + + MaxSpeed + true + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + true + + + Level3 + ProgramDatabase + + + opengl32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX86 + + + + + X64 + + + MaxSpeed + true + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + true + + + Level3 + ProgramDatabase + + + opengl32.lib;%(AdditionalDependencies) + true + Console + true + true + MachineX64 + + + + + {b475a403-9d9b-410d-8a93-ba49fc4dd811} + false + + + + + + + + + \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/src/glsl/xcode/mesaglsl2.xcodeproj/project.pbxproj b/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj similarity index 62% rename from 3rdparty/glsl-optimizer/src/glsl/xcode/mesaglsl2.xcodeproj/project.pbxproj rename to 3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj index acc96c69d..1e2632683 100644 --- a/3rdparty/glsl-optimizer/src/glsl/xcode/mesaglsl2.xcodeproj/project.pbxproj +++ b/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj @@ -26,32 +26,22 @@ 2B3854711293BE5000F3E692 /* opt_structure_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */; }; 2B3854721293BE5000F3E692 /* opt_swizzle_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */; }; 2B3854731293BE5000F3E692 /* opt_tree_grafting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */; }; - 2B3A6B8F15FA043D000DCBE1 /* link_uniforms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */; }; 2B3A6B9015FA043D000DCBE1 /* link_uniforms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */; }; - 2B3A6B9615FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */; }; 2B3A6B9715FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */; }; - 2B3A6BA215FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */; }; - 2B3A6BA315FA0494000DCBE1 /* lower_discard_flow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */; }; - 2B3A6BA415FA0494000DCBE1 /* lower_output_reads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */; }; - 2B3A6BA615FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */; }; - 2B3A6BA715FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */; }; 2B3A6BA815FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */; }; 2B3A6BA915FA0494000DCBE1 /* lower_discard_flow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */; }; 2B3A6BAA15FA0494000DCBE1 /* lower_output_reads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */; }; 2B3A6BAC15FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */; }; 2B3A6BAD15FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */; }; - 2B3A6BD915FA08E1000DCBE1 /* ir_builder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */; }; 2B3A6BDA15FA08E1000DCBE1 /* ir_builder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */; }; 2B3A6BDB15FA08E1000DCBE1 /* ir_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B3A6BD815FA08E1000DCBE1 /* ir_builder.h */; }; - 2B47DA011209C87B00937F2C /* hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FD1209C87B00937F2C /* hash_table.c */; }; + 2B47DA011209C87B00937F2C /* prog_hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FD1209C87B00937F2C /* prog_hash_table.c */; }; 2B47DA021209C87B00937F2C /* hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B47D9FE1209C87B00937F2C /* hash_table.h */; }; 2B47DA031209C87B00937F2C /* symbol_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FF1209C87B00937F2C /* symbol_table.c */; }; 2B47DA041209C87B00937F2C /* symbol_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B47DA001209C87B00937F2C /* symbol_table.h */; }; 2B62491112191339003F6EEE /* ir_rvalue_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */; }; 2B62491212191339003F6EEE /* ir_rvalue_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */; }; - 2B655A7213E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */; }; 2B655A7313E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */; }; - 2B655A7813E0324F00B5278F /* standalone_scaffolding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */; }; 2B655A7913E0324F00B5278F /* standalone_scaffolding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */; }; 2B655A7A13E0324F00B5278F /* standalone_scaffolding.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */; }; 2B6A99F41223B1670059FBED /* glcpp-lex.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99EC1223B1670059FBED /* glcpp-lex.c */; }; @@ -64,84 +54,19 @@ 2B6AC7BB161EC99C0094FD86 /* prog_statevars.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */; }; 2B6AC7BD161EC9D40094FD86 /* ir_uniform.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */; }; 2B6AC8AD161ED9080094FD86 /* glminimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC8AC161ED9080094FD86 /* glminimal.h */; }; - 2B92A05D15F9FF4700CFED4A /* builtin_variables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */; }; + 2B78C91D1858B052007F5D2A /* ir_equals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B78C91C1858B052007F5D2A /* ir_equals.cpp */; }; + 2B8979DE182C0C4700718F8A /* builtin_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979DD182C0C4700718F8A /* builtin_functions.cpp */; }; + 2B8979E0182C195C00718F8A /* opt_cse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979DF182C195C00718F8A /* opt_cse.cpp */; }; + 2B8979E2182CB62900718F8A /* link_atomics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979E1182CB62900718F8A /* link_atomics.cpp */; }; 2B92A05E15F9FF4700CFED4A /* builtin_variables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */; }; + 2B9F0A3D189664F3002FF617 /* opt_vectorize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */; }; 2BA07FAB1352E7BB00A1C074 /* ralloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BA07FA91352E7BB00A1C074 /* ralloc.c */; }; 2BA07FAC1352E7BB00A1C074 /* ralloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA07FAA1352E7BB00A1C074 /* ralloc.h */; }; - 2BA080421352EBB900A1C074 /* ast_expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A511207FEA6002DC82D /* ast_expr.cpp */; }; - 2BA080431352EBB900A1C074 /* ast_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A521207FEA6002DC82D /* ast_function.cpp */; }; - 2BA080441352EBB900A1C074 /* ast_to_hir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */; }; - 2BA080451352EBB900A1C074 /* ast_type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A541207FEA6002DC82D /* ast_type.cpp */; }; - 2BA080471352EBB900A1C074 /* glsl_lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */; }; - 2BA080491352EBB900A1C074 /* glsl_parser_extras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */; }; - 2BA0804A1352EBB900A1C074 /* glsl_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */; }; - 2BA0804B1352EBB900A1C074 /* glsl_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A631207FEA6002DC82D /* glsl_types.cpp */; }; - 2BA0804C1352EBB900A1C074 /* hir_field_selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */; }; - 2BA0804D1352EBB900A1C074 /* ir_basic_block.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */; }; - 2BA0804E1352EBB900A1C074 /* ir_clone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A691207FEA6002DC82D /* ir_clone.cpp */; }; - 2BA0804F1352EBB900A1C074 /* ir_constant_expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */; }; - 2BA080501352EBB900A1C074 /* ir_expression_flattening.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */; }; - 2BA080511352EBB900A1C074 /* ir_function_can_inline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */; }; - 2BA080521352EBB900A1C074 /* ir_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A761207FEA6002DC82D /* ir_function.cpp */; }; - 2BA080531352EBB900A1C074 /* ir_hierarchical_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */; }; - 2BA080541352EBB900A1C074 /* ir_hv_accept.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */; }; - 2BA080551352EBB900A1C074 /* ir_import_prototypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A7D1207FEA6002DC82D /* ir_import_prototypes.cpp */; }; - 2BA080561352EBB900A1C074 /* ir_print_glsl_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */; }; - 2BA080571352EBB900A1C074 /* ir_print_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */; }; - 2BA080581352EBB900A1C074 /* ir_reader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A851207FEA6002DC82D /* ir_reader.cpp */; }; - 2BA080591352EBB900A1C074 /* ir_unused_structs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */; }; - 2BA0805A1352EBB900A1C074 /* ir_validate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */; }; - 2BA0805B1352EBB900A1C074 /* ir_variable_refcount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */; }; - 2BA0805D1352EBB900A1C074 /* ir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A931207FEA6002DC82D /* ir.cpp */; }; - 2BA0805E1352EBB900A1C074 /* link_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A951207FEA6002DC82D /* link_functions.cpp */; }; - 2BA0805F1352EBB900A1C074 /* linker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A961207FEA6002DC82D /* linker.cpp */; }; - 2BA080601352EBB900A1C074 /* s_expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */; }; - 2BA080611352EBB900A1C074 /* hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FD1209C87B00937F2C /* hash_table.c */; }; - 2BA080621352EBB900A1C074 /* symbol_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FF1209C87B00937F2C /* symbol_table.c */; }; - 2BA080631352EBB900A1C074 /* ir_rvalue_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */; }; - 2BA080641352EBB900A1C074 /* glcpp-lex.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99EC1223B1670059FBED /* glcpp-lex.c */; }; - 2BA080651352EBB900A1C074 /* glcpp-parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99EE1223B1670059FBED /* glcpp-parse.c */; }; - 2BA080661352EBB900A1C074 /* pp.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99F31223B1670059FBED /* pp.c */; }; - 2BA080671352EBB900A1C074 /* glsl_symbol_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */; }; - 2BA080681352EBB900A1C074 /* loop_analysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49211254706A00D42573 /* loop_analysis.cpp */; }; - 2BA080691352EBB900A1C074 /* loop_controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49231254706A00D42573 /* loop_controls.cpp */; }; - 2BA0806A1352EBB900A1C074 /* loop_unroll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49241254706A00D42573 /* loop_unroll.cpp */; }; - 2BA0806B1352EBB900A1C074 /* lower_noise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49251254706A00D42573 /* lower_noise.cpp */; }; - 2BA0806C1352EBB900A1C074 /* lower_variable_index_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */; }; - 2BA0806D1352EBB900A1C074 /* opt_redundant_jumps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */; }; - 2BA0806E1352EBB900A1C074 /* lower_if_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */; }; - 2BA0806F1352EBB900A1C074 /* lower_jumps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854491293BE5000F3E692 /* lower_jumps.cpp */; }; - 2BA080701352EBB900A1C074 /* lower_mat_op_to_vec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */; }; - 2BA080711352EBB900A1C074 /* lower_vec_index_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */; }; - 2BA080721352EBB900A1C074 /* lower_vec_index_to_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */; }; - 2BA080731352EBB900A1C074 /* opt_algebraic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */; }; - 2BA080741352EBB900A1C074 /* opt_constant_folding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */; }; - 2BA080751352EBB900A1C074 /* opt_constant_propagation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */; }; - 2BA080761352EBB900A1C074 /* opt_constant_variable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */; }; - 2BA080771352EBB900A1C074 /* opt_copy_propagation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */; }; - 2BA080781352EBB900A1C074 /* opt_dead_code_local.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */; }; - 2BA080791352EBB900A1C074 /* opt_dead_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */; }; - 2BA0807A1352EBB900A1C074 /* opt_dead_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */; }; - 2BA0807B1352EBB900A1C074 /* opt_function_inlining.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */; }; - 2BA0807C1352EBB900A1C074 /* opt_if_simplification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */; }; - 2BA0807D1352EBB900A1C074 /* opt_noop_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */; }; - 2BA0807E1352EBB900A1C074 /* opt_structure_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */; }; - 2BA0807F1352EBB900A1C074 /* opt_swizzle_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */; }; - 2BA080801352EBB900A1C074 /* opt_tree_grafting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */; }; - 2BA080811352EBB900A1C074 /* lower_discard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */; }; - 2BA080821352EBB900A1C074 /* lower_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */; }; - 2BA080831352EBB900A1C074 /* lower_vector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */; }; - 2BA080851352EBB900A1C074 /* strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AE12B8F1580052C6B0 /* strtod.c */; }; - 2BA080861352EBB900A1C074 /* ralloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BA07FA91352E7BB00A1C074 /* ralloc.c */; }; - 2BA080871352EBD100A1C074 /* builtin_stubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA080381352EB1A00A1C074 /* builtin_stubs.cpp */; }; - 2BA0808B1352EBFB00A1C074 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA0808A1352EBFB00A1C074 /* main.cpp */; }; 2BA55A9C1207FEA6002DC82D /* ast_expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A511207FEA6002DC82D /* ast_expr.cpp */; }; 2BA55A9D1207FEA6002DC82D /* ast_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A521207FEA6002DC82D /* ast_function.cpp */; }; 2BA55A9E1207FEA6002DC82D /* ast_to_hir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */; }; 2BA55A9F1207FEA6002DC82D /* ast_type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A541207FEA6002DC82D /* ast_type.cpp */; }; 2BA55AA01207FEA6002DC82D /* ast.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A551207FEA6002DC82D /* ast.h */; }; - 2BA55AA11207FEA6002DC82D /* builtin_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A561207FEA6002DC82D /* builtin_function.cpp */; }; - 2BA55AA21207FEA6002DC82D /* builtin_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A571207FEA6002DC82D /* builtin_types.h */; }; 2BA55AA41207FEA6002DC82D /* glsl_lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */; }; 2BA55AA61207FEA6002DC82D /* glsl_optimizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */; }; 2BA55AA71207FEA6002DC82D /* glsl_optimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */; }; @@ -171,8 +96,6 @@ 2BA55ACD1207FEA6002DC82D /* ir_print_glsl_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */; }; 2BA55ACE1207FEA6002DC82D /* ir_print_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */; }; 2BA55ACF1207FEA6002DC82D /* ir_print_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */; }; - 2BA55AD01207FEA6002DC82D /* ir_reader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A851207FEA6002DC82D /* ir_reader.cpp */; }; - 2BA55AD11207FEA6002DC82D /* ir_reader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A861207FEA6002DC82D /* ir_reader.h */; }; 2BA55AD51207FEA6002DC82D /* ir_unused_structs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */; }; 2BA55AD61207FEA6002DC82D /* ir_unused_structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */; }; 2BA55AD71207FEA6002DC82D /* ir_validate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */; }; @@ -188,6 +111,13 @@ 2BA55AE41207FEA6002DC82D /* program.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A991207FEA6002DC82D /* program.h */; }; 2BA55AE51207FEA6002DC82D /* s_expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */; }; 2BA55AE61207FEA6002DC82D /* s_expression.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A9B1207FEA6002DC82D /* s_expression.h */; }; + 2BA7E13F17D0AEB200D5C475 /* builtin_type_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA7E13817D0AEB200D5C475 /* builtin_type_macros.h */; }; + 2BA7E14017D0AEB200D5C475 /* builtin_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13917D0AEB200D5C475 /* builtin_types.cpp */; }; + 2BA7E14217D0AEB200D5C475 /* link_interface_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13A17D0AEB200D5C475 /* link_interface_blocks.cpp */; }; + 2BA7E14417D0AEB200D5C475 /* lower_named_interface_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */; }; + 2BA7E14617D0AEB200D5C475 /* lower_vector_insert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */; }; + 2BA7E14817D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */; }; + 2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */; }; 2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */; }; 2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */; }; 2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */; }; @@ -211,156 +141,183 @@ 2BBA492E1254706A00D42573 /* lower_noise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49251254706A00D42573 /* lower_noise.cpp */; }; 2BBA492F1254706A00D42573 /* lower_variable_index_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */; }; 2BBA49301254706A00D42573 /* opt_redundant_jumps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */; }; + 2BBD9DAD1719694100515007 /* ast_array_index.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DA91719693E00515007 /* ast_array_index.cpp */; }; + 2BBD9DAF1719694100515007 /* link_uniform_block_active_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DAA1719693F00515007 /* link_uniform_block_active_visitor.cpp */; }; + 2BBD9DB11719694100515007 /* link_uniform_block_active_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBD9DAB1719694000515007 /* link_uniform_block_active_visitor.h */; }; + 2BBD9DB21719694100515007 /* link_uniform_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DAC1719694100515007 /* link_uniform_blocks.cpp */; }; + 2BBD9DB91719698C00515007 /* link_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB41719698800515007 /* link_varyings.cpp */; }; + 2BBD9DBB1719698C00515007 /* link_varyings.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBD9DB51719698900515007 /* link_varyings.h */; }; + 2BBD9DBC1719698C00515007 /* lower_packed_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */; }; + 2BBD9DBE1719698C00515007 /* lower_packing_builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */; }; + 2BBD9DC01719698C00515007 /* opt_flatten_nested_if_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */; }; + 2BBD9DC4171969F700515007 /* hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DC2171969F700515007 /* hash_table.c */; }; + 2BBD9DC6171969F700515007 /* hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBD9DC3171969F700515007 /* hash_table.h */; }; + 2BBD9DC817196A3B00515007 /* imports.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DC717196A3B00515007 /* imports.c */; }; + 2BDCB95D184E182B0075CE6F /* ir_stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */; }; + 2BDCB95E184E182B0075CE6F /* ir_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BDCB95C184E182B0075CE6F /* ir_stats.h */; }; 2BEC22EA1356E98300B5E301 /* opt_copy_propagation_elements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */; }; - 2BEC22EB1356E98500B5E301 /* opt_copy_propagation_elements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_if_to_cond_assign.cpp; path = ../lower_if_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854491293BE5000F3E692 /* lower_jumps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_jumps.cpp; path = ../lower_jumps.cpp; sourceTree = SOURCE_ROOT; }; - 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_mat_op_to_vec.cpp; path = ../lower_mat_op_to_vec.cpp; sourceTree = SOURCE_ROOT; }; - 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vec_index_to_cond_assign.cpp; path = ../lower_vec_index_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; }; - 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vec_index_to_swizzle.cpp; path = ../lower_vec_index_to_swizzle.cpp; sourceTree = SOURCE_ROOT; }; - 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_algebraic.cpp; path = ../opt_algebraic.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_folding.cpp; path = ../opt_constant_folding.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_propagation.cpp; path = ../opt_constant_propagation.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_variable.cpp; path = ../opt_constant_variable.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation.cpp; path = ../opt_copy_propagation.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_code_local.cpp; path = ../opt_dead_code_local.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_code.cpp; path = ../opt_dead_code.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_functions.cpp; path = ../opt_dead_functions.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_function_inlining.cpp; path = ../opt_function_inlining.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_if_simplification.cpp; path = ../opt_if_simplification.cpp; sourceTree = SOURCE_ROOT; }; - 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_noop_swizzle.cpp; path = ../opt_noop_swizzle.cpp; sourceTree = SOURCE_ROOT; }; - 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_structure_splitting.cpp; path = ../opt_structure_splitting.cpp; sourceTree = SOURCE_ROOT; }; - 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_swizzle_swizzle.cpp; path = ../opt_swizzle_swizzle.cpp; sourceTree = SOURCE_ROOT; }; - 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_tree_grafting.cpp; path = ../opt_tree_grafting.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniforms.cpp; path = ../link_uniforms.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_initializers.cpp; path = ../link_uniform_initializers.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_clip_distance.cpp; path = ../lower_clip_distance.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard_flow.cpp; path = ../lower_discard_flow.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_output_reads.cpp; path = ../lower_output_reads.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_ubo_reference.cpp; path = ../lower_ubo_reference.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_array_splitting.cpp; path = ../opt_array_splitting.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_builder.cpp; path = ../ir_builder.cpp; sourceTree = SOURCE_ROOT; }; - 2B3A6BD815FA08E1000DCBE1 /* ir_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_builder.h; path = ../ir_builder.h; sourceTree = SOURCE_ROOT; }; - 2B47D9FD1209C87B00937F2C /* hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash_table.c; path = ../../mesa/program/hash_table.c; sourceTree = SOURCE_ROOT; }; - 2B47D9FE1209C87B00937F2C /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../mesa/program/hash_table.h; sourceTree = SOURCE_ROOT; }; - 2B47D9FF1209C87B00937F2C /* symbol_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = symbol_table.c; path = ../../mesa/program/symbol_table.c; sourceTree = SOURCE_ROOT; }; - 2B47DA001209C87B00937F2C /* symbol_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symbol_table.h; path = ../../mesa/program/symbol_table.h; sourceTree = SOURCE_ROOT; }; - 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_rvalue_visitor.cpp; path = ../ir_rvalue_visitor.cpp; sourceTree = SOURCE_ROOT; }; - 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_rvalue_visitor.h; path = ../ir_rvalue_visitor.h; sourceTree = SOURCE_ROOT; }; - 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function_detect_recursion.cpp; path = ../ir_function_detect_recursion.cpp; sourceTree = SOURCE_ROOT; }; - 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = standalone_scaffolding.cpp; path = ../standalone_scaffolding.cpp; sourceTree = SOURCE_ROOT; }; - 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = standalone_scaffolding.h; path = ../standalone_scaffolding.h; sourceTree = SOURCE_ROOT; }; - 2B6A99EC1223B1670059FBED /* glcpp-lex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "glcpp-lex.c"; path = "../glcpp/glcpp-lex.c"; sourceTree = SOURCE_ROOT; }; - 2B6A99ED1223B1670059FBED /* glcpp-lex.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = "glcpp-lex.l"; path = "../glcpp/glcpp-lex.l"; sourceTree = SOURCE_ROOT; }; - 2B6A99EE1223B1670059FBED /* glcpp-parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "glcpp-parse.c"; path = "../glcpp/glcpp-parse.c"; sourceTree = SOURCE_ROOT; }; - 2B6A99EF1223B1670059FBED /* glcpp-parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "glcpp-parse.h"; path = "../glcpp/glcpp-parse.h"; sourceTree = SOURCE_ROOT; }; - 2B6A99F01223B1670059FBED /* glcpp-parse.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = "glcpp-parse.y"; path = "../glcpp/glcpp-parse.y"; sourceTree = SOURCE_ROOT; }; - 2B6A99F21223B1670059FBED /* glcpp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glcpp.h; path = ../glcpp/glcpp.h; sourceTree = SOURCE_ROOT; }; - 2B6A99F31223B1670059FBED /* pp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pp.c; path = ../glcpp/pp.c; sourceTree = SOURCE_ROOT; }; - 2B6AC7B5161EC99C0094FD86 /* prog_instruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_instruction.h; path = ../../mesa/program/prog_instruction.h; sourceTree = SOURCE_ROOT; }; - 2B6AC7B6161EC99C0094FD86 /* prog_parameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_parameter.h; path = ../../mesa/program/prog_parameter.h; sourceTree = SOURCE_ROOT; }; - 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_statevars.h; path = ../../mesa/program/prog_statevars.h; sourceTree = SOURCE_ROOT; }; - 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_uniform.h; path = ../ir_uniform.h; sourceTree = SOURCE_ROOT; }; - 2B6AC8AC161ED9080094FD86 /* glminimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glminimal.h; path = ../../mesa/main/glminimal.h; sourceTree = SOURCE_ROOT; }; - 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_variables.cpp; path = ../builtin_variables.cpp; sourceTree = SOURCE_ROOT; }; - 2BA07FA91352E7BB00A1C074 /* ralloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ralloc.c; path = ../ralloc.c; sourceTree = SOURCE_ROOT; }; - 2BA07FAA1352E7BB00A1C074 /* ralloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ralloc.h; path = ../ralloc.h; sourceTree = SOURCE_ROOT; }; - 2BA080381352EB1A00A1C074 /* builtin_stubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_stubs.cpp; path = ../builtin_stubs.cpp; sourceTree = SOURCE_ROOT; }; - 2BA0803D1352EB9300A1C074 /* builtin_compiler */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = builtin_compiler; sourceTree = BUILT_PRODUCTS_DIR; }; - 2BA0808A1352EBFB00A1C074 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../main.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A511207FEA6002DC82D /* ast_expr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_expr.cpp; path = ../ast_expr.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A521207FEA6002DC82D /* ast_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_function.cpp; path = ../ast_function.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_to_hir.cpp; path = ../ast_to_hir.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A541207FEA6002DC82D /* ast_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_type.cpp; path = ../ast_type.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A551207FEA6002DC82D /* ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ast.h; path = ../ast.h; sourceTree = SOURCE_ROOT; }; - 2BA55A561207FEA6002DC82D /* builtin_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_function.cpp; path = ../builtin_function.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A571207FEA6002DC82D /* builtin_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = builtin_types.h; path = ../builtin_types.h; sourceTree = SOURCE_ROOT; }; - 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_lexer.cpp; path = ../glsl_lexer.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A5A1207FEA6002DC82D /* glsl_lexer.ll */ = {isa = PBXFileReference; explicitFileType = sourcecode.lex; fileEncoding = 4; name = glsl_lexer.ll; path = ../glsl_lexer.ll; sourceTree = SOURCE_ROOT; }; - 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_optimizer.cpp; path = ../glsl_optimizer.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_optimizer.h; path = ../glsl_optimizer.h; sourceTree = SOURCE_ROOT; }; - 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_parser_extras.cpp; path = ../glsl_parser_extras.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_parser_extras.h; path = ../glsl_parser_extras.h; sourceTree = SOURCE_ROOT; }; - 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_parser.cpp; path = ../glsl_parser.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A601207FEA6002DC82D /* glsl_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_parser.h; path = ../glsl_parser.h; sourceTree = SOURCE_ROOT; }; - 2BA55A611207FEA6002DC82D /* glsl_parser.yy */ = {isa = PBXFileReference; explicitFileType = sourcecode.yacc; fileEncoding = 4; name = glsl_parser.yy; path = ../glsl_parser.yy; sourceTree = SOURCE_ROOT; }; - 2BA55A621207FEA6002DC82D /* glsl_symbol_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_symbol_table.h; path = ../glsl_symbol_table.h; sourceTree = SOURCE_ROOT; }; - 2BA55A631207FEA6002DC82D /* glsl_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_types.cpp; path = ../glsl_types.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A641207FEA6002DC82D /* glsl_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_types.h; path = ../glsl_types.h; sourceTree = SOURCE_ROOT; }; - 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hir_field_selection.cpp; path = ../hir_field_selection.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_basic_block.cpp; path = ../ir_basic_block.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A681207FEA6002DC82D /* ir_basic_block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_basic_block.h; path = ../ir_basic_block.h; sourceTree = SOURCE_ROOT; }; - 2BA55A691207FEA6002DC82D /* ir_clone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_clone.cpp; path = ../ir_clone.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_constant_expression.cpp; path = ../ir_constant_expression.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_expression_flattening.cpp; path = ../ir_expression_flattening.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A721207FEA6002DC82D /* ir_expression_flattening.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_expression_flattening.h; path = ../ir_expression_flattening.h; sourceTree = SOURCE_ROOT; }; - 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function_can_inline.cpp; path = ../ir_function_can_inline.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A751207FEA6002DC82D /* ir_function_inlining.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_function_inlining.h; path = ../ir_function_inlining.h; sourceTree = SOURCE_ROOT; }; - 2BA55A761207FEA6002DC82D /* ir_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function.cpp; path = ../ir_function.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_hierarchical_visitor.cpp; path = ../ir_hierarchical_visitor.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A781207FEA6002DC82D /* ir_hierarchical_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_hierarchical_visitor.h; path = ../ir_hierarchical_visitor.h; sourceTree = SOURCE_ROOT; }; - 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_hv_accept.cpp; path = ../ir_hv_accept.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A7D1207FEA6002DC82D /* ir_import_prototypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_import_prototypes.cpp; path = ../ir_import_prototypes.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A801207FEA6002DC82D /* ir_optimization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_optimization.h; path = ../ir_optimization.h; sourceTree = SOURCE_ROOT; }; - 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_glsl_visitor.cpp; path = ../ir_print_glsl_visitor.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_glsl_visitor.h; path = ../ir_print_glsl_visitor.h; sourceTree = SOURCE_ROOT; }; - 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_visitor.cpp; path = ../ir_print_visitor.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_visitor.h; path = ../ir_print_visitor.h; sourceTree = SOURCE_ROOT; }; - 2BA55A851207FEA6002DC82D /* ir_reader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_reader.cpp; path = ../ir_reader.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A861207FEA6002DC82D /* ir_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_reader.h; path = ../ir_reader.h; sourceTree = SOURCE_ROOT; }; - 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_unused_structs.cpp; path = ../ir_unused_structs.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_unused_structs.h; path = ../ir_unused_structs.h; sourceTree = SOURCE_ROOT; }; - 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_validate.cpp; path = ../ir_validate.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_variable_refcount.cpp; path = ../ir_variable_refcount.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A8E1207FEA6002DC82D /* ir_variable_refcount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_variable_refcount.h; path = ../ir_variable_refcount.h; sourceTree = SOURCE_ROOT; }; - 2BA55A921207FEA6002DC82D /* ir_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_visitor.h; path = ../ir_visitor.h; sourceTree = SOURCE_ROOT; }; - 2BA55A931207FEA6002DC82D /* ir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir.cpp; path = ../ir.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A941207FEA6002DC82D /* ir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir.h; path = ../ir.h; sourceTree = SOURCE_ROOT; }; - 2BA55A951207FEA6002DC82D /* link_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_functions.cpp; path = ../link_functions.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A961207FEA6002DC82D /* linker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = linker.cpp; path = ../linker.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A971207FEA6002DC82D /* linker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = linker.h; path = ../linker.h; sourceTree = SOURCE_ROOT; }; - 2BA55A981207FEA6002DC82D /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = list.h; path = ../list.h; sourceTree = SOURCE_ROOT; }; - 2BA55A991207FEA6002DC82D /* program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = program.h; path = ../program.h; sourceTree = SOURCE_ROOT; }; - 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = s_expression.cpp; path = ../s_expression.cpp; sourceTree = SOURCE_ROOT; }; - 2BA55A9B1207FEA6002DC82D /* s_expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = s_expression.h; path = ../s_expression.h; sourceTree = SOURCE_ROOT; }; - 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard.cpp; path = ../lower_discard.cpp; sourceTree = SOURCE_ROOT; }; - 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_instructions.cpp; path = ../lower_instructions.cpp; sourceTree = SOURCE_ROOT; }; - 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector.cpp; path = ../lower_vector.cpp; sourceTree = SOURCE_ROOT; }; - 2BB2F5AE12B8F1580052C6B0 /* strtod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strtod.c; path = ../strtod.c; sourceTree = SOURCE_ROOT; }; - 2BB2F5AF12B8F1580052C6B0 /* strtod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strtod.h; path = ../strtod.h; sourceTree = SOURCE_ROOT; }; - 2BB7259B135094BE0057D8B5 /* compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = compiler.h; path = ../../mesa/main/compiler.h; sourceTree = SOURCE_ROOT; }; - 2BB7259C135094BE0057D8B5 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../../mesa/main/config.h; sourceTree = SOURCE_ROOT; }; - 2BB7259D135094BE0057D8B5 /* context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = context.h; path = ../../mesa/main/context.h; sourceTree = SOURCE_ROOT; }; - 2BB7259E135094BE0057D8B5 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = core.h; path = ../../mesa/main/core.h; sourceTree = SOURCE_ROOT; }; - 2BB7259F135094BE0057D8B5 /* dd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dd.h; path = ../../mesa/main/dd.h; sourceTree = SOURCE_ROOT; }; - 2BB725A1135094BE0057D8B5 /* glheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glheader.h; path = ../../mesa/main/glheader.h; sourceTree = SOURCE_ROOT; }; - 2BB725A2135094BE0057D8B5 /* imports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imports.h; path = ../../mesa/main/imports.h; sourceTree = SOURCE_ROOT; }; - 2BB725A3135094BE0057D8B5 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = ../../mesa/main/macros.h; sourceTree = SOURCE_ROOT; }; - 2BB725A5135094BE0057D8B5 /* mtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mtypes.h; path = ../../mesa/main/mtypes.h; sourceTree = SOURCE_ROOT; }; - 2BB725A7135094BE0057D8B5 /* simple_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simple_list.h; path = ../../mesa/main/simple_list.h; sourceTree = SOURCE_ROOT; }; - 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_symbol_table.cpp; path = ../glsl_symbol_table.cpp; sourceTree = SOURCE_ROOT; }; - 2BBA49211254706A00D42573 /* loop_analysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_analysis.cpp; path = ../loop_analysis.cpp; sourceTree = SOURCE_ROOT; }; - 2BBA49221254706A00D42573 /* loop_analysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = loop_analysis.h; path = ../loop_analysis.h; sourceTree = SOURCE_ROOT; }; - 2BBA49231254706A00D42573 /* loop_controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_controls.cpp; path = ../loop_controls.cpp; sourceTree = SOURCE_ROOT; }; - 2BBA49241254706A00D42573 /* loop_unroll.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_unroll.cpp; path = ../loop_unroll.cpp; sourceTree = SOURCE_ROOT; }; - 2BBA49251254706A00D42573 /* lower_noise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_noise.cpp; path = ../lower_noise.cpp; sourceTree = SOURCE_ROOT; }; - 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_variable_index_to_cond_assign.cpp; path = ../lower_variable_index_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; }; - 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_redundant_jumps.cpp; path = ../opt_redundant_jumps.cpp; sourceTree = SOURCE_ROOT; }; - 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation_elements.cpp; path = ../opt_copy_propagation_elements.cpp; sourceTree = SOURCE_ROOT; }; - D2AAC046055464E500DB518D /* libmesaglsl2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libmesaglsl2.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_if_to_cond_assign.cpp; path = ../../src/glsl/lower_if_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854491293BE5000F3E692 /* lower_jumps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_jumps.cpp; path = ../../src/glsl/lower_jumps.cpp; sourceTree = SOURCE_ROOT; }; + 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_mat_op_to_vec.cpp; path = ../../src/glsl/lower_mat_op_to_vec.cpp; sourceTree = SOURCE_ROOT; }; + 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vec_index_to_cond_assign.cpp; path = ../../src/glsl/lower_vec_index_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; }; + 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vec_index_to_swizzle.cpp; path = ../../src/glsl/lower_vec_index_to_swizzle.cpp; sourceTree = SOURCE_ROOT; }; + 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_algebraic.cpp; path = ../../src/glsl/opt_algebraic.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_folding.cpp; path = ../../src/glsl/opt_constant_folding.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_propagation.cpp; path = ../../src/glsl/opt_constant_propagation.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_variable.cpp; path = ../../src/glsl/opt_constant_variable.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation.cpp; path = ../../src/glsl/opt_copy_propagation.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_code_local.cpp; path = ../../src/glsl/opt_dead_code_local.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_code.cpp; path = ../../src/glsl/opt_dead_code.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_functions.cpp; path = ../../src/glsl/opt_dead_functions.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_function_inlining.cpp; path = ../../src/glsl/opt_function_inlining.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_if_simplification.cpp; path = ../../src/glsl/opt_if_simplification.cpp; sourceTree = SOURCE_ROOT; }; + 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_noop_swizzle.cpp; path = ../../src/glsl/opt_noop_swizzle.cpp; sourceTree = SOURCE_ROOT; }; + 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_structure_splitting.cpp; path = ../../src/glsl/opt_structure_splitting.cpp; sourceTree = SOURCE_ROOT; }; + 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_swizzle_swizzle.cpp; path = ../../src/glsl/opt_swizzle_swizzle.cpp; sourceTree = SOURCE_ROOT; }; + 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_tree_grafting.cpp; path = ../../src/glsl/opt_tree_grafting.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniforms.cpp; path = ../../src/glsl/link_uniforms.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_initializers.cpp; path = ../../src/glsl/link_uniform_initializers.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_clip_distance.cpp; path = ../../src/glsl/lower_clip_distance.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard_flow.cpp; path = ../../src/glsl/lower_discard_flow.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_output_reads.cpp; path = ../../src/glsl/lower_output_reads.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_ubo_reference.cpp; path = ../../src/glsl/lower_ubo_reference.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_array_splitting.cpp; path = ../../src/glsl/opt_array_splitting.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_builder.cpp; path = ../../src/glsl/ir_builder.cpp; sourceTree = SOURCE_ROOT; }; + 2B3A6BD815FA08E1000DCBE1 /* ir_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_builder.h; path = ../../src/glsl/ir_builder.h; sourceTree = SOURCE_ROOT; }; + 2B47D9FD1209C87B00937F2C /* prog_hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prog_hash_table.c; path = ../../src/mesa/program/prog_hash_table.c; sourceTree = SOURCE_ROOT; }; + 2B47D9FE1209C87B00937F2C /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../src/mesa/program/hash_table.h; sourceTree = SOURCE_ROOT; }; + 2B47D9FF1209C87B00937F2C /* symbol_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = symbol_table.c; path = ../../src/mesa/program/symbol_table.c; sourceTree = SOURCE_ROOT; }; + 2B47DA001209C87B00937F2C /* symbol_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symbol_table.h; path = ../../src/mesa/program/symbol_table.h; sourceTree = SOURCE_ROOT; }; + 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_rvalue_visitor.cpp; path = ../../src/glsl/ir_rvalue_visitor.cpp; sourceTree = SOURCE_ROOT; }; + 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_rvalue_visitor.h; path = ../../src/glsl/ir_rvalue_visitor.h; sourceTree = SOURCE_ROOT; }; + 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function_detect_recursion.cpp; path = ../../src/glsl/ir_function_detect_recursion.cpp; sourceTree = SOURCE_ROOT; }; + 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = standalone_scaffolding.cpp; path = ../../src/glsl/standalone_scaffolding.cpp; sourceTree = SOURCE_ROOT; }; + 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = standalone_scaffolding.h; path = ../../src/glsl/standalone_scaffolding.h; sourceTree = SOURCE_ROOT; }; + 2B6A99EC1223B1670059FBED /* glcpp-lex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "glcpp-lex.c"; path = "../../src/glsl/glcpp/glcpp-lex.c"; sourceTree = SOURCE_ROOT; }; + 2B6A99ED1223B1670059FBED /* glcpp-lex.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = "glcpp-lex.l"; path = "../../src/glsl/glcpp/glcpp-lex.l"; sourceTree = SOURCE_ROOT; }; + 2B6A99EE1223B1670059FBED /* glcpp-parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "glcpp-parse.c"; path = "../../src/glsl/glcpp/glcpp-parse.c"; sourceTree = SOURCE_ROOT; }; + 2B6A99EF1223B1670059FBED /* glcpp-parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "glcpp-parse.h"; path = "../../src/glsl/glcpp/glcpp-parse.h"; sourceTree = SOURCE_ROOT; }; + 2B6A99F01223B1670059FBED /* glcpp-parse.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = "glcpp-parse.y"; path = "../../src/glsl/glcpp/glcpp-parse.y"; sourceTree = SOURCE_ROOT; }; + 2B6A99F21223B1670059FBED /* glcpp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glcpp.h; path = ../../src/glsl/glcpp/glcpp.h; sourceTree = SOURCE_ROOT; }; + 2B6A99F31223B1670059FBED /* pp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pp.c; path = ../../src/glsl/glcpp/pp.c; sourceTree = SOURCE_ROOT; }; + 2B6AC7B5161EC99C0094FD86 /* prog_instruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_instruction.h; path = ../../src/mesa/program/prog_instruction.h; sourceTree = SOURCE_ROOT; }; + 2B6AC7B6161EC99C0094FD86 /* prog_parameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_parameter.h; path = ../../src/mesa/program/prog_parameter.h; sourceTree = SOURCE_ROOT; }; + 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_statevars.h; path = ../../src/mesa/program/prog_statevars.h; sourceTree = SOURCE_ROOT; }; + 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_uniform.h; path = ../../src/glsl/ir_uniform.h; sourceTree = SOURCE_ROOT; }; + 2B6AC8AC161ED9080094FD86 /* glminimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glminimal.h; path = ../../src/mesa/main/glminimal.h; sourceTree = SOURCE_ROOT; }; + 2B78C91C1858B052007F5D2A /* ir_equals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_equals.cpp; path = ../../src/glsl/ir_equals.cpp; sourceTree = ""; }; + 2B8979DD182C0C4700718F8A /* builtin_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_functions.cpp; path = ../../src/glsl/builtin_functions.cpp; sourceTree = ""; }; + 2B8979DF182C195C00718F8A /* opt_cse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_cse.cpp; path = ../../src/glsl/opt_cse.cpp; sourceTree = ""; }; + 2B8979E1182CB62900718F8A /* link_atomics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_atomics.cpp; path = ../../src/glsl/link_atomics.cpp; sourceTree = ""; }; + 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_variables.cpp; path = ../../src/glsl/builtin_variables.cpp; sourceTree = SOURCE_ROOT; }; + 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_vectorize.cpp; path = ../../src/glsl/opt_vectorize.cpp; sourceTree = ""; }; + 2BA07FA91352E7BB00A1C074 /* ralloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ralloc.c; path = ../../src/glsl/ralloc.c; sourceTree = SOURCE_ROOT; }; + 2BA07FAA1352E7BB00A1C074 /* ralloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ralloc.h; path = ../../src/glsl/ralloc.h; sourceTree = SOURCE_ROOT; }; + 2BA0808A1352EBFB00A1C074 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../src/glsl/main.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A511207FEA6002DC82D /* ast_expr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_expr.cpp; path = ../../src/glsl/ast_expr.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A521207FEA6002DC82D /* ast_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_function.cpp; path = ../../src/glsl/ast_function.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_to_hir.cpp; path = ../../src/glsl/ast_to_hir.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A541207FEA6002DC82D /* ast_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_type.cpp; path = ../../src/glsl/ast_type.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A551207FEA6002DC82D /* ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ast.h; path = ../../src/glsl/ast.h; sourceTree = SOURCE_ROOT; }; + 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_lexer.cpp; path = ../../src/glsl/glsl_lexer.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A5A1207FEA6002DC82D /* glsl_lexer.ll */ = {isa = PBXFileReference; explicitFileType = sourcecode.lex; fileEncoding = 4; name = glsl_lexer.ll; path = ../../src/glsl/glsl_lexer.ll; sourceTree = SOURCE_ROOT; }; + 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_optimizer.cpp; path = ../../src/glsl/glsl_optimizer.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_optimizer.h; path = ../../src/glsl/glsl_optimizer.h; sourceTree = SOURCE_ROOT; }; + 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_parser_extras.cpp; path = ../../src/glsl/glsl_parser_extras.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_parser_extras.h; path = ../../src/glsl/glsl_parser_extras.h; sourceTree = SOURCE_ROOT; }; + 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_parser.cpp; path = ../../src/glsl/glsl_parser.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A601207FEA6002DC82D /* glsl_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_parser.h; path = ../../src/glsl/glsl_parser.h; sourceTree = SOURCE_ROOT; }; + 2BA55A611207FEA6002DC82D /* glsl_parser.yy */ = {isa = PBXFileReference; explicitFileType = sourcecode.yacc; fileEncoding = 4; name = glsl_parser.yy; path = ../../src/glsl/glsl_parser.yy; sourceTree = SOURCE_ROOT; }; + 2BA55A621207FEA6002DC82D /* glsl_symbol_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_symbol_table.h; path = ../../src/glsl/glsl_symbol_table.h; sourceTree = SOURCE_ROOT; }; + 2BA55A631207FEA6002DC82D /* glsl_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_types.cpp; path = ../../src/glsl/glsl_types.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A641207FEA6002DC82D /* glsl_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_types.h; path = ../../src/glsl/glsl_types.h; sourceTree = SOURCE_ROOT; }; + 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hir_field_selection.cpp; path = ../../src/glsl/hir_field_selection.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_basic_block.cpp; path = ../../src/glsl/ir_basic_block.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A681207FEA6002DC82D /* ir_basic_block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_basic_block.h; path = ../../src/glsl/ir_basic_block.h; sourceTree = SOURCE_ROOT; }; + 2BA55A691207FEA6002DC82D /* ir_clone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_clone.cpp; path = ../../src/glsl/ir_clone.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_constant_expression.cpp; path = ../../src/glsl/ir_constant_expression.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_expression_flattening.cpp; path = ../../src/glsl/ir_expression_flattening.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A721207FEA6002DC82D /* ir_expression_flattening.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_expression_flattening.h; path = ../../src/glsl/ir_expression_flattening.h; sourceTree = SOURCE_ROOT; }; + 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function_can_inline.cpp; path = ../../src/glsl/ir_function_can_inline.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A751207FEA6002DC82D /* ir_function_inlining.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_function_inlining.h; path = ../../src/glsl/ir_function_inlining.h; sourceTree = SOURCE_ROOT; }; + 2BA55A761207FEA6002DC82D /* ir_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function.cpp; path = ../../src/glsl/ir_function.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_hierarchical_visitor.cpp; path = ../../src/glsl/ir_hierarchical_visitor.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A781207FEA6002DC82D /* ir_hierarchical_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_hierarchical_visitor.h; path = ../../src/glsl/ir_hierarchical_visitor.h; sourceTree = SOURCE_ROOT; }; + 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_hv_accept.cpp; path = ../../src/glsl/ir_hv_accept.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A7D1207FEA6002DC82D /* ir_import_prototypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_import_prototypes.cpp; path = ../../src/glsl/ir_import_prototypes.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A801207FEA6002DC82D /* ir_optimization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_optimization.h; path = ../../src/glsl/ir_optimization.h; sourceTree = SOURCE_ROOT; }; + 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_glsl_visitor.cpp; path = ../../src/glsl/ir_print_glsl_visitor.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_glsl_visitor.h; path = ../../src/glsl/ir_print_glsl_visitor.h; sourceTree = SOURCE_ROOT; }; + 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_visitor.cpp; path = ../../src/glsl/ir_print_visitor.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_visitor.h; path = ../../src/glsl/ir_print_visitor.h; sourceTree = SOURCE_ROOT; }; + 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_unused_structs.cpp; path = ../../src/glsl/ir_unused_structs.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_unused_structs.h; path = ../../src/glsl/ir_unused_structs.h; sourceTree = SOURCE_ROOT; }; + 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_validate.cpp; path = ../../src/glsl/ir_validate.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_variable_refcount.cpp; path = ../../src/glsl/ir_variable_refcount.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A8E1207FEA6002DC82D /* ir_variable_refcount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_variable_refcount.h; path = ../../src/glsl/ir_variable_refcount.h; sourceTree = SOURCE_ROOT; }; + 2BA55A921207FEA6002DC82D /* ir_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_visitor.h; path = ../../src/glsl/ir_visitor.h; sourceTree = SOURCE_ROOT; }; + 2BA55A931207FEA6002DC82D /* ir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir.cpp; path = ../../src/glsl/ir.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A941207FEA6002DC82D /* ir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir.h; path = ../../src/glsl/ir.h; sourceTree = SOURCE_ROOT; }; + 2BA55A951207FEA6002DC82D /* link_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_functions.cpp; path = ../../src/glsl/link_functions.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A961207FEA6002DC82D /* linker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = linker.cpp; path = ../../src/glsl/linker.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A971207FEA6002DC82D /* linker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = linker.h; path = ../../src/glsl/linker.h; sourceTree = SOURCE_ROOT; }; + 2BA55A981207FEA6002DC82D /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = list.h; path = ../../src/glsl/list.h; sourceTree = SOURCE_ROOT; }; + 2BA55A991207FEA6002DC82D /* program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = program.h; path = ../../src/glsl/program.h; sourceTree = SOURCE_ROOT; }; + 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = s_expression.cpp; path = ../../src/glsl/s_expression.cpp; sourceTree = SOURCE_ROOT; }; + 2BA55A9B1207FEA6002DC82D /* s_expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = s_expression.h; path = ../../src/glsl/s_expression.h; sourceTree = SOURCE_ROOT; }; + 2BA7E13817D0AEB200D5C475 /* builtin_type_macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = builtin_type_macros.h; path = ../../src/glsl/builtin_type_macros.h; sourceTree = ""; }; + 2BA7E13917D0AEB200D5C475 /* builtin_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_types.cpp; path = ../../src/glsl/builtin_types.cpp; sourceTree = ""; }; + 2BA7E13A17D0AEB200D5C475 /* link_interface_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_interface_blocks.cpp; path = ../../src/glsl/link_interface_blocks.cpp; sourceTree = ""; }; + 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_named_interface_blocks.cpp; path = ../../src/glsl/lower_named_interface_blocks.cpp; sourceTree = ""; }; + 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector_insert.cpp; path = ../../src/glsl/lower_vector_insert.cpp; sourceTree = ""; }; + 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_builtin_varyings.cpp; path = ../../src/glsl/opt_dead_builtin_varyings.cpp; sourceTree = ""; }; + 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flip_matrices.cpp; path = ../../src/glsl/opt_flip_matrices.cpp; sourceTree = ""; }; + 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard.cpp; path = ../../src/glsl/lower_discard.cpp; sourceTree = SOURCE_ROOT; }; + 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_instructions.cpp; path = ../../src/glsl/lower_instructions.cpp; sourceTree = SOURCE_ROOT; }; + 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector.cpp; path = ../../src/glsl/lower_vector.cpp; sourceTree = SOURCE_ROOT; }; + 2BB2F5AE12B8F1580052C6B0 /* strtod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strtod.c; path = ../../src/glsl/strtod.c; sourceTree = SOURCE_ROOT; }; + 2BB2F5AF12B8F1580052C6B0 /* strtod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strtod.h; path = ../../src/glsl/strtod.h; sourceTree = SOURCE_ROOT; }; + 2BB7259B135094BE0057D8B5 /* compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = compiler.h; path = ../../src/mesa/main/compiler.h; sourceTree = SOURCE_ROOT; }; + 2BB7259C135094BE0057D8B5 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../../src/mesa/main/config.h; sourceTree = SOURCE_ROOT; }; + 2BB7259D135094BE0057D8B5 /* context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = context.h; path = ../../src/mesa/main/context.h; sourceTree = SOURCE_ROOT; }; + 2BB7259E135094BE0057D8B5 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = core.h; path = ../../src/mesa/main/core.h; sourceTree = SOURCE_ROOT; }; + 2BB7259F135094BE0057D8B5 /* dd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dd.h; path = ../../src/mesa/main/dd.h; sourceTree = SOURCE_ROOT; }; + 2BB725A1135094BE0057D8B5 /* glheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glheader.h; path = ../../src/mesa/main/glheader.h; sourceTree = SOURCE_ROOT; }; + 2BB725A2135094BE0057D8B5 /* imports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imports.h; path = ../../src/mesa/main/imports.h; sourceTree = SOURCE_ROOT; }; + 2BB725A3135094BE0057D8B5 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = ../../src/mesa/main/macros.h; sourceTree = SOURCE_ROOT; }; + 2BB725A5135094BE0057D8B5 /* mtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mtypes.h; path = ../../src/mesa/main/mtypes.h; sourceTree = SOURCE_ROOT; }; + 2BB725A7135094BE0057D8B5 /* simple_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simple_list.h; path = ../../src/mesa/main/simple_list.h; sourceTree = SOURCE_ROOT; }; + 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_symbol_table.cpp; path = ../../src/glsl/glsl_symbol_table.cpp; sourceTree = SOURCE_ROOT; }; + 2BBA49211254706A00D42573 /* loop_analysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_analysis.cpp; path = ../../src/glsl/loop_analysis.cpp; sourceTree = SOURCE_ROOT; }; + 2BBA49221254706A00D42573 /* loop_analysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = loop_analysis.h; path = ../../src/glsl/loop_analysis.h; sourceTree = SOURCE_ROOT; }; + 2BBA49231254706A00D42573 /* loop_controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_controls.cpp; path = ../../src/glsl/loop_controls.cpp; sourceTree = SOURCE_ROOT; }; + 2BBA49241254706A00D42573 /* loop_unroll.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_unroll.cpp; path = ../../src/glsl/loop_unroll.cpp; sourceTree = SOURCE_ROOT; }; + 2BBA49251254706A00D42573 /* lower_noise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_noise.cpp; path = ../../src/glsl/lower_noise.cpp; sourceTree = SOURCE_ROOT; }; + 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_variable_index_to_cond_assign.cpp; path = ../../src/glsl/lower_variable_index_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; }; + 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_redundant_jumps.cpp; path = ../../src/glsl/opt_redundant_jumps.cpp; sourceTree = SOURCE_ROOT; }; + 2BBD9DA717193BEA00515007 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../../README.md; sourceTree = ""; }; + 2BBD9DA91719693E00515007 /* ast_array_index.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_array_index.cpp; path = ../../src/glsl/ast_array_index.cpp; sourceTree = ""; }; + 2BBD9DAA1719693F00515007 /* link_uniform_block_active_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_block_active_visitor.cpp; path = ../../src/glsl/link_uniform_block_active_visitor.cpp; sourceTree = ""; }; + 2BBD9DAB1719694000515007 /* link_uniform_block_active_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = link_uniform_block_active_visitor.h; path = ../../src/glsl/link_uniform_block_active_visitor.h; sourceTree = ""; }; + 2BBD9DAC1719694100515007 /* link_uniform_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_blocks.cpp; path = ../../src/glsl/link_uniform_blocks.cpp; sourceTree = ""; }; + 2BBD9DB41719698800515007 /* link_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_varyings.cpp; path = ../../src/glsl/link_varyings.cpp; sourceTree = ""; }; + 2BBD9DB51719698900515007 /* link_varyings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = link_varyings.h; path = ../../src/glsl/link_varyings.h; sourceTree = ""; }; + 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_packed_varyings.cpp; path = ../../src/glsl/lower_packed_varyings.cpp; sourceTree = ""; }; + 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_packing_builtins.cpp; path = ../../src/glsl/lower_packing_builtins.cpp; sourceTree = ""; }; + 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flatten_nested_if_blocks.cpp; path = ../../src/glsl/opt_flatten_nested_if_blocks.cpp; sourceTree = ""; }; + 2BBD9DC2171969F700515007 /* hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash_table.c; path = ../../src/mesa/main/hash_table.c; sourceTree = ""; }; + 2BBD9DC3171969F700515007 /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../src/mesa/main/hash_table.h; sourceTree = ""; }; + 2BBD9DC717196A3B00515007 /* imports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = imports.c; path = ../../src/mesa/main/imports.c; sourceTree = ""; }; + 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_stats.cpp; path = ../../src/glsl/ir_stats.cpp; sourceTree = ""; }; + 2BDCB95C184E182B0075CE6F /* ir_stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_stats.h; path = ../../src/glsl/ir_stats.h; sourceTree = ""; }; + 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation_elements.cpp; path = ../../src/glsl/opt_copy_propagation_elements.cpp; sourceTree = SOURCE_ROOT; }; + D2AAC046055464E500DB518D /* libglsl_optimizer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libglsl_optimizer.a; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 2BA0803B1352EB9300A1C074 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; D289987405E68DCB004EDB86 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -374,6 +331,7 @@ 08FB7794FE84155DC02AAC07 /* mesaglsl2 */ = { isa = PBXGroup; children = ( + 2BBD9DA717193BEA00515007 /* README.md */, 08FB7795FE84155DC02AAC07 /* Source */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); @@ -393,8 +351,7 @@ 1AB674ADFE9D54B511CA2CBB /* Products */ = { isa = PBXGroup; children = ( - D2AAC046055464E500DB518D /* libmesaglsl2.a */, - 2BA0803D1352EB9300A1C074 /* builtin_compiler */, + D2AAC046055464E500DB518D /* libglsl_optimizer.a */, ); name = Products; sourceTree = ""; @@ -405,7 +362,7 @@ 2B6AC7B5161EC99C0094FD86 /* prog_instruction.h */, 2B6AC7B6161EC99C0094FD86 /* prog_parameter.h */, 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */, - 2B47D9FD1209C87B00937F2C /* hash_table.c */, + 2B47D9FD1209C87B00937F2C /* prog_hash_table.c */, 2B47D9FE1209C87B00937F2C /* hash_table.h */, 2B47D9FF1209C87B00937F2C /* symbol_table.c */, 2B47DA001209C87B00937F2C /* symbol_table.h */, @@ -430,37 +387,33 @@ 2BA55A501207FE41002DC82D /* glsl */ = { isa = PBXGroup; children = ( - 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */, - 2BA0808A1352EBFB00A1C074 /* main.cpp */, - 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */, - 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */, - 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */, - 2BB2F5AE12B8F1580052C6B0 /* strtod.c */, - 2BB2F5AF12B8F1580052C6B0 /* strtod.h */, - 2B6A99EB1223B1460059FBED /* glcpp */, + 2BA55A551207FEA6002DC82D /* ast.h */, + 2BBD9DA91719693E00515007 /* ast_array_index.cpp */, 2BA55A511207FEA6002DC82D /* ast_expr.cpp */, 2BA55A521207FEA6002DC82D /* ast_function.cpp */, 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */, 2BA55A541207FEA6002DC82D /* ast_type.cpp */, - 2BA55A551207FEA6002DC82D /* ast.h */, - 2BA55A561207FEA6002DC82D /* builtin_function.cpp */, - 2BA080381352EB1A00A1C074 /* builtin_stubs.cpp */, - 2BA55A571207FEA6002DC82D /* builtin_types.h */, + 2B8979DD182C0C4700718F8A /* builtin_functions.cpp */, + 2BA7E13817D0AEB200D5C475 /* builtin_type_macros.h */, + 2BA7E13917D0AEB200D5C475 /* builtin_types.cpp */, 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */, + 2B6A99EB1223B1460059FBED /* glcpp */, 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */, 2BA55A5A1207FEA6002DC82D /* glsl_lexer.ll */, 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */, 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */, - 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */, - 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */, 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */, 2BA55A601207FEA6002DC82D /* glsl_parser.h */, 2BA55A611207FEA6002DC82D /* glsl_parser.yy */, + 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */, + 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */, 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */, 2BA55A621207FEA6002DC82D /* glsl_symbol_table.h */, 2BA55A631207FEA6002DC82D /* glsl_types.cpp */, 2BA55A641207FEA6002DC82D /* glsl_types.h */, 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */, + 2BA55A931207FEA6002DC82D /* ir.cpp */, + 2BA55A941207FEA6002DC82D /* ir.h */, 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */, 2BA55A681207FEA6002DC82D /* ir_basic_block.h */, 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */, @@ -469,10 +422,11 @@ 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */, 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */, 2BA55A721207FEA6002DC82D /* ir_expression_flattening.h */, + 2B78C91C1858B052007F5D2A /* ir_equals.cpp */, + 2BA55A761207FEA6002DC82D /* ir_function.cpp */, 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */, 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */, 2BA55A751207FEA6002DC82D /* ir_function_inlining.h */, - 2BA55A761207FEA6002DC82D /* ir_function.cpp */, 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */, 2BA55A781207FEA6002DC82D /* ir_hierarchical_visitor.h */, 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */, @@ -482,10 +436,10 @@ 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */, 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */, 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */, - 2BA55A851207FEA6002DC82D /* ir_reader.cpp */, - 2BA55A861207FEA6002DC82D /* ir_reader.h */, 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */, 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */, + 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */, + 2BDCB95C184E182B0075CE6F /* ir_stats.h */, 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */, 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */, 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */, @@ -493,11 +447,16 @@ 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */, 2BA55A8E1207FEA6002DC82D /* ir_variable_refcount.h */, 2BA55A921207FEA6002DC82D /* ir_visitor.h */, - 2BA55A931207FEA6002DC82D /* ir.cpp */, - 2BA55A941207FEA6002DC82D /* ir.h */, + 2B8979E1182CB62900718F8A /* link_atomics.cpp */, 2BA55A951207FEA6002DC82D /* link_functions.cpp */, - 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */, + 2BA7E13A17D0AEB200D5C475 /* link_interface_blocks.cpp */, + 2BBD9DAA1719693F00515007 /* link_uniform_block_active_visitor.cpp */, + 2BBD9DAB1719694000515007 /* link_uniform_block_active_visitor.h */, + 2BBD9DAC1719694100515007 /* link_uniform_blocks.cpp */, 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */, + 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */, + 2BBD9DB41719698800515007 /* link_varyings.cpp */, + 2BBD9DB51719698900515007 /* link_varyings.h */, 2BA55A961207FEA6002DC82D /* linker.cpp */, 2BA55A971207FEA6002DC82D /* linker.h */, 2BA55A981207FEA6002DC82D /* list.h */, @@ -506,25 +465,38 @@ 2BBA49231254706A00D42573 /* loop_controls.cpp */, 2BBA49241254706A00D42573 /* loop_unroll.cpp */, 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */, + 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */, 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */, 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */, + 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */, 2B3854491293BE5000F3E692 /* lower_jumps.cpp */, 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */, + 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */, 2BBA49251254706A00D42573 /* lower_noise.cpp */, 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */, + 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */, + 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */, 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */, 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */, 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */, 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */, + 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */, + 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */, + 2BA0808A1352EBFB00A1C074 /* main.cpp */, 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */, + 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */, 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */, 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */, 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */, 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */, 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */, - 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */, + 2B8979DF182C195C00718F8A /* opt_cse.cpp */, + 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */, 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */, + 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */, 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */, + 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */, + 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */, 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */, 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */, 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */, @@ -532,6 +504,7 @@ 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */, 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */, 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */, + 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */, 2BA55A991207FEA6002DC82D /* program.h */, 2BA07FA91352E7BB00A1C074 /* ralloc.c */, 2BA07FAA1352E7BB00A1C074 /* ralloc.h */, @@ -539,6 +512,8 @@ 2BA55A9B1207FEA6002DC82D /* s_expression.h */, 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */, 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */, + 2BB2F5AE12B8F1580052C6B0 /* strtod.c */, + 2BB2F5AF12B8F1580052C6B0 /* strtod.h */, ); name = glsl; sourceTree = ""; @@ -546,6 +521,9 @@ 2BB7259A135094A60057D8B5 /* mesa */ = { isa = PBXGroup; children = ( + 2BBD9DC717196A3B00515007 /* imports.c */, + 2BBD9DC2171969F700515007 /* hash_table.c */, + 2BBD9DC3171969F700515007 /* hash_table.h */, 2BB7259B135094BE0057D8B5 /* compiler.h */, 2BB7259C135094BE0057D8B5 /* config.h */, 2BB7259D135094BE0057D8B5 /* context.h */, @@ -569,7 +547,6 @@ buildActionMask = 2147483647; files = ( 2BA55AA01207FEA6002DC82D /* ast.h in Headers */, - 2BA55AA21207FEA6002DC82D /* builtin_types.h in Headers */, 2BA55AA71207FEA6002DC82D /* glsl_optimizer.h in Headers */, 2BA55AA91207FEA6002DC82D /* glsl_parser_extras.h in Headers */, 2BA55AAB1207FEA6002DC82D /* glsl_parser.h in Headers */, @@ -582,7 +559,6 @@ 2BA55ACB1207FEA6002DC82D /* ir_optimization.h in Headers */, 2BA55ACD1207FEA6002DC82D /* ir_print_glsl_visitor.h in Headers */, 2BA55ACF1207FEA6002DC82D /* ir_print_visitor.h in Headers */, - 2BA55AD11207FEA6002DC82D /* ir_reader.h in Headers */, 2BA55AD61207FEA6002DC82D /* ir_unused_structs.h in Headers */, 2BA55AD91207FEA6002DC82D /* ir_variable_refcount.h in Headers */, 2BA55ADD1207FEA6002DC82D /* ir_visitor.h in Headers */, @@ -607,6 +583,8 @@ 2BB725B0135094BE0057D8B5 /* imports.h in Headers */, 2BB725B1135094BE0057D8B5 /* macros.h in Headers */, 2BB725B3135094BE0057D8B5 /* mtypes.h in Headers */, + 2BA7E13F17D0AEB200D5C475 /* builtin_type_macros.h in Headers */, + 2BDCB95E184E182B0075CE6F /* ir_stats.h in Headers */, 2BB725B5135094BE0057D8B5 /* simple_list.h in Headers */, 2BA07FAC1352E7BB00A1C074 /* ralloc.h in Headers */, 2B655A7A13E0324F00B5278F /* standalone_scaffolding.h in Headers */, @@ -616,32 +594,18 @@ 2B6AC7BB161EC99C0094FD86 /* prog_statevars.h in Headers */, 2B6AC7BD161EC9D40094FD86 /* ir_uniform.h in Headers */, 2B6AC8AD161ED9080094FD86 /* glminimal.h in Headers */, + 2BBD9DB11719694100515007 /* link_uniform_block_active_visitor.h in Headers */, + 2BBD9DBB1719698C00515007 /* link_varyings.h in Headers */, + 2BBD9DC6171969F700515007 /* hash_table.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 2BA0803C1352EB9300A1C074 /* builtin_compiler */ = { + D2AAC045055464E500DB518D /* glsl_optimizer */ = { isa = PBXNativeTarget; - buildConfigurationList = 2BA080411352EBAB00A1C074 /* Build configuration list for PBXNativeTarget "builtin_compiler" */; - buildPhases = ( - 2BA0803A1352EB9300A1C074 /* Sources */, - 2BA0803B1352EB9300A1C074 /* Frameworks */, - 2BA080AA1352EE5500A1C074 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = builtin_compiler; - productName = builtin_compiler; - productReference = 2BA0803D1352EB9300A1C074 /* builtin_compiler */; - productType = "com.apple.product-type.tool"; - }; - D2AAC045055464E500DB518D /* mesaglsl2 */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "mesaglsl2" */; + buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer" */; buildPhases = ( D2AAC043055464E500DB518D /* Headers */, D2AAC044055464E500DB518D /* Sources */, @@ -651,9 +615,9 @@ ); dependencies = ( ); - name = mesaglsl2; + name = glsl_optimizer; productName = mesaglsl2; - productReference = D2AAC046055464E500DB518D /* libmesaglsl2.a */; + productReference = D2AAC046055464E500DB518D /* libglsl_optimizer.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -662,9 +626,9 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0500; }; - buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "mesaglsl2" */; + buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "glsl_optimizer_lib" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; @@ -678,115 +642,12 @@ projectDirPath = ""; projectRoot = ""; targets = ( - D2AAC045055464E500DB518D /* mesaglsl2 */, - 2BA0803C1352EB9300A1C074 /* builtin_compiler */, + D2AAC045055464E500DB518D /* glsl_optimizer */, ); }; /* End PBXProject section */ -/* Begin PBXShellScriptBuildPhase section */ - 2BA080AA1352EE5500A1C074 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Generating builtin functions...\"\ncd $BUILT_PRODUCTS_DIR\npython builtins/tools/generate_builtins.py ./builtin_compiler >builtin_function.cpp"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ - 2BA0803A1352EB9300A1C074 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2BA080421352EBB900A1C074 /* ast_expr.cpp in Sources */, - 2BA080431352EBB900A1C074 /* ast_function.cpp in Sources */, - 2BA080441352EBB900A1C074 /* ast_to_hir.cpp in Sources */, - 2BA080451352EBB900A1C074 /* ast_type.cpp in Sources */, - 2BA080471352EBB900A1C074 /* glsl_lexer.cpp in Sources */, - 2BA080491352EBB900A1C074 /* glsl_parser_extras.cpp in Sources */, - 2BA0804A1352EBB900A1C074 /* glsl_parser.cpp in Sources */, - 2BA0804B1352EBB900A1C074 /* glsl_types.cpp in Sources */, - 2BA0804C1352EBB900A1C074 /* hir_field_selection.cpp in Sources */, - 2BA0804D1352EBB900A1C074 /* ir_basic_block.cpp in Sources */, - 2BA0804E1352EBB900A1C074 /* ir_clone.cpp in Sources */, - 2BA0804F1352EBB900A1C074 /* ir_constant_expression.cpp in Sources */, - 2BA080501352EBB900A1C074 /* ir_expression_flattening.cpp in Sources */, - 2BA080511352EBB900A1C074 /* ir_function_can_inline.cpp in Sources */, - 2BA080521352EBB900A1C074 /* ir_function.cpp in Sources */, - 2BA080531352EBB900A1C074 /* ir_hierarchical_visitor.cpp in Sources */, - 2BA080541352EBB900A1C074 /* ir_hv_accept.cpp in Sources */, - 2BA080551352EBB900A1C074 /* ir_import_prototypes.cpp in Sources */, - 2BA080561352EBB900A1C074 /* ir_print_glsl_visitor.cpp in Sources */, - 2BA080571352EBB900A1C074 /* ir_print_visitor.cpp in Sources */, - 2BA080581352EBB900A1C074 /* ir_reader.cpp in Sources */, - 2BA080591352EBB900A1C074 /* ir_unused_structs.cpp in Sources */, - 2BA0805A1352EBB900A1C074 /* ir_validate.cpp in Sources */, - 2BA0805B1352EBB900A1C074 /* ir_variable_refcount.cpp in Sources */, - 2BA0805D1352EBB900A1C074 /* ir.cpp in Sources */, - 2BA0805E1352EBB900A1C074 /* link_functions.cpp in Sources */, - 2BA0805F1352EBB900A1C074 /* linker.cpp in Sources */, - 2BA080601352EBB900A1C074 /* s_expression.cpp in Sources */, - 2BA080611352EBB900A1C074 /* hash_table.c in Sources */, - 2BA080621352EBB900A1C074 /* symbol_table.c in Sources */, - 2BA080631352EBB900A1C074 /* ir_rvalue_visitor.cpp in Sources */, - 2BA080641352EBB900A1C074 /* glcpp-lex.c in Sources */, - 2BA080651352EBB900A1C074 /* glcpp-parse.c in Sources */, - 2BA080661352EBB900A1C074 /* pp.c in Sources */, - 2BA080671352EBB900A1C074 /* glsl_symbol_table.cpp in Sources */, - 2BA080681352EBB900A1C074 /* loop_analysis.cpp in Sources */, - 2BA080691352EBB900A1C074 /* loop_controls.cpp in Sources */, - 2BA0806A1352EBB900A1C074 /* loop_unroll.cpp in Sources */, - 2BA0806B1352EBB900A1C074 /* lower_noise.cpp in Sources */, - 2BA0806C1352EBB900A1C074 /* lower_variable_index_to_cond_assign.cpp in Sources */, - 2BA0806D1352EBB900A1C074 /* opt_redundant_jumps.cpp in Sources */, - 2BA0806E1352EBB900A1C074 /* lower_if_to_cond_assign.cpp in Sources */, - 2BA0806F1352EBB900A1C074 /* lower_jumps.cpp in Sources */, - 2BA080701352EBB900A1C074 /* lower_mat_op_to_vec.cpp in Sources */, - 2BA080711352EBB900A1C074 /* lower_vec_index_to_cond_assign.cpp in Sources */, - 2BA080721352EBB900A1C074 /* lower_vec_index_to_swizzle.cpp in Sources */, - 2BA080731352EBB900A1C074 /* opt_algebraic.cpp in Sources */, - 2BA080741352EBB900A1C074 /* opt_constant_folding.cpp in Sources */, - 2BA080751352EBB900A1C074 /* opt_constant_propagation.cpp in Sources */, - 2BA080761352EBB900A1C074 /* opt_constant_variable.cpp in Sources */, - 2BA080771352EBB900A1C074 /* opt_copy_propagation.cpp in Sources */, - 2BA080781352EBB900A1C074 /* opt_dead_code_local.cpp in Sources */, - 2BA080791352EBB900A1C074 /* opt_dead_code.cpp in Sources */, - 2BA0807A1352EBB900A1C074 /* opt_dead_functions.cpp in Sources */, - 2BA0807B1352EBB900A1C074 /* opt_function_inlining.cpp in Sources */, - 2BA0807C1352EBB900A1C074 /* opt_if_simplification.cpp in Sources */, - 2BA0807D1352EBB900A1C074 /* opt_noop_swizzle.cpp in Sources */, - 2BA0807E1352EBB900A1C074 /* opt_structure_splitting.cpp in Sources */, - 2BA0807F1352EBB900A1C074 /* opt_swizzle_swizzle.cpp in Sources */, - 2BA080801352EBB900A1C074 /* opt_tree_grafting.cpp in Sources */, - 2BA080811352EBB900A1C074 /* lower_discard.cpp in Sources */, - 2BA080821352EBB900A1C074 /* lower_instructions.cpp in Sources */, - 2BA080831352EBB900A1C074 /* lower_vector.cpp in Sources */, - 2BA080851352EBB900A1C074 /* strtod.c in Sources */, - 2BA080861352EBB900A1C074 /* ralloc.c in Sources */, - 2BA080871352EBD100A1C074 /* builtin_stubs.cpp in Sources */, - 2BA0808B1352EBFB00A1C074 /* main.cpp in Sources */, - 2BEC22EB1356E98500B5E301 /* opt_copy_propagation_elements.cpp in Sources */, - 2B655A7213E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */, - 2B655A7813E0324F00B5278F /* standalone_scaffolding.cpp in Sources */, - 2B92A05D15F9FF4700CFED4A /* builtin_variables.cpp in Sources */, - 2B3A6B8F15FA043D000DCBE1 /* link_uniforms.cpp in Sources */, - 2B3A6B9615FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */, - 2B3A6BA215FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */, - 2B3A6BA315FA0494000DCBE1 /* lower_discard_flow.cpp in Sources */, - 2B3A6BA415FA0494000DCBE1 /* lower_output_reads.cpp in Sources */, - 2B3A6BA615FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */, - 2B3A6BA715FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */, - 2B3A6BD915FA08E1000DCBE1 /* ir_builder.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; D2AAC044055464E500DB518D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -794,9 +655,10 @@ 2BA55A9C1207FEA6002DC82D /* ast_expr.cpp in Sources */, 2BA55A9D1207FEA6002DC82D /* ast_function.cpp in Sources */, 2BA55A9E1207FEA6002DC82D /* ast_to_hir.cpp in Sources */, + 2BA7E14417D0AEB200D5C475 /* lower_named_interface_blocks.cpp in Sources */, 2BA55A9F1207FEA6002DC82D /* ast_type.cpp in Sources */, - 2BA55AA11207FEA6002DC82D /* builtin_function.cpp in Sources */, 2BA55AA41207FEA6002DC82D /* glsl_lexer.cpp in Sources */, + 2BDCB95D184E182B0075CE6F /* ir_stats.cpp in Sources */, 2BA55AA61207FEA6002DC82D /* glsl_optimizer.cpp in Sources */, 2BA55AA81207FEA6002DC82D /* glsl_parser_extras.cpp in Sources */, 2BA55AAA1207FEA6002DC82D /* glsl_parser.cpp in Sources */, @@ -813,24 +675,27 @@ 2BA55AC81207FEA6002DC82D /* ir_import_prototypes.cpp in Sources */, 2BA55ACC1207FEA6002DC82D /* ir_print_glsl_visitor.cpp in Sources */, 2BA55ACE1207FEA6002DC82D /* ir_print_visitor.cpp in Sources */, - 2BA55AD01207FEA6002DC82D /* ir_reader.cpp in Sources */, + 2BA7E14617D0AEB200D5C475 /* lower_vector_insert.cpp in Sources */, 2BA55AD51207FEA6002DC82D /* ir_unused_structs.cpp in Sources */, 2BA55AD71207FEA6002DC82D /* ir_validate.cpp in Sources */, + 2BA7E14817D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp in Sources */, 2BA55AD81207FEA6002DC82D /* ir_variable_refcount.cpp in Sources */, 2BA55ADE1207FEA6002DC82D /* ir.cpp in Sources */, 2BA55AE01207FEA6002DC82D /* link_functions.cpp in Sources */, 2BA55AE11207FEA6002DC82D /* linker.cpp in Sources */, 2BA55AE51207FEA6002DC82D /* s_expression.cpp in Sources */, - 2B47DA011209C87B00937F2C /* hash_table.c in Sources */, + 2B47DA011209C87B00937F2C /* prog_hash_table.c in Sources */, 2B47DA031209C87B00937F2C /* symbol_table.c in Sources */, 2B62491112191339003F6EEE /* ir_rvalue_visitor.cpp in Sources */, 2B6A99F41223B1670059FBED /* glcpp-lex.c in Sources */, + 2B78C91D1858B052007F5D2A /* ir_equals.cpp in Sources */, 2B6A99F61223B1670059FBED /* glcpp-parse.c in Sources */, 2B6A99FB1223B1670059FBED /* pp.c in Sources */, 2BBA49281254706A00D42573 /* glsl_symbol_table.cpp in Sources */, 2BBA492A1254706A00D42573 /* loop_analysis.cpp in Sources */, 2BBA492C1254706A00D42573 /* loop_controls.cpp in Sources */, 2BBA492D1254706A00D42573 /* loop_unroll.cpp in Sources */, + 2B9F0A3D189664F3002FF617 /* opt_vectorize.cpp in Sources */, 2BBA492E1254706A00D42573 /* lower_noise.cpp in Sources */, 2BBA492F1254706A00D42573 /* lower_variable_index_to_cond_assign.cpp in Sources */, 2BBA49301254706A00D42573 /* opt_redundant_jumps.cpp in Sources */, @@ -845,6 +710,7 @@ 2B3854691293BE5000F3E692 /* opt_constant_variable.cpp in Sources */, 2B38546A1293BE5000F3E692 /* opt_copy_propagation.cpp in Sources */, 2B38546B1293BE5000F3E692 /* opt_dead_code_local.cpp in Sources */, + 2B8979E2182CB62900718F8A /* link_atomics.cpp in Sources */, 2B38546C1293BE5000F3E692 /* opt_dead_code.cpp in Sources */, 2B38546D1293BE5000F3E692 /* opt_dead_functions.cpp in Sources */, 2B38546E1293BE5000F3E692 /* opt_function_inlining.cpp in Sources */, @@ -853,14 +719,19 @@ 2B3854711293BE5000F3E692 /* opt_structure_splitting.cpp in Sources */, 2B3854721293BE5000F3E692 /* opt_swizzle_swizzle.cpp in Sources */, 2B3854731293BE5000F3E692 /* opt_tree_grafting.cpp in Sources */, + 2B8979DE182C0C4700718F8A /* builtin_functions.cpp in Sources */, 2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */, 2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */, 2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */, 2BB2F5B412B8F1580052C6B0 /* strtod.c in Sources */, 2BA07FAB1352E7BB00A1C074 /* ralloc.c in Sources */, + 2BA7E14017D0AEB200D5C475 /* builtin_types.cpp in Sources */, 2BEC22EA1356E98300B5E301 /* opt_copy_propagation_elements.cpp in Sources */, + 2B8979E0182C195C00718F8A /* opt_cse.cpp in Sources */, 2B655A7313E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */, 2B655A7913E0324F00B5278F /* standalone_scaffolding.cpp in Sources */, + 2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */, + 2BA7E14217D0AEB200D5C475 /* link_interface_blocks.cpp in Sources */, 2B92A05E15F9FF4700CFED4A /* builtin_variables.cpp in Sources */, 2B3A6B9015FA043D000DCBE1 /* link_uniforms.cpp in Sources */, 2B3A6B9715FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */, @@ -870,6 +741,15 @@ 2B3A6BAC15FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */, 2B3A6BAD15FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */, 2B3A6BDA15FA08E1000DCBE1 /* ir_builder.cpp in Sources */, + 2BBD9DAD1719694100515007 /* ast_array_index.cpp in Sources */, + 2BBD9DAF1719694100515007 /* link_uniform_block_active_visitor.cpp in Sources */, + 2BBD9DB21719694100515007 /* link_uniform_blocks.cpp in Sources */, + 2BBD9DB91719698C00515007 /* link_varyings.cpp in Sources */, + 2BBD9DBC1719698C00515007 /* lower_packed_varyings.cpp in Sources */, + 2BBD9DBE1719698C00515007 /* lower_packing_builtins.cpp in Sources */, + 2BBD9DC01719698C00515007 /* opt_flatten_nested_if_blocks.cpp in Sources */, + 2BBD9DC4171969F700515007 /* hash_table.c in Sources */, + 2BBD9DC817196A3B00515007 /* imports.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -886,7 +766,7 @@ GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; INSTALL_PATH = /usr/local/lib; - PRODUCT_NAME = mesaglsl2; + PRODUCT_NAME = glsl_optimizer; }; name = Debug; }; @@ -898,81 +778,45 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/lib; - PRODUCT_NAME = mesaglsl2; + PRODUCT_NAME = glsl_optimizer; }; name = Release; }; 1DEB91F008733DB70010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = i386; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; - GCC_VERSION = ""; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - ../../mapi, - ../../../include, - ../../mesa, + ../../include, + ../../src/mesa, ); MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; }; name = Debug; }; 1DEB91F108733DB70010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = i386; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - ../../mapi, - ../../../include, - ../../mesa, + ../../include, + ../../src/mesa, ); MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx; - }; - name = Release; - }; - 2BA0803F1352EB9400A1C074 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CONFIGURATION_BUILD_DIR = ..; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = builtin_compiler; - }; - name = Debug; - }; - 2BA080401352EB9400A1C074 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CONFIGURATION_BUILD_DIR = ..; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_MODEL_TUNING = G5; - INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = builtin_compiler; - ZERO_LINK = NO; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "mesaglsl2" */ = { + 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91EC08733DB70010E9CD /* Debug */, @@ -981,7 +825,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "mesaglsl2" */ = { + 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "glsl_optimizer_lib" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91F008733DB70010E9CD /* Debug */, @@ -990,15 +834,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2BA080411352EBAB00A1C074 /* Build configuration list for PBXNativeTarget "builtin_compiler" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2BA0803F1352EB9400A1C074 /* Debug */, - 2BA080401352EB9400A1C074 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; diff --git a/3rdparty/glsl-optimizer/tests/glsl-optimizer-tests.xcodeproj/project.pbxproj b/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj similarity index 62% rename from 3rdparty/glsl-optimizer/tests/glsl-optimizer-tests.xcodeproj/project.pbxproj rename to 3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj index 944803ff6..398729a65 100644 --- a/3rdparty/glsl-optimizer/tests/glsl-optimizer-tests.xcodeproj/project.pbxproj +++ b/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj @@ -8,32 +8,31 @@ /* Begin PBXBuildFile section */ 2B47D9AB1209C6AC00937F2C /* glsl_optimizer_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9AA1209C6AC00937F2C /* glsl_optimizer_tests.cpp */; }; - 2B47D9BA1209C71700937F2C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B47D9B91209C71700937F2C /* OpenGL.framework */; }; - 2B47D9C01209C72100937F2C /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B47D9BF1209C72100937F2C /* AGL.framework */; }; - 2B62803D13A15D7D00B735C2 /* libmesaglsl2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B62800E13A15CE100B735C2 /* libmesaglsl2.a */; }; + 2B88BF721821AEBD007FEFD9 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B88BF711821AEBD007FEFD9 /* OpenGL.framework */; }; + 2BBD9DA217193ABA00515007 /* libglsl_optimizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BE167B6171937F4006A0537 /* libglsl_optimizer.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 2B62800D13A15CE100B735C2 /* PBXContainerItemProxy */ = { + 2BE167B5171937F4006A0537 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 2B47D9C51209C72F00937F2C /* mesaglsl2.xcodeproj */; + containerPortal = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */; proxyType = 2; remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = mesaglsl2; + remoteInfo = glsl_optimizer; }; - 2B62800F13A15CE100B735C2 /* PBXContainerItemProxy */ = { + 2BE167B7171937F4006A0537 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 2B47D9C51209C72F00937F2C /* mesaglsl2.xcodeproj */; + containerPortal = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */; proxyType = 2; remoteGlobalIDString = 2BA0803D1352EB9300A1C074; remoteInfo = builtin_compiler; }; - 2B62803913A15D6300B735C2 /* PBXContainerItemProxy */ = { + 2BE167B91719383D006A0537 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 2B47D9C51209C72F00937F2C /* mesaglsl2.xcodeproj */; + containerPortal = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */; proxyType = 1; remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = mesaglsl2; + remoteInfo = glsl_optimizer; }; /* End PBXContainerItemProxy section */ @@ -50,11 +49,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 2B47D9AA1209C6AC00937F2C /* glsl_optimizer_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glsl_optimizer_tests.cpp; sourceTree = ""; }; - 2B47D9B91209C71700937F2C /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; - 2B47D9BF1209C72100937F2C /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = System/Library/Frameworks/AGL.framework; sourceTree = SDKROOT; }; - 2B47D9C51209C72F00937F2C /* mesaglsl2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = mesaglsl2.xcodeproj; path = ../src/glsl/xcode/mesaglsl2.xcodeproj; sourceTree = SOURCE_ROOT; }; - 8DD76FB20486AB0100D96B5E /* glsl-optimizer-test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "glsl-optimizer-test"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2B47D9AA1209C6AC00937F2C /* glsl_optimizer_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_optimizer_tests.cpp; path = ../../tests/glsl_optimizer_tests.cpp; sourceTree = ""; }; + 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = glsl_optimizer_lib.xcodeproj; sourceTree = SOURCE_ROOT; }; + 2B88BF711821AEBD007FEFD9 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = glsl_optimizer_tests; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,25 +60,23 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2B62803D13A15D7D00B735C2 /* libmesaglsl2.a in Frameworks */, - 2B47D9BA1209C71700937F2C /* OpenGL.framework in Frameworks */, - 2B47D9C01209C72100937F2C /* AGL.framework in Frameworks */, + 2BBD9DA217193ABA00515007 /* libglsl_optimizer.a in Frameworks */, + 2B88BF721821AEBD007FEFD9 /* OpenGL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* glsl-optimizer-test */ = { + 08FB7794FE84155DC02AAC07 /* glsl_optimizer_tests */ = { isa = PBXGroup; children = ( 08FB7795FE84155DC02AAC07 /* Source */, 1AB674ADFE9D54B511CA2CBB /* Products */, - 2B47D9C51209C72F00937F2C /* mesaglsl2.xcodeproj */, - 2B47D9B91209C71700937F2C /* OpenGL.framework */, - 2B47D9BF1209C72100937F2C /* AGL.framework */, + 2B88BF711821AEBD007FEFD9 /* OpenGL.framework */, + 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */, ); - name = "glsl-optimizer-test"; + name = glsl_optimizer_tests; sourceTree = ""; }; 08FB7795FE84155DC02AAC07 /* Source */ = { @@ -94,16 +90,16 @@ 1AB674ADFE9D54B511CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 8DD76FB20486AB0100D96B5E /* glsl-optimizer-test */, + 8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */, ); name = Products; sourceTree = ""; }; - 2B62800913A15CE100B735C2 /* Products */ = { + 2BE167B1171937F4006A0537 /* Products */ = { isa = PBXGroup; children = ( - 2B62800E13A15CE100B735C2 /* libmesaglsl2.a */, - 2B62801013A15CE100B735C2 /* builtin_compiler */, + 2BE167B6171937F4006A0537 /* libglsl_optimizer.a */, + 2BE167B8171937F4006A0537 /* builtincompiler */, ); name = Products; sourceTree = ""; @@ -111,9 +107,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 8DD76FA90486AB0100D96B5E /* glsl-optimizer-test */ = { + 8DD76FA90486AB0100D96B5E /* glsl_optimizer_tests */ = { isa = PBXNativeTarget; - buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "glsl-optimizer-test" */; + buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer_tests" */; buildPhases = ( 8DD76FAB0486AB0100D96B5E /* Sources */, 8DD76FAD0486AB0100D96B5E /* Frameworks */, @@ -122,12 +118,12 @@ buildRules = ( ); dependencies = ( - 2B62803A13A15D6300B735C2 /* PBXTargetDependency */, + 2BE167BA1719383D006A0537 /* PBXTargetDependency */, ); - name = "glsl-optimizer-test"; + name = glsl_optimizer_tests; productInstallPath = "$(HOME)/bin"; - productName = "glsl-optimizer-test"; - productReference = 8DD76FB20486AB0100D96B5E /* glsl-optimizer-test */; + productName = glsl_optimizer_tests; + productReference = 8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ @@ -136,9 +132,9 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0500; }; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "glsl-optimizer-tests" */; + buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "glsl_optimizer_tests" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; @@ -148,34 +144,34 @@ French, German, ); - mainGroup = 08FB7794FE84155DC02AAC07 /* glsl-optimizer-test */; + mainGroup = 08FB7794FE84155DC02AAC07 /* glsl_optimizer_tests */; projectDirPath = ""; projectReferences = ( { - ProductGroup = 2B62800913A15CE100B735C2 /* Products */; - ProjectRef = 2B47D9C51209C72F00937F2C /* mesaglsl2.xcodeproj */; + ProductGroup = 2BE167B1171937F4006A0537 /* Products */; + ProjectRef = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */; }, ); projectRoot = ""; targets = ( - 8DD76FA90486AB0100D96B5E /* glsl-optimizer-test */, + 8DD76FA90486AB0100D96B5E /* glsl_optimizer_tests */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 2B62800E13A15CE100B735C2 /* libmesaglsl2.a */ = { + 2BE167B6171937F4006A0537 /* libglsl_optimizer.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libmesaglsl2.a; - remoteRef = 2B62800D13A15CE100B735C2 /* PBXContainerItemProxy */; + path = libglsl_optimizer.a; + remoteRef = 2BE167B5171937F4006A0537 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 2B62801013A15CE100B735C2 /* builtin_compiler */ = { + 2BE167B8171937F4006A0537 /* builtincompiler */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; - path = builtin_compiler; - remoteRef = 2B62800F13A15CE100B735C2 /* PBXContainerItemProxy */; + path = builtincompiler; + remoteRef = 2BE167B7171937F4006A0537 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -192,10 +188,10 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 2B62803A13A15D6300B735C2 /* PBXTargetDependency */ = { + 2BE167BA1719383D006A0537 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = mesaglsl2; - targetProxy = 2B62803913A15D6300B735C2 /* PBXContainerItemProxy */; + name = glsl_optimizer; + targetProxy = 2BE167B91719383D006A0537 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -209,7 +205,7 @@ GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = "glsl-optimizer-test"; + PRODUCT_NAME = glsl_optimizer_tests; }; name = Debug; }; @@ -220,46 +216,39 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; INSTALL_PATH = /usr/local/bin; - PRODUCT_NAME = "glsl-optimizer-test"; + PRODUCT_NAME = glsl_optimizer_tests; }; name = Release; }; 1DEB928A08733DD80010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = i386; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; - GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; }; name = Debug; }; 1DEB928B08733DD80010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = i386; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_PROTOTYPE_CONVERSION = YES; GCC_WARN_SHADOW = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; - SDKROOT = macosx; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "glsl-optimizer-test" */ = { + 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer_tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB928608733DD80010E9CD /* Debug */, @@ -268,7 +257,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "glsl-optimizer-tests" */ = { + 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "glsl_optimizer_tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB928A08733DD80010E9CD /* Debug */, diff --git a/3rdparty/glsl-optimizer/removeDeletedByUs.sh b/3rdparty/glsl-optimizer/removeDeletedByUs.sh index 3ecbc7e0d..a7c526216 100644 --- a/3rdparty/glsl-optimizer/removeDeletedByUs.sh +++ b/3rdparty/glsl-optimizer/removeDeletedByUs.sh @@ -1,7 +1,13 @@ #! /bin/sh +git rm -rf bin git rm -rf docs +git rm -rf m4 git rm -rf src/egl +git rm -rf src/glsl/glcpp/tests +git rm -rf src/mapi git rm -rf src/mesa/drivers +git rm -rf src/mesa/main/tests +git rm -rf src/mesa/state_tracker git rm -rf src/gallium git rm -rf src/glx git rm -rf src/gtest diff --git a/3rdparty/glsl-optimizer/src/.gitignore b/3rdparty/glsl-optimizer/src/.gitignore deleted file mode 100644 index 5fc607b9e..000000000 --- a/3rdparty/glsl-optimizer/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile diff --git a/3rdparty/glsl-optimizer/src/glsl/.dir-locals.el b/3rdparty/glsl-optimizer/src/glsl/.dir-locals.el deleted file mode 100644 index be19e29a5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/.dir-locals.el +++ /dev/null @@ -1,3 +0,0 @@ -((c-mode . ((c-basic-offset . 3))) - (c++-mode . ((c-basic-offset . 3))) -) diff --git a/3rdparty/glsl-optimizer/src/glsl/.gitignore b/3rdparty/glsl-optimizer/src/glsl/.gitignore index 4d3b577ce..d5c2f5a3a 100644 --- a/3rdparty/glsl-optimizer/src/glsl/.gitignore +++ b/3rdparty/glsl-optimizer/src/glsl/.gitignore @@ -1,8 +1,4 @@ glsl_compiler -glsl_lexer.cc -glsl_parser.cc -glsl_parser.h glsl_parser.output -builtin_compiler +builtincompiler glsl_test - diff --git a/3rdparty/glsl-optimizer/src/glsl/.npmignore b/3rdparty/glsl-optimizer/src/glsl/.npmignore new file mode 100644 index 000000000..e69de29bb diff --git a/3rdparty/glsl-optimizer/src/glsl/Makefile b/3rdparty/glsl-optimizer/src/glsl/Makefile index e09b7f961..8b5831c98 100644 --- a/3rdparty/glsl-optimizer/src/glsl/Makefile +++ b/3rdparty/glsl-optimizer/src/glsl/Makefile @@ -24,6 +24,7 @@ SRC = ast_expr.cpp \ ir_basic_block.cpp \ ir_clone.cpp \ ir_constant_expression.cpp \ + ir_equals.cpp \ ir_expression_flattening.cpp \ ir_function.cpp \ ir_function_can_inline.cpp \ @@ -72,6 +73,7 @@ SRC = ast_expr.cpp \ opt_structure_splitting.cpp \ opt_swizzle_swizzle.cpp \ opt_tree_grafting.cpp \ + opt_vectorize.cpp \ ralloc.c \ s_expression.cpp \ standalone_scaffolding.cpp \ diff --git a/3rdparty/glsl-optimizer/src/glsl/Makefile.template b/3rdparty/glsl-optimizer/src/glsl/Makefile.template deleted file mode 100644 index 974987a0a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/Makefile.template +++ /dev/null @@ -1,50 +0,0 @@ -# src/glsl/Makefile.template - -# Template makefile for glsl libraries. -# -# Usage: -# The minimum that the including makefile needs to define -# is TOP, LIBNAME and one of of the *_SOURCES. -# -# Optional defines: -# LIBRARY_INCLUDES are appended to the list of includes directories. -# LIBRARY_DEFINES is not used for makedepend, but for compilation. - - -### Basic defines ### - -OBJECTS = $(C_SOURCES:.c=.o) - -INCLUDES = \ - -I. \ - $(LIBRARY_INCLUDES) - - -##### TARGETS ##### - -default: depend lib$(LIBNAME).a - -lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template - $(MKLIB) -o $(LIBNAME) -static $(OBJECTS) - -depend: $(C_SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) 2> /dev/null - -# Remove .o and backup files -clean: - rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak - -# Dummy target -install: - @echo -n "" - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ - --include depend - diff --git a/3rdparty/glsl-optimizer/src/glsl/SConscript b/3rdparty/glsl-optimizer/src/glsl/SConscript index 6314c7551..fe9d50732 100644 --- a/3rdparty/glsl-optimizer/src/glsl/SConscript +++ b/3rdparty/glsl-optimizer/src/glsl/SConscript @@ -46,56 +46,32 @@ glsl_sources = [ source_lists = env.ParseSourceList('Makefile.sources') # add non-generated sources -for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES', 'LIBGLSL_CXX_FILES'): +for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES'): glsl_sources += source_lists[l] if env['msvc']: env.Prepend(CPPPATH = ['#/src/getopt']) env.PrependUnique(LIBS = [getopt]) -if env['crosscompile'] and not env['embedded']: - Import('builtin_glsl_function') -else: - # Copy these files to avoid generation object files into src/mesa/program - env.Prepend(CPPPATH = ['#src/mesa/program']) - env.Command('hash_table.c', '#src/mesa/program/hash_table.c', Copy('$TARGET', '$SOURCE')) - env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE')) +# Copy these files to avoid generation object files into src/mesa/program +env.Prepend(CPPPATH = ['#src/mesa/main']) +env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE')) +env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE')) +# Copy these files to avoid generation object files into src/mesa/program +env.Prepend(CPPPATH = ['#src/mesa/program']) +env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE')) +env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE')) - compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES']) +compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES']) - mesa_objs = env.StaticObject([ - 'hash_table.c', - 'symbol_table.c', - ]) +mesa_objs = env.StaticObject([ + 'hash_table.c', + 'imports.c', + 'prog_hash_table.c', + 'symbol_table.c', +]) - compiler_objs += mesa_objs - - builtin_compiler = env.Program( - target = 'builtin_compiler', - source = compiler_objs + glsl_sources + \ - source_lists['BUILTIN_COMPILER_CXX_FILES'], - ) - - # SCons builtin dependency scanner doesn't detect that glsl_lexer.ll - # depends on glsl_parser.h - env.Depends(builtin_compiler, glsl_parser) - - builtin_glsl_function = env.CodeGenerate( - target = 'builtin_function.cpp', - script = 'builtins/tools/generate_builtins.py', - source = builtin_compiler, - command = python_cmd + ' $SCRIPT $SOURCE > $TARGET' - ) - - env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', '#src/glsl/builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*')) - - Export('builtin_glsl_function') - - if env['hostonly']: - Return() - - -glsl_sources += builtin_glsl_function +compiler_objs += mesa_objs glsl = env.ConvenienceLibrary( target = 'glsl', @@ -122,11 +98,11 @@ if env['platform'] == 'windows': env.Prepend(LIBS = [glsl]) -glsl2 = env.Program( - target = 'glsl2', +glsl_compiler = env.Program( + target = 'glsl_compiler', source = compiler_objs, ) -env.Alias('glsl2', glsl2) +env.Alias('glsl_compiler', glsl_compiler) glcpp = env.Program( target = 'glcpp/glcpp', diff --git a/3rdparty/glsl-optimizer/src/glsl/ast.h b/3rdparty/glsl-optimizer/src/glsl/ast.h index 3047855ad..91a60917b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast.h +++ b/3rdparty/glsl-optimizer/src/glsl/ast.h @@ -49,24 +49,7 @@ struct YYLTYPE; */ class ast_node { public: - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *node; - - node = rzalloc_size(ctx, size); - assert(node != NULL); - - return node; - } - - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. */ - static void operator delete(void *table) - { - ralloc_free(table); - } + DECLARE_RALLOC_CXX_OPERATORS(ast_node); /** * Print an AST node in something approximating the original GLSL code @@ -189,7 +172,8 @@ enum ast_operators { ast_float_constant, ast_bool_constant, - ast_sequence + ast_sequence, + ast_aggregate }; /** @@ -292,6 +276,76 @@ private: bool cons; }; +class ast_array_specifier : public ast_node { +public: + /** Unsized array specifier ([]) */ + explicit ast_array_specifier(const struct YYLTYPE &locp) + : dimension_count(1), is_unsized_array(true) + { + set_location(locp); + } + + /** Sized array specifier ([dim]) */ + ast_array_specifier(const struct YYLTYPE &locp, ast_expression *dim) + : dimension_count(1), is_unsized_array(false) + { + set_location(locp); + array_dimensions.push_tail(&dim->link); + } + + void add_dimension(ast_expression *dim) + { + array_dimensions.push_tail(&dim->link); + dimension_count++; + } + + virtual void print(void) const; + + /* Count including sized and unsized dimensions */ + unsigned dimension_count; + + /* If true, this means that the array has an unsized outermost dimension. */ + bool is_unsized_array; + + /* This list contains objects of type ast_node containing the + * sized dimensions only, in outermost-to-innermost order. + */ + exec_list array_dimensions; +}; + +/** + * C-style aggregate initialization class + * + * Represents C-style initializers of vectors, matrices, arrays, and + * structures. E.g., vec3 pos = {1.0, 0.0, -1.0} is equivalent to + * vec3 pos = vec3(1.0, 0.0, -1.0). + * + * Specified in GLSL 4.20 and GL_ARB_shading_language_420pack. + * + * \sa _mesa_ast_set_aggregate_type + */ +class ast_aggregate_initializer : public ast_expression { +public: + ast_aggregate_initializer() + : ast_expression(ast_aggregate, NULL, NULL, NULL), + constructor_type(NULL) + { + /* empty */ + } + + /** + * glsl_type of the aggregate, which is inferred from the LHS of whatever + * the aggregate is being used to initialize. This can't be inferred at + * parse time (since the parser deals with ast_type_specifiers, not + * glsl_types), so the parser leaves it NULL. However, the ast-to-hir + * conversion code makes sure to fill it in with the appropriate type + * before hir() is called. + */ + const glsl_type *constructor_type; + + virtual ir_rvalue *hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state); +}; /** * Number of possible operators for an ast_expression @@ -317,14 +371,14 @@ public: class ast_declaration : public ast_node { public: - ast_declaration(const char *identifier, int is_array, ast_expression *array_size, - ast_expression *initializer); + ast_declaration(const char *identifier, + ast_array_specifier *array_specifier, + ast_expression *initializer); virtual void print(void) const; const char *identifier; - - int is_array; - ast_expression *array_size; + + ast_array_specifier *array_specifier; ast_expression *initializer; }; @@ -338,24 +392,7 @@ enum { }; struct ast_type_qualifier { - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *node; - - node = rzalloc_size(ctx, size); - assert(node != NULL); - - return node; - } - - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. */ - static void operator delete(void *table) - { - ralloc_free(table); - } + DECLARE_RALLOC_CXX_OPERATORS(ast_type_qualifier); union { struct { @@ -366,6 +403,7 @@ struct ast_type_qualifier { unsigned in:1; unsigned out:1; unsigned centroid:1; + unsigned sample:1; unsigned uniform:1; unsigned smooth:1; unsigned flat:1; @@ -388,6 +426,18 @@ struct ast_type_qualifier { */ unsigned explicit_index:1; + /** + * Flag set if GL_ARB_shading_language_420pack "binding" layout + * qualifier is used. + */ + unsigned explicit_binding:1; + + /** + * Flag set if GL_ARB_shader_atomic counter "offset" layout + * qualifier is used. + */ + unsigned explicit_offset:1; + /** \name Layout qualifiers for GL_AMD_conservative_depth */ /** \{ */ unsigned depth_any:1; @@ -404,6 +454,12 @@ struct ast_type_qualifier { unsigned column_major:1; unsigned row_major:1; /** \} */ + + /** \name Layout qualifiers for GLSL 1.50 geometry shaders */ + /** \{ */ + unsigned prim_type:1; + unsigned max_vertices:1; + /** \} */ } /** \brief Set of flags, accessed by name. */ q; @@ -412,6 +468,9 @@ struct ast_type_qualifier { unsigned i; } flags; + /** Precision of the type (highp/medium/lowp). */ + unsigned precision:2; + /** * Location specified via GL_ARB_explicit_attrib_location layout * @@ -427,11 +486,49 @@ struct ast_type_qualifier { */ int index; + /** Maximum output vertices in GLSL 1.50 geometry shaders. */ + int max_vertices; + + /** Input or output primitive type in GLSL 1.50 geometry shaders */ + GLenum prim_type; + + /** + * Binding specified via GL_ARB_shading_language_420pack's "binding" keyword. + * + * \note + * This field is only valid if \c explicit_binding is set. + */ + int binding; + + /** + * Offset specified via GL_ARB_shader_atomic_counter's "offset" + * keyword. + * + * \note + * This field is only valid if \c explicit_offset is set. + */ + int offset; + /** * Return true if and only if an interpolation qualifier is present. */ bool has_interpolation() const; + /** + * Return whether a layout qualifier is present. + */ + bool has_layout() const; + + /** + * Return whether a storage qualifier is present. + */ + bool has_storage() const; + + /** + * Return whether an auxiliary storage qualifier is present. + */ + bool has_auxiliary_storage() const; + /** * \brief Return string representation of interpolation qualifier. * @@ -453,6 +550,19 @@ class ast_declarator_list; class ast_struct_specifier : public ast_node { public: + /** + * \brief Make a shallow copy of an ast_struct_specifier. + * + * Use only if the objects are allocated from the same context and will not + * be modified. Zeros the inherited ast_node's fields. + */ + ast_struct_specifier(const ast_struct_specifier& that): + ast_node(), name(that.name), declarations(that.declarations), + is_declaration(that.is_declaration) + { + /* empty */ + } + ast_struct_specifier(const char *identifier, ast_declarator_list *declarator_list); virtual void print(void) const; @@ -463,26 +573,41 @@ public: const char *name; /* List of ast_declarator_list * */ exec_list declarations; + bool is_declaration; }; class ast_type_specifier : public ast_node { public: + /** + * \brief Make a shallow copy of an ast_type_specifier, specifying array + * fields. + * + * Use only if the objects are allocated from the same context and will not + * be modified. Zeros the inherited ast_node's fields. + */ + ast_type_specifier(const ast_type_specifier *that, + ast_array_specifier *array_specifier) + : ast_node(), type_name(that->type_name), structure(that->structure), + array_specifier(array_specifier), + default_precision(that->default_precision) + { + /* empty */ + } + /** Construct a type specifier from a type name */ ast_type_specifier(const char *name) - : type_name(name), structure(NULL), - is_array(false), array_size(NULL), precision(ast_precision_none), - is_precision_statement(false) + : type_name(name), structure(NULL), array_specifier(NULL), + default_precision(ast_precision_none) { /* empty */ } /** Construct a type specifier from a structure definition */ ast_type_specifier(ast_struct_specifier *s) - : type_name(s->name), structure(s), - is_array(false), array_size(NULL), precision(ast_precision_none), - is_precision_statement(false) + : type_name(s->name), structure(s), array_specifier(NULL), + default_precision(ast_precision_none) { /* empty */ } @@ -498,29 +623,27 @@ public: const char *type_name; ast_struct_specifier *structure; - int is_array; - ast_expression *array_size; + ast_array_specifier *array_specifier; - unsigned precision:2; - - bool is_precision_statement; + /** For precision statements, this is the given precision; otherwise none. */ + unsigned default_precision:2; }; class ast_fully_specified_type : public ast_node { public: - ast_fully_specified_type () - { - union { - ast_type_qualifier q; - unsigned i; - } q; - q.i = 0; - qualifier = q.q; - } virtual void print(void) const; bool has_qualifiers() const; + ast_fully_specified_type() : qualifier(), specifier(NULL) + { + qualifier.precision = ast_precision_none; + } + + const struct glsl_type *glsl_type(const char **name, + struct _mesa_glsl_parse_state *state) + const; + ast_type_qualifier qualifier; ast_type_specifier *specifier; }; @@ -535,6 +658,7 @@ public: struct _mesa_glsl_parse_state *state); ast_fully_specified_type *type; + /** List of 'ast_declaration *' */ exec_list declarations; /** @@ -545,22 +669,19 @@ public: * is used to note these cases when no type is specified. */ int invariant; - - /** - * Flag indicating that these declarators are in a uniform block, - * allowing UBO type qualifiers. - */ - bool ubo_qualifiers_valid; }; class ast_parameter_declarator : public ast_node { public: - ast_parameter_declarator() + ast_parameter_declarator() : + type(NULL), + identifier(NULL), + array_specifier(NULL), + formal_parameter(false), + is_void(false) { - this->identifier = NULL; - this->is_array = false; - this->array_size = 0; + /* empty */ } virtual void print(void) const; @@ -570,8 +691,7 @@ public: ast_fully_specified_type *type; const char *identifier; - int is_array; - ast_expression *array_size; + ast_array_specifier *array_specifier; static void parameters_to_hir(exec_list *ast_parameters, bool formal, exec_list *ir_parameters, @@ -801,6 +921,10 @@ public: class ast_function_definition : public ast_node { public: + ast_function_definition() : prototype(NULL), body(NULL) + { + } + virtual void print(void) const; virtual ir_rvalue *hir(exec_list *instructions, @@ -810,14 +934,14 @@ public: ast_compound_statement *body; }; -class ast_uniform_block : public ast_node { +class ast_interface_block : public ast_node { public: - ast_uniform_block(ast_type_qualifier layout, - const char *block_name, - ast_declarator_list *member_list) - : layout(layout), block_name(block_name) + ast_interface_block(ast_type_qualifier layout, + const char *instance_name, + ast_array_specifier *array_specifier) + : layout(layout), block_name(NULL), instance_name(instance_name), + array_specifier(array_specifier) { - declarations.push_degenerate_list_at_head(&member_list->link); } virtual ir_rvalue *hir(exec_list *instructions, @@ -825,9 +949,48 @@ public: ast_type_qualifier layout; const char *block_name; + + /** + * Declared name of the block instance, if specified. + * + * If the block does not have an instance name, this field will be + * \c NULL. + */ + const char *instance_name; + /** List of ast_declarator_list * */ exec_list declarations; + + /** + * Declared array size of the block instance + * + * If the block is not declared as an array or if the block instance array + * is unsized, this field will be \c NULL. + */ + ast_array_specifier *array_specifier; }; + + +/** + * AST node representing a declaration of the input layout for geometry + * shaders. + */ +class ast_gs_input_layout : public ast_node +{ +public: + ast_gs_input_layout(const struct YYLTYPE &locp, GLenum prim_type) + : prim_type(prim_type) + { + set_location(locp); + } + + virtual ir_rvalue *hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state); + +private: + const GLenum prim_type; +}; + /*@}*/ extern void @@ -838,7 +1001,21 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, exec_list *instructions, struct _mesa_glsl_parse_state *state); +extern ir_rvalue * +_mesa_ast_array_index_to_hir(void *mem_ctx, + struct _mesa_glsl_parse_state *state, + ir_rvalue *array, ir_rvalue *idx, + YYLTYPE &loc, YYLTYPE &idx_loc); + +extern void +_mesa_ast_set_aggregate_type(const glsl_type *type, + ast_expression *expr); + void emit_function(_mesa_glsl_parse_state *state, ir_function *f); +extern void +check_builtin_array_max_size(const char *name, unsigned size, + YYLTYPE loc, struct _mesa_glsl_parse_state *state); + #endif /* AST_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp new file mode 100644 index 000000000..9d17e098f --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp @@ -0,0 +1,254 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "ast.h" +#include "glsl_types.h" +#include "ir.h" + +void +ast_array_specifier::print(void) const +{ + if (this->is_unsized_array) { + printf("[ ] "); + } + + foreach_list_typed (ast_node, array_dimension, link, &this->array_dimensions) { + printf("[ "); + array_dimension->print(); + printf("] "); + } +} + +/** + * If \c ir is a reference to an array for which we are tracking the max array + * element accessed, track that the given element has been accessed. + * Otherwise do nothing. + * + * This function also checks whether the array is a built-in array whose + * maximum size is too small to accommodate the given index, and if so uses + * loc and state to report the error. + */ +static void +update_max_array_access(ir_rvalue *ir, unsigned idx, YYLTYPE *loc, + struct _mesa_glsl_parse_state *state) +{ + if (ir_dereference_variable *deref_var = ir->as_dereference_variable()) { + ir_variable *var = deref_var->var; + if (idx > var->data.max_array_access) { + var->data.max_array_access = idx; + + /* Check whether this access will, as a side effect, implicitly cause + * the size of a built-in array to be too large. + */ + check_builtin_array_max_size(var->name, idx+1, *loc, state); + } + } else if (ir_dereference_record *deref_record = + ir->as_dereference_record()) { + /* There are two possibilities we need to consider: + * + * - Accessing an element of an array that is a member of a named + * interface block (e.g. ifc.foo[i]) + * + * - Accessing an element of an array that is a member of a named + * interface block array (e.g. ifc[j].foo[i]). + */ + ir_dereference_variable *deref_var = + deref_record->record->as_dereference_variable(); + if (deref_var == NULL) { + if (ir_dereference_array *deref_array = + deref_record->record->as_dereference_array()) { + deref_var = deref_array->array->as_dereference_variable(); + } + } + + if (deref_var != NULL) { + if (deref_var->var->is_interface_instance()) { + const glsl_type *interface_type = + deref_var->var->get_interface_type(); + unsigned field_index = + deref_record->record->type->field_index(deref_record->field); + assert(field_index < interface_type->length); + if (idx > deref_var->var->max_ifc_array_access[field_index]) { + deref_var->var->max_ifc_array_access[field_index] = idx; + + /* Check whether this access will, as a side effect, implicitly + * cause the size of a built-in array to be too large. + */ + check_builtin_array_max_size(deref_record->field, idx+1, *loc, + state); + } + } + } + } +} + + +ir_rvalue * +_mesa_ast_array_index_to_hir(void *mem_ctx, + struct _mesa_glsl_parse_state *state, + ir_rvalue *array, ir_rvalue *idx, + YYLTYPE &loc, YYLTYPE &idx_loc) +{ + if (!array->type->is_error() + && !array->type->is_array() + && !array->type->is_matrix() + && !array->type->is_vector()) { + _mesa_glsl_error(& idx_loc, state, + "cannot dereference non-array / non-matrix / " + "non-vector"); + } + + if (!idx->type->is_error()) { + if (!idx->type->is_integer()) { + _mesa_glsl_error(& idx_loc, state, "array index must be integer type"); + } else if (!idx->type->is_scalar()) { + _mesa_glsl_error(& idx_loc, state, "array index must be scalar"); + } + } + + /* If the array index is a constant expression and the array has a + * declared size, ensure that the access is in-bounds. If the array + * index is not a constant expression, ensure that the array has a + * declared size. + */ + ir_constant *const const_index = idx->constant_expression_value(); + if (const_index != NULL && idx->type->is_integer()) { + const int idx = const_index->value.i[0]; + const char *type_name = "error"; + unsigned bound = 0; + + /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec: + * + * "It is illegal to declare an array with a size, and then + * later (in the same shader) index the same array with an + * integral constant expression greater than or equal to the + * declared size. It is also illegal to index an array with a + * negative constant expression." + */ + if (array->type->is_matrix()) { + if (array->type->row_type()->vector_elements <= (unsigned)idx) { + type_name = "matrix"; + bound = array->type->row_type()->vector_elements; + } + } else if (array->type->is_vector()) { + if (array->type->vector_elements <= (unsigned)idx) { + type_name = "vector"; + bound = array->type->vector_elements; + } + } else { + /* glsl_type::array_size() returns -1 for non-array types. This means + * that we don't need to verify that the type is an array before + * doing the bounds checking. + */ + if ((array->type->array_size() > 0) + && (array->type->array_size() <= idx)) { + type_name = "array"; + bound = array->type->array_size(); + } + } + + if (bound > 0) { + _mesa_glsl_error(& loc, state, "%s index must be < %u", + type_name, bound); + } else if (idx < 0) { + _mesa_glsl_error(& loc, state, "%s index must be >= 0", + type_name); + } + + if (array->type->is_array()) + update_max_array_access(array, idx, &loc, state); + } else if (const_index == NULL && array->type->is_array()) { + if (array->type->is_unsized_array()) { + _mesa_glsl_error(&loc, state, "unsized array index must be constant"); + } else if (array->type->fields.array->is_interface() + && array->variable_referenced()->data.mode == ir_var_uniform) { + /* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says: + * + * "All indexes used to index a uniform block array must be + * constant integral expressions." + */ + _mesa_glsl_error(&loc, state, + "uniform block array index must be constant"); + } else { + /* whole_variable_referenced can return NULL if the array is a + * member of a structure. In this case it is safe to not update + * the max_array_access field because it is never used for fields + * of structures. + */ + ir_variable *v = array->whole_variable_referenced(); + if (v != NULL) + v->data.max_array_access = array->type->array_size() - 1; + } + + /* From page 23 (29 of the PDF) of the GLSL 1.30 spec: + * + * "Samplers aggregated into arrays within a shader (using square + * brackets [ ]) can only be indexed with integral constant + * expressions [...]." + * + * This restriction was added in GLSL 1.30. Shaders using earlier + * version of the language should not be rejected by the compiler + * front-end for using this construct. This allows useful things such + * as using a loop counter as the index to an array of samplers. If the + * loop in unrolled, the code should compile correctly. Instead, emit a + * warning. + */ + if (array->type->element_type()->is_sampler()) { + if (!state->is_version(130, 100)) { + if (state->es_shader) { + _mesa_glsl_warning(&loc, state, + "sampler arrays indexed with non-constant " + "expressions is optional in %s", + state->get_version_string()); + } else { + _mesa_glsl_warning(&loc, state, + "sampler arrays indexed with non-constant " + "expressions will be forbidden in GLSL 1.30 " + "and later"); + } + } else { + _mesa_glsl_error(&loc, state, + "sampler arrays indexed with non-constant " + "expressions is forbidden in GLSL 1.30 and " + "later"); + } + } + } + + /* After performing all of the error checking, generate the IR for the + * expression. + */ + if (array->type->is_array() + || array->type->is_matrix()) { + return new(mem_ctx) ir_dereference_array(array, idx); + } else if (array->type->is_vector()) { + return new(mem_ctx) ir_expression(ir_binop_vector_extract, array, idx); + } else if (array->type->is_error()) { + return array; + } else { + ir_rvalue *result = new(mem_ctx) ir_dereference_array(array, idx); + result->type = glsl_type::error_type; + + return result; + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp index 82caddb21..805e44a65 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_function.cpp @@ -104,7 +104,7 @@ static glsl_precision precision_for_call (const ir_function_signature* sig, glsl return glsl_precision_low; // if it's a built-in texture function, precision comes from sampler (1st param) precision - if (sig->is_builtin) + if (sig->is_builtin()) { if (strncmp (sig->function_name(), "texture", 7) == 0) return first_prec; @@ -113,7 +113,7 @@ static glsl_precision precision_for_call (const ir_function_signature* sig, glsl } // other built-in: max precision of parameters - if (sig->is_builtin) + if (sig->is_builtin()) return max_prec; // otherwise: undefined @@ -127,24 +127,19 @@ static glsl_precision precision_for_call (const ir_function_signature* sig, exec glsl_precision prec_params_first = glsl_precision_undefined; int params_counter = 0; - exec_list_iterator actual_iter = actual_parameters->iterator(); - exec_list_iterator formal_iter = sig->parameters.iterator(); - - while (actual_iter.has_next()) - { - ir_rvalue *actual = (ir_rvalue *) actual_iter.get(); - ir_variable *formal = (ir_variable *) formal_iter.get(); + foreach_two_lists(formal_node, &sig->parameters, + actual_node, actual_parameters) { + ir_rvalue *actual = (ir_rvalue *) actual_node; + ir_variable *formal = (ir_variable *) formal_node; assert(actual != NULL); assert(formal != NULL); - glsl_precision param_prec = (glsl_precision)formal->precision; + glsl_precision param_prec = (glsl_precision)formal->data.precision; if (param_prec == glsl_precision_undefined) param_prec = actual->get_precision(); prec_params_max = higher_precision (prec_params_max, param_prec); if (params_counter == 0) prec_params_first = param_prec; - actual_iter.next(); - formal_iter.next(); ++params_counter; } @@ -182,7 +177,7 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, YYLTYPE loc = actual_ast->get_location(); /* Verify that 'const_in' parameters are ir_constants. */ - if (formal->mode == ir_var_const_in && + if (formal->data.mode == ir_var_const_in && actual->ir_type != ir_type_constant) { _mesa_glsl_error(&loc, state, "parameter `in %s' must be a constant expression", @@ -191,12 +186,13 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, } /* Verify that 'out' and 'inout' actual parameters are lvalues. */ - if (formal->mode == ir_var_out || formal->mode == ir_var_inout) { + if (formal->data.mode == ir_var_function_out + || formal->data.mode == ir_var_function_inout) { const char *mode = NULL; - switch (formal->mode) { - case ir_var_out: mode = "out"; break; - case ir_var_inout: mode = "inout"; break; - default: assert(false); break; + switch (formal->data.mode) { + case ir_var_function_out: mode = "out"; break; + case ir_var_function_inout: mode = "inout"; break; + default: assert(false); break; } /* This AST-based check catches errors like f(i++). The IR-based @@ -213,9 +209,9 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, ir_variable *var = actual->variable_referenced(); if (var) - var->assigned = true; + var->data.assigned = true; - if (var && var->read_only) { + if (var && var->data.read_only) { _mesa_glsl_error(&loc, state, "function parameter '%s %s' references the " "read-only variable '%s'", @@ -223,10 +219,18 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, actual->variable_referenced()->name); return false; } else if (!actual->is_lvalue()) { - _mesa_glsl_error(&loc, state, - "function parameter '%s %s' is not an lvalue", - mode, formal->name); - return false; + /* Even though ir_binop_vector_extract is not an l-value, let it + * slop through. generate_call will handle it correctly. + */ + ir_expression *const expr = ((ir_rvalue *) actual)->as_expression(); + if (expr == NULL + || expr->operation != ir_binop_vector_extract + || !expr->operands[0]->is_lvalue()) { + _mesa_glsl_error(&loc, state, + "function parameter '%s %s' is not an lvalue", + mode, formal->name); + return false; + } } } @@ -236,107 +240,148 @@ verify_parameter_modes(_mesa_glsl_parse_state *state, return true; } +static void +fix_parameter(void *mem_ctx, ir_rvalue *actual, const glsl_type *formal_type, + exec_list *before_instructions, exec_list *after_instructions, + bool parameter_is_inout, glsl_precision prec) +{ + ir_expression *const expr = actual->as_expression(); + + /* If the types match exactly and the parameter is not a vector-extract, + * nothing needs to be done to fix the parameter. + */ + if (formal_type == actual->type + && (expr == NULL || expr->operation != ir_binop_vector_extract)) + return; + + /* To convert an out parameter, we need to create a temporary variable to + * hold the value before conversion, and then perform the conversion after + * the function call returns. + * + * This has the effect of transforming code like this: + * + * void f(out int x); + * float value; + * f(value); + * + * Into IR that's equivalent to this: + * + * void f(out int x); + * float value; + * int out_parameter_conversion; + * f(out_parameter_conversion); + * value = float(out_parameter_conversion); + * + * If the parameter is an ir_expression of ir_binop_vector_extract, + * additional conversion is needed in the post-call re-write. + */ + ir_variable *tmp = + new(mem_ctx) ir_variable(formal_type, "inout_tmp", ir_var_temporary, prec); + + before_instructions->push_tail(tmp); + + /* If the parameter is an inout parameter, copy the value of the actual + * parameter to the new temporary. Note that no type conversion is allowed + * here because inout parameters must match types exactly. + */ + if (parameter_is_inout) { + /* Inout parameters should never require conversion, since that would + * require an implicit conversion to exist both to and from the formal + * parameter type, and there are no bidirectional implicit conversions. + */ + assert (actual->type == formal_type); + + ir_dereference_variable *const deref_tmp_1 = + new(mem_ctx) ir_dereference_variable(tmp); + ir_assignment *const assignment = + new(mem_ctx) ir_assignment(deref_tmp_1, actual); + before_instructions->push_tail(assignment); + } + + /* Replace the parameter in the call with a dereference of the new + * temporary. + */ + ir_dereference_variable *const deref_tmp_2 = + new(mem_ctx) ir_dereference_variable(tmp); + actual->replace_with(deref_tmp_2); + + + /* Copy the temporary variable to the actual parameter with optional + * type conversion applied. + */ + ir_rvalue *rhs = new(mem_ctx) ir_dereference_variable(tmp); + if (actual->type != formal_type) + rhs = convert_component(rhs, actual->type); + + ir_rvalue *lhs = actual; + if (expr != NULL && expr->operation == ir_binop_vector_extract) { + rhs = new(mem_ctx) ir_expression(ir_triop_vector_insert, + expr->operands[0]->type, + expr->operands[0]->clone(mem_ctx, NULL), + rhs, + expr->operands[1]->clone(mem_ctx, NULL)); + lhs = expr->operands[0]->clone(mem_ctx, NULL); + } + + ir_assignment *const assignment_2 = new(mem_ctx) ir_assignment(lhs, rhs); + after_instructions->push_tail(assignment_2); +} + /** - * If a function call is generated, \c call_ir will point to it on exit. - * Otherwise \c call_ir will be set to \c NULL. + * Generate a function call. + * + * For non-void functions, this returns a dereference of the temporary variable + * which stores the return value for the call. For void functions, this returns + * NULL. */ static ir_rvalue * generate_call(exec_list *instructions, ir_function_signature *sig, - YYLTYPE *loc, exec_list *actual_parameters, - ir_call **call_ir, + exec_list *actual_parameters, struct _mesa_glsl_parse_state *state) { void *ctx = state; exec_list post_call_conversions; - *call_ir = NULL; - /* Perform implicit conversion of arguments. For out parameters, we need * to place them in a temporary variable and do the conversion after the * call takes place. Since we haven't emitted the call yet, we'll place * the post-call conversions in a temporary exec_list, and emit them later. */ - exec_list_iterator actual_iter = actual_parameters->iterator(); - exec_list_iterator formal_iter = sig->parameters.iterator(); - - while (actual_iter.has_next()) { - ir_rvalue *actual = (ir_rvalue *) actual_iter.get(); - ir_variable *formal = (ir_variable *) formal_iter.get(); - - assert(actual != NULL); - assert(formal != NULL); + foreach_two_lists(formal_node, &sig->parameters, + actual_node, actual_parameters) { + ir_rvalue *actual = (ir_rvalue *) actual_node; + ir_variable *formal = (ir_variable *) formal_node; if (formal->type->is_numeric() || formal->type->is_boolean()) { - switch (formal->mode) { + switch (formal->data.mode) { case ir_var_const_in: - case ir_var_in: { + case ir_var_function_in: { ir_rvalue *converted = convert_component(actual, formal->type); actual->replace_with(converted); break; } - case ir_var_out: - if (actual->type != formal->type) { - /* To convert an out parameter, we need to create a - * temporary variable to hold the value before conversion, - * and then perform the conversion after the function call - * returns. - * - * This has the effect of transforming code like this: - * - * void f(out int x); - * float value; - * f(value); - * - * Into IR that's equivalent to this: - * - * void f(out int x); - * float value; - * int out_parameter_conversion; - * f(out_parameter_conversion); - * value = float(out_parameter_conversion); - */ - ir_variable *tmp = - new(ctx) ir_variable(formal->type, - "out_parameter_conversion", - ir_var_temporary, precision_for_call(sig,actual_parameters)); - instructions->push_tail(tmp); - ir_dereference_variable *deref_tmp_1 - = new(ctx) ir_dereference_variable(tmp); - ir_dereference_variable *deref_tmp_2 - = new(ctx) ir_dereference_variable(tmp); - ir_rvalue *converted_tmp - = convert_component(deref_tmp_1, actual->type); - ir_assignment *assignment - = new(ctx) ir_assignment(actual, converted_tmp); - post_call_conversions.push_tail(assignment); - actual->replace_with(deref_tmp_2); - } - break; - case ir_var_inout: - /* Inout parameters should never require conversion, since that - * would require an implicit conversion to exist both to and - * from the formal parameter type, and there are no - * bidirectional implicit conversions. - */ - assert (actual->type == formal->type); + case ir_var_function_out: + case ir_var_function_inout: + fix_parameter(ctx, actual, formal->type, + instructions, &post_call_conversions, + formal->data.mode == ir_var_function_inout, + precision_for_call(sig,actual_parameters)); break; default: assert (!"Illegal formal parameter mode"); break; } } - - actual_iter.next(); - formal_iter.next(); } /* If the function call is a constant expression, don't generate any * instructions; just generate an ir_constant. * - * Function calls were first allowed to be constant expressions in GLSL 1.20. + * Function calls were first allowed to be constant expressions in GLSL + * 1.20 and GLSL ES 3.00. */ - if (state->language_version >= 120) { + if (state->is_version(120, 300)) { ir_constant *value = sig->constant_expression_value(actual_parameters, NULL); if (value != NULL) { return value; @@ -383,13 +428,15 @@ match_function_by_name(const char *name, goto done; /* no match */ /* Is the function hidden by a variable (impossible in 1.10)? */ - if (state->language_version != 110 && state->symbols->get_variable(name)) + if (!state->symbols->separate_function_namespace + && state->symbols->get_variable(name)) goto done; /* no match */ if (f != NULL) { /* Look for a match in the local shader. If exact, we're done. */ bool is_exact = false; - sig = local_sig = f->matching_signature(actual_parameters, &is_exact); + sig = local_sig = f->matching_signature(state, actual_parameters, + &is_exact); if (is_exact) goto done; @@ -403,33 +450,8 @@ match_function_by_name(const char *name, } /* Local shader has no exact candidates; check the built-ins. */ - _mesa_glsl_initialize_functions(state); - for (unsigned i = 0; i < state->num_builtins_to_link; i++) { - ir_function *builtin = - state->builtins_to_link[i]->symbols->get_function(name); - if (builtin == NULL) - continue; - - bool is_exact = false; - ir_function_signature *builtin_sig = - builtin->matching_signature(actual_parameters, &is_exact); - - if (builtin_sig == NULL) - continue; - - /* If the built-in signature is exact, we can stop. */ - if (is_exact) { - sig = builtin_sig; - goto done; - } - - if (sig == NULL) { - /* We found an inexact match, which is better than nothing. However, - * we should keep searching for an exact match. - */ - sig = builtin_sig; - } - } + _mesa_glsl_initialize_builtin_functions(); + sig = _mesa_glsl_find_builtin_function(state, name, actual_parameters); done: if (sig != NULL) { @@ -446,6 +468,25 @@ done: return sig; } +static void +print_function_prototypes(_mesa_glsl_parse_state *state, YYLTYPE *loc, + ir_function *f) +{ + if (f == NULL) + return; + + foreach_list (node, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) node; + + if (sig->is_builtin() && !sig->is_builtin_available(state)) + continue; + + char *str = prototype_string(sig->return_type, f->name, &sig->parameters); + _mesa_glsl_error(loc, state, " %s", str); + ralloc_free(str); + } +} + /** * Raise a "no matching function" error, listing all possible overloads the * compiler considered so developers can figure out what went wrong. @@ -456,27 +497,23 @@ no_matching_function_error(const char *name, exec_list *actual_parameters, _mesa_glsl_parse_state *state) { - char *str = prototype_string(NULL, name, actual_parameters); - _mesa_glsl_error(loc, state, "no matching function for call to `%s'", str); - ralloc_free(str); + gl_shader *sh = _mesa_glsl_get_builtin_function_shader(); - const char *prefix = "candidates are: "; + if (state->symbols->get_function(name) == NULL + && (!state->uses_builtin_functions + || sh->symbols->get_function(name) == NULL)) { + _mesa_glsl_error(loc, state, "no function with name '%s'", name); + } else { + char *str = prototype_string(NULL, name, actual_parameters); + _mesa_glsl_error(loc, state, + "no matching function for call to `%s'; candidates are:", + str); + ralloc_free(str); - for (int i = -1; i < (int) state->num_builtins_to_link; i++) { - glsl_symbol_table *syms = i >= 0 ? state->builtins_to_link[i]->symbols - : state->symbols; - ir_function *f = syms->get_function(name); - if (f == NULL) - continue; + print_function_prototypes(state, loc, state->symbols->get_function(name)); - foreach_list (node, &f->signatures) { - ir_function_signature *sig = (ir_function_signature *) node; - - str = prototype_string(sig->return_type, f->name, &sig->parameters); - _mesa_glsl_error(loc, state, "%s%s", prefix, str); - ralloc_free(str); - - prefix = " "; + if (state->uses_builtin_functions) { + print_function_prototypes(state, loc, sh->symbols->get_function(name)); } } } @@ -610,6 +647,120 @@ dereference_component(ir_rvalue *src, unsigned component) } +static ir_rvalue * +process_vec_mat_constructor(exec_list *instructions, + const glsl_type *constructor_type, + YYLTYPE *loc, exec_list *parameters, + struct _mesa_glsl_parse_state *state) +{ + void *ctx = state; + + /* The ARB_shading_language_420pack spec says: + * + * "If an initializer is a list of initializers enclosed in curly braces, + * the variable being declared must be a vector, a matrix, an array, or a + * structure. + * + * int i = { 1 }; // illegal, i is not an aggregate" + */ + if (constructor_type->vector_elements <= 1) { + _mesa_glsl_error(loc, state, "aggregates can only initialize vectors, " + "matrices, arrays, and structs"); + return ir_rvalue::error_value(ctx); + } + + exec_list actual_parameters; + const unsigned parameter_count = + process_parameters(instructions, &actual_parameters, parameters, state); + + if (parameter_count == 0 + || (constructor_type->is_vector() && + constructor_type->vector_elements != parameter_count) + || (constructor_type->is_matrix() && + constructor_type->matrix_columns != parameter_count)) { + _mesa_glsl_error(loc, state, "%s constructor must have %u parameters", + constructor_type->is_vector() ? "vector" : "matrix", + constructor_type->vector_elements); + return ir_rvalue::error_value(ctx); + } + + bool all_parameters_are_constant = true; + + /* Type cast each parameter and, if possible, fold constants. */ + foreach_list_safe(n, &actual_parameters) { + ir_rvalue *ir = (ir_rvalue *) n; + ir_rvalue *result = ir; + + /* Apply implicit conversions (not the scalar constructor rules!). See + * the spec quote above. */ + if (constructor_type->is_float()) { + const glsl_type *desired_type = + glsl_type::get_instance(GLSL_TYPE_FLOAT, + ir->type->vector_elements, + ir->type->matrix_columns); + if (result->type->can_implicitly_convert_to(desired_type)) { + /* Even though convert_component() implements the constructor + * conversion rules (not the implicit conversion rules), its safe + * to use it here because we already checked that the implicit + * conversion is legal. + */ + result = convert_component(ir, desired_type); + } + } + + if (constructor_type->is_matrix()) { + if (result->type != constructor_type->column_type()) { + _mesa_glsl_error(loc, state, "type error in matrix constructor: " + "expected: %s, found %s", + constructor_type->column_type()->name, + result->type->name); + return ir_rvalue::error_value(ctx); + } + } else if (result->type != constructor_type->get_scalar_type()) { + _mesa_glsl_error(loc, state, "type error in vector constructor: " + "expected: %s, found %s", + constructor_type->get_scalar_type()->name, + result->type->name); + return ir_rvalue::error_value(ctx); + } + + /* Attempt to convert the parameter to a constant valued expression. + * After doing so, track whether or not all the parameters to the + * constructor are trivially constant valued expressions. + */ + ir_rvalue *const constant = result->constant_expression_value(); + + if (constant != NULL) + result = constant; + else + all_parameters_are_constant = false; + + ir->replace_with(result); + } + + if (all_parameters_are_constant) + return new(ctx) ir_constant(constructor_type, &actual_parameters); + + ir_variable *var = new(ctx) ir_variable(constructor_type, "vec_mat_ctor", + ir_var_temporary, glsl_precision_undefined); + instructions->push_tail(var); + + int i = 0; + foreach_list(node, &actual_parameters) { + ir_rvalue *rhs = (ir_rvalue *) node; + ir_rvalue *lhs = new(ctx) ir_dereference_array(var, + new(ctx) ir_constant(i)); + + ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL); + instructions->push_tail(assignment); + + i++; + } + + return new(ctx) ir_dereference_variable(var); +} + + static ir_rvalue * process_array_constructor(exec_list *instructions, const glsl_type *constructor_type, @@ -640,21 +791,21 @@ process_array_constructor(exec_list *instructions, exec_list actual_parameters; const unsigned parameter_count = process_parameters(instructions, &actual_parameters, parameters, state); + bool is_unsized_array = constructor_type->is_unsized_array(); - if ((parameter_count == 0) - || ((constructor_type->length != 0) - && (constructor_type->length != parameter_count))) { - const unsigned min_param = (constructor_type->length == 0) - ? 1 : constructor_type->length; + if ((parameter_count == 0) || + (!is_unsized_array && (constructor_type->length != parameter_count))) { + const unsigned min_param = is_unsized_array + ? 1 : constructor_type->length; _mesa_glsl_error(loc, state, "array constructor must have %s %u " "parameter%s", - (constructor_type->length != 0) ? "at least" : "exactly", + is_unsized_array ? "at least" : "exactly", min_param, (min_param <= 1) ? "" : "s"); return ir_rvalue::error_value(ctx); } - if (constructor_type->length == 0) { + if (is_unsized_array) { constructor_type = glsl_type::get_array_instance(constructor_type->element_type(), parameter_count); @@ -691,6 +842,7 @@ process_array_constructor(exec_list *instructions, "expected: %s, found %s", constructor_type->element_type()->name, result->type->name); + return ir_rvalue::error_value(ctx); } /* Attempt to convert the parameter to a constant valued expression. @@ -797,7 +949,7 @@ emit_inline_vector_constructor(const glsl_type *type, unsigned ast_precision, ir_rvalue *first_param = (ir_rvalue *)parameters->head; ir_rvalue *rhs = new(ctx) ir_swizzle(first_param, 0, 0, 0, 0, lhs_components); - var->precision = higher_precision ((glsl_precision)var->precision, rhs->get_precision()); + var->data.precision = higher_precision ((glsl_precision)var->data.precision, rhs->get_precision()); ir_dereference_variable *lhs = new(ctx) ir_dereference_variable(var); const unsigned mask = (1U << lhs_components) - 1; @@ -815,7 +967,7 @@ emit_inline_vector_constructor(const glsl_type *type, unsigned ast_precision, foreach_list(node, parameters) { ir_rvalue *param = (ir_rvalue *) node; - var->precision = higher_precision ((glsl_precision)var->precision, param->get_precision()); + var->data.precision = higher_precision ((glsl_precision)var->data.precision, param->get_precision()); unsigned rhs_components = param->type->components(); /* Do not try to assign more components to the vector than it has! @@ -1262,6 +1414,63 @@ emit_inline_record_constructor(const glsl_type *type, } +static ir_rvalue * +process_record_constructor(exec_list *instructions, + const glsl_type *constructor_type, + YYLTYPE *loc, exec_list *parameters, + struct _mesa_glsl_parse_state *state) +{ + void *ctx = state; + exec_list actual_parameters; + + process_parameters(instructions, &actual_parameters, + parameters, state); + + exec_node *node = actual_parameters.head; + for (unsigned i = 0; i < constructor_type->length; i++) { + ir_rvalue *ir = (ir_rvalue *) node; + + if (node->is_tail_sentinel()) { + _mesa_glsl_error(loc, state, + "insufficient parameters to constructor for `%s'", + constructor_type->name); + return ir_rvalue::error_value(ctx); + } + + if (apply_implicit_conversion(constructor_type->fields.structure[i].type, + ir, state)) { + node->replace_with(ir); + } else { + _mesa_glsl_error(loc, state, + "parameter type mismatch in constructor for `%s.%s' " + "(%s vs %s)", + constructor_type->name, + constructor_type->fields.structure[i].name, + ir->type->name, + constructor_type->fields.structure[i].type->name); + return ir_rvalue::error_value(ctx);; + } + + node = node->next; + } + + if (!node->is_tail_sentinel()) { + _mesa_glsl_error(loc, state, "too many parameters in constructor " + "for `%s'", constructor_type->name); + return ir_rvalue::error_value(ctx); + } + + ir_rvalue *const constant = + constant_record_constructor(constructor_type, &actual_parameters, + state); + + return (constant != NULL) + ? constant + : emit_inline_record_constructor(constructor_type, instructions, + &actual_parameters, state); +} + + ir_rvalue * ast_function_expression::hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) @@ -1303,9 +1512,8 @@ ast_function_expression::hir(exec_list *instructions, } if (constructor_type->is_array()) { - if (state->language_version <= 110) { - _mesa_glsl_error(& loc, state, - "array constructors forbidden in GLSL 1.10"); + if (!state->check_version(120, 300, &loc, + "array constructors forbidden")) { return ir_rvalue::error_value(ctx); } @@ -1314,63 +1522,24 @@ ast_function_expression::hir(exec_list *instructions, } - /* There are two kinds of constructor call. Constructors for built-in - * language types, such as mat4 and vec2, are free form. The only - * requirement is that the parameters must provide enough values of the - * correct scalar type. Constructors for arrays and structures must - * have the exact number of parameters with matching types in the - * correct order. These constructors follow essentially the same type - * matching rules as functions. + /* There are two kinds of constructor calls. Constructors for arrays and + * structures must have the exact number of arguments with matching types + * in the correct order. These constructors follow essentially the same + * type matching rules as functions. + * + * Constructors for built-in language types, such as mat4 and vec2, are + * free form. The only requirements are that the parameters must provide + * enough values of the correct scalar type and that no arguments are + * given past the last used argument. + * + * When using the C-style initializer syntax from GLSL 4.20, constructors + * must have the exact number of arguments with matching types in the + * correct order. */ if (constructor_type->is_record()) { - exec_list actual_parameters; - - process_parameters(instructions, &actual_parameters, - &this->expressions, state); - - exec_node *node = actual_parameters.head; - for (unsigned i = 0; i < constructor_type->length; i++) { - ir_rvalue *ir = (ir_rvalue *) node; - - if (node->is_tail_sentinel()) { - _mesa_glsl_error(&loc, state, - "insufficient parameters to constructor " - "for `%s'", - constructor_type->name); - return ir_rvalue::error_value(ctx); - } - - if (apply_implicit_conversion(constructor_type->fields.structure[i].type, - ir, state)) { - node->replace_with(ir); - } else { - _mesa_glsl_error(&loc, state, - "parameter type mismatch in constructor " - "for `%s.%s' (%s vs %s)", - constructor_type->name, - constructor_type->fields.structure[i].name, - ir->type->name, - constructor_type->fields.structure[i].type->name); - return ir_rvalue::error_value(ctx);; - } - - node = node->next; - } - - if (!node->is_tail_sentinel()) { - _mesa_glsl_error(&loc, state, "too many parameters in constructor " - "for `%s'", constructor_type->name); - return ir_rvalue::error_value(ctx); - } - - ir_rvalue *const constant = - constant_record_constructor(constructor_type, &actual_parameters, - state); - - return (constant != NULL) - ? constant - : emit_inline_record_constructor(constructor_type, instructions, - &actual_parameters, state); + return process_record_constructor(instructions, constructor_type, + &loc, &this->expressions, + state); } if (!constructor_type->is_numeric() && !constructor_type->is_boolean()) @@ -1428,11 +1597,11 @@ ast_function_expression::hir(exec_list *instructions, * "It is an error to construct matrices from other matrices. This * is reserved for future use." */ - if (state->language_version == 110 && matrix_parameters > 0 - && constructor_type->is_matrix()) { - _mesa_glsl_error(& loc, state, "cannot construct `%s' from a " - "matrix in GLSL 1.10", - constructor_type->name); + if (matrix_parameters > 0 + && constructor_type->is_matrix() + && !state->check_version(120, 100, &loc, + "cannot construct `%s' from a matrix", + constructor_type->name)) { return ir_rvalue::error_value(ctx); } @@ -1529,13 +1698,13 @@ ast_function_expression::hir(exec_list *instructions, return dereference_component((ir_rvalue *) actual_parameters.head, 0); } else if (constructor_type->is_vector()) { - return emit_inline_vector_constructor(constructor_type, type->precision, + return emit_inline_vector_constructor(constructor_type, ast_precision_none, // TODO: type->precision, instructions, &actual_parameters, ctx); } else { assert(constructor_type->is_matrix()); - return emit_inline_matrix_constructor(constructor_type, type->precision, + return emit_inline_matrix_constructor(constructor_type, ast_precision_none, // TODO: type->precision, instructions, &actual_parameters, ctx); @@ -1543,7 +1712,7 @@ ast_function_expression::hir(exec_list *instructions, } else { const ast_expression *id = subexpressions[0]; const char *func_name = id->primary_expression.identifier; - YYLTYPE loc = id->get_location(); + YYLTYPE loc = get_location(); exec_list actual_parameters; process_parameters(instructions, &actual_parameters, &this->expressions, @@ -1552,7 +1721,6 @@ ast_function_expression::hir(exec_list *instructions, ir_function_signature *sig = match_function_by_name(func_name, &actual_parameters, state); - ir_call *call = NULL; ir_rvalue *value = NULL; if (sig == NULL) { no_matching_function_error(func_name, &loc, &actual_parameters, state); @@ -1561,8 +1729,7 @@ ast_function_expression::hir(exec_list *instructions, /* an error has already been emitted */ value = ir_rvalue::error_value(ctx); } else { - value = generate_call(instructions, sig, &loc, &actual_parameters, - &call, state); + value = generate_call(instructions, sig, &actual_parameters, state); } return value; @@ -1570,3 +1737,36 @@ ast_function_expression::hir(exec_list *instructions, return ir_rvalue::error_value(ctx); } + +ir_rvalue * +ast_aggregate_initializer::hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + void *ctx = state; + YYLTYPE loc = this->get_location(); + + if (!this->constructor_type) { + _mesa_glsl_error(&loc, state, "type of C-style initializer unknown"); + return ir_rvalue::error_value(ctx); + } + const glsl_type *const constructor_type = this->constructor_type; + + if (!state->ARB_shading_language_420pack_enable) { + _mesa_glsl_error(&loc, state, "C-style initialization requires the " + "GL_ARB_shading_language_420pack extension"); + return ir_rvalue::error_value(ctx); + } + + if (constructor_type->is_array()) { + return process_array_constructor(instructions, constructor_type, &loc, + &this->expressions, state); + } + + if (constructor_type->is_record()) { + return process_record_constructor(instructions, constructor_type, &loc, + &this->expressions, state); + } + + return process_vec_mat_constructor(instructions, constructor_type, &loc, + &this->expressions, state); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp index 996d4354b..c4ff8ff01 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp @@ -60,18 +60,24 @@ static void detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, exec_list *instructions); +static void +remove_per_vertex_blocks(exec_list *instructions, + _mesa_glsl_parse_state *state, ir_variable_mode mode); + void _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) { _mesa_glsl_initialize_variables(instructions, state); - state->symbols->language_version = state->language_version; + state->symbols->separate_function_namespace = state->language_version == 110; state->current_function = NULL; state->toplevel_ir = instructions; + state->gs_input_prim_type_specified = false; + /* Section 4.2 of the GLSL 1.20 specification states: * "The built-in functions are scoped in a scope outside the global scope * users declare global variables in. That is, a shader's global scope, @@ -94,6 +100,72 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) detect_conflicting_assignments(state, instructions); state->toplevel_ir = NULL; + + /* Move all of the variable declarations to the front of the IR list, and + * reverse the order. This has the (intended!) side effect that vertex + * shader inputs and fragment shader outputs will appear in the IR in the + * same order that they appeared in the shader code. This results in the + * locations being assigned in the declared order. Many (arguably buggy) + * applications depend on this behavior, and it matches what nearly all + * other drivers do. + * + * However, do not push the declarations before struct decls or precision + * statements. + */ + ir_instruction* before_node = (ir_instruction*)instructions->head; + ir_instruction* after_node = NULL; + while (before_node && (before_node->ir_type == ir_type_precision || before_node->ir_type == ir_type_typedecl)) + { + after_node = before_node; + before_node = (ir_instruction*)before_node->next; + } + + foreach_list_safe(node, instructions) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if (var == NULL) + continue; + + var->remove(); + if (after_node) + after_node->insert_after(var); + else + instructions->push_head(var); + } + + /* From section 7.1 (Built-In Language Variables) of the GLSL 4.10 spec: + * + * If multiple shaders using members of a built-in block belonging to + * the same interface are linked together in the same program, they + * must all redeclare the built-in block in the same way, as described + * in section 4.3.7 "Interface Blocks" for interface block matching, or + * a link error will result. + * + * The phrase "using members of a built-in block" implies that if two + * shaders are linked together and one of them *does not use* any members + * of the built-in block, then that shader does not need to have a matching + * redeclaration of the built-in block. + * + * This appears to be a clarification to the behaviour established for + * gl_PerVertex by GLSL 1.50, therefore implement it regardless of GLSL + * version. + * + * The definition of "interface" in section 4.3.7 that applies here is as + * follows: + * + * The boundary between adjacent programmable pipeline stages: This + * spans all the outputs in all compilation units of the first stage + * and all the inputs in all compilation units of the second stage. + * + * Therefore this rule applies to both inter- and intra-stage linking. + * + * The easiest way to implement this is to check whether the shader uses + * gl_PerVertex right after ast-to-ir conversion, and if it doesn't, simply + * remove all the relevant variable declaration from the IR, so that the + * linker won't see them and complain about mismatches. + */ + remove_per_vertex_blocks(instructions, state, ir_var_shader_in); + remove_per_vertex_blocks(instructions, state, ir_var_shader_out); } @@ -121,7 +193,7 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from, /* This conversion was added in GLSL 1.20. If the compilation mode is * GLSL 1.10, the conversion is skipped. */ - if (state->language_version < 120) + if (!state->is_version(120, 0)) return false; /* From page 27 (page 33 of the PDF) of the GLSL 1.50 spec: @@ -177,7 +249,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (!type_a->is_numeric() || !type_b->is_numeric()) { _mesa_glsl_error(loc, state, - "Operands to arithmetic operators must be numeric"); + "operands to arithmetic operators must be numeric"); return glsl_type::error_type; } @@ -189,7 +261,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, if (!apply_implicit_conversion(type_a, value_b, state) && !apply_implicit_conversion(type_b, value_a, state)) { _mesa_glsl_error(loc, state, - "Could not implicitly convert operands to " + "could not implicitly convert operands to " "arithmetic operator"); return glsl_type::error_type; } @@ -368,7 +440,7 @@ unary_arithmetic_result_type(const struct glsl_type *type, */ if (!type->is_numeric()) { _mesa_glsl_error(loc, state, - "Operands to arithmetic operators must be numeric"); + "operands to arithmetic operators must be numeric"); return glsl_type::error_type; } @@ -390,8 +462,7 @@ bit_logic_result_type(const struct glsl_type *type_a, ast_operators op, struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { - if (state->language_version < 130) { - _mesa_glsl_error(loc, state, "bit operations require GLSL 1.30"); + if (!state->check_bitwise_operations_allowed(loc)) { return glsl_type::error_type; } @@ -446,10 +517,7 @@ modulus_result_type(const struct glsl_type *type_a, const struct glsl_type *type_b, struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { - if (state->language_version < 130) { - _mesa_glsl_error(loc, state, - "operator '%%' is reserved in %s", - state->version_string); + if (!state->check_version(130, 300, loc, "operator '%%' is reserved")) { return glsl_type::error_type; } @@ -459,11 +527,11 @@ modulus_result_type(const struct glsl_type *type_a, * unsigned." */ if (!type_a->is_integer()) { - _mesa_glsl_error(loc, state, "LHS of operator %% must be an integer."); + _mesa_glsl_error(loc, state, "LHS of operator %% must be an integer"); return glsl_type::error_type; } if (!type_b->is_integer()) { - _mesa_glsl_error(loc, state, "RHS of operator %% must be an integer."); + _mesa_glsl_error(loc, state, "RHS of operator %% must be an integer"); return glsl_type::error_type; } if (type_a->base_type != type_b->base_type) { @@ -509,7 +577,7 @@ relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, || !type_a->is_scalar() || !type_b->is_scalar()) { _mesa_glsl_error(loc, state, - "Operands to relational operators must be scalar and " + "operands to relational operators must be scalar and " "numeric"); return glsl_type::error_type; } @@ -521,7 +589,7 @@ relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, if (!apply_implicit_conversion(type_a, value_b, state) && !apply_implicit_conversion(type_b, value_a, state)) { _mesa_glsl_error(loc, state, - "Could not implicitly convert operands to " + "could not implicitly convert operands to " "relational operator"); return glsl_type::error_type; } @@ -553,8 +621,7 @@ shift_result_type(const struct glsl_type *type_a, ast_operators op, struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { - if (state->language_version < 130) { - _mesa_glsl_error(loc, state, "bit operations require GLSL 1.30"); + if (!state->check_bitwise_operations_allowed(loc)) { return glsl_type::error_type; } @@ -580,7 +647,7 @@ shift_result_type(const struct glsl_type *type_a, * a scalar as well." */ if (type_a->is_scalar() && !type_b->is_scalar()) { - _mesa_glsl_error(loc, state, "If the first operand of %s is scalar, the " + _mesa_glsl_error(loc, state, "if the first operand of %s is scalar, the " "second must be scalar as well", ast_expression::operator_string(op)); return glsl_type::error_type; @@ -592,7 +659,7 @@ shift_result_type(const struct glsl_type *type_a, if (type_a->is_vector() && type_b->is_vector() && type_a->vector_elements != type_b->vector_elements) { - _mesa_glsl_error(loc, state, "Vector operands to operator %s must " + _mesa_glsl_error(loc, state, "vector operands to operator %s must " "have same number of elements", ast_expression::operator_string(op)); return glsl_type::error_type; @@ -622,8 +689,8 @@ shift_result_type(const struct glsl_type *type_a, */ ir_rvalue * validate_assignment(struct _mesa_glsl_parse_state *state, - const glsl_type *lhs_type, ir_rvalue *rhs, - bool is_initializer) + YYLTYPE loc, const glsl_type *lhs_type, + ir_rvalue *rhs, bool is_initializer) { /* If there is already some error in the RHS, just return it. Anything * else will lead to an avalanche of error message back to the user. @@ -636,17 +703,22 @@ validate_assignment(struct _mesa_glsl_parse_state *state, if (rhs->type == lhs_type) return rhs; - /* If the array element types are the same and the size of the LHS is zero, + /* If the array element types are the same and the LHS is unsized, * the assignment is okay for initializers embedded in variable * declarations. * * Note: Whole-array assignments are not permitted in GLSL 1.10, but this * is handled by ir_dereference::is_lvalue. */ - if (is_initializer && lhs_type->is_array() && rhs->type->is_array() - && (lhs_type->element_type() == rhs->type->element_type()) - && (lhs_type->array_size() == 0)) { - return rhs; + if (lhs_type->is_unsized_array() && rhs->type->is_array() + && (lhs_type->element_type() == rhs->type->element_type())) { + if (is_initializer) { + return rhs; + } else { + _mesa_glsl_error(&loc, state, + "implicitly sized arrays cannot be assigned"); + return NULL; + } } /* Check for implicit conversion in GLSL 1.20 */ @@ -655,6 +727,12 @@ validate_assignment(struct _mesa_glsl_parse_state *state, return rhs; } + _mesa_glsl_error(&loc, state, + "%s of type %s cannot be assigned to " + "variable of type %s", + is_initializer ? "initializer" : "value", + rhs->type->name, lhs_type->name); + return NULL; } @@ -664,7 +742,7 @@ mark_whole_array_access(ir_rvalue *access) ir_dereference_variable *deref = access->as_dereference_variable(); if (deref && deref->var) { - deref->var->max_array_access = deref->type->length - 1; + deref->var->data.max_array_access = deref->type->length - 1; } } @@ -676,10 +754,47 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, { void *ctx = state; bool error_emitted = (lhs->type->is_error() || rhs->type->is_error()); + ir_rvalue *extract_channel = NULL; + + /* If the assignment LHS comes back as an ir_binop_vector_extract + * expression, move it to the RHS as an ir_triop_vector_insert. + */ + if (lhs->ir_type == ir_type_expression) { + ir_expression *const lhs_expr = lhs->as_expression(); + + if (unlikely(lhs_expr->operation == ir_binop_vector_extract)) { + ir_rvalue *new_rhs = + validate_assignment(state, lhs_loc, lhs->type, + rhs, is_initializer); + + if (new_rhs == NULL) { + return lhs; + } else { + /* This converts: + * - LHS: (expression float vector_extract ) + * - RHS: + * into: + * - LHS: + * - RHS: (expression vec2 vector_insert ) + * + * The LHS type is now a vector instead of a scalar. Since GLSL + * allows assignments to be used as rvalues, we need to re-extract + * the channel from assignment_temp when returning the rvalue. + */ + extract_channel = lhs_expr->operands[1]; + rhs = new(ctx) ir_expression(ir_triop_vector_insert, + lhs_expr->operands[0]->type, + lhs_expr->operands[0], + new_rhs, + extract_channel); + lhs = lhs_expr->operands[0]->clone(ctx, NULL); + } + } + } ir_variable *lhs_var = lhs->variable_referenced(); if (lhs_var) - lhs_var->assigned = true; + lhs_var->data.assigned = true; if (!error_emitted) { if (non_lvalue_description != NULL) { @@ -688,21 +803,23 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, non_lvalue_description); error_emitted = true; } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->read_only) { + && lhs->variable_referenced()->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", lhs->variable_referenced()->name); error_emitted = true; - } else if (state->language_version <= 110 && lhs->type->is_array()) { + } else if (lhs->type->is_array() && + !state->check_version(120, 300, &lhs_loc, + "whole array assignment forbidden")) { /* From page 32 (page 38 of the PDF) of the GLSL 1.10 spec: * * "Other binary or unary expressions, non-dereferenced * arrays, function names, swizzles with repeated fields, * and constants cannot be l-values." + * + * The restriction on arrays is lifted in GLSL 1.20 and GLSL ES 3.00. */ - _mesa_glsl_error(&lhs_loc, state, "whole array assignment is not " - "allowed in GLSL 1.10 or GLSL ES 1.00."); error_emitted = true; } else if (!lhs->is_lvalue()) { _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment"); @@ -711,10 +828,8 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, } ir_rvalue *new_rhs = - validate_assignment(state, lhs->type, rhs, is_initializer); - if (new_rhs == NULL) { - _mesa_glsl_error(& lhs_loc, state, "type mismatch"); - } else { + validate_assignment(state, lhs_loc, lhs->type, rhs, is_initializer); + if (new_rhs != NULL) { rhs = new_rhs; /* If the LHS array was not declared with a size, it takes it size from @@ -722,7 +837,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, * dereference of a variable. Any other case would require that the LHS * is either not an l-value or not a whole array. */ - if (lhs->type->array_size() == 0) { + if (lhs->type->is_unsized_array()) { ir_dereference *const d = lhs->as_dereference(); assert(d != NULL); @@ -731,19 +846,21 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, assert(var != NULL); - if (var->max_array_access >= unsigned(rhs->type->array_size())) { + if (var->data.max_array_access >= unsigned(rhs->type->array_size())) { /* FINISHME: This should actually log the location of the RHS. */ _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to " "previous access", - var->max_array_access); + var->data.max_array_access); } var->type = glsl_type::get_array_instance(lhs->type->element_type(), rhs->type->array_size()); d->type = var->type; } - mark_whole_array_access(rhs); - mark_whole_array_access(lhs); + if (lhs->type->is_array()) { + mark_whole_array_access(rhs); + mark_whole_array_access(lhs); + } } if (lhs->get_precision() == glsl_precision_undefined) @@ -754,7 +871,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, { ir_variable *const var = d->variable_referenced(); if (var) - var->precision = prec; + var->data.precision = prec; } } @@ -778,6 +895,11 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, if (!error_emitted) instructions->push_tail(new(ctx) ir_assignment(lhs, deref_var)); + if (extract_channel) { + return new(ctx) ir_expression(ir_binop_vector_extract, + new(ctx) ir_dereference_variable(var), + extract_channel->clone(ctx, NULL)); + } return new(ctx) ir_dereference_variable(var); } @@ -790,7 +912,7 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue) var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp", ir_var_temporary, precision_from_ir(lvalue)); instructions->push_tail(var); - var->mode = ir_var_auto; + var->data.mode = ir_var_auto; instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), lvalue)); @@ -872,14 +994,12 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1) case GLSL_TYPE_ERROR: case GLSL_TYPE_VOID: case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_INTERFACE: + case GLSL_TYPE_ATOMIC_UINT: /* I assume a comparison of a struct containing a sampler just * ignores the sampler present in the type. */ break; - - default: - assert(!"Should not get here."); - break; } if (cmp == NULL) @@ -922,7 +1042,7 @@ get_scalar_boolean_operand(exec_list *instructions, * If name refers to a builtin array whose maximum allowed size is less than * size, report an error and return true. Otherwise return false. */ -static bool +void check_builtin_array_max_size(const char *name, unsigned size, YYLTYPE loc, struct _mesa_glsl_parse_state *state) { @@ -934,9 +1054,8 @@ check_builtin_array_max_size(const char *name, unsigned size, * gl_MaxTextureCoords." */ _mesa_glsl_error(&loc, state, "`gl_TexCoord' array size cannot " - "be larger than gl_MaxTextureCoords (%u)\n", + "be larger than gl_MaxTextureCoords (%u)", state->Const.MaxTextureCoords); - return true; } else if (strcmp("gl_ClipDistance", name) == 0 && size > state->Const.MaxClipPlanes) { /* From section 7.1 (Vertex Shader Special Variables) of the @@ -949,11 +1068,9 @@ check_builtin_array_max_size(const char *name, unsigned size, * gl_MaxClipDistances." */ _mesa_glsl_error(&loc, state, "`gl_ClipDistance' array size cannot " - "be larger than gl_MaxClipDistances (%u)\n", + "be larger than gl_MaxClipDistances (%u)", state->Const.MaxClipPlanes); - return true; } - return false; } /** @@ -1047,6 +1164,10 @@ ast_expression::hir(exec_list *instructions, loc = this->get_location(); switch (this->oper) { + case ast_aggregate: + assert(!"ast_aggregate: Should never get here."); + break; + case ast_assign: { op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = this->subexpressions[1]->hir(instructions, state); @@ -1111,9 +1232,7 @@ ast_expression::hir(exec_list *instructions, case ast_lshift: case ast_rshift: - if (state->language_version < 130) { - _mesa_glsl_error(&loc, state, "operator %s requires GLSL 1.30", - operator_string(this->oper)); + if (!state->check_bitwise_operations_allowed(&loc)) { error_emitted = true; } @@ -1167,11 +1286,14 @@ ast_expression::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "operands of `%s' must have the same " "type", (this->oper == ast_equal) ? "==" : "!="); error_emitted = true; - } else if ((state->language_version <= 110) - && (op[0]->type->is_array() || op[1]->type->is_array())) { - _mesa_glsl_error(& loc, state, "array comparisons forbidden in " - "GLSL 1.10"); + } else if ((op[0]->type->is_array() || op[1]->type->is_array()) && + !state->check_version(120, 300, &loc, + "array comparisons forbidden")) { error_emitted = true; + } else if ((op[0]->type->contains_opaque() || + op[1]->type->contains_opaque())) { + _mesa_glsl_error(&loc, state, "opaque type comparisons forbidden"); + error_emitted = true; } if (error_emitted) { @@ -1198,8 +1320,7 @@ ast_expression::hir(exec_list *instructions, case ast_bit_not: op[0] = this->subexpressions[0]->hir(instructions, state); - if (state->language_version < 130) { - _mesa_glsl_error(&loc, state, "bit-wise operations require GLSL 1.30"); + if (!state->check_bitwise_operations_allowed(&loc)) { error_emitted = true; } @@ -1424,8 +1545,8 @@ ast_expression::hir(exec_list *instructions, || (op[1]->type != op[2]->type)) { YYLTYPE loc = this->subexpressions[1]->get_location(); - _mesa_glsl_error(& loc, state, "Second and third operands of ?: " - "operator must have matching types."); + _mesa_glsl_error(& loc, state, "second and third operands of ?: " + "operator must have matching types"); error_emitted = true; type = glsl_type::error_type; } else { @@ -1437,9 +1558,10 @@ ast_expression::hir(exec_list *instructions, * "The second and third expressions must be the same type, but can * be of any type other than an array." */ - if ((state->language_version <= 110) && type->is_array()) { - _mesa_glsl_error(& loc, state, "Second and third operands of ?: " - "operator must not be arrays."); + if (type->is_array() && + !state->check_version(120, 300, &loc, + "second and third operands of ?: operator " + "cannot be arrays")) { error_emitted = true; } @@ -1539,160 +1661,11 @@ ast_expression::hir(exec_list *instructions, op[0] = subexpressions[0]->hir(instructions, state); op[1] = subexpressions[1]->hir(instructions, state); - error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); + result = _mesa_ast_array_index_to_hir(ctx, state, op[0], op[1], + loc, index_loc); - ir_rvalue *const array = op[0]; - - result = new(ctx) ir_dereference_array(op[0], op[1]); - - /* Do not use op[0] after this point. Use array. - */ - op[0] = NULL; - - - if (error_emitted) - break; - - if (!array->type->is_array() - && !array->type->is_matrix() - && !array->type->is_vector()) { - _mesa_glsl_error(& index_loc, state, - "cannot dereference non-array / non-matrix / " - "non-vector"); + if (result->type->is_error()) error_emitted = true; - } - - if (!op[1]->type->is_integer()) { - _mesa_glsl_error(& index_loc, state, - "array index must be integer type"); - error_emitted = true; - } else if (!op[1]->type->is_scalar()) { - _mesa_glsl_error(& index_loc, state, - "array index must be scalar"); - error_emitted = true; - } - - /* If the array index is a constant expression and the array has a - * declared size, ensure that the access is in-bounds. If the array - * index is not a constant expression, ensure that the array has a - * declared size. - */ - ir_constant *const const_index = op[1]->constant_expression_value(); - if (const_index != NULL) { - const int idx = const_index->value.i[0]; - const char *type_name; - unsigned bound = 0; - - if (array->type->is_matrix()) { - type_name = "matrix"; - } else if (array->type->is_vector()) { - type_name = "vector"; - } else { - type_name = "array"; - } - - /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec: - * - * "It is illegal to declare an array with a size, and then - * later (in the same shader) index the same array with an - * integral constant expression greater than or equal to the - * declared size. It is also illegal to index an array with a - * negative constant expression." - */ - if (array->type->is_matrix()) { - if ((int)array->type->row_type()->vector_elements <= idx) { - bound = array->type->row_type()->vector_elements; - } - } else if (array->type->is_vector()) { - if ((int)array->type->vector_elements <= idx) { - bound = array->type->vector_elements; - } - } else { - if ((array->type->array_size() > 0) - && (array->type->array_size() <= idx)) { - bound = array->type->array_size(); - } - } - - if (bound > 0) { - _mesa_glsl_error(& loc, state, "%s index must be < %u", - type_name, bound); - error_emitted = true; - } else if (idx < 0) { - _mesa_glsl_error(& loc, state, "%s index must be >= 0", - type_name); - error_emitted = true; - } - - if (array->type->is_array()) { - /* If the array is a variable dereference, it dereferences the - * whole array, by definition. Use this to get the variable. - * - * FINISHME: Should some methods for getting / setting / testing - * FINISHME: array access limits be added to ir_dereference? - */ - ir_variable *const v = array->whole_variable_referenced(); - if ((v != NULL) && (unsigned(idx) > v->max_array_access)) { - v->max_array_access = idx; - - /* Check whether this access will, as a side effect, implicitly - * cause the size of a built-in array to be too large. - */ - if (check_builtin_array_max_size(v->name, idx+1, loc, state)) - error_emitted = true; - } - } - } else if (array->type->array_size() == 0) { - _mesa_glsl_error(&loc, state, "unsized array index must be constant"); - } else { - if (array->type->is_array()) { - /* whole_variable_referenced can return NULL if the array is a - * member of a structure. In this case it is safe to not update - * the max_array_access field because it is never used for fields - * of structures. - */ - ir_variable *v = array->whole_variable_referenced(); - if (v != NULL) - v->max_array_access = array->type->array_size() - 1; - } - } - - /* From page 23 (29 of the PDF) of the GLSL 1.30 spec: - * - * "Samplers aggregated into arrays within a shader (using square - * brackets [ ]) can only be indexed with integral constant - * expressions [...]." - * - * This restriction was added in GLSL 1.30. Shaders using earlier version - * of the language should not be rejected by the compiler front-end for - * using this construct. This allows useful things such as using a loop - * counter as the index to an array of samplers. If the loop in unrolled, - * the code should compile correctly. Instead, emit a warning. - */ - if (array->type->is_array() && - array->type->element_type()->is_sampler() && - const_index == NULL) { - - if (state->language_version == 100) { - _mesa_glsl_warning(&loc, state, - "sampler arrays indexed with non-constant " - "expressions is optional in GLSL ES 1.00"); - } else if (state->language_version < 130) { - _mesa_glsl_warning(&loc, state, - "sampler arrays indexed with non-constant " - "expressions is forbidden in GLSL 1.30 and " - "later"); - } else { - _mesa_glsl_error(&loc, state, - "sampler arrays indexed with non-constant " - "expressions is forbidden in GLSL 1.30 and " - "later"); - error_emitted = true; - } - } - - if (error_emitted) - result->type = glsl_type::error_type; break; } @@ -1713,7 +1686,7 @@ ast_expression::hir(exec_list *instructions, state->symbols->get_variable(this->primary_expression.identifier); if (var != NULL) { - var->used = true; + var->data.used = true; result = new(ctx) ir_dereference_variable(var); } else { _mesa_glsl_error(& loc, state, "`%s' undeclared", @@ -1845,66 +1818,108 @@ ast_compound_statement::hir(exec_list *instructions, return NULL; } +/** + * Evaluate the given exec_node (which should be an ast_node representing + * a single array dimension) and return its integer value. + */ +static const unsigned +process_array_size(exec_node *node, + struct _mesa_glsl_parse_state *state) +{ + exec_list dummy_instructions; + + ast_node *array_size = exec_node_data(ast_node, node, link); + ir_rvalue *const ir = array_size->hir(& dummy_instructions, + state); + YYLTYPE loc = array_size->get_location(); + + if (ir == NULL) { + _mesa_glsl_error(& loc, state, + "array size could not be resolved"); + return 0; + } + + if (!ir->type->is_integer()) { + _mesa_glsl_error(& loc, state, + "array size must be integer type"); + return 0; + } + + if (!ir->type->is_scalar()) { + _mesa_glsl_error(& loc, state, + "array size must be scalar type"); + return 0; + } + + ir_constant *const size = ir->constant_expression_value(); + if (size == NULL) { + _mesa_glsl_error(& loc, state, "array size must be a " + "constant valued expression"); + return 0; + } + + if (size->value.i[0] <= 0) { + _mesa_glsl_error(& loc, state, "array size must be > 0"); + return 0; + } + + assert(size->type == ir->type); + + /* If the array size is const (and we've verified that + * it is) then no instructions should have been emitted + * when we converted it to HIR. If they were emitted, + * then either the array size isn't const after all, or + * we are emitting unnecessary instructions. + */ + assert(dummy_instructions.is_empty()); + + return size->value.u[0]; +} static const glsl_type * -process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size, - struct _mesa_glsl_parse_state *state) +process_array_type(YYLTYPE *loc, const glsl_type *base, + ast_array_specifier *array_specifier, + struct _mesa_glsl_parse_state *state) { - unsigned length = 0; + const glsl_type *array_type = base; - /* From page 19 (page 25) of the GLSL 1.20 spec: - * - * "Only one-dimensional arrays may be declared." - */ - if (base->is_array()) { - _mesa_glsl_error(loc, state, - "invalid array of `%s' (only one-dimensional arrays " - "may be declared)", - base->name); - return glsl_type::error_type; - } + if (array_specifier != NULL) { + if (base->is_array()) { - if (array_size != NULL) { - exec_list dummy_instructions; - ir_rvalue *const ir = array_size->hir(& dummy_instructions, state); - YYLTYPE loc = array_size->get_location(); + /* From page 19 (page 25) of the GLSL 1.20 spec: + * + * "Only one-dimensional arrays may be declared." + */ + if (!state->ARB_arrays_of_arrays_enable) { + _mesa_glsl_error(loc, state, + "invalid array of `%s'" + "GL_ARB_arrays_of_arrays " + "required for defining arrays of arrays", + base->name); + return glsl_type::error_type; + } - if (ir != NULL) { - if (!ir->type->is_integer()) { - _mesa_glsl_error(& loc, state, "array size must be integer type"); - } else if (!ir->type->is_scalar()) { - _mesa_glsl_error(& loc, state, "array size must be scalar type"); - } else { - ir_constant *const size = ir->constant_expression_value(); - - if (size == NULL) { - _mesa_glsl_error(& loc, state, "array size must be a " - "constant valued expression"); - } else if (size->value.i[0] <= 0) { - _mesa_glsl_error(& loc, state, "array size must be > 0"); - } else { - assert(size->type == ir->type); - length = size->value.u[0]; - - /* If the array size is const (and we've verified that - * it is) then no instructions should have been emitted - * when we converted it to HIR. If they were emitted, - * then either the array size isn't const after all, or - * we are emitting unnecessary instructions. - */ - assert(dummy_instructions.is_empty()); - } - } + if (base->length == 0) { + _mesa_glsl_error(loc, state, + "only the outermost array dimension can " + "be unsized", + base->name); + return glsl_type::error_type; + } } - } else if (state->es_shader) { - /* Section 10.17 of the GLSL ES 1.00 specification states that unsized - * array declarations have been removed from the language. - */ - _mesa_glsl_error(loc, state, "unsized array declarations are not " - "allowed in GLSL ES 1.00."); + + for (exec_node *node = array_specifier->array_dimensions.tail_pred; + !node->is_head_sentinel(); node = node->prev) { + unsigned array_size = process_array_size(node, state); + array_type = glsl_type::get_array_instance(array_type, + array_size); + } + + if (array_specifier->is_unsized_array) + array_type = glsl_type::get_array_instance(array_type, 0); } - return glsl_type::get_array_instance(base, length); + return array_type; } @@ -1917,121 +1932,451 @@ ast_type_specifier::glsl_type(const char **name, type = state->symbols->get_type(this->type_name); *name = this->type_name; - if (this->is_array) { - YYLTYPE loc = this->get_location(); - type = process_array_type(&loc, type, this->array_size, state); - } + YYLTYPE loc = this->get_location(); + type = process_array_type(&loc, type, this->array_specifier, state); return type; } +const glsl_type * +ast_fully_specified_type::glsl_type(const char **name, + struct _mesa_glsl_parse_state *state) const +{ + const struct glsl_type *type = this->specifier->glsl_type(name, state); + + if (type == NULL) + return NULL; + + /* GLSL Optimizer change: do allow unspecified precision; hlsl2glsl + produces a bunch of wrapper functions without precision specified. + + if (type->base_type == GLSL_TYPE_FLOAT + && state->es_shader + && state->stage == MESA_SHADER_FRAGMENT + && this->qualifier.precision == ast_precision_none + && state->symbols->get_variable("#default precision") == NULL) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(&loc, state, + "no precision specified this scope for type `%s'", + type->name); + } + */ + + return type; +} + +/** + * Determine whether a toplevel variable declaration declares a varying. This + * function operates by examining the variable's mode and the shader target, + * so it correctly identifies linkage variables regardless of whether they are + * declared using the deprecated "varying" syntax or the new "in/out" syntax. + * + * Passing a non-toplevel variable declaration (e.g. a function parameter) to + * this function will produce undefined results. + */ +static bool +is_varying_var(ir_variable *var, gl_shader_stage target) +{ + switch (target) { + case MESA_SHADER_VERTEX: + return var->data.mode == ir_var_shader_out; + case MESA_SHADER_FRAGMENT: + return var->data.mode == ir_var_shader_in; + default: + return var->data.mode == ir_var_shader_out || var->data.mode == ir_var_shader_in; + } +} + + +/** + * Matrix layout qualifiers are only allowed on certain types + */ +static void +validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state, + YYLTYPE *loc, + const glsl_type *type, + ir_variable *var) +{ + if (var && !var->is_in_uniform_block()) { + /* Layout qualifiers may only apply to interface blocks and fields in + * them. + */ + _mesa_glsl_error(loc, state, + "uniform block layout qualifiers row_major and " + "column_major may not be applied to variables " + "outside of uniform blocks"); + } else if (!type->is_matrix()) { + /* The OpenGL ES 3.0 conformance tests did not originally allow + * matrix layout qualifiers on non-matrices. However, the OpenGL + * 4.4 and OpenGL ES 3.0 (revision TBD) specifications were + * amended to specifically allow these layouts on all types. Emit + * a warning so that people know their code may not be portable. + */ + _mesa_glsl_warning(loc, state, + "uniform block layout qualifiers row_major and " + "column_major applied to non-matrix types may " + "be rejected by older compilers"); + } else if (type->is_record()) { + /* We allow 'layout(row_major)' on structure types because it's the only + * way to get row-major layouts on matrices contained in structures. + */ + _mesa_glsl_warning(loc, state, + "uniform block layout qualifiers row_major and " + "column_major applied to structure types is not " + "strictly conformant and may be rejected by other " + "compilers"); + } +} + +static bool +validate_binding_qualifier(struct _mesa_glsl_parse_state *state, + YYLTYPE *loc, + ir_variable *var, + const ast_type_qualifier *qual) +{ + if (var->data.mode != ir_var_uniform) { + _mesa_glsl_error(loc, state, + "the \"binding\" qualifier only applies to uniforms"); + return false; + } + + if (qual->binding < 0) { + _mesa_glsl_error(loc, state, "binding values must be >= 0"); + return false; + } + + const struct gl_context *const ctx = state->ctx; + unsigned elements = var->type->is_array() ? var->type->length : 1; + unsigned max_index = qual->binding + elements - 1; + + if (var->type->is_interface()) { + /* UBOs. From page 60 of the GLSL 4.20 specification: + * "If the binding point for any uniform block instance is less than zero, + * or greater than or equal to the implementation-dependent maximum + * number of uniform buffer bindings, a compilation error will occur. + * When the binding identifier is used with a uniform block instanced as + * an array of size N, all elements of the array from binding through + * binding + N – 1 must be within this range." + * + * The implementation-dependent maximum is GL_MAX_UNIFORM_BUFFER_BINDINGS. + */ + if (max_index >= ctx->Const.MaxUniformBufferBindings) { + _mesa_glsl_error(loc, state, "layout(binding = %d) for %d UBOs exceeds " + "the maximum number of UBO binding points (%d)", + qual->binding, elements, + ctx->Const.MaxUniformBufferBindings); + return false; + } + } else if (var->type->is_sampler() || + (var->type->is_array() && var->type->fields.array->is_sampler())) { + /* Samplers. From page 63 of the GLSL 4.20 specification: + * "If the binding is less than zero, or greater than or equal to the + * implementation-dependent maximum supported number of units, a + * compilation error will occur. When the binding identifier is used + * with an array of size N, all elements of the array from binding + * through binding + N - 1 must be within this range." + */ + unsigned limit = ctx->Const.Program[state->stage].MaxTextureImageUnits; + + if (max_index >= limit) { + _mesa_glsl_error(loc, state, "layout(binding = %d) for %d samplers " + "exceeds the maximum number of texture image units " + "(%d)", qual->binding, elements, limit); + + return false; + } + } else if (var->type->contains_atomic()) { + assert(ctx->Const.MaxAtomicBufferBindings <= MAX_COMBINED_ATOMIC_BUFFERS); + if (unsigned(qual->binding) >= ctx->Const.MaxAtomicBufferBindings) { + _mesa_glsl_error(loc, state, "layout(binding = %d) exceeds the " + " maximum number of atomic counter buffer bindings" + "(%d)", qual->binding, + ctx->Const.MaxAtomicBufferBindings); + + return false; + } + } else { + _mesa_glsl_error(loc, state, + "the \"binding\" qualifier only applies to uniform " + "blocks, samplers, atomic counters, or arrays thereof"); + return false; + } + + return true; +} + + +static glsl_interp_qualifier +interpret_interpolation_qualifier(const struct ast_type_qualifier *qual, + ir_variable_mode mode, + struct _mesa_glsl_parse_state *state, + YYLTYPE *loc) +{ + glsl_interp_qualifier interpolation; + if (qual->flags.q.flat) + interpolation = INTERP_QUALIFIER_FLAT; + else if (qual->flags.q.noperspective) + interpolation = INTERP_QUALIFIER_NOPERSPECTIVE; + else if (qual->flags.q.smooth) + interpolation = INTERP_QUALIFIER_SMOOTH; + else + interpolation = INTERP_QUALIFIER_NONE; + + if (interpolation != INTERP_QUALIFIER_NONE) { + if (mode != ir_var_shader_in && mode != ir_var_shader_out) { + _mesa_glsl_error(loc, state, + "interpolation qualifier `%s' can only be applied to " + "shader inputs or outputs.", + interpolation_string(interpolation)); + + } + + if ((state->stage == MESA_SHADER_VERTEX && mode == ir_var_shader_in) || + (state->stage == MESA_SHADER_FRAGMENT && mode == ir_var_shader_out)) { + _mesa_glsl_error(loc, state, + "interpolation qualifier `%s' cannot be applied to " + "vertex shader inputs or fragment shader outputs", + interpolation_string(interpolation)); + } + } + + return interpolation; +} + + +static void +validate_explicit_location(const struct ast_type_qualifier *qual, + ir_variable *var, + struct _mesa_glsl_parse_state *state, + YYLTYPE *loc) +{ + bool fail = false; + + /* In the vertex shader only shader inputs can be given explicit + * locations. + * + * In the fragment shader only shader outputs can be given explicit + * locations. + */ + switch (state->stage) { + case MESA_SHADER_VERTEX: + if (var->data.mode == ir_var_shader_in) { + if (!state->check_explicit_attrib_location_allowed(loc, var)) + return; + + break; + } + + fail = true; + break; + + case MESA_SHADER_GEOMETRY: + _mesa_glsl_error(loc, state, + "geometry shader variables cannot be given " + "explicit locations"); + return; + + case MESA_SHADER_FRAGMENT: + if (var->data.mode == ir_var_shader_out) { + if (!state->check_explicit_attrib_location_allowed(loc, var)) + return; + + break; + } + + fail = true; + break; + }; + + if (fail) { + _mesa_glsl_error(loc, state, + "%s cannot be given an explicit location in %s shader", + mode_string(var), + _mesa_shader_stage_to_string(state->stage)); + } else { + var->data.explicit_location = true; + + /* This bit of silliness is needed because invalid explicit locations + * are supposed to be flagged during linking. Small negative values + * biased by VERT_ATTRIB_GENERIC0 or FRAG_RESULT_DATA0 could alias + * built-in values (e.g., -16+VERT_ATTRIB_GENERIC0 = VERT_ATTRIB_POS). + * The linker needs to be able to differentiate these cases. This + * ensures that negative values stay negative. + */ + if (qual->location >= 0) { + var->data.location = (state->stage == MESA_SHADER_VERTEX) + ? (qual->location + VERT_ATTRIB_GENERIC0) + : (qual->location + FRAG_RESULT_DATA0); + } else { + var->data.location = qual->location; + } + + if (qual->flags.q.explicit_index) { + /* From the GLSL 4.30 specification, section 4.4.2 (Output + * Layout Qualifiers): + * + * "It is also a compile-time error if a fragment shader + * sets a layout index to less than 0 or greater than 1." + * + * Older specifications don't mandate a behavior; we take + * this as a clarification and always generate the error. + */ + if (qual->index < 0 || qual->index > 1) { + _mesa_glsl_error(loc, state, + "explicit index may only be 0 or 1"); + } else { + var->data.explicit_index = true; + var->data.index = qual->index; + } + } + } + + return; +} static void apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, ir_variable *var, struct _mesa_glsl_parse_state *state, YYLTYPE *loc, - bool ubo_qualifiers_valid) + bool is_parameter) { + STATIC_ASSERT(sizeof(qual->flags.q) <= sizeof(qual->flags.i)); + if (qual->flags.q.invariant) { - if (var->used) { + if (var->data.used) { _mesa_glsl_error(loc, state, "variable `%s' may not be redeclared " "`invariant' after being used", var->name); } else { - var->invariant = 1; + var->data.invariant = 1; } } if (qual->flags.q.constant || qual->flags.q.attribute || qual->flags.q.uniform - || (qual->flags.q.varying && (state->target == fragment_shader))) - var->read_only = 1; + || (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT))) + var->data.read_only = 1; if (qual->flags.q.centroid) - var->centroid = 1; + var->data.centroid = 1; - if (qual->flags.q.attribute && state->target != vertex_shader) { + if (qual->flags.q.sample) + var->data.sample = 1; + + if (qual->flags.q.attribute && state->stage != MESA_SHADER_VERTEX) { var->type = glsl_type::error_type; _mesa_glsl_error(loc, state, "`attribute' variables may not be declared in the " "%s shader", - _mesa_glsl_shader_target_name(state->target)); + _mesa_shader_stage_to_string(state->stage)); } - /* From page 25 (page 31 of the PDF) of the GLSL 1.10 spec: + /* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says: * - * "The varying qualifier can be used only with the data types - * float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of - * these." + * "However, the const qualifier cannot be used with out or inout." + * + * The same section of the GLSL 4.40 spec further clarifies this saying: + * + * "The const qualifier cannot be used with out or inout, or a + * compile-time error results." */ - if (qual->flags.q.varying) { - const glsl_type *non_array_type; - - if (var->type && var->type->is_array()) - non_array_type = var->type->fields.array; - else - non_array_type = var->type; - - if (non_array_type && non_array_type->base_type != GLSL_TYPE_FLOAT) { - var->type = glsl_type::error_type; - _mesa_glsl_error(loc, state, - "varying variables must be of base type float"); - } + if (is_parameter && qual->flags.q.constant && qual->flags.q.out) { + _mesa_glsl_error(loc, state, + "`const' may not be applied to `out' or `inout' " + "function parameters"); } /* If there is no qualifier that changes the mode of the variable, leave * the setting alone. */ if (qual->flags.q.in && qual->flags.q.out) - var->mode = ir_var_inout; - else if (qual->flags.q.attribute || qual->flags.q.in - || (qual->flags.q.varying && (state->target == fragment_shader))) - var->mode = ir_var_in; - else if (qual->flags.q.out - || (qual->flags.q.varying && (state->target == vertex_shader))) - var->mode = ir_var_out; + var->data.mode = ir_var_function_inout; + else if (qual->flags.q.in) + var->data.mode = is_parameter ? ir_var_function_in : ir_var_shader_in; + else if (qual->flags.q.attribute + || (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT))) + var->data.mode = ir_var_shader_in; + else if (qual->flags.q.out) + var->data.mode = is_parameter ? ir_var_function_out : ir_var_shader_out; + else if (qual->flags.q.varying && (state->stage == MESA_SHADER_VERTEX)) + var->data.mode = ir_var_shader_out; else if (qual->flags.q.uniform) - var->mode = ir_var_uniform; + var->data.mode = ir_var_uniform; + + if (!is_parameter && is_varying_var(var, state->stage)) { + /* This variable is being used to link data between shader stages (in + * pre-glsl-1.30 parlance, it's a "varying"). Check that it has a type + * that is allowed for such purposes. + * + * From page 25 (page 31 of the PDF) of the GLSL 1.10 spec: + * + * "The varying qualifier can be used only with the data types + * float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of + * these." + * + * This was relaxed in GLSL version 1.30 and GLSL ES version 3.00. From + * page 31 (page 37 of the PDF) of the GLSL 1.30 spec: + * + * "Fragment inputs can only be signed and unsigned integers and + * integer vectors, float, floating-point vectors, matrices, or + * arrays of these. Structures cannot be input. + * + * Similar text exists in the section on vertex shader outputs. + * + * Similar text exists in the GLSL ES 3.00 spec, except that the GLSL ES + * 3.00 spec allows structs as well. Varying structs are also allowed + * in GLSL 1.50. + */ + switch (var->type->get_scalar_type()->base_type) { + case GLSL_TYPE_FLOAT: + /* Ok in all GLSL versions */ + break; + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + if (state->is_version(130, 300)) + break; + _mesa_glsl_error(loc, state, + "varying variables must be of base type float in %s", + state->get_version_string()); + break; + case GLSL_TYPE_STRUCT: + if (state->is_version(150, 300)) + break; + _mesa_glsl_error(loc, state, + "varying variables may not be of type struct"); + break; + default: + _mesa_glsl_error(loc, state, "illegal type for a varying variable"); + break; + } + } if (state->all_invariant && (state->current_function == NULL)) { - switch (state->target) { - case vertex_shader: - if (var->mode == ir_var_out) - var->invariant = true; + switch (state->stage) { + case MESA_SHADER_VERTEX: + if (var->data.mode == ir_var_shader_out) + var->data.invariant = true; break; - case geometry_shader: - if ((var->mode == ir_var_in) || (var->mode == ir_var_out)) - var->invariant = true; + case MESA_SHADER_GEOMETRY: + if ((var->data.mode == ir_var_shader_in) + || (var->data.mode == ir_var_shader_out)) + var->data.invariant = true; break; - case fragment_shader: - if (var->mode == ir_var_in) - var->invariant = true; + case MESA_SHADER_FRAGMENT: + if (var->data.mode == ir_var_shader_in) + var->data.invariant = true; break; } } - if (qual->flags.q.flat) - var->interpolation = INTERP_QUALIFIER_FLAT; - else if (qual->flags.q.noperspective) - var->interpolation = INTERP_QUALIFIER_NOPERSPECTIVE; - else if (qual->flags.q.smooth) - var->interpolation = INTERP_QUALIFIER_SMOOTH; - else - var->interpolation = INTERP_QUALIFIER_NONE; + var->data.interpolation = + interpret_interpolation_qualifier(qual, (ir_variable_mode) var->data.mode, + state, loc); - if (var->interpolation != INTERP_QUALIFIER_NONE && - !(state->target == vertex_shader && var->mode == ir_var_out) && - !(state->target == fragment_shader && var->mode == ir_var_in)) { - _mesa_glsl_error(loc, state, - "interpolation qualifier `%s' can only be applied to " - "vertex shader outputs and fragment shader inputs.", - var->interpolation_string()); - } - - var->pixel_center_integer = qual->flags.q.pixel_center_integer; - var->origin_upper_left = qual->flags.q.origin_upper_left; + var->data.pixel_center_integer = qual->flags.q.pixel_center_integer; + var->data.origin_upper_left = qual->flags.q.origin_upper_left; if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer) && (strcmp(var->name, "gl_FragCoord") != 0)) { const char *const qual_string = (qual->flags.q.origin_upper_left) @@ -2044,91 +2389,41 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, } if (qual->flags.q.explicit_location) { - const bool global_scope = (state->current_function == NULL); - bool fail = false; - const char *string = ""; - - /* In the vertex shader only shader inputs can be given explicit - * locations. - * - * In the fragment shader only shader outputs can be given explicit - * locations. - */ - switch (state->target) { - case vertex_shader: - if (!global_scope || (var->mode != ir_var_in)) { - fail = true; - string = "input"; - } - break; - - case geometry_shader: - _mesa_glsl_error(loc, state, - "geometry shader variables cannot be given " - "explicit locations\n"); - break; - - case fragment_shader: - if (!global_scope || (var->mode != ir_var_out)) { - fail = true; - string = "output"; - } - break; - }; - - if (fail) { - _mesa_glsl_error(loc, state, - "only %s shader %s variables can be given an " - "explicit location\n", - _mesa_glsl_shader_target_name(state->target), - string); - } else { - var->explicit_location = true; - - /* This bit of silliness is needed because invalid explicit locations - * are supposed to be flagged during linking. Small negative values - * biased by VERT_ATTRIB_GENERIC0 or FRAG_RESULT_DATA0 could alias - * built-in values (e.g., -16+VERT_ATTRIB_GENERIC0 = VERT_ATTRIB_POS). - * The linker needs to be able to differentiate these cases. This - * ensures that negative values stay negative. - */ - if (qual->location >= 0) { - var->location = (state->target == vertex_shader) - ? (qual->location + VERT_ATTRIB_GENERIC0) - : (qual->location + FRAG_RESULT_DATA0); - } else { - var->location = qual->location; - } - - if (qual->flags.q.explicit_index) { - /* From the GLSL 4.30 specification, section 4.4.2 (Output - * Layout Qualifiers): - * - * "It is also a compile-time error if a fragment shader - * sets a layout index to less than 0 or greater than 1." - * - * Older specifications don't mandate a behavior; we take - * this as a clarification and always generate the error. - */ - if (qual->index < 0 || qual->index > 1) { - _mesa_glsl_error(loc, state, - "explicit index may only be 0 or 1\n"); - } else { - var->explicit_index = true; - var->index = qual->index; - } - } - } + validate_explicit_location(qual, var, state, loc); } else if (qual->flags.q.explicit_index) { _mesa_glsl_error(loc, state, - "explicit index requires explicit location\n"); + "explicit index requires explicit location"); } - /* Does the declaration use the 'layout' keyword? - */ - const bool uses_layout = qual->flags.q.pixel_center_integer - || qual->flags.q.origin_upper_left - || qual->flags.q.explicit_location; /* no need for index since it relies on location */ + if (qual->flags.q.explicit_binding && + validate_binding_qualifier(state, loc, var, qual)) { + var->data.explicit_binding = true; + var->data.binding = qual->binding; + } + + if (var->type->contains_atomic()) { + if (var->data.mode == ir_var_uniform) { + if (var->data.explicit_binding) { + unsigned *offset = + &state->atomic_counter_offsets[var->data.binding]; + + if (*offset % ATOMIC_COUNTER_SIZE) + _mesa_glsl_error(loc, state, + "misaligned atomic counter offset"); + + var->data.atomic.offset = *offset; + *offset += var->type->atomic_size(); + + } else { + _mesa_glsl_error(loc, state, + "atomic counters require explicit binding point"); + } + } else if (var->data.mode != ir_var_function_in) { + _mesa_glsl_error(loc, state, "atomic counters may only be declared as " + "function parameters or uniform-qualified " + "global variables"); + } + } /* Does the declaration use the deprecated 'attribute' or 'varying' * keywords? @@ -2159,7 +2454,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, const bool relaxed_layout_qualifier_checking = state->ARB_fragment_coord_conventions_enable; - if (uses_layout && uses_deprecated_qualifier) { + if (qual->has_layout() && uses_deprecated_qualifier) { if (relaxed_layout_qualifier_checking) { _mesa_glsl_warning(loc, state, "`layout' qualifier may not be used with " @@ -2197,15 +2492,15 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, "gl_FragDepth"); } if (qual->flags.q.depth_any) - var->depth_layout = ir_depth_layout_any; + var->data.depth_layout = ir_depth_layout_any; else if (qual->flags.q.depth_greater) - var->depth_layout = ir_depth_layout_greater; + var->data.depth_layout = ir_depth_layout_greater; else if (qual->flags.q.depth_less) - var->depth_layout = ir_depth_layout_less; + var->data.depth_layout = ir_depth_layout_less; else if (qual->flags.q.depth_unchanged) - var->depth_layout = ir_depth_layout_unchanged; + var->data.depth_layout = ir_depth_layout_unchanged; else - var->depth_layout = ir_depth_layout_none; + var->data.depth_layout = ir_depth_layout_none; if (qual->flags.q.std140 || qual->flags.q.packed || @@ -2216,12 +2511,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, "members"); } - if (!ubo_qualifiers_valid && - (qual->flags.q.row_major || qual->flags.q.column_major)) { - _mesa_glsl_error(loc, state, - "uniform block layout qualifiers row_major and " - "column_major can only be applied to uniform block " - "members"); + if (qual->flags.q.row_major || qual->flags.q.column_major) { + validate_matrix_layout_for_type(state, loc, var->type, var); } } @@ -2236,9 +2527,10 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, * A pointer to an existing variable in the current scope if the declaration * is a redeclaration, \c NULL otherwise. */ -ir_variable * -get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, - struct _mesa_glsl_parse_state *state) +static ir_variable * +get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, + struct _mesa_glsl_parse_state *state, + bool allow_all_redeclarations) { /* Check if this declaration is actually a re-declaration, either to * resize an array or add qualifiers to an existing variable. @@ -2246,24 +2538,21 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, * This is allowed for variables in the current scope, or when at * global scope (for built-ins in the implicit outer scope). */ - ir_variable *earlier = state->symbols->get_variable(decl->identifier); + ir_variable *earlier = state->symbols->get_variable(var->name); if (earlier == NULL || (state->current_function != NULL && - !state->symbols->name_declared_this_scope(decl->identifier))) { + !state->symbols->name_declared_this_scope(var->name))) { return NULL; } - YYLTYPE loc = decl->get_location(); - /* From page 24 (page 30 of the PDF) of the GLSL 1.50 spec, * * "It is legal to declare an array without a size and then * later re-declare the same name as an array of the same * type and specify a size." */ - if ((earlier->type->array_size() == 0) - && var->type->is_array() + if (earlier->type->is_unsized_array() && var->type->is_array() && (var->type->element_type() == earlier->type->element_type())) { /* FINISHME: This doesn't match the qualifiers on the two * FINISHME: declarations. It's not 100% clear whether this is @@ -2272,24 +2561,25 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, const unsigned size = unsigned(var->type->array_size()); check_builtin_array_max_size(var->name, size, loc, state); - if ((size > 0) && (size <= earlier->max_array_access)) { + if ((size > 0) && (size <= earlier->data.max_array_access)) { _mesa_glsl_error(& loc, state, "array size must be > %u due to " "previous access", - earlier->max_array_access); + earlier->data.max_array_access); } earlier->type = var->type; delete var; var = NULL; - } else if (state->ARB_fragment_coord_conventions_enable + } else if ((state->ARB_fragment_coord_conventions_enable || + state->is_version(150, 0)) && strcmp(var->name, "gl_FragCoord") == 0 && earlier->type == var->type - && earlier->mode == var->mode) { + && earlier->data.mode == var->data.mode) { /* Allow redeclaration of gl_FragCoord for ARB_fcc layout * qualifiers. */ - earlier->origin_upper_left = var->origin_upper_left; - earlier->pixel_center_integer = var->pixel_center_integer; + earlier->data.origin_upper_left = var->data.origin_upper_left; + earlier->data.pixel_center_integer = var->data.pixel_center_integer; /* According to section 4.3.7 of the GLSL 1.30 spec, * the following built-in varaibles can be redeclared with an @@ -2301,7 +2591,7 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, * * gl_Color * * gl_SecondaryColor */ - } else if (state->language_version >= 130 + } else if (state->is_version(130, 0) && (strcmp(var->name, "gl_FrontColor") == 0 || strcmp(var->name, "gl_BackColor") == 0 || strcmp(var->name, "gl_FrontSecondaryColor") == 0 @@ -2309,41 +2599,51 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, || strcmp(var->name, "gl_Color") == 0 || strcmp(var->name, "gl_SecondaryColor") == 0) && earlier->type == var->type - && earlier->mode == var->mode) { - earlier->interpolation = var->interpolation; + && earlier->data.mode == var->data.mode) { + earlier->data.interpolation = var->data.interpolation; /* Layout qualifiers for gl_FragDepth. */ } else if ((state->AMD_conservative_depth_enable || state->ARB_conservative_depth_enable) && strcmp(var->name, "gl_FragDepth") == 0 && earlier->type == var->type - && earlier->mode == var->mode) { + && earlier->data.mode == var->data.mode) { /** From the AMD_conservative_depth spec: * Within any shader, the first redeclarations of gl_FragDepth * must appear before any use of gl_FragDepth. */ - if (earlier->used) { + if (earlier->data.used) { _mesa_glsl_error(&loc, state, "the first redeclaration of gl_FragDepth " "must appear before any use of gl_FragDepth"); } /* Prevent inconsistent redeclaration of depth layout qualifier. */ - if (earlier->depth_layout != ir_depth_layout_none - && earlier->depth_layout != var->depth_layout) { + if (earlier->data.depth_layout != ir_depth_layout_none + && earlier->data.depth_layout != var->data.depth_layout) { _mesa_glsl_error(&loc, state, "gl_FragDepth: depth layout is declared here " "as '%s, but it was previously declared as " "'%s'", - depth_layout_string(var->depth_layout), - depth_layout_string(earlier->depth_layout)); + depth_layout_string(var->data.depth_layout), + depth_layout_string(earlier->data.depth_layout)); } - earlier->depth_layout = var->depth_layout; + earlier->data.depth_layout = var->data.depth_layout; + } else if (allow_all_redeclarations) { + if (earlier->data.mode != var->data.mode) { + _mesa_glsl_error(&loc, state, + "redeclaration of `%s' with incorrect qualifiers", + var->name); + } else if (earlier->type != var->type) { + _mesa_glsl_error(&loc, state, + "redeclaration of `%s' has incorrect type", + var->name); + } } else { - _mesa_glsl_error(&loc, state, "`%s' redeclared", decl->identifier); + _mesa_glsl_error(&loc, state, "`%s' redeclared", var->name); } return earlier; @@ -2368,10 +2668,9 @@ process_initializer(ir_variable *var, ast_declaration *decl, * directly by an application via API commands, or indirectly by * OpenGL." */ - if ((state->language_version <= 110) - && (var->mode == ir_var_uniform)) { - _mesa_glsl_error(& initializer_loc, state, - "cannot initialize uniforms in GLSL 1.10"); + if (var->data.mode == ir_var_uniform) { + state->check_version(120, 0, &initializer_loc, + "cannot initialize uniforms"); } if (var->type->is_sampler()) { @@ -2379,14 +2678,21 @@ process_initializer(ir_variable *var, ast_declaration *decl, "cannot initialize samplers"); } - if ((var->mode == ir_var_in) && (state->current_function == NULL)) { + if ((var->data.mode == ir_var_shader_in) && (state->current_function == NULL)) { _mesa_glsl_error(& initializer_loc, state, "cannot initialize %s shader input / %s", - _mesa_glsl_shader_target_name(state->target), - (state->target == vertex_shader) + _mesa_shader_stage_to_string(state->stage), + (state->stage == MESA_SHADER_VERTEX) ? "attribute" : "varying"); } + /* If the initializer is an ast_aggregate_initializer, recursively store + * type information from the LHS into it, so that its hir() function can do + * type checking. + */ + if (decl->initializer->oper == ast_aggregate) + _mesa_ast_set_aggregate_type(var->type, decl->initializer); + ir_dereference *const lhs = new(state) ir_dereference_variable(var); ir_rvalue *rhs = decl->initializer->hir(initializer_instructions, state); @@ -2396,31 +2702,36 @@ process_initializer(ir_variable *var, ast_declaration *decl, */ if (type->qualifier.flags.q.constant || type->qualifier.flags.q.uniform) { - ir_rvalue *new_rhs = validate_assignment(state, var->type, rhs, true); + ir_rvalue *new_rhs = validate_assignment(state, initializer_loc, + var->type, rhs, true); if (new_rhs != NULL) { rhs = new_rhs; ir_constant *constant_value = rhs->constant_expression_value(); if (!constant_value) { - _mesa_glsl_error(& initializer_loc, state, - "initializer of %s variable `%s' must be a " - "constant expression", - (type->qualifier.flags.q.constant) - ? "const" : "uniform", - decl->identifier); - if (var->type->is_numeric()) { - /* Reduce cascading errors. */ - var->constant_value = ir_constant::zero(state, var->type); - } - } else { + /* If ARB_shading_language_420pack is enabled, initializers of + * const-qualified local variables do not have to be constant + * expressions. Const-qualified global variables must still be + * initialized with constant expressions. + */ + if (!state->ARB_shading_language_420pack_enable + || state->current_function == NULL) { + _mesa_glsl_error(& initializer_loc, state, + "initializer of %s variable `%s' must be a " + "constant expression", + (type->qualifier.flags.q.constant) + ? "const" : "uniform", + decl->identifier); + if (var->type->is_numeric()) { + /* Reduce cascading errors. */ + var->constant_value = ir_constant::zero(state, var->type); + } + } + } else { rhs = constant_value; var->constant_value = constant_value; } } else { - _mesa_glsl_error(&initializer_loc, state, - "initializer of type %s cannot be assigned to " - "variable of type %s", - rhs->type->name, var->type->name); if (var->type->is_numeric()) { /* Reduce cascading errors. */ var->constant_value = ir_constant::zero(state, var->type); @@ -2429,9 +2740,9 @@ process_initializer(ir_variable *var, ast_declaration *decl, } if (rhs && !rhs->type->is_error()) { - bool temp = var->read_only; + bool temp = var->data.read_only; if (type->qualifier.flags.q.constant) - var->read_only = false; + var->data.read_only = false; /* Never emit code to initialize a uniform. */ @@ -2446,7 +2757,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, initializer_type = rhs->type; var->constant_initializer = rhs->constant_expression_value(); - var->has_initializer = true; + var->data.has_initializer = true; /* If the declared variable is an unsized array, it must inherrit * its full type from the initializer. A declaration such as @@ -2470,23 +2781,127 @@ process_initializer(ir_variable *var, ast_declaration *decl, */ var->type = initializer_type; - var->read_only = temp; + var->data.read_only = temp; } return result; } static void -apply_precision_to_variable(const class ast_type_specifier *spec, +apply_precision_to_variable(const struct ast_type_qualifier& qual, ir_variable *var, struct _mesa_glsl_parse_state *state) { if (!state->es_shader) return; - if (var->type->is_sampler() && spec->precision == ast_precision_none) - var->precision = ast_precision_low; // samplers default to low precision + if (var->type->is_sampler() && qual.precision == ast_precision_none) + var->data.precision = ast_precision_low; // samplers default to low precision else - var->precision = spec->precision; + var->data.precision = qual.precision; +} + + +/** + * Do additional processing necessary for geometry shader input declarations + * (this covers both interface blocks arrays and bare input variables). + */ +static void +handle_geometry_shader_input_decl(struct _mesa_glsl_parse_state *state, + YYLTYPE loc, ir_variable *var) +{ + unsigned num_vertices = 0; + if (state->gs_input_prim_type_specified) { + num_vertices = vertices_per_prim(state->gs_input_prim_type); + } + + /* Geometry shader input variables must be arrays. Caller should have + * reported an error for this. + */ + if (!var->type->is_array()) { + assert(state->error); + + /* To avoid cascading failures, short circuit the checks below. */ + return; + } + + if (var->type->is_unsized_array()) { + /* Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says: + * + * All geometry shader input unsized array declarations will be + * sized by an earlier input layout qualifier, when present, as per + * the following table. + * + * Followed by a table mapping each allowed input layout qualifier to + * the corresponding input length. + */ + if (num_vertices != 0) + var->type = glsl_type::get_array_instance(var->type->fields.array, + num_vertices); + } else { + /* Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec + * includes the following examples of compile-time errors: + * + * // code sequence within one shader... + * in vec4 Color1[]; // size unknown + * ...Color1.length()...// illegal, length() unknown + * in vec4 Color2[2]; // size is 2 + * ...Color1.length()...// illegal, Color1 still has no size + * in vec4 Color3[3]; // illegal, input sizes are inconsistent + * layout(lines) in; // legal, input size is 2, matching + * in vec4 Color4[3]; // illegal, contradicts layout + * ... + * + * To detect the case illustrated by Color3, we verify that the size of + * an explicitly-sized array matches the size of any previously declared + * explicitly-sized array. To detect the case illustrated by Color4, we + * verify that the size of an explicitly-sized array is consistent with + * any previously declared input layout. + */ + if (num_vertices != 0 && var->type->length != num_vertices) { + _mesa_glsl_error(&loc, state, + "geometry shader input size contradicts previously" + " declared layout (size is %u, but layout requires a" + " size of %u)", var->type->length, num_vertices); + } else if (state->gs_input_size != 0 && + var->type->length != state->gs_input_size) { + _mesa_glsl_error(&loc, state, + "geometry shader input sizes are " + "inconsistent (size is %u, but a previous " + "declaration has size %u)", + var->type->length, state->gs_input_size); + } else { + state->gs_input_size = var->type->length; + } + } +} + + +void +validate_identifier(const char *identifier, YYLTYPE loc, + struct _mesa_glsl_parse_state *state) +{ + /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec, + * + * "Identifiers starting with "gl_" are reserved for use by + * OpenGL, and may not be declared in a shader as either a + * variable or a function." + */ + if (strncmp(identifier, "gl_", 3) == 0) { + _mesa_glsl_error(&loc, state, + "identifier `%s' uses reserved `gl_' prefix", + identifier); + } else if (strstr(identifier, "__")) { + /* From page 14 (page 20 of the PDF) of the GLSL 1.10 + * spec: + * + * "In addition, all identifiers containing two + * consecutive underscores (__) are reserved as + * possible future keywords." + */ + _mesa_glsl_error(&loc, state, + "identifier `%s' uses reserved `__' string", + identifier); + } } @@ -2516,38 +2931,37 @@ ast_declarator_list::hir(exec_list *instructions, if (state->current_function != NULL) { _mesa_glsl_error(& loc, state, - "All uses of `invariant' keyword must be at global " - "scope\n"); + "all uses of `invariant' keyword must be at global " + "scope"); } foreach_list_typed (ast_declaration, decl, link, &this->declarations) { - assert(!decl->is_array); - assert(decl->array_size == NULL); + assert(decl->array_specifier == NULL); assert(decl->initializer == NULL); ir_variable *const earlier = state->symbols->get_variable(decl->identifier); if (earlier == NULL) { _mesa_glsl_error(& loc, state, - "Undeclared variable `%s' cannot be marked " - "invariant\n", decl->identifier); - } else if ((state->target == vertex_shader) - && (earlier->mode != ir_var_out)) { + "undeclared variable `%s' cannot be marked " + "invariant", decl->identifier); + } else if ((state->stage == MESA_SHADER_VERTEX) + && (earlier->data.mode != ir_var_shader_out)) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, vertex shader " - "outputs only\n", decl->identifier); - } else if ((state->target == fragment_shader) - && (earlier->mode != ir_var_in)) { + "outputs only", decl->identifier); + } else if ((state->stage == MESA_SHADER_FRAGMENT) + && (earlier->data.mode != ir_var_shader_in)) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, fragment shader " - "inputs only\n", decl->identifier); - } else if (earlier->used) { + "inputs only", decl->identifier); + } else if (earlier->data.used) { _mesa_glsl_error(& loc, state, "variable `%s' may not be redeclared " "`invariant' after being used", earlier->name); } else { - earlier->invariant = true; + earlier->data.invariant = true; } } @@ -2564,7 +2978,19 @@ ast_declarator_list::hir(exec_list *instructions, */ (void) this->type->specifier->hir(instructions, state); - decl_type = this->type->specifier->glsl_type(& type_name, state); + decl_type = this->type->glsl_type(& type_name, state); + + /* An offset-qualified atomic counter declaration sets the default + * offset for the next declaration within the same atomic counter + * buffer. + */ + if (decl_type && decl_type->contains_atomic()) { + if (type->qualifier.flags.q.explicit_binding && + type->qualifier.flags.q.explicit_offset) + state->atomic_counter_offsets[type->qualifier.binding] = + type->qualifier.offset; + } + if (this->declarations.is_empty()) { /* If there is no structure involved in the program text, there are two * possible scenarios: @@ -2576,6 +3002,11 @@ ast_declarator_list::hir(exec_list *instructions, * name of a known structure type. This is both invalid and weird. * Emit an error. * + * - The program text contained something like 'mediump float;' + * when the programmer probably meant 'precision mediump + * float;' Emit a warning with a description of what they + * probably meant to do. + * * Note that if decl_type is NULL and there is a structure involved, * there must have been some sort of error with the structure. In this * case we assume that an error was already generated on this line of @@ -2584,14 +3015,38 @@ ast_declarator_list::hir(exec_list *instructions, */ assert(this->type->specifier->structure == NULL || decl_type != NULL || state->error); - if (this->type->specifier->structure == NULL) { - if (decl_type != NULL) { - _mesa_glsl_warning(&loc, state, "empty declaration"); - } else { - _mesa_glsl_error(&loc, state, - "invalid type `%s' in empty declaration", - type_name); - } + + if (decl_type == NULL) { + _mesa_glsl_error(&loc, state, + "invalid type `%s' in empty declaration", + type_name); + } else if (decl_type->base_type == GLSL_TYPE_ATOMIC_UINT) { + /* Empty atomic counter declarations are allowed and useful + * to set the default offset qualifier. + */ + return NULL; + } else if (this->type->qualifier.precision != ast_precision_none) { + if (this->type->specifier->structure != NULL) { + _mesa_glsl_error(&loc, state, + "precision qualifiers can't be applied " + "to structures"); + } else { + static const char *const precision_names[] = { + "highp", + "highp", + "mediump", + "lowp" + }; + + _mesa_glsl_warning(&loc, state, + "empty declaration with precision qualifier, " + "to set the default precision, use " + "`precision %s %s;'", + precision_names[this->type->qualifier.precision], + type_name); + } + } else if (this->type->specifier->structure == NULL) { + _mesa_glsl_warning(&loc, state, "empty declaration"); } } @@ -2616,16 +3071,30 @@ ast_declarator_list::hir(exec_list *instructions, continue; } - if (decl->is_array) { - var_type = process_array_type(&loc, decl_type, decl->array_size, - state); - if (var_type->is_error()) - continue; - } else { - var_type = decl_type; - } + var_type = process_array_type(&loc, decl_type, decl->array_specifier, + state); - var = new(ctx) ir_variable(var_type, decl->identifier, ir_var_auto, (glsl_precision)this->type->specifier->precision); + var = new(ctx) ir_variable(var_type, decl->identifier, ir_var_auto, (glsl_precision)this->type->qualifier.precision); + + /* The 'varying in' and 'varying out' qualifiers can only be used with + * ARB_geometry_shader4 and EXT_geometry_shader4, which we don't support + * yet. + */ + if (this->type->qualifier.flags.q.varying) { + if (this->type->qualifier.flags.q.in) { + _mesa_glsl_error(& loc, state, + "`varying in' qualifier in declaration of " + "`%s' only valid for geometry shaders using " + "ARB_geometry_shader4 or EXT_geometry_shader4", + decl->identifier); + } else if (this->type->qualifier.flags.q.out) { + _mesa_glsl_error(& loc, state, + "`varying out' qualifier in declaration of " + "`%s' only valid for geometry shaders using " + "ARB_geometry_shader4 or EXT_geometry_shader4", + decl->identifier); + } + } /* From page 22 (page 28 of the PDF) of the GLSL 1.10 specification; * @@ -2635,48 +3104,45 @@ ast_declarator_list::hir(exec_list *instructions, * * Local variables can only use the qualifier const." * - * This is relaxed in GLSL 1.30. It is also relaxed by any extension - * that adds the 'layout' keyword. + * This is relaxed in GLSL 1.30 and GLSL ES 3.00. It is also relaxed by + * any extension that adds the 'layout' keyword. */ - if ((state->language_version < 130) - && !state->ARB_explicit_attrib_location_enable + if (!state->is_version(130, 300) + && !state->has_explicit_attrib_location() && !state->ARB_fragment_coord_conventions_enable) { if (this->type->qualifier.flags.q.out) { _mesa_glsl_error(& loc, state, "`out' qualifier in declaration of `%s' " - "only valid for function parameters in %s.", - decl->identifier, state->version_string); + "only valid for function parameters in %s", + decl->identifier, state->get_version_string()); } if (this->type->qualifier.flags.q.in) { _mesa_glsl_error(& loc, state, "`in' qualifier in declaration of `%s' " - "only valid for function parameters in %s.", - decl->identifier, state->version_string); + "only valid for function parameters in %s", + decl->identifier, state->get_version_string()); } /* FINISHME: Test for other invalid qualifiers. */ } apply_type_qualifier_to_variable(& this->type->qualifier, var, state, - & loc, this->ubo_qualifiers_valid); - apply_precision_to_variable(this->type->specifier, var, state); + & loc, false); + apply_precision_to_variable(this->type->qualifier, var, state); if (this->type->qualifier.flags.q.invariant) { - if ((state->target == vertex_shader) && !(var->mode == ir_var_out || - var->mode == ir_var_inout)) { - /* FINISHME: Note that this doesn't work for invariant on - * a function signature outval - */ + if ((state->stage == MESA_SHADER_VERTEX) && + var->data.mode != ir_var_shader_out) { _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, vertex shader " - "outputs only\n", var->name); - } else if ((state->target == fragment_shader) && - !(var->mode == ir_var_in || var->mode == ir_var_inout)) { + "outputs only", var->name); + } else if ((state->stage == MESA_SHADER_FRAGMENT) && + var->data.mode != ir_var_shader_in) { /* FINISHME: Note that this doesn't work for invariant on * a function signature inval */ _mesa_glsl_error(& loc, state, "`%s' cannot be marked invariant, fragment shader " - "inputs only\n", var->name); + "inputs only", var->name); } } @@ -2707,10 +3173,10 @@ ast_declarator_list::hir(exec_list *instructions, "global scope%s", mode, var->name, extra); } - } else if (var->mode == ir_var_in) { - var->read_only = true; + } else if (var->data.mode == ir_var_shader_in) { + var->data.read_only = true; - if (state->target == vertex_shader) { + if (state->stage == MESA_SHADER_VERTEX) { bool error_emitted = false; /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: @@ -2731,16 +3197,24 @@ ast_declarator_list::hir(exec_list *instructions, * "The attribute qualifier can be used only with float, * floating-point vectors, and matrices. Attribute variables * cannot be declared as arrays or structures." + * + * From page 33 (page 39 of the PDF) of the GLSL ES 3.00 spec: + * + * "Vertex shader inputs can only be float, floating-point + * vectors, matrices, signed and unsigned integers and integer + * vectors. Vertex shader inputs cannot be arrays or + * structures." */ - const glsl_type *check_type = var->type->is_array() - ? var->type->fields.array : var->type; + const glsl_type *check_type = var->type; + while (check_type->is_array()) + check_type = check_type->element_type(); switch (check_type->base_type) { case GLSL_TYPE_FLOAT: break; case GLSL_TYPE_UINT: case GLSL_TYPE_INT: - if (state->language_version > 120) + if (state->is_version(120, 300)) break; /* FALLTHROUGH */ default: @@ -2752,32 +3226,70 @@ ast_declarator_list::hir(exec_list *instructions, error_emitted = true; } - if (!error_emitted && (state->language_version <= 130) - && var->type->is_array()) { - _mesa_glsl_error(& loc, state, - "vertex shader input / attribute cannot have " - "array type"); + if (!error_emitted && var->type->is_array() && + !state->check_version(150, 0, &loc, + "vertex shader input / attribute " + "cannot have array type")) { error_emitted = true; } - } + } else if (state->stage == MESA_SHADER_GEOMETRY) { + /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec: + * + * Geometry shader input variables get the per-vertex values + * written out by vertex shader output variables of the same + * names. Since a geometry shader operates on a set of + * vertices, each input varying variable (or input block, see + * interface blocks below) needs to be declared as an array. + */ + if (!var->type->is_array()) { + _mesa_glsl_error(&loc, state, + "geometry shader inputs must be arrays"); + } + + handle_geometry_shader_input_decl(state, loc, var); + } } - /* Integer vertex outputs must be qualified with 'flat'. + /* Integer fragment inputs must be qualified with 'flat'. In GLSL ES, + * so must integer vertex outputs. * - * From section 4.3.6 of the GLSL 1.30 spec: - * "If a vertex output is a signed or unsigned integer or integer - * vector, then it must be qualified with the interpolation qualifier + * From section 4.3.4 ("Inputs") of the GLSL 1.50 spec: + * "Fragment shader inputs that are signed or unsigned integers or + * integer vectors must be qualified with the interpolation qualifier * flat." + * + * From section 4.3.4 ("Input Variables") of the GLSL 3.00 ES spec: + * "Fragment shader inputs that are, or contain, signed or unsigned + * integers or integer vectors must be qualified with the + * interpolation qualifier flat." + * + * From section 4.3.6 ("Output Variables") of the GLSL 3.00 ES spec: + * "Vertex shader outputs that are, or contain, signed or unsigned + * integers or integer vectors must be qualified with the + * interpolation qualifier flat." + * + * Note that prior to GLSL 1.50, this requirement applied to vertex + * outputs rather than fragment inputs. That creates problems in the + * presence of geometry shaders, so we adopt the GLSL 1.50 rule for all + * desktop GL shaders. For GLSL ES shaders, we follow the spec and + * apply the restriction to both vertex outputs and fragment inputs. + * + * Note also that the desktop GLSL specs are missing the text "or + * contain"; this is presumably an oversight, since there is no + * reasonable way to interpolate a fragment shader input that contains + * an integer. */ - if (state->language_version >= 130 - && state->target == vertex_shader - && state->current_function == NULL - && var->type->is_integer() - && var->mode == ir_var_out - && var->interpolation != INTERP_QUALIFIER_FLAT) { - - _mesa_glsl_error(&loc, state, "If a vertex output is an integer, " - "then it must be qualified with 'flat'"); + if (state->is_version(130, 300) && + var->type->contains_integer() && + var->data.interpolation != INTERP_QUALIFIER_FLAT && + ((state->stage == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_in) + || (state->stage == MESA_SHADER_VERTEX && var->data.mode == ir_var_shader_out + && state->es_shader))) { + const char *var_type = (state->stage == MESA_SHADER_VERTEX) ? + "vertex output" : "fragment input"; + _mesa_glsl_error(&loc, state, "if a %s is (or contains) " + "an integer, then it must be qualified with 'flat'", + var_type); } @@ -2788,8 +3300,10 @@ ast_declarator_list::hir(exec_list *instructions, * "interpolation qualifiers may only precede the qualifiers in, * centroid in, out, or centroid out in a declaration. They do not apply * to the deprecated storage qualifiers varying or centroid varying." + * + * These deprecated storage qualifiers do not exist in GLSL ES 3.00. */ - if (state->language_version >= 130 + if (state->is_version(130, 0) && this->type->qualifier.has_interpolation() && this->type->qualifier.flags.q.varying) { @@ -2814,22 +3328,28 @@ ast_declarator_list::hir(exec_list *instructions, * "Outputs from a vertex shader (out) and inputs to a fragment * shader (in) can be further qualified with one or more of these * interpolation qualifiers" + * + * From page 31 (page 37 of the PDF) of the GLSL ES 3.00 spec: + * "These interpolation qualifiers may only precede the qualifiers + * in, centroid in, out, or centroid out in a declaration. They do + * not apply to inputs into a vertex shader or outputs from a + * fragment shader." */ - if (state->language_version >= 130 + if (state->is_version(130, 300) && this->type->qualifier.has_interpolation()) { const char *i = this->type->qualifier.interpolation_string(); assert(i != NULL); - switch (state->target) { - case vertex_shader: + switch (state->stage) { + case MESA_SHADER_VERTEX: if (this->type->qualifier.flags.q.in) { _mesa_glsl_error(&loc, state, "qualifier '%s' cannot be applied to vertex " "shader inputs", i); } break; - case fragment_shader: + case MESA_SHADER_FRAGMENT: if (this->type->qualifier.flags.q.out) { _mesa_glsl_error(&loc, state, "qualifier '%s' cannot be applied to fragment " @@ -2837,61 +3357,96 @@ ast_declarator_list::hir(exec_list *instructions, } break; default: - assert(0); + break; } } /* From section 4.3.4 of the GLSL 1.30 spec: * "It is an error to use centroid in in a vertex shader." + * + * From section 4.3.4 of the GLSL ES 3.00 spec: + * "It is an error to use centroid in or interpolation qualifiers in + * a vertex shader input." */ - if (state->language_version >= 130 + if (state->is_version(130, 300) && this->type->qualifier.flags.q.centroid && this->type->qualifier.flags.q.in - && state->target == vertex_shader) { + && state->stage == MESA_SHADER_VERTEX) { _mesa_glsl_error(&loc, state, "'centroid in' cannot be used in a vertex shader"); } + if (state->stage == MESA_SHADER_VERTEX + && this->type->qualifier.flags.q.sample + && this->type->qualifier.flags.q.in) { + + _mesa_glsl_error(&loc, state, + "'sample in' cannot be used in a vertex shader"); + } + + /* Section 4.3.6 of the GLSL 1.30 specification states: + * "It is an error to use centroid out in a fragment shader." + * + * The GL_ARB_shading_language_420pack extension specification states: + * "It is an error to use auxiliary storage qualifiers or interpolation + * qualifiers on an output in a fragment shader." + */ + if (state->stage == MESA_SHADER_FRAGMENT && + this->type->qualifier.flags.q.out && + this->type->qualifier.has_auxiliary_storage()) { + _mesa_glsl_error(&loc, state, + "auxiliary storage qualifiers cannot be used on " + "fragment shader outputs"); + } /* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30. */ - if (this->type->specifier->precision != ast_precision_none - && state->language_version != 100 - && state->language_version < 130) { - - _mesa_glsl_error(&loc, state, - "precision qualifiers are supported only in GLSL ES " - "1.00, and GLSL 1.30 and later"); + if (this->type->qualifier.precision != ast_precision_none) { + state->check_precision_qualifiers_allowed(&loc); } - /* Precision qualifiers only apply to floating point and integer types. + /* Precision qualifiers apply to floating point, integer and sampler + * types. * - * From section 4.5.2 of the GLSL 1.30 spec: + * Section 4.5.2 (Precision Qualifiers) of the GLSL 1.30 spec says: * "Any floating point or any integer declaration can have the type * preceded by one of these precision qualifiers [...] Literal * constants do not have precision qualifiers. Neither do Boolean * variables. * - * In GLSL ES, sampler types are also allowed. + * Section 4.5 (Precision and Precision Qualifiers) of the GLSL 1.30 + * spec also says: * - * From page 87 of the GLSL ES spec: - * "RESOLUTION: Allow sampler types to take a precision qualifier." + * "Precision qualifiers are added for code portability with OpenGL + * ES, not for functionality. They have the same syntax as in OpenGL + * ES." + * + * Section 8 (Built-In Functions) of the GLSL ES 1.00 spec says: + * + * "uniform lowp sampler2D sampler; + * highp vec2 coord; + * ... + * lowp vec4 col = texture2D (sampler, coord); + * // texture2D returns lowp" + * + * From this, we infer that GLSL 1.30 (and later) should allow precision + * qualifiers on sampler types just like float and integer types. */ - if (this->type->specifier->precision != ast_precision_none + if (this->type->qualifier.precision != ast_precision_none && !var->type->is_float() && !var->type->is_integer() - && !(var->type->is_sampler() && state->es_shader) + && !var->type->is_record() + && !var->type->is_sampler() && !(var->type->is_array() && (var->type->fields.array->is_float() || var->type->fields.array->is_integer()))) { _mesa_glsl_error(&loc, state, "precision qualifiers apply only to floating point" - "%s types", state->es_shader ? ", integer, and sampler" - : "and integer"); + ", integer and sampler types"); } /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec: @@ -2912,7 +3467,18 @@ ast_declarator_list::hir(exec_list *instructions, * instruction stream. */ exec_list initializer_instructions; - ir_variable *earlier = get_variable_being_redeclared(var, decl, state); + ir_variable *earlier = + get_variable_being_redeclared(var, decl->get_location(), state, + false /* allow_all_redeclarations */); + if (earlier != NULL) { + if (strncmp(var->name, "gl_", 3) == 0 && + earlier->data.how_declared == ir_var_declared_in_block) { + _mesa_glsl_error(&loc, state, + "`%s' has already been redeclared using " + "gl_PerVertex", var->name); + } + earlier->data.how_declared = ir_var_declared_normally; + } if (decl->initializer != NULL) { result = process_initializer((earlier == NULL) ? var : earlier, @@ -2932,33 +3498,39 @@ ast_declarator_list::hir(exec_list *instructions, decl->identifier); } + if (state->es_shader) { + const glsl_type *const t = (earlier == NULL) + ? var->type : earlier->type; + + if (t->is_unsized_array()) + /* Section 10.17 of the GLSL ES 1.00 specification states that + * unsized array declarations have been removed from the language. + * Arrays that are sized using an initializer are still explicitly + * sized. However, GLSL ES 1.00 does not allow array + * initializers. That is only allowed in GLSL ES 3.00. + * + * Section 4.1.9 (Arrays) of the GLSL ES 3.00 spec says: + * + * "An array type can also be formed without specifying a size + * if the definition includes an initializer: + * + * float x[] = float[2] (1.0, 2.0); // declares an array of size 2 + * float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3 + * + * float a[5]; + * float b[] = a;" + */ + _mesa_glsl_error(& loc, state, + "unsized array declarations are not allowed in " + "GLSL ES"); + } + /* If the declaration is not a redeclaration, there are a few additional * semantic checks that must be applied. In addition, variable that was * created for the declaration should be added to the IR stream. */ if (earlier == NULL) { - /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec, - * - * "Identifiers starting with "gl_" are reserved for use by - * OpenGL, and may not be declared in a shader as either a - * variable or a function." - */ - if (strncmp(decl->identifier, "gl_", 3) == 0) - _mesa_glsl_error(& loc, state, - "identifier `%s' uses reserved `gl_' prefix", - decl->identifier); - else if (strstr(decl->identifier, "__")) { - /* From page 14 (page 20 of the PDF) of the GLSL 1.10 - * spec: - * - * "In addition, all identifiers containing two - * consecutive underscores (__) are reserved as - * possible future keywords." - */ - _mesa_glsl_error(& loc, state, - "identifier `%s' uses reserved `__' string", - decl->identifier); - } + validate_identifier(decl->identifier, loc, state); /* Add the variable to the symbol table. Note that the initializer's * IR was already processed earlier (though it hasn't been emitted @@ -2984,11 +3556,12 @@ ast_declarator_list::hir(exec_list *instructions, * but otherwise we run into trouble if a function is prototyped, a * global var is decled, then the function is defined with usage of * the global var. See glslparsertest's CorrectModule.frag. - * However, do not insert declarations before default precision statements. + * However, do not insert declarations before default precision statements + * or type declarations. */ - exec_node* before_node = instructions->head; - while (before_node && ((ir_instruction*)before_node)->ir_type == ir_type_precision) - before_node = before_node->next; + ir_instruction* before_node = (ir_instruction*)instructions->head; + while (before_node && (before_node->ir_type == ir_type_precision || before_node->ir_type == ir_type_typedecl)) + before_node = (ir_instruction*)before_node->next; if (before_node) before_node->insert_before(var); else @@ -3021,7 +3594,7 @@ ast_parameter_declarator::hir(exec_list *instructions, const char *name = NULL; YYLTYPE loc = this->get_location(); - type = this->type->specifier->glsl_type(& name, state); + type = this->type->glsl_type(& name, state); if (type == NULL) { if (name != NULL) { @@ -3066,25 +3639,24 @@ ast_parameter_declarator::hir(exec_list *instructions, /* This only handles "vec4 foo[..]". The earlier specifier->glsl_type(...) * call already handled the "vec4[..] foo" case. */ - if (this->is_array) { - type = process_array_type(&loc, type, this->array_size, state); - } + type = process_array_type(&loc, type, this->array_specifier, state); - if (!type->is_error() && type->array_size() == 0) { + if (!type->is_error() && type->is_unsized_array()) { _mesa_glsl_error(&loc, state, "arrays passed as parameters must have " - "a declared size."); + "a declared size"); type = glsl_type::error_type; } is_void = false; - ir_variable *var = new(ctx) ir_variable(type, this->identifier, ir_var_in, (glsl_precision)this->type->specifier->precision); + ir_variable *var = new(ctx) + ir_variable(type, this->identifier, ir_var_function_in, (glsl_precision)this->type->qualifier.precision); /* Apply any specified qualifiers to the parameter declaration. Note that * for function parameters the default mode is 'in'. */ apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc, - false); - apply_precision_to_variable(this->type->specifier, var, state); + true); + apply_precision_to_variable(this->type->qualifier, var, state); /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec: * @@ -3092,7 +3664,7 @@ ast_parameter_declarator::hir(exec_list *instructions, * as out or inout function parameters, nor can they be assigned * into." */ - if ((var->mode == ir_var_inout || var->mode == ir_var_out) + if ((var->data.mode == ir_var_function_inout || var->data.mode == ir_var_function_out) && type->contains_sampler()) { _mesa_glsl_error(&loc, state, "out and inout parameters cannot contain samplers"); type = glsl_type::error_type; @@ -3112,9 +3684,10 @@ ast_parameter_declarator::hir(exec_list *instructions, * So for GLSL 1.10, passing an array as an out or inout parameter is not * allowed. This restriction is removed in GLSL 1.20, and in GLSL ES. */ - if ((var->mode == ir_var_inout || var->mode == ir_var_out) - && type->is_array() && state->language_version == 110) { - _mesa_glsl_error(&loc, state, "Arrays cannot be out or inout parameters in GLSL 1.10"); + if ((var->data.mode == ir_var_function_inout || var->data.mode == ir_var_function_out) + && type->is_array() + && !state->check_version(120, 100, &loc, + "arrays cannot be out or inout parameters")) { type = glsl_type::error_type; } @@ -3197,24 +3770,15 @@ ast_function::hir(exec_list *instructions, * * Note that this language does not appear in GLSL 1.10. */ - if ((state->current_function != NULL) && (state->language_version != 110)) { + if ((state->current_function != NULL) && + state->is_version(120, 100)) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(&loc, state, "declaration of function `%s' not allowed within " "function body", name); } - /* From page 15 (page 21 of the PDF) of the GLSL 1.10 spec, - * - * "Identifiers starting with "gl_" are reserved for use by - * OpenGL, and may not be declared in a shader as either a - * variable or a function." - */ - if (strncmp(name, "gl_", 3) == 0) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, - "identifier `%s' uses reserved `gl_' prefix", name); - } + validate_identifier(name, this->get_location(), state); /* Convert the list of function parameters to HIR now so that they can be * used below to compare this function's signature with previously seen @@ -3226,7 +3790,7 @@ ast_function::hir(exec_list *instructions, const char *return_type_name; const glsl_type *return_type = - this->return_type->specifier->glsl_type(& return_type_name, state); + this->return_type->glsl_type(& return_type_name, state); if (!return_type) { YYLTYPE loc = this->get_location(); @@ -3245,6 +3809,18 @@ ast_function::hir(exec_list *instructions, "function `%s' return type has qualifiers", name); } + /* Section 6.1 (Function Definitions) of the GLSL 1.20 spec says: + * + * "Arrays are allowed as arguments and as the return type. In both + * cases, the array must be explicitly sized." + */ + if (return_type->is_unsized_array()) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(& loc, state, + "function `%s' return type array must be explicitly " + "sized", name); + } + /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec: * * "[Sampler types] can only be declared as function parameters @@ -3263,7 +3839,7 @@ ast_function::hir(exec_list *instructions, */ f = state->symbols->get_function(name); if (f != NULL && (state->es_shader || f->has_user_signature())) { - sig = f->exact_matching_signature(&hir_parameters); + sig = f->exact_matching_signature(state, &hir_parameters); if (sig != NULL) { const char *badvar = sig->qualifiers_match(&hir_parameters); if (badvar != NULL) { @@ -3280,10 +3856,17 @@ ast_function::hir(exec_list *instructions, "match prototype", name); } - if (is_definition && sig->is_defined) { - YYLTYPE loc = this->get_location(); - - _mesa_glsl_error(& loc, state, "function `%s' redefined", name); + if (sig->is_defined) { + if (is_definition) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(& loc, state, "function `%s' redefined", name); + } else { + /* We just encountered a prototype that exactly matches a + * function that's already been defined. This is redundant, + * and we should ignore it. + */ + return NULL; + } } } } else { @@ -3318,7 +3901,7 @@ ast_function::hir(exec_list *instructions, /* Finish storing the information about this new function in its signature. */ if (sig == NULL) { - sig = new(ctx) ir_function_signature(return_type, (glsl_precision)this->return_type->specifier->precision); + sig = new(ctx) ir_function_signature(return_type, (glsl_precision)this->return_type->qualifier.precision); f->add_signature(sig); } @@ -3350,8 +3933,8 @@ ast_function_definition::hir(exec_list *instructions, * Add these to the symbol table. */ state->symbols->push_scope(); - foreach_iter(exec_list_iterator, iter, signature->parameters) { - ir_variable *const var = ((ir_instruction *) iter.get())->as_variable(); + foreach_list(n, &signature->parameters) { + ir_variable *const var = ((ir_instruction *) n)->as_variable(); assert(var != NULL); @@ -3402,7 +3985,7 @@ ast_jump_statement::hir(exec_list *instructions, assert(state->current_function); if (opt_return_value) { - ir_rvalue *const ret = opt_return_value->hir(instructions, state); + ir_rvalue *ret = opt_return_value->hir(instructions, state); /* The value of the return type can be NULL if the shader says * 'return foo();' and foo() is a function that returns void. @@ -3414,17 +3997,46 @@ ast_jump_statement::hir(exec_list *instructions, const glsl_type *const ret_type = (ret == NULL) ? glsl_type::void_type : ret->type; - /* Implicit conversions are not allowed for return values. */ - if (state->current_function->return_type != ret_type) { + /* Implicit conversions are not allowed for return values prior to + * ARB_shading_language_420pack. + */ + if (state->current_function->return_type != ret_type) { YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "`return' with wrong type %s, in function `%s' " - "returning %s", - ret_type->name, - state->current_function->function_name(), - state->current_function->return_type->name); - } + if (state->ARB_shading_language_420pack_enable) { + if (!apply_implicit_conversion(state->current_function->return_type, + ret, state)) { + _mesa_glsl_error(& loc, state, + "could not implicitly convert return value " + "to %s, in function `%s'", + state->current_function->return_type->name, + state->current_function->function_name()); + } + } else { + _mesa_glsl_error(& loc, state, + "`return' with wrong type %s, in function `%s' " + "returning %s", + ret_type->name, + state->current_function->function_name(), + state->current_function->return_type->name); + } + } else if (state->current_function->return_type->base_type == + GLSL_TYPE_VOID) { + YYLTYPE loc = this->get_location(); + + /* The ARB_shading_language_420pack, GLSL ES 3.0, and GLSL 4.20 + * specs add a clarification: + * + * "A void function can only use return without a return argument, even if + * the return argument has void type. Return statements only accept values: + * + * void func1() { } + * void func2() { return func1(); } // illegal return statement" + */ + _mesa_glsl_error(& loc, state, + "void functions can only use `return' without a " + "return argument"); + } inst = new(ctx) ir_return(ret); } else { @@ -3446,7 +4058,7 @@ ast_jump_statement::hir(exec_list *instructions, } case ast_discard: - if (state->target != fragment_shader) { + if (state->stage != MESA_SHADER_FRAGMENT) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, @@ -3898,30 +4510,54 @@ ast_iteration_statement::hir(exec_list *instructions, } +/** + * Determine if the given type is valid for establishing a default precision + * qualifier. + * + * From GLSL ES 3.00 section 4.5.4 ("Default Precision Qualifiers"): + * + * "The precision statement + * + * precision precision-qualifier type; + * + * can be used to establish a default precision qualifier. The type field + * can be either int or float or any of the sampler types, and the + * precision-qualifier can be lowp, mediump, or highp." + * + * GLSL ES 1.00 has similar language. GLSL 1.30 doesn't allow precision + * qualifiers on sampler types, but this seems like an oversight (since the + * intention of including these in GLSL 1.30 is to allow compatibility with ES + * shaders). So we allow int, float, and all sampler types regardless of GLSL + * version. + */ +static bool +is_valid_default_precision_type(const struct glsl_type *const type) +{ + if (type == NULL) + return false; + + switch (type->base_type) { + case GLSL_TYPE_INT: + case GLSL_TYPE_FLOAT: + /* "int" and "float" are valid, but vectors and matrices are not. */ + return type->vector_elements == 1 && type->matrix_columns == 1; + case GLSL_TYPE_SAMPLER: + return true; + default: + return false; + } +} + + ir_rvalue * ast_type_specifier::hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) { - if (!this->is_precision_statement && this->structure == NULL) + if (this->default_precision == ast_precision_none && this->structure == NULL) return NULL; YYLTYPE loc = this->get_location(); - if (this->precision != ast_precision_none - && state->language_version != 100 - && state->language_version < 130) { - _mesa_glsl_error(&loc, state, - "precision qualifiers exist only in " - "GLSL ES 1.00, and GLSL 1.30 and later"); - return NULL; - } - if (this->precision != ast_precision_none - && this->structure != NULL) { - _mesa_glsl_error(&loc, state, - "precision qualifiers do not apply to structures"); - return NULL; - } - /* If this is a precision statement, check that the type to which it is * applied is either float or int. * @@ -3932,21 +4568,29 @@ ast_type_specifier::hir(exec_list *instructions, * field can be either int or float [...]. Any other types or * qualifiers will result in an error. */ - if (this->is_precision_statement) { - assert(this->precision != ast_precision_none); - assert(this->structure == NULL); /* The check for structures was - * performed above. */ - if (this->is_array) { + if (this->default_precision != ast_precision_none) { + if (!state->check_precision_qualifiers_allowed(&loc)) + return NULL; + + if (this->structure != NULL) { + _mesa_glsl_error(&loc, state, + "precision qualifiers do not apply to structures"); + return NULL; + } + + if (this->array_specifier != NULL) { _mesa_glsl_error(&loc, state, "default precision statements do not apply to " "arrays"); return NULL; } - if (strcmp(this->type_name, "float") != 0 && - strcmp(this->type_name, "int") != 0) { + + const struct glsl_type *const type = + state->symbols->get_type(this->type_name); + if (!is_valid_default_precision_type(type)) { _mesa_glsl_error(&loc, state, - "default precision statements apply only to types " - "float and int"); + "default precision statements apply only to " + "float, int, and sampler types"); return NULL; } @@ -3954,7 +4598,7 @@ ast_type_specifier::hir(exec_list *instructions, void *ctx = state; const char* precision_type = NULL; - switch (this->precision) { + switch (this->default_precision) { case glsl_precision_high: precision_type = "highp"; break; case glsl_precision_medium: precision_type = "mediump"; break; case glsl_precision_low: precision_type = "lowp"; break; @@ -3966,45 +4610,118 @@ ast_type_specifier::hir(exec_list *instructions, instructions->push_head(stmt); } + + if (type->base_type == GLSL_TYPE_FLOAT + && state->es_shader + && state->stage == MESA_SHADER_FRAGMENT) { + /* Section 4.5.3 (Default Precision Qualifiers) of the GLSL ES 1.00 + * spec says: + * + * "The fragment language has no default precision qualifier for + * floating point types." + * + * As a result, we have to track whether or not default precision has + * been specified for float in GLSL ES fragment shaders. + * + * Earlier in that same section, the spec says: + * + * "Non-precision qualified declarations will use the precision + * qualifier specified in the most recent precision statement + * that is still in scope. The precision statement has the same + * scoping rules as variable declarations. If it is declared + * inside a compound statement, its effect stops at the end of + * the innermost statement it was declared in. Precision + * statements in nested scopes override precision statements in + * outer scopes. Multiple precision statements for the same basic + * type can appear inside the same scope, with later statements + * overriding earlier statements within that scope." + * + * Default precision specifications follow the same scope rules as + * variables. So, we can track the state of the default float + * precision in the symbol table, and the rules will just work. This + * is a slight abuse of the symbol table, but it has the semantics + * that we want. + */ + ir_variable *const junk = + new(state) ir_variable(type, "#default precision", + ir_var_temporary, (glsl_precision)this->default_precision); + + state->symbols->add_variable(junk); + } + + /* FINISHME: Translate precision statements into IR. */ return NULL; } - if (this->structure != NULL) + /* _mesa_ast_set_aggregate_type() sets the field so that + * process_record_constructor() can do type-checking on C-style initializer + * expressions of structs, but ast_struct_specifier should only be translated + * to HIR if it is declaring the type of a structure. + * + * The ->is_declaration field is false for initializers of variables + * declared separately from the struct's type definition. + * + * struct S { ... }; (is_declaration = true) + * struct T { ... } t = { ... }; (is_declaration = true) + * S s = { ... }; (is_declaration = false) + */ + if (this->structure != NULL && this->structure->is_declaration) return this->structure->hir(instructions, state); return NULL; } -ir_rvalue * -ast_struct_specifier::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) +/** + * Process a structure or interface block tree into an array of structure fields + * + * After parsing, where there are some syntax differnces, structures and + * interface blocks are almost identical. They are similar enough that the + * AST for each can be processed the same way into a set of + * \c glsl_struct_field to describe the members. + * + * If we're processing an interface block, var_mode should be the type of the + * interface block (ir_var_shader_in, ir_var_shader_out, or ir_var_uniform). + * If we're processing a structure, var_mode should be ir_var_auto. + * + * \return + * The number of fields processed. A pointer to the array structure fields is + * stored in \c *fields_ret. + */ +unsigned +ast_process_structure_or_interface_block(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + exec_list *declarations, + YYLTYPE &loc, + glsl_struct_field **fields_ret, + bool is_interface, + bool block_row_major, + bool allow_reserved_names, + ir_variable_mode var_mode) { unsigned decl_count = 0; - /* Make an initial pass over the list of structure fields to determine how + /* Make an initial pass over the list of fields to determine how * many there are. Each element in this list is an ast_declarator_list. * This means that we actually need to count the number of elements in the * 'declarations' list in each of the elements. */ - foreach_list_typed (ast_declarator_list, decl_list, link, - &this->declarations) { + foreach_list_typed (ast_declarator_list, decl_list, link, declarations) { foreach_list_const (decl_ptr, & decl_list->declarations) { decl_count++; } } - /* Allocate storage for the structure fields and process the field + /* Allocate storage for the fields and process the field * declarations. As the declarations are processed, try to also convert * the types to HIR. This ensures that structure definitions embedded in - * other structure definitions are processed. + * other structure definitions or in interface blocks are processed. */ glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field, decl_count); unsigned i = 0; - foreach_list_typed (ast_declarator_list, decl_list, link, - &this->declarations) { + foreach_list_typed (ast_declarator_list, decl_list, link, declarations) { const char *type_name; decl_list->type->specifier->hir(instructions, state); @@ -4013,36 +4730,157 @@ ast_struct_specifier::hir(exec_list *instructions, * embedded structure definitions have been removed from the language. */ if (state->es_shader && decl_list->type->specifier->structure != NULL) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "Embedded structure definitions are " - "not allowed in GLSL ES 1.00."); + _mesa_glsl_error(&loc, state, "embedded structure definitions are " + "not allowed in GLSL ES 1.00"); } const glsl_type *decl_type = - decl_list->type->specifier->glsl_type(& type_name, state); + decl_list->type->glsl_type(& type_name, state); foreach_list_typed (ast_declaration, decl, link, &decl_list->declarations) { - const struct glsl_type *field_type = decl_type; - if (decl->is_array) { - YYLTYPE loc = decl->get_location(); - field_type = process_array_type(&loc, decl_type, decl->array_size, - state); - } - fields[i].type = (field_type != NULL) - ? field_type : glsl_type::error_type; + if (!allow_reserved_names) + validate_identifier(decl->identifier, loc, state); + + /* From the GL_ARB_uniform_buffer_object spec: + * + * "Sampler types are not allowed inside of uniform + * blocks. All other types, arrays, and structures + * allowed for uniforms are allowed within a uniform + * block." + * + * It should be impossible for decl_type to be NULL here. Cases that + * might naturally lead to decl_type being NULL, especially for the + * is_interface case, will have resulted in compilation having + * already halted due to a syntax error. + */ + const struct glsl_type *field_type = + decl_type != NULL ? decl_type : glsl_type::error_type; + + if (is_interface && field_type->contains_sampler()) { + YYLTYPE loc = decl_list->get_location(); + _mesa_glsl_error(&loc, state, + "uniform in non-default uniform block contains sampler"); + } + + if (field_type->contains_atomic()) { + /* FINISHME: Add a spec quotation here once updated spec + * FINISHME: language is available. See Khronos bug #10903 + * FINISHME: on whether atomic counters are allowed in + * FINISHME: structures. + */ + YYLTYPE loc = decl_list->get_location(); + _mesa_glsl_error(&loc, state, "atomic counter in structure or " + "uniform block"); + } + + const struct ast_type_qualifier *const qual = + & decl_list->type->qualifier; + if (qual->flags.q.std140 || + qual->flags.q.packed || + qual->flags.q.shared) { + _mesa_glsl_error(&loc, state, + "uniform block layout qualifiers std140, packed, and " + "shared can only be applied to uniform blocks, not " + "members"); + } + + field_type = process_array_type(&loc, decl_type, + decl->array_specifier, state); + fields[i].type = field_type; fields[i].name = decl->identifier; - fields[i].precision = (glsl_precision)decl_list->type->specifier->precision; + fields[i].precision = (glsl_precision)decl_list->type->qualifier.precision; + fields[i].location = -1; + fields[i].interpolation = + interpret_interpolation_qualifier(qual, var_mode, state, &loc); + fields[i].centroid = qual->flags.q.centroid ? 1 : 0; + fields[i].sample = qual->flags.q.sample ? 1 : 0; + + if (qual->flags.q.row_major || qual->flags.q.column_major) { + if (!qual->flags.q.uniform) { + _mesa_glsl_error(&loc, state, + "row_major and column_major can only be " + "applied to uniform interface blocks"); + } else + validate_matrix_layout_for_type(state, &loc, field_type, NULL); + } + + if (qual->flags.q.uniform && qual->has_interpolation()) { + _mesa_glsl_error(&loc, state, + "interpolation qualifiers cannot be used " + "with uniform interface blocks"); + } + + if (field_type->is_matrix() || + (field_type->is_array() && field_type->fields.array->is_matrix())) { + fields[i].row_major = block_row_major; + if (qual->flags.q.row_major) + fields[i].row_major = true; + else if (qual->flags.q.column_major) + fields[i].row_major = false; + } + i++; } } assert(i == decl_count); + *fields_ret = fields; + return decl_count; +} + + +ir_rvalue * +ast_struct_specifier::hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + YYLTYPE loc = this->get_location(); + + /* Section 4.1.8 (Structures) of the GLSL 1.10 spec says: + * + * "Anonymous structures are not supported; so embedded structures must + * have a declarator. A name given to an embedded struct is scoped at + * the same level as the struct it is embedded in." + * + * The same section of the GLSL 1.20 spec says: + * + * "Anonymous structures are not supported. Embedded structures are not + * supported. + * + * struct S { float f; }; + * struct T { + * S; // Error: anonymous structures disallowed + * struct { ... }; // Error: embedded structures disallowed + * S s; // Okay: nested structures with name are allowed + * };" + * + * The GLSL ES 1.00 and 3.00 specs have similar langauge and examples. So, + * we allow embedded structures in 1.10 only. + */ + if (state->language_version != 110 && state->struct_specifier_depth != 0) + _mesa_glsl_error(&loc, state, + "embedded structure declartions are not allowed"); + + state->struct_specifier_depth++; + + glsl_struct_field *fields; + unsigned decl_count = + ast_process_structure_or_interface_block(instructions, + state, + &this->declarations, + loc, + &fields, + false, + false, + false /* allow_reserved_names */, + ir_var_auto); + + validate_identifier(this->name, loc, state); + const glsl_type *t = glsl_type::get_record_instance(fields, decl_count, this->name); - YYLTYPE loc = this->get_location(); if (!state->symbols->add_type(name, t)) { _mesa_glsl_error(& loc, state, "struct `%s' previously defined", name); } else { @@ -4053,104 +4891,491 @@ ast_struct_specifier::hir(exec_list *instructions, s[state->num_user_structures] = t; state->user_structures = s; state->num_user_structures++; + ir_typedecl_statement* stmt = new(state) ir_typedecl_statement(t); + + /* Push the struct declarations to the top. + * However, do not insert declarations before default precision + * statements or other declarations + */ + ir_instruction* before_node = (ir_instruction*)instructions->head; + while (before_node && + (before_node->ir_type == ir_type_precision || + before_node->ir_type == ir_type_typedecl)) + before_node = (ir_instruction*)before_node->next; + if (before_node) + before_node->insert_before(stmt); + else + instructions->push_head(stmt); } } + state->struct_specifier_depth--; + /* Structure type definitions do not have r-values. */ return NULL; } -static struct gl_uniform_block * -get_next_uniform_block(struct _mesa_glsl_parse_state *state) -{ - if (state->num_uniform_blocks >= state->uniform_block_array_size) { - state->uniform_block_array_size *= 2; - if (state->uniform_block_array_size <= 4) - state->uniform_block_array_size = 4; - state->uniform_blocks = reralloc(state, - state->uniform_blocks, - struct gl_uniform_block, - state->uniform_block_array_size); +/** + * Visitor class which detects whether a given interface block has been used. + */ +class interface_block_usage_visitor : public ir_hierarchical_visitor +{ +public: + interface_block_usage_visitor(ir_variable_mode mode, const glsl_type *block) + : mode(mode), block(block), found(false) + { } - memset(&state->uniform_blocks[state->num_uniform_blocks], - 0, sizeof(*state->uniform_blocks)); - return &state->uniform_blocks[state->num_uniform_blocks++]; -} + virtual ir_visitor_status visit(ir_dereference_variable *ir) + { + if (ir->var->data.mode == mode && ir->var->get_interface_type() == block) { + found = true; + return visit_stop; + } + return visit_continue; + } + + bool usage_found() const + { + return this->found; + } + +private: + ir_variable_mode mode; + const glsl_type *block; + bool found; +}; + ir_rvalue * -ast_uniform_block::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) +ast_interface_block::hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state) { - /* The ast_uniform_block has a list of ast_declarator_lists. We + YYLTYPE loc = this->get_location(); + + /* The ast_interface_block has a list of ast_declarator_lists. We * need to turn those into ir_variables with an association * with this uniform block. */ - struct gl_uniform_block *ubo = get_next_uniform_block(state); - ubo->Name = ralloc_strdup(state->uniform_blocks, this->block_name); + enum glsl_interface_packing packing; + if (this->layout.flags.q.shared) { + packing = GLSL_INTERFACE_PACKING_SHARED; + } else if (this->layout.flags.q.packed) { + packing = GLSL_INTERFACE_PACKING_PACKED; + } else { + /* The default layout is std140. + */ + packing = GLSL_INTERFACE_PACKING_STD140; + } - unsigned int num_variables = 0; - foreach_list_typed(ast_declarator_list, decl_list, link, &declarations) { - foreach_list_const(node, &decl_list->declarations) { - num_variables++; + ir_variable_mode var_mode; + const char *iface_type_name; + if (this->layout.flags.q.in) { + var_mode = ir_var_shader_in; + iface_type_name = "in"; + } else if (this->layout.flags.q.out) { + var_mode = ir_var_shader_out; + iface_type_name = "out"; + } else if (this->layout.flags.q.uniform) { + var_mode = ir_var_uniform; + iface_type_name = "uniform"; + } else { + var_mode = ir_var_auto; + iface_type_name = "UNKNOWN"; + assert(!"interface block layout qualifier not found!"); + } + + bool redeclaring_per_vertex = strcmp(this->block_name, "gl_PerVertex") == 0; + bool block_row_major = this->layout.flags.q.row_major; + exec_list declared_variables; + glsl_struct_field *fields; + unsigned int num_variables = + ast_process_structure_or_interface_block(&declared_variables, + state, + &this->declarations, + loc, + &fields, + true, + block_row_major, + redeclaring_per_vertex, + var_mode); + + if (!redeclaring_per_vertex) + validate_identifier(this->block_name, loc, state); + + const glsl_type *earlier_per_vertex = NULL; + if (redeclaring_per_vertex) { + /* Find the previous declaration of gl_PerVertex. If we're redeclaring + * the named interface block gl_in, we can find it by looking at the + * previous declaration of gl_in. Otherwise we can find it by looking + * at the previous decalartion of any of the built-in outputs, + * e.g. gl_Position. + * + * Also check that the instance name and array-ness of the redeclaration + * are correct. + */ + switch (var_mode) { + case ir_var_shader_in: + if (ir_variable *earlier_gl_in = + state->symbols->get_variable("gl_in")) { + earlier_per_vertex = earlier_gl_in->get_interface_type(); + } else { + _mesa_glsl_error(&loc, state, + "redeclaration of gl_PerVertex input not allowed " + "in the %s shader", + _mesa_shader_stage_to_string(state->stage)); + } + if (this->instance_name == NULL || + strcmp(this->instance_name, "gl_in") != 0 || this->array_specifier == NULL) { + _mesa_glsl_error(&loc, state, + "gl_PerVertex input must be redeclared as " + "gl_in[]"); + } + break; + case ir_var_shader_out: + if (ir_variable *earlier_gl_Position = + state->symbols->get_variable("gl_Position")) { + earlier_per_vertex = earlier_gl_Position->get_interface_type(); + } else { + _mesa_glsl_error(&loc, state, + "redeclaration of gl_PerVertex output not " + "allowed in the %s shader", + _mesa_shader_stage_to_string(state->stage)); + } + if (this->instance_name != NULL) { + _mesa_glsl_error(&loc, state, + "gl_PerVertex input may not be redeclared with " + "an instance name"); + } + break; + default: + _mesa_glsl_error(&loc, state, + "gl_PerVertex must be declared as an input or an " + "output"); + break; + } + + if (earlier_per_vertex == NULL) { + /* An error has already been reported. Bail out to avoid null + * dereferences later in this function. + */ + return NULL; + } + + /* Copy locations from the old gl_PerVertex interface block. */ + for (unsigned i = 0; i < num_variables; i++) { + int j = earlier_per_vertex->field_index(fields[i].name); + if (j == -1) { + _mesa_glsl_error(&loc, state, + "redeclaration of gl_PerVertex must be a subset " + "of the built-in members of gl_PerVertex"); + } else { + fields[i].location = + earlier_per_vertex->fields.structure[j].location; + fields[i].interpolation = + earlier_per_vertex->fields.structure[j].interpolation; + fields[i].centroid = + earlier_per_vertex->fields.structure[j].centroid; + fields[i].sample = + earlier_per_vertex->fields.structure[j].sample; + } + } + + /* From section 7.1 ("Built-in Language Variables") of the GLSL 4.10 + * spec: + * + * If a built-in interface block is redeclared, it must appear in + * the shader before any use of any member included in the built-in + * declaration, or a compilation error will result. + * + * This appears to be a clarification to the behaviour established for + * gl_PerVertex by GLSL 1.50, therefore we implement this behaviour + * regardless of GLSL version. + */ + interface_block_usage_visitor v(var_mode, earlier_per_vertex); + v.run(instructions); + if (v.usage_found()) { + _mesa_glsl_error(&loc, state, + "redeclaration of a built-in interface block must " + "appear before any use of any member of the " + "interface block"); } } - bool block_row_major = this->layout.flags.q.row_major; + const glsl_type *block_type = + glsl_type::get_interface_instance(fields, + num_variables, + packing, + this->block_name); - ubo->Uniforms = rzalloc_array(state->uniform_blocks, - struct gl_uniform_buffer_variable, - num_variables); + if (!state->symbols->add_interface(block_type->name, block_type, var_mode)) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(&loc, state, "interface block `%s' with type `%s' " + "already taken in the current scope", + this->block_name, iface_type_name); + } - foreach_list_typed(ast_declarator_list, decl_list, link, &declarations) { - exec_list declared_variables; + /* Since interface blocks cannot contain statements, it should be + * impossible for the block to generate any instructions. + */ + assert(declared_variables.is_empty()); - decl_list->hir(&declared_variables, state); + /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec: + * + * Geometry shader input variables get the per-vertex values written + * out by vertex shader output variables of the same names. Since a + * geometry shader operates on a set of vertices, each input varying + * variable (or input block, see interface blocks below) needs to be + * declared as an array. + */ + if (state->stage == MESA_SHADER_GEOMETRY && this->array_specifier == NULL && + var_mode == ir_var_shader_in) { + _mesa_glsl_error(&loc, state, "geometry shader inputs must be arrays"); + } - foreach_list_const(node, &declared_variables) { - class ir_variable *var = (ir_variable *)node; - - struct gl_uniform_buffer_variable *ubo_var = - &ubo->Uniforms[ubo->NumUniforms++]; - - var->uniform_block = (int)(ubo - state->uniform_blocks); - - ubo_var->Name = ralloc_strdup(state->uniform_blocks, var->name); - ubo_var->Type = var->type; - ubo_var->Buffer = (int)(ubo - state->uniform_blocks); - ubo_var->Offset = 0; /* Assigned at link time. */ - - if (var->type->is_matrix() || - (var->type->is_array() && var->type->fields.array->is_matrix())) { - ubo_var->RowMajor = block_row_major; - if (decl_list->type->qualifier.flags.q.row_major) - ubo_var->RowMajor = true; - else if (decl_list->type->qualifier.flags.q.column_major) - ubo_var->RowMajor = false; - } - - /* From the GL_ARB_uniform_buffer_object spec: - * - * "Sampler types are not allowed inside of uniform - * blocks. All other types, arrays, and structures - * allowed for uniforms are allowed within a uniform - * block." - */ - if (var->type->contains_sampler()) { - YYLTYPE loc = decl_list->get_location(); - _mesa_glsl_error(&loc, state, - "Uniform in non-default uniform block contains sampler\n"); - } + /* Page 39 (page 45 of the PDF) of section 4.3.7 in the GLSL ES 3.00 spec + * says: + * + * "If an instance name (instance-name) is used, then it puts all the + * members inside a scope within its own name space, accessed with the + * field selector ( . ) operator (analogously to structures)." + */ + if (this->instance_name) { + if (redeclaring_per_vertex) { + /* When a built-in in an unnamed interface block is redeclared, + * get_variable_being_redeclared() calls + * check_builtin_array_max_size() to make sure that built-in array + * variables aren't redeclared to illegal sizes. But we're looking + * at a redeclaration of a named built-in interface block. So we + * have to manually call check_builtin_array_max_size() for all parts + * of the interface that are arrays. + */ + for (unsigned i = 0; i < num_variables; i++) { + if (fields[i].type->is_array()) { + const unsigned size = fields[i].type->array_size(); + check_builtin_array_max_size(fields[i].name, size, loc, state); + } + } + } else { + validate_identifier(this->instance_name, loc, state); } - instructions->append_list(&declared_variables); + ir_variable *var; + + if (this->array_specifier != NULL) { + /* Section 4.3.7 (Interface Blocks) of the GLSL 1.50 spec says: + * + * For uniform blocks declared an array, each individual array + * element corresponds to a separate buffer object backing one + * instance of the block. As the array size indicates the number + * of buffer objects needed, uniform block array declarations + * must specify an array size. + * + * And a few paragraphs later: + * + * Geometry shader input blocks must be declared as arrays and + * follow the array declaration and linking rules for all + * geometry shader inputs. All other input and output block + * arrays must specify an array size. + * + * The upshot of this is that the only circumstance where an + * interface array size *doesn't* need to be specified is on a + * geometry shader input. + */ + if (this->array_specifier->is_unsized_array && + (state->stage != MESA_SHADER_GEOMETRY || !this->layout.flags.q.in)) { + _mesa_glsl_error(&loc, state, + "only geometry shader inputs may be unsized " + "instance block arrays"); + + } + + const glsl_type *block_array_type = + process_array_type(&loc, block_type, this->array_specifier, state); + + var = new(state) ir_variable(block_array_type, + this->instance_name, + var_mode, glsl_precision_undefined); + } else { + var = new(state) ir_variable(block_type, + this->instance_name, + var_mode, glsl_precision_undefined); + } + + if (state->stage == MESA_SHADER_GEOMETRY && var_mode == ir_var_shader_in) + handle_geometry_shader_input_decl(state, loc, var); + + if (ir_variable *earlier = + state->symbols->get_variable(this->instance_name)) { + if (!redeclaring_per_vertex) { + _mesa_glsl_error(&loc, state, "`%s' redeclared", + this->instance_name); + } + earlier->data.how_declared = ir_var_declared_normally; + earlier->type = var->type; + earlier->reinit_interface_type(block_type); + delete var; + } else { + state->symbols->add_variable(var); + instructions->push_tail(var); + } + } else { + /* In order to have an array size, the block must also be declared with + * an instane name. + */ + assert(this->array_specifier == NULL); + + for (unsigned i = 0; i < num_variables; i++) { + ir_variable *var = + new(state) ir_variable(fields[i].type, + ralloc_strdup(state, fields[i].name), + var_mode, fields[i].precision); + var->data.interpolation = fields[i].interpolation; + var->data.centroid = fields[i].centroid; + var->data.sample = fields[i].sample; + var->init_interface_type(block_type); + + if (redeclaring_per_vertex) { + ir_variable *earlier = + get_variable_being_redeclared(var, loc, state, + true /* allow_all_redeclarations */); + if (strncmp(var->name, "gl_", 3) != 0 || earlier == NULL) { + _mesa_glsl_error(&loc, state, + "redeclaration of gl_PerVertex can only " + "include built-in variables"); + } else if (earlier->data.how_declared == ir_var_declared_normally) { + _mesa_glsl_error(&loc, state, + "`%s' has already been redeclared", var->name); + } else { + earlier->data.how_declared = ir_var_declared_in_block; + earlier->reinit_interface_type(block_type); + } + continue; + } + + if (state->symbols->get_variable(var->name) != NULL) + _mesa_glsl_error(&loc, state, "`%s' redeclared", var->name); + + /* Propagate the "binding" keyword into this UBO's fields; + * the UBO declaration itself doesn't get an ir_variable unless it + * has an instance name. This is ugly. + */ + var->data.explicit_binding = this->layout.flags.q.explicit_binding; + var->data.binding = this->layout.binding; + + state->symbols->add_variable(var); + instructions->push_tail(var); + } + + if (redeclaring_per_vertex && block_type != earlier_per_vertex) { + /* From section 7.1 ("Built-in Language Variables") of the GLSL 4.10 spec: + * + * It is also a compilation error ... to redeclare a built-in + * block and then use a member from that built-in block that was + * not included in the redeclaration. + * + * This appears to be a clarification to the behaviour established + * for gl_PerVertex by GLSL 1.50, therefore we implement this + * behaviour regardless of GLSL version. + * + * To prevent the shader from using a member that was not included in + * the redeclaration, we disable any ir_variables that are still + * associated with the old declaration of gl_PerVertex (since we've + * already updated all of the variables contained in the new + * gl_PerVertex to point to it). + * + * As a side effect this will prevent + * validate_intrastage_interface_blocks() from getting confused and + * thinking there are conflicting definitions of gl_PerVertex in the + * shader. + */ + foreach_list_safe(node, instructions) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + if (var != NULL && + var->get_interface_type() == earlier_per_vertex && + var->data.mode == var_mode) { + if (var->data.how_declared == ir_var_declared_normally) { + _mesa_glsl_error(&loc, state, + "redeclaration of gl_PerVertex cannot " + "follow a redeclaration of `%s'", + var->name); + } + state->symbols->disable_variable(var->name); + var->remove(); + } + } + } } return NULL; } + +ir_rvalue * +ast_gs_input_layout::hir(exec_list *instructions, + struct _mesa_glsl_parse_state *state) +{ + YYLTYPE loc = this->get_location(); + + /* If any geometry input layout declaration preceded this one, make sure it + * was consistent with this one. + */ + if (state->gs_input_prim_type_specified && + state->gs_input_prim_type != this->prim_type) { + _mesa_glsl_error(&loc, state, + "geometry shader input layout does not match" + " previous declaration"); + return NULL; + } + + /* If any shader inputs occurred before this declaration and specified an + * array size, make sure the size they specified is consistent with the + * primitive type. + */ + unsigned num_vertices = vertices_per_prim(this->prim_type); + if (state->gs_input_size != 0 && state->gs_input_size != num_vertices) { + _mesa_glsl_error(&loc, state, + "this geometry shader input layout implies %u vertices" + " per primitive, but a previous input is declared" + " with size %u", num_vertices, state->gs_input_size); + return NULL; + } + + state->gs_input_prim_type_specified = true; + state->gs_input_prim_type = this->prim_type; + + /* If any shader inputs occurred before this declaration and did not + * specify an array size, their size is determined now. + */ + foreach_list (node, instructions) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (var == NULL || var->data.mode != ir_var_shader_in) + continue; + + /* Note: gl_PrimitiveIDIn has mode ir_var_shader_in, but it's not an + * array; skip it. + */ + + if (var->type->is_unsized_array()) { + if (var->data.max_array_access >= num_vertices) { + _mesa_glsl_error(&loc, state, + "this geometry shader input layout implies %u" + " vertices, but an access to element %u of input" + " `%s' already exists", num_vertices, + var->data.max_array_access, var->name); + } else { + var->type = glsl_type::get_array_instance(var->type->fields.array, + num_vertices); + } + } + } + + return NULL; +} + + static void detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, exec_list *instructions) @@ -4167,7 +5392,7 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, foreach_list(node, instructions) { ir_variable *var = ((ir_instruction *)node)->as_variable(); - if (!var || !var->assigned) + if (!var || !var->data.assigned) continue; if (strcmp(var->name, "gl_FragColor") == 0) @@ -4175,8 +5400,8 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, else if (strcmp(var->name, "gl_FragData") == 0) gl_FragData_assigned = true; else if (strncmp(var->name, "gl_", 3) != 0) { - if (state->target == fragment_shader && - (var->mode == ir_var_out || var->mode == ir_var_inout)) { + if (state->stage == MESA_SHADER_FRAGMENT && + var->data.mode == ir_var_shader_out) { user_defined_fs_output_assigned = true; user_defined_fs_output = var; } @@ -4200,14 +5425,66 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, */ if (gl_FragColor_assigned && gl_FragData_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragColor' and `gl_FragData'\n"); + "`gl_FragColor' and `gl_FragData'"); } else if (gl_FragColor_assigned && user_defined_fs_output_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragColor' and `%s'\n", + "`gl_FragColor' and `%s'", user_defined_fs_output->name); } else if (gl_FragData_assigned && user_defined_fs_output_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragData' and `%s'\n", + "`gl_FragData' and `%s'", user_defined_fs_output->name); } } + + +static void +remove_per_vertex_blocks(exec_list *instructions, + _mesa_glsl_parse_state *state, ir_variable_mode mode) +{ + /* Find the gl_PerVertex interface block of the appropriate (in/out) mode, + * if it exists in this shader type. + */ + const glsl_type *per_vertex = NULL; + switch (mode) { + case ir_var_shader_in: + if (ir_variable *gl_in = state->symbols->get_variable("gl_in")) + per_vertex = gl_in->get_interface_type(); + break; + case ir_var_shader_out: + if (ir_variable *gl_Position = + state->symbols->get_variable("gl_Position")) { + per_vertex = gl_Position->get_interface_type(); + } + break; + default: + assert(!"Unexpected mode"); + break; + } + + /* If we didn't find a built-in gl_PerVertex interface block, then we don't + * need to do anything. + */ + if (per_vertex == NULL) + return; + + /* If the interface block is used by the shader, then we don't need to do + * anything. + */ + interface_block_usage_visitor v(mode, per_vertex); + v.run(instructions); + if (v.usage_found()) + return; + + /* Remove any ir_variable declarations that refer to the interface block + * we're removing. + */ + foreach_list_safe(node, instructions) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + if (var != NULL && var->get_interface_type() == per_vertex && + var->data.mode == mode) { + state->symbols->disable_variable(var->name); + var->remove(); + } + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp b/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp index 29493e2f6..637da0dfb 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ast_type.cpp @@ -22,9 +22,6 @@ */ #include "ast.h" -extern "C" { -#include "program/symbol_table.h" -} void ast_type_specifier::print(void) const @@ -35,14 +32,8 @@ ast_type_specifier::print(void) const printf("%s ", type_name); } - if (is_array) { - printf("[ "); - - if (array_size) { - array_size->print(); - } - - printf("] "); + if (array_specifier) { + array_specifier->print(); } } @@ -59,6 +50,44 @@ bool ast_type_qualifier::has_interpolation() const || this->flags.q.noperspective; } +bool +ast_type_qualifier::has_layout() const +{ + return this->flags.q.origin_upper_left + || this->flags.q.pixel_center_integer + || this->flags.q.depth_any + || this->flags.q.depth_greater + || this->flags.q.depth_less + || this->flags.q.depth_unchanged + || this->flags.q.std140 + || this->flags.q.shared + || this->flags.q.column_major + || this->flags.q.row_major + || this->flags.q.packed + || this->flags.q.explicit_location + || this->flags.q.explicit_index + || this->flags.q.explicit_binding + || this->flags.q.explicit_offset; +} + +bool +ast_type_qualifier::has_storage() const +{ + return this->flags.q.constant + || this->flags.q.attribute + || this->flags.q.varying + || this->flags.q.in + || this->flags.q.out + || this->flags.q.uniform; +} + +bool +ast_type_qualifier::has_auxiliary_storage() const +{ + return this->flags.q.centroid + || this->flags.q.sample; +} + const char* ast_type_qualifier::interpolation_string() const { @@ -88,18 +117,42 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, ubo_layout_mask.flags.q.packed = 1; ubo_layout_mask.flags.q.shared = 1; + ast_type_qualifier ubo_binding_mask; + ubo_binding_mask.flags.q.explicit_binding = 1; + ubo_binding_mask.flags.q.explicit_offset = 1; + /* Uniform block layout qualifiers get to overwrite each * other (rightmost having priority), while all other * qualifiers currently don't allow duplicates. */ if ((this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i | - ubo_layout_mask.flags.i)) != 0) { + ubo_layout_mask.flags.i | + ubo_binding_mask.flags.i)) != 0) { _mesa_glsl_error(loc, state, - "duplicate layout qualifiers used\n"); + "duplicate layout qualifiers used"); return false; } + if (q.flags.q.prim_type) { + if (this->flags.q.prim_type && this->prim_type != q.prim_type) { + _mesa_glsl_error(loc, state, + "conflicting primitive type qualifiers used"); + return false; + } + this->prim_type = q.prim_type; + } + + if (q.flags.q.max_vertices) { + if (this->flags.q.max_vertices && this->max_vertices != q.max_vertices) { + _mesa_glsl_error(loc, state, + "geometry shader set conflicting max_vertices " + "(%d and %d)", this->max_vertices, q.max_vertices); + return false; + } + this->max_vertices = q.max_vertices; + } + if ((q.flags.i & ubo_mat_mask.flags.i) != 0) this->flags.i &= ~ubo_mat_mask.flags.i; if ((q.flags.i & ubo_layout_mask.flags.i) != 0) @@ -113,6 +166,15 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, if (q.flags.q.explicit_index) this->index = q.index; + if (q.flags.q.explicit_binding) + this->binding = q.binding; + + if (q.flags.q.explicit_offset) + this->offset = q.offset; + + if (q.precision != ast_precision_none) + this->precision = q.precision; + return true; } diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_function.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_function.cpp deleted file mode 100644 index 3a452a09c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_function.cpp +++ /dev/null @@ -1,14992 +0,0 @@ -/* DO NOT MODIFY - automatically generated by generate_builtins.py */ -/* - * Copyright © 2010 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include "main/core.h" /* for struct gl_shader */ -#include "glsl_parser_extras.h" -#include "ir_reader.h" -#include "program.h" -#include "ast.h" - -extern "C" struct gl_shader * -_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); - -gl_shader * -read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) -{ - struct gl_context fakeCtx; - fakeCtx.API = API_OPENGL; - fakeCtx.Const.GLSLVersion = 140; - fakeCtx.Extensions.ARB_ES2_compatibility = true; - fakeCtx.Const.ForceGLSLExtensionsWarn = false; - gl_shader *sh = _mesa_new_shader(NULL, 0, target); - struct _mesa_glsl_parse_state *st = - new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh); - - st->language_version = 140; - st->symbols->language_version = 140; - st->ARB_texture_rectangle_enable = true; - st->EXT_texture_array_enable = true; - st->OES_EGL_image_external_enable = true; - st->ARB_shader_bit_encoding_enable = true; - _mesa_glsl_initialize_types(st); - - sh->ir = new(sh) exec_list; - sh->symbols = st->symbols; - - /* Read the IR containing the prototypes */ - _mesa_glsl_read_ir(st, sh->ir, protos, true); - - /* Read ALL the function bodies, telling the IR reader not to scan for - * prototypes (we've already created them). The IR reader will skip any - * signature that does not already exist as a prototype. - */ - for (unsigned i = 0; i < count; i++) { - _mesa_glsl_read_ir(st, sh->ir, functions[i], false); - - if (st->error) { - printf("error reading builtin: %.35s ...\n", functions[i]); - printf("Info log:\n%s\n", st->info_log); - ralloc_free(sh); - return NULL; - } - } - - reparent_ir(sh->ir, sh); - delete st; - - return sh; -} - -static const char builtin_abs[] = - "((function abs\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float abs (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 abs (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 abs (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 abs (var_ref arg0)))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int arg0))\n" - " ((return (expression int abs (var_ref arg0)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0))\n" - " ((return (expression ivec2 abs (var_ref arg0)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0))\n" - " ((return (expression ivec3 abs (var_ref arg0)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0))\n" - " ((return (expression ivec4 abs (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_acos[] = - "((function acos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((declare () float s)\n" - " (call asin (var_ref s) ((var_ref x)))\n" - " (return (expression float - (constant float (1.5707964)) (var_ref s)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 s)\n" - " (call asin (var_ref s) ((var_ref x)))\n" - " (return (expression vec2 - (constant float (1.5707964)) (var_ref s)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 s)\n" - " (call asin (var_ref s) ((var_ref x)))\n" - " (return (expression vec3 - (constant float (1.5707964)) (var_ref s)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 s)\n" - " (call asin (var_ref s) ((var_ref x)))\n" - " (return (expression vec4 - (constant float (1.5707964)) (var_ref s)))))\n" - "))\n" - "" -; -static const char builtin_acosh[] = - "((function acosh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float log (expression float + (var_ref x) (expression float sqrt (expression float - (expression float * (var_ref x) (var_ref x)) (constant float (1)))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 log (expression vec2 + (var_ref x) (expression vec2 sqrt (expression vec2 - (expression vec2 * (var_ref x) (var_ref x)) (constant float (1)))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 log (expression vec3 + (var_ref x) (expression vec3 sqrt (expression vec3 - (expression vec3 * (var_ref x) (var_ref x)) (constant float (1)))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 log (expression vec4 + (var_ref x) (expression vec4 sqrt (expression vec4 - (expression vec4 * (var_ref x) (var_ref x)) (constant float (1)))))))))\n" - "))\n" - "" -; -static const char builtin_all[] = - "((function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))))))\n" - "\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 arg0))\n" - " ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))))))\n" - "\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0))))))\n" - "))\n" - "" -; -static const char builtin_any[] = - "((function any\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bool any (var_ref arg0)))))\n" - "\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 arg0))\n" - " ((return (expression bool any (var_ref arg0)))))\n" - "\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bool any (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_asin[] = - "((function asin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float *\n" - " (expression float sign (var_ref x))\n" - " (expression float -\n" - " (constant float (1.5707964))\n" - " (expression float *\n" - " (expression float sqrt\n" - " (expression float -\n" - " (constant float (1.0))\n" - " (expression float abs (var_ref x))))\n" - " (expression float +\n" - " (constant float (1.5707964))\n" - " (expression float *\n" - " (expression float abs (var_ref x))\n" - " (expression float +\n" - " (constant float (-0.21460183))\n" - " (expression float *\n" - " (expression float abs (var_ref x))\n" - " (expression float +\n" - " (constant float (0.086566724))\n" - " (expression float *\n" - " (expression float abs (var_ref x))\n" - " (constant float (-0.03102955))\n" - " ))))))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 *\n" - " (expression vec2 sign (var_ref x))\n" - " (expression vec2 -\n" - " (constant float (1.5707964))\n" - " (expression vec2 *\n" - " (expression vec2 sqrt\n" - " (expression vec2 -\n" - " (constant float (1.0))\n" - " (expression vec2 abs (var_ref x))))\n" - " (expression vec2 +\n" - " (constant float (1.5707964))\n" - " (expression vec2 *\n" - " (expression vec2 abs (var_ref x))\n" - " (expression vec2 +\n" - " (constant float (-0.21460183))\n" - " (expression vec2 *\n" - " (expression vec2 abs (var_ref x))\n" - " (expression vec2 +\n" - " (constant float (0.086566724))\n" - " (expression vec2 *\n" - " (expression vec2 abs (var_ref x))\n" - " (constant float (-0.03102955))\n" - " ))))))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 *\n" - " (expression vec3 sign (var_ref x))\n" - " (expression vec3 -\n" - " (constant float (1.5707964))\n" - " (expression vec3 *\n" - " (expression vec3 sqrt\n" - " (expression vec3 -\n" - " (constant float (1.0))\n" - " (expression vec3 abs (var_ref x))))\n" - " (expression vec3 +\n" - " (constant float (1.5707964))\n" - " (expression vec3 *\n" - " (expression vec3 abs (var_ref x))\n" - " (expression vec3 +\n" - " (constant float (-0.21460183))\n" - " (expression vec3 *\n" - " (expression vec3 abs (var_ref x))\n" - " (expression vec3 +\n" - " (constant float (0.086566724))\n" - " (expression vec3 *\n" - " (expression vec3 abs (var_ref x))\n" - " (constant float (-0.03102955))\n" - " ))))))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 *\n" - " (expression vec4 sign (var_ref x))\n" - " (expression vec4 -\n" - " (constant float (1.5707964))\n" - " (expression vec4 *\n" - " (expression vec4 sqrt\n" - " (expression vec4 -\n" - " (constant float (1.0))\n" - " (expression vec4 abs (var_ref x))))\n" - " (expression vec4 +\n" - " (constant float (1.5707964))\n" - " (expression vec4 *\n" - " (expression vec4 abs (var_ref x))\n" - " (expression vec4 +\n" - " (constant float (-0.21460183))\n" - " (expression vec4 *\n" - " (expression vec4 abs (var_ref x))\n" - " (expression vec4 +\n" - " (constant float (0.086566724))\n" - " (expression vec4 *\n" - " (expression vec4 abs (var_ref x))\n" - " (constant float (-0.03102955))\n" - " ))))))))))))\n" - "))\n" - "" -; -static const char builtin_asinh[] = - "((function asinh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float *\n" - " (expression float sign (var_ref x))\n" - " (expression float log\n" - " (expression float +\n" - " (expression float abs (var_ref x))\n" - " (expression float sqrt\n" - " (expression float +\n" - " (expression float * (var_ref x) (var_ref x))\n" - " (constant float (1))))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 *\n" - " (expression vec2 sign (var_ref x))\n" - " (expression vec2 log\n" - " (expression vec2 +\n" - " (expression vec2 abs (var_ref x))\n" - " (expression vec2 sqrt\n" - " (expression vec2 +\n" - " (expression vec2 * (var_ref x) (var_ref x))\n" - " (constant float (1))))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 *\n" - " (expression vec3 sign (var_ref x))\n" - " (expression vec3 log\n" - " (expression vec3 +\n" - " (expression vec3 abs (var_ref x))\n" - " (expression vec3 sqrt\n" - " (expression vec3 +\n" - " (expression vec3 * (var_ref x) (var_ref x))\n" - " (constant float (1))))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 *\n" - " (expression vec4 sign (var_ref x))\n" - " (expression vec4 log\n" - " (expression vec4 +\n" - " (expression vec4 abs (var_ref x))\n" - " (expression vec4 sqrt\n" - " (expression vec4 +\n" - " (expression vec4 * (var_ref x) (var_ref x))\n" - " (constant float (1))))))))))\n" - "))\n" - "" -; -static const char builtin_atan[] = - "((function atan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y_over_x))\n" - " ((declare () float s)\n" - " (call asin (var_ref s)\n" - " ((expression float *\n" - " (var_ref y_over_x)\n" - " (expression float rsq\n" - " (expression float +\n" - " (expression float *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0)))))))\n" - " (return (var_ref s))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ((declare () vec2 s)\n" - " (call asin (var_ref s)\n" - " ((expression vec2 *\n" - " (var_ref y_over_x)\n" - " (expression vec2 rsq\n" - " (expression vec2 +\n" - " (expression vec2 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0)))))))\n" - " (return (var_ref s))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ((declare () vec3 s)\n" - " (call asin (var_ref s)\n" - " ((expression vec3 *\n" - " (var_ref y_over_x)\n" - " (expression vec3 rsq\n" - " (expression vec3 +\n" - " (expression vec3 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0)))))))\n" - " (return (var_ref s))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y_over_x))\n" - " ((declare () vec4 s)\n" - " (call asin (var_ref s)\n" - " ((expression vec4 *\n" - " (var_ref y_over_x)\n" - " (expression vec4 rsq\n" - " (expression vec4 +\n" - " (expression vec4 *\n" - " (var_ref y_over_x)\n" - " (var_ref y_over_x))\n" - " (constant float (1.0)))))))\n" - " (return (var_ref s))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in ) float y)\n" - " (declare (in ) float x)\n" - " )\n" - " (\n" - " (declare () float r)\n" - " (if (expression bool >\n" - " (expression float abs (var_ref x))\n" - " (expression float * (constant float (1.0e-8)) (expression float abs (var_ref y)))) (\n" - " (call atan (var_ref r) ((expression float / (var_ref y) (var_ref x))))\n" - " (if (expression bool < (var_ref x) (constant float (0.000000)) ) (\n" - " (if (expression bool >= (var_ref y) (constant float (0.000000)) )\n" - " ((assign (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593)))))\n" - " ((assign (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593))))))\n" - " )\n" - " (\n" - " ))\n" - " )\n" - " (\n" - " (declare () float sgn)\n" - " (assign (x) (var_ref sgn) (expression float sign (var_ref y)))\n" - " (assign (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965))))\n" - " ))\n" - "\n" - " (return (var_ref r) )\n" - " ))\n" - "\n" - "\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 r)\n" - " (declare () float temp)\n" - " (call atan (var_ref temp) ((swiz x (var_ref y)) (swiz x (var_ref x))))\n" - " (assign (x) (var_ref r) (var_ref temp))\n" - " (call atan (var_ref temp) ((swiz y (var_ref y)) (swiz y (var_ref x))))\n" - " (assign (y) (var_ref r) (var_ref temp))\n" - " (return (var_ref r))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 r)\n" - " (declare () float temp)\n" - " (call atan (var_ref temp) ((swiz x (var_ref y)) (swiz x (var_ref x))))\n" - " (assign (x) (var_ref r) (var_ref temp))\n" - " (call atan (var_ref temp) ((swiz y (var_ref y)) (swiz y (var_ref x))))\n" - " (assign (y) (var_ref r) (var_ref temp))\n" - " (call atan (var_ref temp) ((swiz z (var_ref y)) (swiz z (var_ref x))))\n" - " (assign (z) (var_ref r) (var_ref temp))\n" - " (return (var_ref r))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 r)\n" - " (declare () float temp)\n" - " (call atan (var_ref temp) ((swiz x (var_ref y)) (swiz x (var_ref x))))\n" - " (assign (x) (var_ref r) (var_ref temp))\n" - " (call atan (var_ref temp) ((swiz y (var_ref y)) (swiz y (var_ref x))))\n" - " (assign (y) (var_ref r) (var_ref temp))\n" - " (call atan (var_ref temp) ((swiz z (var_ref y)) (swiz z (var_ref x))))\n" - " (assign (z) (var_ref r) (var_ref temp))\n" - " (call atan (var_ref temp) ((swiz w (var_ref y)) (swiz w (var_ref x))))\n" - " (assign (w) (var_ref r) (var_ref temp))\n" - " (return (var_ref r))))\n" - "\n" - "))\n" - "" -; -static const char builtin_atanh[] = - "((function atanh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float * (constant float (0.5))\n" - " (expression float log\n" - " (expression float /\n" - " (expression float + (constant float (1)) (var_ref x))\n" - " (expression float - (constant float (1)) (var_ref x))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 * (constant float (0.5))\n" - " (expression vec2 log\n" - " (expression vec2 /\n" - " (expression vec2 + (constant float (1)) (var_ref x))\n" - " (expression vec2 - (constant float (1)) (var_ref x))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 * (constant float (0.5))\n" - " (expression vec3 log\n" - " (expression vec3 /\n" - " (expression vec3 + (constant float (1)) (var_ref x))\n" - " (expression vec3 - (constant float (1)) (var_ref x))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 * (constant float (0.5))\n" - " (expression vec4 log\n" - " (expression vec4 /\n" - " (expression vec4 + (constant float (1)) (var_ref x))\n" - " (expression vec4 - (constant float (1)) (var_ref x))))))))\n" - "))\n" - "" -; -static const char builtin_ceil[] = - "((function ceil\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float ceil (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 ceil (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 ceil (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 ceil (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_clamp[] = - "((function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression float clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1)\n" - " (declare (in) vec2 arg2))\n" - " ((return (expression vec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1)\n" - " (declare (in) vec3 arg2))\n" - " ((return (expression vec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1)\n" - " (declare (in) vec4 arg2))\n" - " ((return (expression vec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression int clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1)\n" - " (declare (in) ivec2 arg2))\n" - " ((return (expression ivec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1)\n" - " (declare (in) ivec3 arg2))\n" - " ((return (expression ivec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1)\n" - " (declare (in) ivec4 arg2))\n" - " ((return (expression ivec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression ivec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression ivec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1)\n" - " (declare (in) int arg2))\n" - " ((return (expression ivec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uint clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1)\n" - " (declare (in) uvec2 arg2))\n" - " ((return (expression uvec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1)\n" - " (declare (in) uvec3 arg2))\n" - " ((return (expression uvec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1)\n" - " (declare (in) uvec4 arg2))\n" - " ((return (expression uvec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uvec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uvec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uint arg1)\n" - " (declare (in) uint arg2))\n" - " ((return (expression uvec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "))\n" - "" -; -static const char builtin_cos[] = - "((function cos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float cos (var_ref angle)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 cos (var_ref angle)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 cos (var_ref angle)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 cos (var_ref angle)))))\n" - "))\n" - "" -; -static const char builtin_cosh[] = - "((function cosh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float * (constant float (0.5))\n" - " (expression float +\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))))))\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 * (constant float (0.5))\n" - " (expression vec2 +\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 * (constant float (0.5))\n" - " (expression vec3 +\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 * (constant float (0.5))\n" - " (expression vec4 +\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" - "))\n" - "" -; -static const char builtin_cross[] = - "((function cross\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 a)\n" - " (declare (in) vec3 b))\n" - " ((return (expression vec3 -\n" - " (expression vec3 * (swiz yzx (var_ref a)) (swiz zxy (var_ref b)))\n" - " (expression vec3 * (swiz zxy (var_ref a)) (swiz yzx (var_ref b)))))))\n" - "))\n" - "" -; -static const char builtin_dFdx[] = - "((function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdx (var_ref p)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 dFdx (var_ref p)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 dFdx (var_ref p)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 dFdx (var_ref p)))))\n" - "))\n" - "" -; -static const char builtin_dFdy[] = - "((function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float dFdy (var_ref p)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 dFdy (var_ref p)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 dFdy (var_ref p)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 dFdy (var_ref p)))))\n" - "))\n" - "" -; -static const char builtin_degrees[] = - "((function degrees\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (57.295780))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (57.295780))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (57.295780))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (57.295780))))))\n" - "))\n" - "" -; -static const char builtin_distance[] = - "((function distance\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" - " ((return (expression float abs (expression float - (var_ref p0) (var_ref p1))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" - " ((declare () vec2 p)\n" - " (assign (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1)))\n" - " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" - " ((declare () vec3 p)\n" - " (assign (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1)))\n" - " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ((declare () vec4 p)\n" - " (assign (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1)))\n" - " (return (expression float sqrt (expression float dot (var_ref p) (var_ref p))))))\n" - "))\n" - "" -; -static const char builtin_dot[] = - "((function dot\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float * (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression float dot (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_equal[] = - "((function equal\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression bvec2 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression bvec3 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression bvec4 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 arg0)\n" - " (declare (in) bvec2 arg1))\n" - " ((return (expression bvec2 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 arg0)\n" - " (declare (in) bvec3 arg1))\n" - " ((return (expression bvec3 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 arg0)\n" - " (declare (in) bvec4 arg1))\n" - " ((return (expression bvec4 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression bvec2 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression bvec3 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression bvec4 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression bvec2 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression bvec3 == (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression bvec4 == (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_exp[] = - "((function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float exp (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 exp (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_exp2[] = - "((function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float exp2 (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 exp2 (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 exp2 (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 exp2 (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_faceforward[] = - "((function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" - " ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression float neg (var_ref N)))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" - " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression vec2 neg (var_ref N)))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" - " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression vec3 neg (var_ref N)))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0)))\n" - " ((return (var_ref N)))\n" - " ((return (expression vec4 neg (var_ref N)))))))\n" - "))\n" - "" -; -static const char builtin_floatBitsToInt[] = - "((function floatBitsToInt\n" - " (signature int\n" - " (parameters\n" - " (declare (in) float arg))\n" - " ((return (expression int bitcast_f2i (var_ref arg)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) vec2 arg))\n" - " ((return (expression ivec2 bitcast_f2i (var_ref arg)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) vec3 arg))\n" - " ((return (expression ivec3 bitcast_f2i (var_ref arg)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) vec4 arg))\n" - " ((return (expression ivec4 bitcast_f2i (var_ref arg)))))\n" - "))\n" - "" -; -static const char builtin_floatBitsToUint[] = - "((function floatBitsToUint\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) float arg))\n" - " ((return (expression uint bitcast_f2u (var_ref arg)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) vec2 arg))\n" - " ((return (expression uvec2 bitcast_f2u (var_ref arg)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) vec3 arg))\n" - " ((return (expression uvec3 bitcast_f2u (var_ref arg)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) vec4 arg))\n" - " ((return (expression uvec4 bitcast_f2u (var_ref arg)))))\n" - "))\n" - "" -; -static const char builtin_floor[] = - "((function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float floor (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 floor (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 floor (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 floor (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_fract[] = - "((function fract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float fract (var_ref x)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 fract (var_ref x)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 fract (var_ref x)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 fract (var_ref x)))))\n" - "))\n" - "\n" - "" -; -static const char builtin_ftransform[] = - "((declare (uniform) mat4 gl_ModelViewProjectionMatrix)\n" - " (declare (in) vec4 gl_Vertex)\n" - " (function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ((return (expression vec4 *\n" - " (var_ref gl_ModelViewProjectionMatrix)\n" - " (var_ref gl_Vertex)))))\n" - "))\n" - "" -; -static const char builtin_fwidth[] = - "((function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ((return (expression float +\n" - " (expression float abs (expression float dFdx (var_ref p)))\n" - " (expression float abs (expression float dFdy (var_ref p)))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ((return (expression vec2 +\n" - " (expression vec2 abs (expression vec2 dFdx (var_ref p)))\n" - " (expression vec2 abs (expression vec2 dFdy (var_ref p)))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ((return (expression vec3 +\n" - " (expression vec3 abs (expression vec3 dFdx (var_ref p)))\n" - " (expression vec3 abs (expression vec3 dFdy (var_ref p)))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ((return (expression vec4 +\n" - " (expression vec4 abs (expression vec4 dFdx (var_ref p)))\n" - " (expression vec4 abs (expression vec4 dFdy (var_ref p)))))))\n" - "))\n" - "" -; -static const char builtin_greaterThan[] = - "((function greaterThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression bvec2 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression bvec3 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression bvec4 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression bvec2 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression bvec3 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression bvec4 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression bvec2 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression bvec3 > (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression bvec4 > (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_greaterThanEqual[] = - "((function greaterThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_intBitsToFloat[] = - "((function intBitsToFloat\n" - " (signature float\n" - " (parameters\n" - " (declare (in) int arg))\n" - " ((return (expression float bitcast_i2f (var_ref arg)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) ivec2 arg))\n" - " ((return (expression vec2 bitcast_i2f (var_ref arg)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) ivec3 arg))\n" - " ((return (expression vec3 bitcast_i2f (var_ref arg)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) ivec4 arg))\n" - " ((return (expression vec4 bitcast_i2f (var_ref arg)))))\n" - "))\n" - "" -; -static const char builtin_inverse[] = - "(\n" - "(function inverse\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 m))\n" - " (\n" - " (declare () float det)\n" - " (declare () mat2 adj)\n" - " (declare (temporary) float assignment_tmp)\n" - " (assign (x) (var_ref assignment_tmp) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (0))) (var_ref assignment_tmp)) \n" - " (declare (temporary) float assignment_tmp@2)\n" - " (assign (x) (var_ref assignment_tmp@2) (expression float neg (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (1))) (var_ref assignment_tmp@2)) \n" - " (declare (temporary) float assignment_tmp@3)\n" - " (assign (x) (var_ref assignment_tmp@3) (expression float neg (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (0))) (var_ref assignment_tmp@3)) \n" - " (declare (temporary) float assignment_tmp@4)\n" - " (assign (x) (var_ref assignment_tmp@4) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (1))) (var_ref assignment_tmp@4)) \n" - " (declare (temporary) float assignment_tmp@5)\n" - " (assign (x) (var_ref assignment_tmp@5) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1)))))) \n" - " (assign (x) (var_ref det) (var_ref assignment_tmp@5)) \n" - " (return (expression mat2 / (var_ref adj) (var_ref det)))))\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 m))\n" - " (\n" - " (declare () float det)\n" - " (declare () mat3 adj)\n" - " (declare (temporary) float assignment_tmp)\n" - " (assign (x) (var_ref assignment_tmp) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (0))) (var_ref assignment_tmp)) \n" - " (declare (temporary) float assignment_tmp@6)\n" - " (assign (x) (var_ref assignment_tmp@6) (expression float neg (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (0))) (var_ref assignment_tmp@6)) \n" - " (declare (temporary) float assignment_tmp@7)\n" - " (assign (x) (var_ref assignment_tmp@7) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1)))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (0))) (var_ref assignment_tmp@7)) \n" - " (declare (temporary) float assignment_tmp@8)\n" - " (assign (x) (var_ref assignment_tmp@8) (expression float neg (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (1))) (var_ref assignment_tmp@8)) \n" - " (declare (temporary) float assignment_tmp@9)\n" - " (assign (x) (var_ref assignment_tmp@9) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2)))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (1))) (var_ref assignment_tmp@9)) \n" - " (declare (temporary) float assignment_tmp@10)\n" - " (assign (x) (var_ref assignment_tmp@10) (expression float neg (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (1))) (var_ref assignment_tmp@10)) \n" - " (declare (temporary) float assignment_tmp@11)\n" - " (assign (x) (var_ref assignment_tmp@11) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2)))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (2))) (var_ref assignment_tmp@11)) \n" - " (declare (temporary) float assignment_tmp@12)\n" - " (assign (x) (var_ref assignment_tmp@12) (expression float neg (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (2))) (var_ref assignment_tmp@12)) \n" - " (declare (temporary) float assignment_tmp@13)\n" - " (assign (x) (var_ref assignment_tmp@13) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1)))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (2))) (var_ref assignment_tmp@13)) \n" - " (declare (temporary) float assignment_tmp@14)\n" - " (assign (x) (var_ref assignment_tmp@14) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1)))))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))))))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0)))))))) \n" - " (assign (x) (var_ref det) (var_ref assignment_tmp@14)) \n" - " (return (expression mat3 / (var_ref adj) (var_ref det)))))\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 m))\n" - " (\n" - " (declare () float det)\n" - " (declare () mat4 adj)\n" - " (declare () float SubFactor18)\n" - " (declare () float SubFactor17)\n" - " (declare () float SubFactor16)\n" - " (declare () float SubFactor15)\n" - " (declare () float SubFactor14)\n" - " (declare () float SubFactor13)\n" - " (declare () float SubFactor12)\n" - " (declare () float SubFactor11)\n" - " (declare () float SubFactor10)\n" - " (declare () float SubFactor09)\n" - " (declare () float SubFactor08)\n" - " (declare () float SubFactor07)\n" - " (declare () float SubFactor06)\n" - " (declare () float SubFactor05)\n" - " (declare () float SubFactor04)\n" - " (declare () float SubFactor03)\n" - " (declare () float SubFactor02)\n" - " (declare () float SubFactor01)\n" - " (declare () float SubFactor00)\n" - " (declare (temporary) float assignment_tmp)\n" - " (assign (x) (var_ref assignment_tmp) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor00) (var_ref assignment_tmp)) \n" - " (declare (temporary) float assignment_tmp@15)\n" - " (assign (x) (var_ref assignment_tmp@15) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor01) (var_ref assignment_tmp@15)) \n" - " (declare (temporary) float assignment_tmp@16)\n" - " (assign (x) (var_ref assignment_tmp@16) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))))) \n" - " (assign (x) (var_ref SubFactor02) (var_ref assignment_tmp@16)) \n" - " (declare (temporary) float assignment_tmp@17)\n" - " (assign (x) (var_ref assignment_tmp@17) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor03) (var_ref assignment_tmp@17)) \n" - " (declare (temporary) float assignment_tmp@18)\n" - " (assign (x) (var_ref assignment_tmp@18) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))))) \n" - " (assign (x) (var_ref SubFactor04) (var_ref assignment_tmp@18)) \n" - " (declare (temporary) float assignment_tmp@19)\n" - " (assign (x) (var_ref assignment_tmp@19) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1)))))) \n" - " (assign (x) (var_ref SubFactor05) (var_ref assignment_tmp@19)) \n" - " (declare (temporary) float assignment_tmp@20)\n" - " (assign (x) (var_ref assignment_tmp@20) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor06) (var_ref assignment_tmp@20)) \n" - " (declare (temporary) float assignment_tmp@21)\n" - " (assign (x) (var_ref assignment_tmp@21) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor07) (var_ref assignment_tmp@21)) \n" - " (declare (temporary) float assignment_tmp@22)\n" - " (assign (x) (var_ref assignment_tmp@22) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))))) \n" - " (assign (x) (var_ref SubFactor08) (var_ref assignment_tmp@22)) \n" - " (declare (temporary) float assignment_tmp@23)\n" - " (assign (x) (var_ref assignment_tmp@23) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor09) (var_ref assignment_tmp@23)) \n" - " (declare (temporary) float assignment_tmp@24)\n" - " (assign (x) (var_ref assignment_tmp@24) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))))) \n" - " (assign (x) (var_ref SubFactor10) (var_ref assignment_tmp@24)) \n" - " (declare (temporary) float assignment_tmp@25)\n" - " (assign (x) (var_ref assignment_tmp@25) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor11) (var_ref assignment_tmp@25)) \n" - " (declare (temporary) float assignment_tmp@26)\n" - " (assign (x) (var_ref assignment_tmp@26) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (3))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1)))))) \n" - " (assign (x) (var_ref SubFactor12) (var_ref assignment_tmp@26)) \n" - " (declare (temporary) float assignment_tmp@27)\n" - " (assign (x) (var_ref assignment_tmp@27) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor13) (var_ref assignment_tmp@27)) \n" - " (declare (temporary) float assignment_tmp@28)\n" - " (assign (x) (var_ref assignment_tmp@28) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor14) (var_ref assignment_tmp@28)) \n" - " (declare (temporary) float assignment_tmp@29)\n" - " (assign (x) (var_ref assignment_tmp@29) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))))) \n" - " (assign (x) (var_ref SubFactor15) (var_ref assignment_tmp@29)) \n" - " (declare (temporary) float assignment_tmp@30)\n" - " (assign (x) (var_ref assignment_tmp@30) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (3)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3)))))) \n" - " (assign (x) (var_ref SubFactor16) (var_ref assignment_tmp@30)) \n" - " (declare (temporary) float assignment_tmp@31)\n" - " (assign (x) (var_ref assignment_tmp@31) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (2)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2)))))) \n" - " (assign (x) (var_ref SubFactor17) (var_ref assignment_tmp@31)) \n" - " (declare (temporary) float assignment_tmp@32)\n" - " (assign (x) (var_ref assignment_tmp@32) (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (1)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (2))) (constant int (0))) (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1)))))) \n" - " (assign (x) (var_ref SubFactor18) (var_ref assignment_tmp@32)) \n" - " (declare (temporary) float assignment_tmp@33)\n" - " (assign (x) (var_ref assignment_tmp@33) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (var_ref SubFactor00)) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (var_ref SubFactor01))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3))) (var_ref SubFactor02)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (0))) (var_ref assignment_tmp@33)) \n" - " (declare (temporary) float assignment_tmp@34)\n" - " (assign (x) (var_ref assignment_tmp@34) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (var_ref SubFactor00)) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (var_ref SubFactor03))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3))) (var_ref SubFactor04))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (0))) (var_ref assignment_tmp@34)) \n" - " (declare (temporary) float assignment_tmp@35)\n" - " (assign (x) (var_ref assignment_tmp@35) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (var_ref SubFactor01)) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (var_ref SubFactor03))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (3))) (var_ref SubFactor05)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (0))) (var_ref assignment_tmp@35)) \n" - " (declare (temporary) float assignment_tmp@36)\n" - " (assign (x) (var_ref assignment_tmp@36) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (0))) (var_ref SubFactor02)) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (1))) (var_ref SubFactor04))) (expression float * (array_ref (array_ref (var_ref m) (constant int (1))) (constant int (2))) (var_ref SubFactor05))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (3))) (constant int (0))) (var_ref assignment_tmp@36)) \n" - " (declare (temporary) float assignment_tmp@37)\n" - " (assign (x) (var_ref assignment_tmp@37) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor00)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor01))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor02))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (1))) (var_ref assignment_tmp@37)) \n" - " (declare (temporary) float assignment_tmp@38)\n" - " (assign (x) (var_ref assignment_tmp@38) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor00)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor03))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor04)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (1))) (var_ref assignment_tmp@38)) \n" - " (declare (temporary) float assignment_tmp@39)\n" - " (assign (x) (var_ref assignment_tmp@39) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor01)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor03))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor05))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (1))) (var_ref assignment_tmp@39)) \n" - " (declare (temporary) float assignment_tmp@40)\n" - " (assign (x) (var_ref assignment_tmp@40) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor02)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor04))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor05)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (3))) (constant int (1))) (var_ref assignment_tmp@40)) \n" - " (declare (temporary) float assignment_tmp@41)\n" - " (assign (x) (var_ref assignment_tmp@41) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor06)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor07))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor08)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (2))) (var_ref assignment_tmp@41)) \n" - " (declare (temporary) float assignment_tmp@42)\n" - " (assign (x) (var_ref assignment_tmp@42) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor06)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor09))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor10))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (2))) (var_ref assignment_tmp@42)) \n" - " (declare (temporary) float assignment_tmp@43)\n" - " (assign (x) (var_ref assignment_tmp@43) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor11)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor09))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor12)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (2))) (var_ref assignment_tmp@43)) \n" - " (declare (temporary) float assignment_tmp@44)\n" - " (assign (x) (var_ref assignment_tmp@44) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor08)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor10))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor12))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (3))) (constant int (2))) (var_ref assignment_tmp@44)) \n" - " (declare (temporary) float assignment_tmp@45)\n" - " (assign (x) (var_ref assignment_tmp@45) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor13)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor14))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor15))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (3))) (var_ref assignment_tmp@45)) \n" - " (declare (temporary) float assignment_tmp@46)\n" - " (assign (x) (var_ref assignment_tmp@46) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor13)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor16))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor17)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (3))) (var_ref assignment_tmp@46)) \n" - " (declare (temporary) float assignment_tmp@47)\n" - " (assign (x) (var_ref assignment_tmp@47) (expression float neg (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor14)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor16))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (var_ref SubFactor18))))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (3))) (var_ref assignment_tmp@47)) \n" - " (declare (temporary) float assignment_tmp@48)\n" - " (assign (x) (var_ref assignment_tmp@48) (expression float + (expression float - (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (var_ref SubFactor15)) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (var_ref SubFactor17))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (var_ref SubFactor18)))) \n" - " (assign (x) (array_ref (array_ref (var_ref adj) (constant int (3))) (constant int (3))) (var_ref assignment_tmp@48)) \n" - " (declare (temporary) float assignment_tmp@49)\n" - " (assign (x) (var_ref assignment_tmp@49) (expression float + (expression float + (expression float + (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (0))) (array_ref (array_ref (var_ref adj) (constant int (0))) (constant int (0)))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (1))) (array_ref (array_ref (var_ref adj) (constant int (1))) (constant int (0))))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (2))) (array_ref (array_ref (var_ref adj) (constant int (2))) (constant int (0))))) (expression float * (array_ref (array_ref (var_ref m) (constant int (0))) (constant int (3))) (array_ref (array_ref (var_ref adj) (constant int (3))) (constant int (0)))))) \n" - " (assign (x) (var_ref det) (var_ref assignment_tmp@49)) \n" - " (return (expression mat4 / (var_ref adj) (var_ref det)))))))" -; -static const char builtin_inversesqrt[] = - "((function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float rsq (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 rsq (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 rsq (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 rsq (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_isinf[] = - "((function isinf\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression bool == (expression float abs (var_ref x)) (constant float (+INF))))))\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression bvec2 == (expression vec2 abs (var_ref x)) (constant vec2 (+INF +INF))))))\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression bvec3 == (expression vec3 abs (var_ref x)) (constant vec3 (+INF +INF +INF))))))\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression bvec4 == (expression vec4 abs (var_ref x)) (constant vec4 (+INF +INF +INF +INF))))))))\n" - "" -; -static const char builtin_isnan[] = - "((function isnan\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression bool != (var_ref x) (var_ref x)))))\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression bvec2 != (var_ref x) (var_ref x)))))\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression bvec3 != (var_ref x) (var_ref x)))))\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression bvec4 != (var_ref x) (var_ref x)))))))\n" - "" -; -static const char builtin_length[] = - "((function length\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float abs (var_ref arg0)))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0))))))\n" - "))\n" - "" -; -static const char builtin_lessThan[] = - "((function lessThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression bvec2 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression bvec3 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression bvec4 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression bvec2 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression bvec3 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression bvec4 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression bvec2 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression bvec3 < (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression bvec4 < (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_lessThanEqual[] = - "((function lessThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_log[] = - "((function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 log (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 log (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 log (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_log2[] = - "((function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float log2 (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 log2 (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 log2 (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 log2 (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_matrixCompMult[] = - "((function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ((declare () mat2 z)\n" - " (assign (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" - " ((declare () mat3 z)\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" - " ((declare () mat4 z)\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" - " ((declare () mat2x3 z)\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" - " ((declare () mat3x2 z)\n" - " (assign (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - " (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ((declare () mat2x4 z)\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" - " ((declare () mat4x2 z)\n" - " (assign (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - " (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n" - " (assign (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" - " ((declare () mat3x4 z)\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - " (assign (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n" - "(return (var_ref z))))\n" - "\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ((declare () mat4x3 z)\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0)))))\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1)))))\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2)))))\n" - " (assign (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3)))))\n" - "(return (var_ref z))))\n" - "))\n" - "" -; -static const char builtin_max[] = - "((function max\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression int max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec2 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec3 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec4 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uint max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec2 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec3 max (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec4 max (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_min[] = - "((function min\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression int min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec2 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec3 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) int arg1))\n" - " ((return (expression ivec4 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) uint arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uint min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec2 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec3 min (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uint arg1))\n" - " ((return (expression uvec4 min (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_mix[] = - "((function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression float mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1)\n" - " (declare (in) vec2 arg2))\n" - " ((return (expression vec2 mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1)\n" - " (declare (in) vec3 arg2))\n" - " ((return (expression vec3 mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1)\n" - " (declare (in) vec4 arg2))\n" - " ((return (expression vec4 mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec2 mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec3 mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1)\n" - " (declare (in) float arg2))\n" - " ((return (expression vec4 mix (var_ref arg0) (var_ref arg1) (var_ref arg2)))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float v1)\n" - " (declare (in) float v2)\n" - " (declare (in) bool a))\n" - " ((assign (var_ref a) (x) (var_ref v1) (var_ref v2))\n" - " (return (var_ref v1))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 v1)\n" - " (declare (in) vec2 v2)\n" - " (declare (in) bvec2 a))\n" - " ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))\n" - " (return (var_ref v1))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 v1)\n" - " (declare (in) vec3 v2)\n" - " (declare (in) bvec3 a))\n" - " ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))\n" - " (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2)))\n" - " (return (var_ref v1))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 v1)\n" - " (declare (in) vec4 v2)\n" - " (declare (in) bvec4 a))\n" - " ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2)))\n" - " (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2)))\n" - " (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2)))\n" - " (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2)))\n" - " (return (var_ref v1))))\n" - "))\n" - "" -; -static const char builtin_mod[] = - "((function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec2 % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec3 % (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression vec4 % (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_modf[] = - "((function modf\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (out) float i))\n" - " ((declare () float t)\n" - " (assign (x) (var_ref t) (expression float trunc (var_ref x)))\n" - " (assign (x) (var_ref i) (var_ref t))\n" - " (return (expression float - (var_ref x) (var_ref t)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (out) vec2 i))\n" - " ((declare () vec2 t)\n" - " (assign (xy) (var_ref t) (expression vec2 trunc (var_ref x)))\n" - " (assign (xy) (var_ref i) (var_ref t))\n" - " (return (expression vec2 - (var_ref x) (var_ref t)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (out) vec3 i))\n" - " ((declare () vec3 t)\n" - " (assign (xyz) (var_ref t) (expression vec3 trunc (var_ref x)))\n" - " (assign (xyz) (var_ref i) (var_ref t))\n" - " (return (expression vec3 - (var_ref x) (var_ref t)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (out) vec4 i))\n" - " ((declare () vec4 t)\n" - " (assign (xyzw) (var_ref t) (expression vec4 trunc (var_ref x)))\n" - " (assign (xyzw) (var_ref i) (var_ref t))\n" - " (return (expression vec4 - (var_ref x) (var_ref t)))))\n" - "))\n" - "" -; -static const char builtin_noise1[] = - "((function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float noise (var_ref x)))))\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression float noise (var_ref x)))))\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression float noise (var_ref x)))))\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression float noise (var_ref x)))))\n" - "))\n" - "" -; -static const char builtin_noise2[] = - "((function noise2\n" - " (signature vec2\n" - " (parameters (declare (in) vec4 p))\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () vec2 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (return (var_ref t))\n" - " ))\n" - "\n" - " (signature vec2\n" - " (parameters (declare (in) vec3 p))\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () vec2 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (return (var_ref t))\n" - " ))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in ) vec2 p)\n" - " )\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () vec2 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (return (var_ref t))\n" - " ))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in ) float p)\n" - " )\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () vec2 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (return (var_ref t))\n" - " ))\n" - "))\n" - "" -; -static const char builtin_noise3[] = - "((function noise3\n" - " (signature vec3\n" - " (parameters (declare (in) vec4 p))\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () float c)\n" - " (declare () vec3 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" - " (assign (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0)))))\n" - "\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (assign (z) (var_ref t) (var_ref c))\n" - " (return (var_ref t))\n" - " ))\n" - "\n" - " (signature vec3\n" - " (parameters (declare (in) vec3 p))\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () float c)\n" - " (declare () vec3 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n" - " (assign (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0)))))\n" - "\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (assign (z) (var_ref t) (var_ref c))\n" - " (return (var_ref t))\n" - " ))\n" - "\n" - " (signature vec3\n" - " (parameters (declare (in) vec2 p))\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () float c)\n" - " (declare () vec3 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n" - " (assign (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0)))))\n" - "\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (assign (z) (var_ref t) (var_ref c))\n" - " (return (var_ref t))\n" - " ))\n" - "\n" - " (signature vec3\n" - " (parameters (declare (in) float p))\n" - " (\n" - " (declare () float a)\n" - " (declare () float b)\n" - " (declare () float c)\n" - " (declare () vec3 t)\n" - "\n" - " (assign (x) (var_ref a) (expression float noise (var_ref p)))\n" - " (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0)))))\n" - " (assign (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0)))))\n" - "\n" - " (assign (x) (var_ref t) (var_ref a))\n" - " (assign (y) (var_ref t) (var_ref b))\n" - " (assign (z) (var_ref t) (var_ref c))\n" - " (return (var_ref t))\n" - " ))\n" - "))\n" - "" -; -static const char builtin_noise4[] = - "((function noise4\n" - " (signature vec4\n" - " (parameters (declare (in) vec4 p))\n" - " (\n" - " (declare () float _x)\n" - " (declare () float _y)\n" - " (declare () float _z)\n" - " (declare () float _w)\n" - " (declare () vec4 _r)\n" - "\n" - " (declare () vec4 _p)\n" - " (assign (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) )\n" - "\n" - " (assign (x) (var_ref _x) (expression float noise(var_ref p)))\n" - " (assign (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" - " (assign (x) (var_ref _z) (expression float noise(var_ref _p)))\n" - " (assign (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0)))))\n" - "\n" - " (assign (x) (var_ref _r) (var_ref _x))\n" - " (assign (y) (var_ref _r) (var_ref _y))\n" - " (assign (z) (var_ref _r) (var_ref _z))\n" - " (assign (w) (var_ref _r) (var_ref _w))\n" - " (return (var_ref _r))\n" - " ))\n" - "\n" - " (signature vec4\n" - " (parameters (declare (in) vec3 p))\n" - " (\n" - " (declare () float _x)\n" - " (declare () float _y)\n" - " (declare () float _z)\n" - " (declare () float _w)\n" - " (declare () vec4 _r)\n" - "\n" - " (declare () vec3 _p)\n" - " (assign (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) )\n" - "\n" - " (assign (x) (var_ref _x) (expression float noise(var_ref p)))\n" - " (assign (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0)))))\n" - " (assign (x) (var_ref _z) (expression float noise(var_ref _p)))\n" - " (assign (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0)))))\n" - "\n" - " (assign (x) (var_ref _r) (var_ref _x))\n" - " (assign (y) (var_ref _r) (var_ref _y))\n" - " (assign (z) (var_ref _r) (var_ref _z))\n" - " (assign (w) (var_ref _r) (var_ref _w))\n" - " (return (var_ref _r))\n" - " ))\n" - "\n" - " (signature vec4\n" - " (parameters (declare (in) vec2 p))\n" - " (\n" - " (declare () float _x)\n" - " (declare () float _y)\n" - " (declare () float _z)\n" - " (declare () float _w)\n" - " (declare () vec4 _r)\n" - "\n" - " (declare () vec2 _p)\n" - " (assign (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) )\n" - "\n" - " (assign (x) (var_ref _x) (expression float noise(var_ref p)))\n" - " (assign (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0)))))\n" - " (assign (x) (var_ref _z) (expression float noise(var_ref _p)))\n" - " (assign (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0)))))\n" - "\n" - " (assign (x) (var_ref _r) (var_ref _x))\n" - " (assign (y) (var_ref _r) (var_ref _y))\n" - " (assign (z) (var_ref _r) (var_ref _z))\n" - " (assign (w) (var_ref _r) (var_ref _w))\n" - " (return (var_ref _r))\n" - " ))\n" - "\n" - " (signature vec4\n" - " (parameters (declare (in) float p))\n" - " (\n" - " (declare () float _x)\n" - " (declare () float _y)\n" - " (declare () float _z)\n" - " (declare () float _w)\n" - " (declare () vec4 _r)\n" - "\n" - " (declare () float _p)\n" - " (assign (x) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) )\n" - "\n" - " (assign (x) (var_ref _x) (expression float noise(var_ref p)))\n" - " (assign (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0)))))\n" - " (assign (x) (var_ref _z) (expression float noise(var_ref _p)))\n" - " (assign (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0)))))\n" - "\n" - " (assign (x) (var_ref _r) (var_ref _x))\n" - " (assign (y) (var_ref _r) (var_ref _y))\n" - " (assign (z) (var_ref _r) (var_ref _z))\n" - " (assign (w) (var_ref _r) (var_ref _w))\n" - " (return (var_ref _r))\n" - " ))\n" - "))\n" - "" -; -static const char builtin_normalize[] = - "((function normalize\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float sign (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 normalize (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 normalize (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 normalize (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_not[] = - "((function not\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 arg0))\n" - " ((return (expression bvec2 ! (var_ref arg0)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 arg0))\n" - " ((return (expression bvec3 ! (var_ref arg0)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 arg0))\n" - " ((return (expression bvec4 ! (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_notEqual[] = - "((function notEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression bvec2 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression bvec3 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression bvec4 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 arg0)\n" - " (declare (in) bvec2 arg1))\n" - " ((return (expression bvec2 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 arg0)\n" - " (declare (in) bvec3 arg1))\n" - " ((return (expression bvec3 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 arg0)\n" - " (declare (in) bvec4 arg1))\n" - " ((return (expression bvec4 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 arg0)\n" - " (declare (in) ivec2 arg1))\n" - " ((return (expression bvec2 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 arg0)\n" - " (declare (in) ivec3 arg1))\n" - " ((return (expression bvec3 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 arg0)\n" - " (declare (in) ivec4 arg1))\n" - " ((return (expression bvec4 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) uvec2 arg0)\n" - " (declare (in) uvec2 arg1))\n" - " ((return (expression bvec2 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) uvec3 arg0)\n" - " (declare (in) uvec3 arg1))\n" - " ((return (expression bvec3 != (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) uvec4 arg0)\n" - " (declare (in) uvec4 arg1))\n" - " ((return (expression bvec4 != (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_outerProduct[] = - "((function outerProduct\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec2 v))\n" - " ((declare () mat2 m)\n" - " (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec2 v))\n" - " ((declare () mat2x3 m)\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec2 v))\n" - " ((declare () mat2x4 m)\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3x2 m)\n" - " (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))\n" - " ))\n" - "\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3 m)\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec3 v))\n" - " ((declare () mat3x4 m)\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) vec2 u)\n" - " (declare (in) vec4 v))\n" - " ((declare () mat4x2 m)\n" - " (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v))))\n" - " (assign (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) vec3 u)\n" - " (declare (in) vec4 v))\n" - " ((declare () mat4x3 m)\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v))))\n" - " (assign (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v))))\n" - " (return (var_ref m))))\n" - "\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) vec4 u)\n" - " (declare (in) vec4 v))\n" - " ((declare () mat4 m)\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v))))\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v))))\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v))))\n" - " (assign (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v))))\n" - " (return (var_ref m))))\n" - "))\n" - "" -; -static const char builtin_pow[] = - "((function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0)\n" - " (declare (in) float arg1))\n" - " ((return (expression float pow (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0)\n" - " (declare (in) vec2 arg1))\n" - " ((return (expression vec2 pow (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0)\n" - " (declare (in) vec3 arg1))\n" - " ((return (expression vec3 pow (var_ref arg0) (var_ref arg1)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0)\n" - " (declare (in) vec4 arg1))\n" - " ((return (expression vec4 pow (var_ref arg0) (var_ref arg1)))))\n" - "))\n" - "" -; -static const char builtin_radians[] = - "((function radians\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float * (var_ref arg0) (constant float (0.0174532925))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 * (var_ref arg0) (constant float (0.0174532925))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 * (var_ref arg0) (constant float (0.0174532925))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 * (var_ref arg0) (constant float (0.0174532925))))))\n" - "))\n" - "" -; -static const char builtin_reflect[] = - "((function reflect\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float i)\n" - " (declare (in) float n))\n" - " ((return (expression float -\n" - " (var_ref i)\n" - " (expression float *\n" - " (constant float (2.0))\n" - " (expression float *\n" - " (expression float *\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 i)\n" - " (declare (in) vec2 n))\n" - " ((return (expression vec2 -\n" - " (var_ref i)\n" - " (expression vec2 *\n" - " (constant float (2.0))\n" - " (expression vec2 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 i)\n" - " (declare (in) vec3 n))\n" - " ((return (expression vec3 -\n" - " (var_ref i)\n" - " (expression vec3 *\n" - " (constant float (2.0))\n" - " (expression vec3 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 i)\n" - " (declare (in) vec4 n))\n" - " ((return (expression vec4 -\n" - " (var_ref i)\n" - " (expression vec4 *\n" - " (constant float (2.0))\n" - " (expression vec4 *\n" - " (expression float dot\n" - " (var_ref n)\n" - " (var_ref i))\n" - " (var_ref n)))))))\n" - "\n" - "))\n" - "" -; -static const char builtin_refract[] = - "((function refract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float i)\n" - " (declare (in) float n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (x) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float * (var_ref n) (var_ref i))\n" - " (expression float * (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant float (0.0))))\n" - " ((return (expression float -\n" - " (expression float * (var_ref eta) (var_ref i))\n" - " (expression float *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 i)\n" - " (declare (in) vec2 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (x) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float dot (var_ref n) (var_ref i))\n" - " (expression float dot (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec2 (0.0 0.0))))\n" - " ((return (expression vec2 -\n" - " (expression vec2 * (var_ref eta) (var_ref i))\n" - " (expression vec2 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 i)\n" - " (declare (in) vec3 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (x) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float dot (var_ref n) (var_ref i))\n" - " (expression float dot (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec3 (0.0 0.0 0.0))))\n" - " ((return (expression vec3 -\n" - " (expression vec3 * (var_ref eta) (var_ref i))\n" - " (expression vec3 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 i)\n" - " (declare (in) vec4 n)\n" - " (declare (in) float eta))\n" - " ((declare () float k)\n" - " (assign (x) (var_ref k)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * (var_ref eta)\n" - " (expression float * (var_ref eta)\n" - " (expression float - (constant float (1.0))\n" - " (expression float * \n" - " (expression float dot (var_ref n) (var_ref i))\n" - " (expression float dot (var_ref n) (var_ref i))))))))\n" - " (if (expression bool < (var_ref k) (constant float (0.0)))\n" - " ((return (constant vec4 (0.0 0.0 0.0 0.0))))\n" - " ((return (expression vec4 -\n" - " (expression vec4 * (var_ref eta) (var_ref i))\n" - " (expression vec4 *\n" - " (expression float +\n" - " (expression float * (var_ref eta)\n" - " (expression float dot (var_ref n) (var_ref i)))\n" - " (expression float sqrt (var_ref k)))\n" - " (var_ref n))))))))\n" - "\n" - "))\n" - "" -; -static const char builtin_round[] = - "((function round\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float round_even (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 round_even (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 round_even (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 round_even (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_roundEven[] = - "((function roundEven\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float round_even (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 round_even (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 round_even (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 round_even (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_shadow1D[] = - "((function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DArray[] = - "((function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DArrayLod[] = - "((function shadow1DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DGradARB[] = - "((function shadow1DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DLod[] = - "((function shadow1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DProj[] = - "((function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DProjGradARB[] = - "((function shadow1DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow1DProjLod[] = - "((function shadow1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2D[] = - "((function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DArray[] = - "((function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DEXT[] = - "((function shadow2DEXT\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DGradARB[] = - "((function shadow2DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DLod[] = - "((function shadow2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DProj[] = - "((function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DProjEXT[] = - "((function shadow2DProjEXT\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DProjGradARB[] = - "((function shadow2DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DProjLod[] = - "((function shadow2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DRect[] = - "((function shadow2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DRectGradARB[] = - "((function shadow2DRectGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DRectProj[] = - "((function shadow2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_shadow2DRectProjGradARB[] = - "((function shadow2DRectProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_sign[] = - "((function sign\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float sign (var_ref x)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 sign (var_ref x)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 sign (var_ref x)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 sign (var_ref x)))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) int x))\n" - " ((return (expression int sign (var_ref x)))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) ivec2 x))\n" - " ((return (expression ivec2 sign (var_ref x)))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) ivec3 x))\n" - " ((return (expression ivec3 sign (var_ref x)))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) ivec4 x))\n" - " ((return (expression ivec4 sign (var_ref x)))))\n" - "))\n" - "\n" - "" -; -static const char builtin_sin[] = - "((function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float sin (var_ref angle)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 sin (var_ref angle)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 sin (var_ref angle)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 sin (var_ref angle)))))\n" - "))\n" - "" -; -static const char builtin_sinh[] = - "((function sinh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float * (constant float (0.5))\n" - " (expression float -\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))))))\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 * (constant float (0.5))\n" - " (expression vec2 -\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 * (constant float (0.5))\n" - " (expression vec3 -\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 * (constant float (0.5))\n" - " (expression vec4 -\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" - "))\n" - "" -; -static const char builtin_smoothstep[] = - "((function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ((declare () float t)\n" - " (assign (x) (var_ref t)\n" - " (expression float max\n" - " (expression float min\n" - " (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t))))))))\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (xy) (var_ref t)\n" - " (expression vec2 max\n" - " (expression vec2 min\n" - " (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (xyz) (var_ref t)\n" - " (expression vec3 max\n" - " (expression vec3 min\n" - " (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))\n" - "\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (xyzw) (var_ref t)\n" - " (expression vec4 max\n" - " (expression vec4 min\n" - " (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (xy) (var_ref t)\n" - " (expression vec2 max\n" - " (expression vec2 min\n" - " (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t))))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (xyz) (var_ref t)\n" - " (expression vec3 max\n" - " (expression vec3 min\n" - " (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t))))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (xyzw) (var_ref t)\n" - " (expression vec4 max\n" - " (expression vec4 min\n" - " (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0)))\n" - " (constant float (1.0)))\n" - " (constant float (0.0))))\n" - " (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t))))))))\n" - "))\n" - "\n" - "" -; -static const char builtin_sqrt[] = - "((function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float sqrt (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 sqrt (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 sqrt (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 sqrt (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_step[] = - "((function step\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge))))\n" - " (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge))))\n" - " (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge))))\n" - " (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" - " ((declare () vec2 t)\n" - " (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" - " (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" - " ((declare () vec3 t)\n" - " (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" - " (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" - " (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n" - " (return (var_ref t))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" - " ((declare () vec4 t)\n" - " (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge)))))\n" - " (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge)))))\n" - " (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge)))))\n" - " (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge)))))\n" - " (return (var_ref t))))\n" - "))\n" - "\n" - "" -; -static const char builtin_tan[] = - "((function tan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle))))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle))))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle))))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle))))))\n" - "))\n" - "" -; -static const char builtin_tanh[] = - "((function tanh\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ((return (expression float /\n" - " (expression float -\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))\n" - " (expression float +\n" - " (expression float exp (var_ref x))\n" - " (expression float exp (expression float neg (var_ref x))))))))\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ((return (expression vec2 /\n" - " (expression vec2 -\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))\n" - " (expression vec2 +\n" - " (expression vec2 exp (var_ref x))\n" - " (expression vec2 exp (expression vec2 neg (var_ref x))))))))\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ((return (expression vec3 /\n" - " (expression vec3 -\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))\n" - " (expression vec3 +\n" - " (expression vec3 exp (var_ref x))\n" - " (expression vec3 exp (expression vec3 neg (var_ref x))))))))\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ((return (expression vec4 /\n" - " (expression vec4 -\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))\n" - " (expression vec4 +\n" - " (expression vec4 exp (var_ref x))\n" - " (expression vec4 exp (expression vec4 neg (var_ref x))))))))\n" - "))\n" - "" -; -static const char builtin_texelFetch[] = - "((function texelFetch\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) int P) \n" - " (declare (in) int lod) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) int P) \n" - " (declare (in) int lod) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) int P) \n" - " (declare (in) int lod) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) ivec2 P) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (constant int (0))\n" - "))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) ivec2 P) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (constant int (0))\n" - "))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) ivec2 P) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (constant int (0))\n" - "))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerBuffer sampler) \n" - " (declare (in) int P) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) 0 (constant int (0))\n" - "))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerBuffer sampler) \n" - " (declare (in) int P) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) 0 (constant int (0))\n" - "))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerBuffer sampler) \n" - " (declare (in) int P) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) 0 (constant int (0))\n" - "))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texelFetchOffset[] = - "((function texelFetchOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) int P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) int P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) int P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) (var_ref offset) (constant int (0))\n" - "))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (constant int (0))\n" - "))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (constant int (0))\n" - "))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) ivec2 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) ivec3 P) \n" - " (declare (in) int lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txf uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture[] = - "((function texture\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) samplerCubeShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) samplerCubeShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1D[] = - "((function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DArray[] = - "((function texture1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DArrayLod[] = - "((function texture1DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DGradARB[] = - "((function texture1DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DLod[] = - "((function texture1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DProj[] = - "((function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DProjGradARB[] = - "((function texture1DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture1DProjLod[] = - "((function texture1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2D[] = - "((function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerExternalOES sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DArray[] = - "((function texture2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DArrayLod[] = - "((function texture2DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DGradARB[] = - "((function texture2DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DGradEXT[] = - "((function texture2DGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DLod[] = - "((function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DLodEXT[] = - "((function texture2DLodEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DProj[] = - "((function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerExternalOES sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerExternalOES sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DProjGradARB[] = - "((function texture2DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DProjGradEXT[] = - "((function texture2DProjGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DProjLod[] = - "((function texture2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DProjLodEXT[] = - "((function texture2DProjLodEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DRect[] = - "((function texture2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DRectGradARB[] = - "((function texture2DRectGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DRectProj[] = - "((function texture2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture2DRectProjGradARB[] = - "((function texture2DRectProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture3D[] = - "((function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture3DGradARB[] = - "((function texture3DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture3DLod[] = - "((function texture3DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture3DProj[] = - "((function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture3DProjGradARB[] = - "((function texture3DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_texture3DProjLod[] = - "((function texture3DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureCube[] = - "((function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureCubeGradARB[] = - "((function textureCubeGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureCubeGradEXT[] = - "((function textureCubeGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureCubeLod[] = - "((function textureCubeLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureCubeLodEXT[] = - "((function textureCubeLodEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureGrad[] = - "((function textureGrad\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) samplerCubeShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureGradOffset[] = - "((function textureGradOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureLod[] = - "((function textureLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureLodOffset[] = - "((function textureLodOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureOffset[] = - "((function textureOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) float P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec3 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec3 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec3 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureProj[] = - "((function textureProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec3 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec4 P) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) 0 ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) 0 (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureProjGrad[] = - "((function textureProjGrad\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) 0 ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureProjGradOffset[] = - "((function textureProjGradOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec3 dPdx) \n" - " (declare (in) vec3 dPdy) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd vec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float dPdx) \n" - " (declare (in) float dPdy) \n" - " (declare (const_in) int offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) vec2 dPdx) \n" - " (declare (in) vec2 dPdy) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txd float (var_ref sampler) (var_ref P) (var_ref offset) ((var_ref dPdx) (var_ref dPdy)) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureProjLod[] = - "((function textureProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) 0 (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureProjLodOffset[] = - "((function textureProjLodOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txl vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txl ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (txl uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) int offset) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (in) float lod) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (txl float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref lod) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureProjOffset[] = - "((function textureProjOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec3 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex vec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex ivec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex uvec4 (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) )\n" - " ((return (tex float (var_ref sampler) (var_ref P) (var_ref offset) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec2 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec3 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec3 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb vec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec3 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb ivec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec3 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb uvec4 (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) int offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) vec4 P) \n" - " (declare (const_in) ivec2 offset) \n" - " (declare (in) float bias) )\n" - " ((return (txb float (var_ref sampler) (var_ref P) (var_ref offset) (var_ref bias) ))))\n" - "\n" - "))\n" - "" -; -static const char builtin_textureSize[] = - "((function textureSize\n" - " (signature int\n" - " (parameters\n" - " (declare (in) sampler1D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs int (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) isampler1D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs int (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) usampler1D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs int (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) sampler2D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) isampler2D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) usampler2D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) sampler3D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) isampler3D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) usampler3D sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) samplerCube sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) isamplerCube sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) usamplerCube sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs int (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) samplerCubeShadow sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec2 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler) \n" - " (declare (in) int lod) )\n" - " ((return (txs ivec3 (var_ref sampler) (var_ref lod) ))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler) )\n" - " ((return (txs ivec2 (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) isampler2DRect sampler) )\n" - " ((return (txs ivec2 (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) usampler2DRect sampler) )\n" - " ((return (txs ivec2 (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler) )\n" - " ((return (txs ivec2 (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) samplerBuffer sampler) )\n" - " ((return (txs int (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) isamplerBuffer sampler) )\n" - " ((return (txs int (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - " (signature int\n" - " (parameters\n" - " (declare (in) usamplerBuffer sampler) )\n" - " ((return (txs int (var_ref sampler) (constant int (0))\n" - "))))\n" - "\n" - "))\n" - "" -; -static const char builtin_transpose[] = - "((function transpose\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 m))\n" - " ((declare () mat2 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ((declare () mat3x2 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ((declare () mat4x2 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat3x2 m))\n" - " ((declare () mat2x3 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 m))\n" - " ((declare () mat3 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat3x4 m))\n" - " ((declare () mat4x3 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat4x2 m))\n" - " ((declare () mat2x4 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat4x3 m))\n" - " ((declare () mat3x4 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3)))))\n" - "(return (var_ref t))))\n" - "\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 m))\n" - " ((declare () mat4 t)\n" - " (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3)))))\n" - " (assign (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3)))))\n" - "(return (var_ref t))))\n" - ")\n" - "\n" - ")\n" - "\n" - "" -; -static const char builtin_trunc[] = - "((function trunc\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float arg0))\n" - " ((return (expression float trunc (var_ref arg0)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 arg0))\n" - " ((return (expression vec2 trunc (var_ref arg0)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 arg0))\n" - " ((return (expression vec3 trunc (var_ref arg0)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 arg0))\n" - " ((return (expression vec4 trunc (var_ref arg0)))))\n" - "))\n" - "" -; -static const char builtin_uintBitsToFloat[] = - "((function uintBitsToFloat\n" - " (signature float\n" - " (parameters\n" - " (declare (in) uint arg))\n" - " ((return (expression float bitcast_u2f (var_ref arg)))))\n" - "\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) uvec2 arg))\n" - " ((return (expression vec2 bitcast_u2f (var_ref arg)))))\n" - "\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) uvec3 arg))\n" - " ((return (expression vec3 bitcast_u2f (var_ref arg)))))\n" - "\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) uvec4 arg))\n" - " ((return (expression vec4 bitcast_u2f (var_ref arg)))))\n" - "))\n" - "" -; -static const char prototypes_for_100_frag[] = - "(\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ())))" -; -static const char *functions_for_100_frag [] = { - builtin_texture2D, - builtin_texture2DProj, - builtin_textureCube, -}; -static const char prototypes_for_100_glsl[] = - "(\n" - "(function radians\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float degrees))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 degrees))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 degrees))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 degrees))\n" - " ()))\n" - "(function degrees\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float radians))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 radians))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 radians))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 radians))\n" - " ()))\n" - "(function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function cos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function tan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function asin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function acos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function atan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y_over_x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y_over_x))\n" - " ()))\n" - "(function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function abs\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sign\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ceil\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function fract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function min\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function max\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ()))\n" - "(function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) float a))\n" - " ()))\n" - "(function step\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function length\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function distance\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ()))\n" - "(function dot\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function cross\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ()))\n" - "(function normalize\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ()))\n" - "(function reflect\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N))\n" - " ()))\n" - "(function refract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" - " ()))\n" - "(function lessThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function lessThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function equal\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function notEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function any\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function not\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord))\n" - " ())))" -; -static const char *functions_for_100_glsl [] = { - builtin_abs, - builtin_acos, - builtin_all, - builtin_any, - builtin_asin, - builtin_atan, - builtin_ceil, - builtin_clamp, - builtin_cos, - builtin_cross, - builtin_degrees, - builtin_distance, - builtin_dot, - builtin_equal, - builtin_exp, - builtin_exp2, - builtin_faceforward, - builtin_floor, - builtin_fract, - builtin_greaterThan, - builtin_greaterThanEqual, - builtin_inversesqrt, - builtin_length, - builtin_lessThan, - builtin_lessThanEqual, - builtin_log, - builtin_log2, - builtin_matrixCompMult, - builtin_max, - builtin_min, - builtin_mix, - builtin_mod, - builtin_normalize, - builtin_not, - builtin_notEqual, - builtin_pow, - builtin_radians, - builtin_reflect, - builtin_refract, - builtin_sign, - builtin_sin, - builtin_smoothstep, - builtin_sqrt, - builtin_step, - builtin_tan, - builtin_texture2D, - builtin_texture2DProj, - builtin_textureCube, -}; -static const char prototypes_for_100_vert[] = - "(\n" - "(function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function textureCubeLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ())))" -; -static const char *functions_for_100_vert [] = { - builtin_texture2DLod, - builtin_texture2DProjLod, - builtin_textureCubeLod, -}; -static const char prototypes_for_110_frag[] = - "(\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ())))" -; -static const char *functions_for_110_frag [] = { - builtin_dFdx, - builtin_dFdy, - builtin_fwidth, - builtin_shadow1D, - builtin_shadow1DProj, - builtin_shadow2D, - builtin_shadow2DProj, - builtin_texture1D, - builtin_texture1DProj, - builtin_texture2D, - builtin_texture2DProj, - builtin_texture3D, - builtin_texture3DProj, - builtin_textureCube, -}; -static const char prototypes_for_110_glsl[] = - "(\n" - "(function radians\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float degrees))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 degrees))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 degrees))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 degrees))\n" - " ()))\n" - "(function degrees\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float radians))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 radians))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 radians))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 radians))\n" - " ()))\n" - "(function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function cos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function tan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function asin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function acos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function atan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y_over_x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y_over_x))\n" - " ()))\n" - "(function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function abs\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sign\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ceil\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function fract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function min\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function max\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ()))\n" - "(function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) float a))\n" - " ()))\n" - "(function step\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function length\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function distance\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ()))\n" - "(function dot\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function cross\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ()))\n" - "(function normalize\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ()))\n" - "(function reflect\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N))\n" - " ()))\n" - "(function refract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" - " ()))\n" - "(function lessThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function lessThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function equal\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function notEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function any\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function not\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord))\n" - " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise2\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise3\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise4\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ())))" -; -static const char *functions_for_110_glsl [] = { - builtin_abs, - builtin_acos, - builtin_all, - builtin_any, - builtin_asin, - builtin_atan, - builtin_ceil, - builtin_clamp, - builtin_cos, - builtin_cross, - builtin_degrees, - builtin_distance, - builtin_dot, - builtin_equal, - builtin_exp, - builtin_exp2, - builtin_faceforward, - builtin_floor, - builtin_fract, - builtin_greaterThan, - builtin_greaterThanEqual, - builtin_inversesqrt, - builtin_length, - builtin_lessThan, - builtin_lessThanEqual, - builtin_log, - builtin_log2, - builtin_matrixCompMult, - builtin_max, - builtin_min, - builtin_mix, - builtin_mod, - builtin_noise1, - builtin_noise2, - builtin_noise3, - builtin_noise4, - builtin_normalize, - builtin_not, - builtin_notEqual, - builtin_pow, - builtin_radians, - builtin_reflect, - builtin_refract, - builtin_shadow1D, - builtin_shadow1DProj, - builtin_shadow2D, - builtin_shadow2DProj, - builtin_sign, - builtin_sin, - builtin_smoothstep, - builtin_sqrt, - builtin_step, - builtin_tan, - builtin_texture1D, - builtin_texture1DProj, - builtin_texture2D, - builtin_texture2DProj, - builtin_texture3D, - builtin_texture3DProj, - builtin_textureCube, -}; -static const char prototypes_for_110_vert[] = - "(\n" - "(function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ()))\n" - "(function texture1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function textureCubeLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ())))" -; -static const char *functions_for_110_vert [] = { - builtin_ftransform, - builtin_shadow1DLod, - builtin_shadow1DProjLod, - builtin_shadow2DLod, - builtin_shadow2DProjLod, - builtin_texture1DLod, - builtin_texture1DProjLod, - builtin_texture2DLod, - builtin_texture2DProjLod, - builtin_texture3DLod, - builtin_texture3DProjLod, - builtin_textureCubeLod, -}; -static const char prototypes_for_120_frag[] = - "(\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ())))" -; -static const char *functions_for_120_frag [] = { - builtin_dFdx, - builtin_dFdy, - builtin_fwidth, - builtin_shadow1D, - builtin_shadow1DProj, - builtin_shadow2D, - builtin_shadow2DProj, - builtin_texture1D, - builtin_texture1DProj, - builtin_texture2D, - builtin_texture2DProj, - builtin_texture3D, - builtin_texture3DProj, - builtin_textureCube, -}; -static const char prototypes_for_120_glsl[] = - "(\n" - "(function radians\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float degrees))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 degrees))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 degrees))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 degrees))\n" - " ()))\n" - "(function degrees\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float radians))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 radians))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 radians))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 radians))\n" - " ()))\n" - "(function sin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function cos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function tan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function asin\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function acos\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float angle))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 angle))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 angle))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 angle))\n" - " ()))\n" - "(function atan\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float y_over_x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 y_over_x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 y_over_x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 y_over_x))\n" - " ()))\n" - "(function pow\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function exp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function exp2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function log2\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function inversesqrt\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function abs\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function sign\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function floor\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function ceil\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function fract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function mod\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function min\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function max\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float y))\n" - " ()))\n" - "(function clamp\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 minVal)\n" - " (declare (in) vec2 maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 minVal)\n" - " (declare (in) vec3 maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 minVal)\n" - " (declare (in) vec4 maxVal))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) float minVal)\n" - " (declare (in) float maxVal))\n" - " ()))\n" - "(function mix\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) vec2 a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) vec3 a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) vec4 a))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y)\n" - " (declare (in) float a))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y)\n" - " (declare (in) float a))\n" - " ()))\n" - "(function step\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function smoothstep\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 edge0)\n" - " (declare (in) vec2 edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 edge0)\n" - " (declare (in) vec3 edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 edge0)\n" - " (declare (in) vec4 edge1)\n" - " (declare (in) vec4 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float edge0)\n" - " (declare (in) float edge1)\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function length\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function distance\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p0)\n" - " (declare (in) float p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 p0)\n" - " (declare (in) vec2 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 p0)\n" - " (declare (in) vec3 p1))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 p0)\n" - " (declare (in) vec4 p1))\n" - " ()))\n" - "(function dot\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x)\n" - " (declare (in) float y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ()))\n" - "(function cross\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ()))\n" - "(function normalize\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function faceforward\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float N)\n" - " (declare (in) float I)\n" - " (declare (in) float Nref))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 N)\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 Nref))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 N)\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 Nref))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 N)\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 Nref))\n" - " ()))\n" - "(function reflect\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N))\n" - " ()))\n" - "(function refract\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float I)\n" - " (declare (in) float N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 I)\n" - " (declare (in) vec2 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 I)\n" - " (declare (in) vec3 N)\n" - " (declare (in) float eta))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 I)\n" - " (declare (in) vec4 N)\n" - " (declare (in) float eta))\n" - " ()))\n" - "(function matrixCompMult\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 x)\n" - " (declare (in) mat2 y))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 x)\n" - " (declare (in) mat3 y))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 x)\n" - " (declare (in) mat4 y))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat2x3 x)\n" - " (declare (in) mat2x3 y))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat2x4 x)\n" - " (declare (in) mat2x4 y))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat3x2 x)\n" - " (declare (in) mat3x2 y))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat3x4 x)\n" - " (declare (in) mat3x4 y))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat4x2 x)\n" - " (declare (in) mat4x2 y))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat4x3 x)\n" - " (declare (in) mat4x3 y))\n" - " ()))\n" - "(function outerProduct\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec2 r))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) vec2 c)\n" - " (declare (in) vec4 r))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) vec4 c)\n" - " (declare (in) vec3 r))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) vec3 c)\n" - " (declare (in) vec4 r))\n" - " ()))\n" - "(function transpose\n" - " (signature mat2\n" - " (parameters\n" - " (declare (in) mat2 m))\n" - " ())\n" - " (signature mat3\n" - " (parameters\n" - " (declare (in) mat3 m))\n" - " ())\n" - " (signature mat4\n" - " (parameters\n" - " (declare (in) mat4 m))\n" - " ())\n" - " (signature mat2x3\n" - " (parameters\n" - " (declare (in) mat3x2 m))\n" - " ())\n" - " (signature mat3x2\n" - " (parameters\n" - " (declare (in) mat2x3 m))\n" - " ())\n" - " (signature mat2x4\n" - " (parameters\n" - " (declare (in) mat4x2 m))\n" - " ())\n" - " (signature mat4x2\n" - " (parameters\n" - " (declare (in) mat2x4 m))\n" - " ())\n" - " (signature mat3x4\n" - " (parameters\n" - " (declare (in) mat4x3 m))\n" - " ())\n" - " (signature mat4x3\n" - " (parameters\n" - " (declare (in) mat3x4 m))\n" - " ()))\n" - "(function lessThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function lessThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThan\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function greaterThanEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ()))\n" - "(function equal\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function notEqual\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) vec2 x)\n" - " (declare (in) vec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) vec3 x)\n" - " (declare (in) vec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) vec4 x)\n" - " (declare (in) vec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) ivec2 x)\n" - " (declare (in) ivec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) ivec3 x)\n" - " (declare (in) ivec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) ivec4 x)\n" - " (declare (in) ivec4 y))\n" - " ())\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x)\n" - " (declare (in) bvec2 y))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x)\n" - " (declare (in) bvec3 y))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x)\n" - " (declare (in) bvec4 y))\n" - " ()))\n" - "(function any\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function all\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bool\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function not\n" - " (signature bvec2\n" - " (parameters\n" - " (declare (in) bvec2 x))\n" - " ())\n" - " (signature bvec3\n" - " (parameters\n" - " (declare (in) bvec3 x))\n" - " ())\n" - " (signature bvec4\n" - " (parameters\n" - " (declare (in) bvec4 x))\n" - " ()))\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord))\n" - " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function noise1\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise2\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise3\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ()))\n" - "(function noise4\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) float x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec2 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec3 x))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 x))\n" - " ())))" -; -static const char *functions_for_120_glsl [] = { - builtin_abs, - builtin_acos, - builtin_all, - builtin_any, - builtin_asin, - builtin_atan, - builtin_ceil, - builtin_clamp, - builtin_cos, - builtin_cross, - builtin_degrees, - builtin_distance, - builtin_dot, - builtin_equal, - builtin_exp, - builtin_exp2, - builtin_faceforward, - builtin_floor, - builtin_fract, - builtin_greaterThan, - builtin_greaterThanEqual, - builtin_inversesqrt, - builtin_length, - builtin_lessThan, - builtin_lessThanEqual, - builtin_log, - builtin_log2, - builtin_matrixCompMult, - builtin_max, - builtin_min, - builtin_mix, - builtin_mod, - builtin_noise1, - builtin_noise2, - builtin_noise3, - builtin_noise4, - builtin_normalize, - builtin_not, - builtin_notEqual, - builtin_outerProduct, - builtin_pow, - builtin_radians, - builtin_reflect, - builtin_refract, - builtin_shadow1D, - builtin_shadow1DProj, - builtin_shadow2D, - builtin_shadow2DProj, - builtin_sign, - builtin_sin, - builtin_smoothstep, - builtin_sqrt, - builtin_step, - builtin_tan, - builtin_texture1D, - builtin_texture1DProj, - builtin_texture2D, - builtin_texture2DProj, - builtin_texture3D, - builtin_texture3DProj, - builtin_textureCube, - builtin_transpose, -}; -static const char prototypes_for_120_vert[] = - "(\n" - "(function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ()))\n" - "(function texture1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function textureCubeLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ())))" -; -static const char *functions_for_120_vert [] = { - builtin_ftransform, - builtin_shadow1DLod, - builtin_shadow1DProjLod, - builtin_shadow2DLod, - builtin_shadow2DProjLod, - builtin_texture1DLod, - builtin_texture1DProjLod, - builtin_texture2DLod, - builtin_texture2DProjLod, - builtin_texture3DLod, - builtin_texture3DProjLod, - builtin_textureCubeLod, -}; -static const char prototypes_for_130_frag[] = - "(\n" - "(function texture\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow samp)\n" - " (declare (in) vec3 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureProjOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow s)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow s)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ())))" -; -static const char *functions_for_130_frag [] = { - builtin_dFdx, - builtin_dFdy, - builtin_fwidth, - builtin_shadow1D, - builtin_shadow1DProj, - builtin_shadow2D, - builtin_shadow2DProj, - builtin_texture, - builtin_texture1D, - builtin_texture1DProj, - builtin_texture2D, - builtin_texture2DProj, - builtin_texture3D, - builtin_texture3DProj, - builtin_textureCube, - builtin_textureOffset, - builtin_textureProj, - builtin_textureProjOffset, -}; -static const char prototypes_for_130_glsl[] = -{'(', -'(','f','u','n','c','t','i','o','n',' ','r','a','d','i','a','n','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','d','e','g','r','e','e','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','i','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','o','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','s','i','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','c','o','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','t','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','i','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','o','s','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','a','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','s','i','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','c','o','s','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','t','a','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','p','o','w',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','e','x','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','o','g',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','e','x','p','2',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','o','g','2',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','q','r','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','n','v','e','r','s','e','s','q','r','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','b','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','i','g','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','f','l','o','o','r',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','r','u','n','c',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','o','u','n','d',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','o','u','n','d','E','v','e','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','e','i','l',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','f','r','a','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','o','d','f',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','f','l','o','a','t',' ','i',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','v','e','c','2',' ','i',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','v','e','c','3',' ','i',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','v','e','c','4',' ','i',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','i','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','a','x',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','l','a','m','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','i','x',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','o','o','l',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','a',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','t','e','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','m','o','o','t','h','s','t','e','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','s','n','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','s','i','n','f',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','e','n','g','t','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','d','i','s','t','a','n','c','e',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','p','1',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','p','1',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','p','1',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','p','1',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','d','o','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','r','o','s','s',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','r','m','a','l','i','z','e',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','f','a','c','e','f','o','r','w','a','r','d',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N','r','e','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N','r','e','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N','r','e','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N','r','e','f',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','e','f','l','e','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','e','f','r','a','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','a','t','r','i','x','C','o','m','p','M','u','l','t',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','3',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','o','u','t','e','r','P','r','o','d','u','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','r','a','n','s','p','o','s','e',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','4',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','4',' ','m',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','e','s','s','T','h','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','e','s','s','T','h','a','n','E','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','g','r','e','a','t','e','r','T','h','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','g','r','e','a','t','e','r','T','h','a','n','E','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','e','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','t','E','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','n','y',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','l','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','t',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','S','i','z','e',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','e','l','F','e','t','c','h',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','e','l','F','e','t','c','h','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','L','o','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','L','o','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','G','r','a','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','G','r','a','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','G','r','a','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','G','r','a','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','C','u','b','e',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','C','u','b','e','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','1',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','2',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','3',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','4',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')',')'} ; -static const char *functions_for_130_glsl [] = { - builtin_abs, - builtin_acos, - builtin_acosh, - builtin_all, - builtin_any, - builtin_asin, - builtin_asinh, - builtin_atan, - builtin_atanh, - builtin_ceil, - builtin_clamp, - builtin_cos, - builtin_cosh, - builtin_cross, - builtin_degrees, - builtin_distance, - builtin_dot, - builtin_equal, - builtin_exp, - builtin_exp2, - builtin_faceforward, - builtin_floor, - builtin_fract, - builtin_greaterThan, - builtin_greaterThanEqual, - builtin_inversesqrt, - builtin_isinf, - builtin_isnan, - builtin_length, - builtin_lessThan, - builtin_lessThanEqual, - builtin_log, - builtin_log2, - builtin_matrixCompMult, - builtin_max, - builtin_min, - builtin_mix, - builtin_mod, - builtin_modf, - builtin_noise1, - builtin_noise2, - builtin_noise3, - builtin_noise4, - builtin_normalize, - builtin_not, - builtin_notEqual, - builtin_outerProduct, - builtin_pow, - builtin_radians, - builtin_reflect, - builtin_refract, - builtin_round, - builtin_roundEven, - builtin_shadow1D, - builtin_shadow1DLod, - builtin_shadow1DProj, - builtin_shadow1DProjLod, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_shadow2DProj, - builtin_shadow2DProjLod, - builtin_sign, - builtin_sin, - builtin_sinh, - builtin_smoothstep, - builtin_sqrt, - builtin_step, - builtin_tan, - builtin_tanh, - builtin_texelFetch, - builtin_texelFetchOffset, - builtin_texture, - builtin_texture1D, - builtin_texture1DLod, - builtin_texture1DProj, - builtin_texture1DProjLod, - builtin_texture2D, - builtin_texture2DLod, - builtin_texture2DProj, - builtin_texture2DProjLod, - builtin_texture3D, - builtin_texture3DLod, - builtin_texture3DProj, - builtin_texture3DProjLod, - builtin_textureCube, - builtin_textureCubeLod, - builtin_textureGrad, - builtin_textureGradOffset, - builtin_textureLod, - builtin_textureLodOffset, - builtin_textureOffset, - builtin_textureProj, - builtin_textureProjGrad, - builtin_textureProjGradOffset, - builtin_textureProjLod, - builtin_textureProjLodOffset, - builtin_textureProjOffset, - builtin_textureSize, - builtin_transpose, - builtin_trunc, -}; -static const char prototypes_for_130_vert[] = - "(\n" - "(function ftransform\n" - " (signature vec4\n" - " (parameters)\n" - " ())))" -; -static const char *functions_for_130_vert [] = { - builtin_ftransform, -}; -static const char prototypes_for_140_frag[] = - "(\n" - "(function texture\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usamplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) samplerCubeShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1DArray sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2DArray sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow samp)\n" - " (declare (in) vec3 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureProjOffset\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) isampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) usampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec3 offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler1DShadow s)\n" - " (declare (in) vec4 P)\n" - " (declare (in) int offset)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow s)\n" - " (declare (in) vec4 P)\n" - " (declare (in) ivec2 offset)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function textureCube\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ())))" -; -static const char *functions_for_140_frag [] = { - builtin_dFdx, - builtin_dFdy, - builtin_fwidth, - builtin_shadow1D, - builtin_shadow1DProj, - builtin_shadow2D, - builtin_shadow2DProj, - builtin_texture, - builtin_texture1D, - builtin_texture1DProj, - builtin_texture2D, - builtin_texture2DProj, - builtin_texture3D, - builtin_texture3DProj, - builtin_textureCube, - builtin_textureOffset, - builtin_textureProj, - builtin_textureProjOffset, -}; -static const char prototypes_for_140_glsl[] = -{'(', -'(','f','u','n','c','t','i','o','n',' ','r','a','d','i','a','n','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','d','e','g','r','e','e','s',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','d','e','g','r','e','e','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r','a','d','i','a','n','s',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','i','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','o','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','s','i','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','c','o','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a','n','g','l','e',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a','n','g','l','e',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','t','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y','_','o','v','e','r','_','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','i','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','o','s','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','a','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','s','i','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','c','o','s','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','t','a','n','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','p','o','w',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','e','x','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','o','g',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','e','x','p','2',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','o','g','2',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','q','r','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','n','v','e','r','s','e','s','q','r','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','b','s',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','i','g','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','f','l','o','o','r',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','r','u','n','c',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','o','u','n','d',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','o','u','n','d','E','v','e','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','e','i','l',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','f','r','a','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','o','d','f',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','f','l','o','a','t',' ','i',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','v','e','c','2',' ','i',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','v','e','c','3',' ','i',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','o','u','t',')',' ','v','e','c','4',' ','i',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','i','n',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','a','x',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','l','a','m','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','i','n','V','a','l',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','i','n','t',' ','m','a','x','V','a','l',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','i','x',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','o','o','l',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','a',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','t','e','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','m','o','o','t','h','s','t','e','p',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','d','g','e','1',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','s','n','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','s','i','n','f',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','e','n','g','t','h',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','d','i','s','t','a','n','c','e',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','p','1',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','p','1',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','p','1',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','p','0',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','p','1',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','d','o','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','c','r','o','s','s',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','r','m','a','l','i','z','e',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','f','a','c','e','f','o','r','w','a','r','d',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N','r','e','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N','r','e','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N','r','e','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N','r','e','f',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','e','f','l','e','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','r','e','f','r','a','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','I',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','N',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','e','t','a',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','m','a','t','r','i','x','C','o','m','p','M','u','l','t',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','3',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','o','u','t','e','r','P','r','o','d','u','c','t',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','r',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','r','a','n','s','p','o','s','e',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2','x','4',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3','x','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4','x','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4','x','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3','x','4',' ','m',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','i','n','v','e','r','s','e',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','2',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','3',' ','m',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','m','a','t','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','m','a','t','4',' ','m',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','e','s','s','T','h','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','l','e','s','s','T','h','a','n','E','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','g','r','e','a','t','e','r','T','h','a','n',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','g','r','e','a','t','e','r','T','h','a','n','E','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','e','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','t','E','q','u','a','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','v','e','c','4',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','n','y',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','a','l','l',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','o','o','l',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','t',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','b','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','b','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','S','i','z','e',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','B','u','f','f','e','r',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','B','u','f','f','e','r',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','n','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','B','u','f','f','e','r',' ','s','a','m','p','l','e','r',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','e','l','F','e','t','c','h',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','B','u','f','f','e','r',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','B','u','f','f','e','r',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','B','u','f','f','e','r',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','e','l','F','e','t','c','h','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','L','o','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','L','o','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','G','r','a','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','G','r','a','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f','s','e','t',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','A','r','r','a','y',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','A','r','r','a','y','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','A','r','r','a','y','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','G','r','a','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','P','d','y',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','P','d','y',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','P','r','o','j','G','r','a','d','O','f','f','s','e','t',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','1','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','2','D','R','e','c','t',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','R','e','c','t','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','i','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','u','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','u','s','a','m','p','l','e','r','3','D',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','3',' ','o','f','f',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','n','t',' ','o',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','P',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','x',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','d','y',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','i','v','e','c','2',' ','o',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','1','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','2','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','3','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','3','D',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','C','u','b','e',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','t','e','x','t','u','r','e','C','u','b','e','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','C','u','b','e',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D','P','r','o','j',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','1','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','1','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','s','h','a','d','o','w','2','D','P','r','o','j','L','o','d',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','s','a','m','p','l','e','r','2','D','S','h','a','d','o','w',' ','s','a','m','p','l','e','r',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','c','o','o','r','d',')',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','l','o','d',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','1',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','f','l','o','a','t',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','2',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','2',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','3',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','3',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')', -'(','f','u','n','c','t','i','o','n',' ','n','o','i','s','e','4',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','f','l','o','a','t',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','2',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','3',' ','x',')',')',' ','(',')',')',' ','(','s','i','g','n','a','t','u','r','e',' ','v','e','c','4',' ','(','p','a','r','a','m','e','t','e','r','s',' ','(','d','e','c','l','a','r','e',' ','(','i','n',')',' ','v','e','c','4',' ','x',')',')',' ','(',')',')',')',')'} ; -static const char *functions_for_140_glsl [] = { - builtin_abs, - builtin_acos, - builtin_acosh, - builtin_all, - builtin_any, - builtin_asin, - builtin_asinh, - builtin_atan, - builtin_atanh, - builtin_ceil, - builtin_clamp, - builtin_cos, - builtin_cosh, - builtin_cross, - builtin_degrees, - builtin_distance, - builtin_dot, - builtin_equal, - builtin_exp, - builtin_exp2, - builtin_faceforward, - builtin_floor, - builtin_fract, - builtin_greaterThan, - builtin_greaterThanEqual, - builtin_inverse, - builtin_inversesqrt, - builtin_isinf, - builtin_isnan, - builtin_length, - builtin_lessThan, - builtin_lessThanEqual, - builtin_log, - builtin_log2, - builtin_matrixCompMult, - builtin_max, - builtin_min, - builtin_mix, - builtin_mod, - builtin_modf, - builtin_noise1, - builtin_noise2, - builtin_noise3, - builtin_noise4, - builtin_normalize, - builtin_not, - builtin_notEqual, - builtin_outerProduct, - builtin_pow, - builtin_radians, - builtin_reflect, - builtin_refract, - builtin_round, - builtin_roundEven, - builtin_shadow1D, - builtin_shadow1DLod, - builtin_shadow1DProj, - builtin_shadow1DProjLod, - builtin_shadow2D, - builtin_shadow2DLod, - builtin_shadow2DProj, - builtin_shadow2DProjLod, - builtin_sign, - builtin_sin, - builtin_sinh, - builtin_smoothstep, - builtin_sqrt, - builtin_step, - builtin_tan, - builtin_tanh, - builtin_texelFetch, - builtin_texelFetchOffset, - builtin_texture, - builtin_texture1D, - builtin_texture1DLod, - builtin_texture1DProj, - builtin_texture1DProjLod, - builtin_texture2D, - builtin_texture2DLod, - builtin_texture2DProj, - builtin_texture2DProjLod, - builtin_texture3D, - builtin_texture3DLod, - builtin_texture3DProj, - builtin_texture3DProjLod, - builtin_textureCube, - builtin_textureCubeLod, - builtin_textureGrad, - builtin_textureGradOffset, - builtin_textureLod, - builtin_textureLodOffset, - builtin_textureOffset, - builtin_textureProj, - builtin_textureProjGrad, - builtin_textureProjGradOffset, - builtin_textureProjLod, - builtin_textureProjLodOffset, - builtin_textureProjOffset, - builtin_textureSize, - builtin_transpose, - builtin_trunc, -}; -static const char prototypes_for_ARB_shader_bit_encoding_glsl[] = - "(\n" - "(function floatBitsToInt\n" - " (signature int\n" - " (parameters\n" - " (declare (in) float value))\n" - " ())\n" - " (signature ivec2\n" - " (parameters\n" - " (declare (in) vec2 value))\n" - " ())\n" - " (signature ivec3\n" - " (parameters\n" - " (declare (in) vec3 value))\n" - " ())\n" - " (signature ivec4\n" - " (parameters\n" - " (declare (in) vec4 value))\n" - " ()))\n" - "(function floatBitsToUint\n" - " (signature uint\n" - " (parameters\n" - " (declare (in) float value))\n" - " ())\n" - " (signature uvec2\n" - " (parameters\n" - " (declare (in) vec2 value))\n" - " ())\n" - " (signature uvec3\n" - " (parameters\n" - " (declare (in) vec3 value))\n" - " ())\n" - " (signature uvec4\n" - " (parameters\n" - " (declare (in) vec4 value))\n" - " ()))\n" - "(function intBitsToFloat\n" - " (signature float\n" - " (parameters\n" - " (declare (in) int value))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) ivec2 value))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) ivec3 value))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) ivec4 value))\n" - " ()))\n" - "(function uintBitsToFloat\n" - " (signature float\n" - " (parameters\n" - " (declare (in) uint value))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) uvec2 value))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) uvec3 value))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) uvec4 value))\n" - " ())))" -; -static const char *functions_for_ARB_shader_bit_encoding_glsl [] = { - builtin_floatBitsToInt, - builtin_floatBitsToUint, - builtin_intBitsToFloat, - builtin_uintBitsToFloat, -}; -static const char prototypes_for_ARB_shader_texture_lod_frag[] = - "(\n" - "(function texture1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function textureCubeLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ())))" -; -static const char *functions_for_ARB_shader_texture_lod_frag [] = { - builtin_shadow1DLod, - builtin_shadow1DProjLod, - builtin_shadow2DLod, - builtin_shadow2DProjLod, - builtin_texture1DLod, - builtin_texture1DProjLod, - builtin_texture2DLod, - builtin_texture2DProjLod, - builtin_texture3DLod, - builtin_texture3DProjLod, - builtin_textureCubeLod, -}; -static const char prototypes_for_ARB_shader_texture_lod_glsl[] = - "(\n" - "(function texture1DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) float P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" - " ()))\n" - "(function texture1DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" - " ()))\n" - "(function texture2DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture2DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture3DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" - " ()))\n" - "(function texture3DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" - " ()))\n" - "(function textureCubeGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" - " ()))\n" - "(function shadow1DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" - " ()))\n" - "(function shadow1DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) float dPdx)\n" - " (declare (in) float dPdy))\n" - " ()))\n" - "(function shadow2DGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function shadow2DProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture2DRectGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture2DRectProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function shadow2DRectGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function shadow2DRectProjGradARB\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())))" -; -static const char *functions_for_ARB_shader_texture_lod_glsl [] = { - builtin_shadow1DGradARB, - builtin_shadow1DProjGradARB, - builtin_shadow2DGradARB, - builtin_shadow2DProjGradARB, - builtin_shadow2DRectGradARB, - builtin_shadow2DRectProjGradARB, - builtin_texture1DGradARB, - builtin_texture1DProjGradARB, - builtin_texture2DGradARB, - builtin_texture2DProjGradARB, - builtin_texture2DRectGradARB, - builtin_texture2DRectProjGradARB, - builtin_texture3DGradARB, - builtin_texture3DProjGradARB, - builtin_textureCubeGradARB, -}; -static const char prototypes_for_ARB_texture_rectangle_glsl[] = - "(\n" - "(function texture2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRect sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function shadow2DRect\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2DRectProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DRectShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_ARB_texture_rectangle_glsl [] = { - builtin_shadow2DRect, - builtin_shadow2DRectProj, - builtin_texture2DRect, - builtin_texture2DRectProj, -}; -static const char prototypes_for_EXT_shader_texture_lod_frag[] = - "(\n" - "(function texture2DLodEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DProjLodEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function textureCubeLodEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture2DProjGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function textureCubeGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" - " ())))" -; -static const char *functions_for_EXT_shader_texture_lod_frag [] = { - builtin_texture2DGradEXT, - builtin_texture2DLodEXT, - builtin_texture2DProjGradEXT, - builtin_texture2DProjLodEXT, - builtin_textureCubeGradEXT, - builtin_textureCubeLodEXT, -}; -static const char prototypes_for_EXT_shader_texture_lod_vert[] = - "(\n" - "(function texture2DGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec2 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function texture2DProjGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2D sampler)\n" - " (declare (in) vec4 P)\n" - " (declare (in) vec2 dPdx)\n" - " (declare (in) vec2 dPdy))\n" - " ()))\n" - "(function textureCubeGradEXT\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerCube sampler)\n" - " (declare (in) vec3 P)\n" - " (declare (in) vec3 dPdx)\n" - " (declare (in) vec3 dPdy))\n" - " ())))" -; -static const char *functions_for_EXT_shader_texture_lod_vert [] = { - builtin_texture2DGradEXT, - builtin_texture2DProjGradEXT, - builtin_textureCubeGradEXT, -}; -static const char prototypes_for_EXT_shadow_samplers_frag[] = - "(\n" - "(function shadow2DEXT\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2DProjEXT\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_shadow_samplers_frag [] = { - builtin_shadow2DEXT, - builtin_shadow2DProjEXT, -}; -static const char prototypes_for_EXT_shadow_samplers_vert[] = - "(\n" - "(function shadow2DEXT\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow2DProjEXT\n" - " (signature float\n" - " (parameters\n" - " (declare (in) sampler2DShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_shadow_samplers_vert [] = { - builtin_shadow2DEXT, - builtin_shadow2DProjEXT, -}; -static const char prototypes_for_EXT_texture_array_frag[] = - "(\n" - "(function texture1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_texture_array_frag [] = { - builtin_shadow1DArray, - builtin_shadow2DArray, - builtin_texture1DArray, - builtin_texture2DArray, -}; -static const char prototypes_for_EXT_texture_array_vert[] = - "(\n" - "(function texture1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture1DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArray sampler)\n" - " (declare (in) vec2 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture2DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArray sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow1DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function shadow1DArrayLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler1DArrayShadow sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function shadow2DArray\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler2DArrayShadow sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_EXT_texture_array_vert [] = { - builtin_shadow1DArray, - builtin_shadow1DArrayLod, - builtin_shadow2DArray, - builtin_texture1DArray, - builtin_texture1DArrayLod, - builtin_texture2DArray, - builtin_texture2DArrayLod, -}; -static const char prototypes_for_OES_EGL_image_external_glsl[] = - "(\n" - "(function texture2D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerExternalOES sampler)\n" - " (declare (in) vec2 coord))\n" - " ()))\n" - "(function texture2DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerExternalOES sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) samplerExternalOES sampler)\n" - " (declare (in) vec4 coord))\n" - " ())))" -; -static const char *functions_for_OES_EGL_image_external_glsl [] = { - builtin_texture2D, - builtin_texture2DProj, -}; -static const char prototypes_for_OES_standard_derivatives_frag[] = - "(\n" - "(function dFdx\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function dFdy\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ()))\n" - "(function fwidth\n" - " (signature float\n" - " (parameters\n" - " (declare (in) float p))\n" - " ())\n" - " (signature vec2\n" - " (parameters\n" - " (declare (in) vec2 p))\n" - " ())\n" - " (signature vec3\n" - " (parameters\n" - " (declare (in) vec3 p))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) vec4 p))\n" - " ())))" -; -static const char *functions_for_OES_standard_derivatives_frag [] = { - builtin_dFdx, - builtin_dFdy, - builtin_fwidth, -}; -static const char prototypes_for_OES_texture_3D_frag[] = - "(\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float bias))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" - " ())\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float bias))\n" - " ())))" -; -static const char *functions_for_OES_texture_3D_frag [] = { - builtin_texture3D, - builtin_texture3DProj, -}; -static const char prototypes_for_OES_texture_3D_vert[] = - "(\n" - "(function texture3D\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord))\n" - " ()))\n" - "(function texture3DProj\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord))\n" - " ()))\n" - "(function texture3DLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec3 coord)\n" - " (declare (in) float lod))\n" - " ()))\n" - "(function texture3DProjLod\n" - " (signature vec4\n" - " (parameters\n" - " (declare (in) sampler3D sampler)\n" - " (declare (in) vec4 coord)\n" - " (declare (in) float lod))\n" - " ())))" -; -static const char *functions_for_OES_texture_3D_vert [] = { - builtin_texture3D, - builtin_texture3DLod, - builtin_texture3DProj, - builtin_texture3DProjLod, -}; -static gl_shader *builtin_profiles[28]; - -static void *builtin_mem_ctx = NULL; - -void -_mesa_glsl_release_functions(void) -{ - ralloc_free(builtin_mem_ctx); - builtin_mem_ctx = NULL; - memset(builtin_profiles, 0, sizeof(builtin_profiles)); -} - -static void -_mesa_read_profile(struct _mesa_glsl_parse_state *state, - int profile_index, - const char *prototypes, - const char **functions, - int count) -{ - gl_shader *sh = builtin_profiles[profile_index]; - - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count); - ralloc_steal(builtin_mem_ctx, sh); - builtin_profiles[profile_index] = sh; - } - - state->builtins_to_link[state->num_builtins_to_link] = sh; - state->num_builtins_to_link++; -} - -void -_mesa_glsl_initialize_functions(struct _mesa_glsl_parse_state *state) -{ - /* If we've already initialized the built-ins, bail early. */ - if (state->num_builtins_to_link > 0) - return; - - if (builtin_mem_ctx == NULL) { - builtin_mem_ctx = ralloc_context(NULL); // "GLSL built-in functions" - memset(&builtin_profiles, 0, sizeof(builtin_profiles)); - } - - if (state->target == fragment_shader && state->language_version == 100) { - _mesa_read_profile(state, 0, - prototypes_for_100_frag, - functions_for_100_frag, - Elements(functions_for_100_frag)); - } - - if (state->language_version == 100) { - _mesa_read_profile(state, 1, - prototypes_for_100_glsl, - functions_for_100_glsl, - Elements(functions_for_100_glsl)); - } - - if (state->target == vertex_shader && state->language_version == 100) { - _mesa_read_profile(state, 2, - prototypes_for_100_vert, - functions_for_100_vert, - Elements(functions_for_100_vert)); - } - - if (state->target == fragment_shader && state->language_version == 110) { - _mesa_read_profile(state, 3, - prototypes_for_110_frag, - functions_for_110_frag, - Elements(functions_for_110_frag)); - } - - if (state->language_version == 110) { - _mesa_read_profile(state, 4, - prototypes_for_110_glsl, - functions_for_110_glsl, - Elements(functions_for_110_glsl)); - } - - if (state->target == vertex_shader && state->language_version == 110) { - _mesa_read_profile(state, 5, - prototypes_for_110_vert, - functions_for_110_vert, - Elements(functions_for_110_vert)); - } - - if (state->target == fragment_shader && state->language_version == 120) { - _mesa_read_profile(state, 6, - prototypes_for_120_frag, - functions_for_120_frag, - Elements(functions_for_120_frag)); - } - - if (state->language_version == 120) { - _mesa_read_profile(state, 7, - prototypes_for_120_glsl, - functions_for_120_glsl, - Elements(functions_for_120_glsl)); - } - - if (state->target == vertex_shader && state->language_version == 120) { - _mesa_read_profile(state, 8, - prototypes_for_120_vert, - functions_for_120_vert, - Elements(functions_for_120_vert)); - } - - if (state->target == fragment_shader && state->language_version == 130) { - _mesa_read_profile(state, 9, - prototypes_for_130_frag, - functions_for_130_frag, - Elements(functions_for_130_frag)); - } - - if (state->language_version == 130) { - _mesa_read_profile(state, 10, - prototypes_for_130_glsl, - functions_for_130_glsl, - Elements(functions_for_130_glsl)); - } - - if (state->target == vertex_shader && state->language_version == 130) { - _mesa_read_profile(state, 11, - prototypes_for_130_vert, - functions_for_130_vert, - Elements(functions_for_130_vert)); - } - - if (state->target == fragment_shader && state->language_version == 140) { - _mesa_read_profile(state, 12, - prototypes_for_140_frag, - functions_for_140_frag, - Elements(functions_for_140_frag)); - } - - if (state->language_version == 140) { - _mesa_read_profile(state, 13, - prototypes_for_140_glsl, - functions_for_140_glsl, - Elements(functions_for_140_glsl)); - } - - if (state->ARB_shader_bit_encoding_enable) { - _mesa_read_profile(state, 14, - prototypes_for_ARB_shader_bit_encoding_glsl, - functions_for_ARB_shader_bit_encoding_glsl, - Elements(functions_for_ARB_shader_bit_encoding_glsl)); - } - - if (state->target == fragment_shader && state->ARB_shader_texture_lod_enable) { - _mesa_read_profile(state, 15, - prototypes_for_ARB_shader_texture_lod_frag, - functions_for_ARB_shader_texture_lod_frag, - Elements(functions_for_ARB_shader_texture_lod_frag)); - } - - if (state->ARB_shader_texture_lod_enable) { - _mesa_read_profile(state, 16, - prototypes_for_ARB_shader_texture_lod_glsl, - functions_for_ARB_shader_texture_lod_glsl, - Elements(functions_for_ARB_shader_texture_lod_glsl)); - } - - if (state->ARB_texture_rectangle_enable) { - _mesa_read_profile(state, 17, - prototypes_for_ARB_texture_rectangle_glsl, - functions_for_ARB_texture_rectangle_glsl, - Elements(functions_for_ARB_texture_rectangle_glsl)); - } - - if (state->target == fragment_shader && state->EXT_shader_texture_lod_enable) { - _mesa_read_profile(state, 18, - prototypes_for_EXT_shader_texture_lod_frag, - functions_for_EXT_shader_texture_lod_frag, - Elements(functions_for_EXT_shader_texture_lod_frag)); - } - - if (state->target == vertex_shader && state->EXT_shader_texture_lod_enable) { - _mesa_read_profile(state, 19, - prototypes_for_EXT_shader_texture_lod_vert, - functions_for_EXT_shader_texture_lod_vert, - Elements(functions_for_EXT_shader_texture_lod_vert)); - } - - if (state->target == fragment_shader && state->EXT_shadow_samplers_enable) { - _mesa_read_profile(state, 20, - prototypes_for_EXT_shadow_samplers_frag, - functions_for_EXT_shadow_samplers_frag, - Elements(functions_for_EXT_shadow_samplers_frag)); - } - - if (state->target == vertex_shader && state->EXT_shadow_samplers_enable) { - _mesa_read_profile(state, 21, - prototypes_for_EXT_shadow_samplers_vert, - functions_for_EXT_shadow_samplers_vert, - Elements(functions_for_EXT_shadow_samplers_vert)); - } - - if (state->target == fragment_shader && state->EXT_texture_array_enable) { - _mesa_read_profile(state, 22, - prototypes_for_EXT_texture_array_frag, - functions_for_EXT_texture_array_frag, - Elements(functions_for_EXT_texture_array_frag)); - } - - if (state->target == vertex_shader && state->EXT_texture_array_enable) { - _mesa_read_profile(state, 23, - prototypes_for_EXT_texture_array_vert, - functions_for_EXT_texture_array_vert, - Elements(functions_for_EXT_texture_array_vert)); - } - - if (state->OES_EGL_image_external_enable) { - _mesa_read_profile(state, 24, - prototypes_for_OES_EGL_image_external_glsl, - functions_for_OES_EGL_image_external_glsl, - Elements(functions_for_OES_EGL_image_external_glsl)); - } - - if (state->target == fragment_shader && state->OES_standard_derivatives_enable) { - _mesa_read_profile(state, 25, - prototypes_for_OES_standard_derivatives_frag, - functions_for_OES_standard_derivatives_frag, - Elements(functions_for_OES_standard_derivatives_frag)); - } - - if (state->target == fragment_shader && state->OES_texture_3D_enable) { - _mesa_read_profile(state, 26, - prototypes_for_OES_texture_3D_frag, - functions_for_OES_texture_3D_frag, - Elements(functions_for_OES_texture_3D_frag)); - } - - if (state->target == vertex_shader && state->OES_texture_3D_enable) { - _mesa_read_profile(state, 27, - prototypes_for_OES_texture_3D_vert, - functions_for_OES_texture_3D_vert, - Elements(functions_for_OES_texture_3D_vert)); - } - -} diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp new file mode 100644 index 000000000..a2ec5c22f --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp @@ -0,0 +1,4190 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file builtin_functions.cpp + * + * Support for GLSL built-in functions. + * + * This file is split into several main components: + * + * 1. Availability predicates + * + * A series of small functions that check whether the current shader + * supports the version/extensions required to expose a built-in. + * + * 2. Core builtin_builder class functionality + * + * 3. Lists of built-in functions + * + * The builtin_builder::create_builtins() function contains lists of all + * built-in function signatures, where they're available, what types they + * take, and so on. + * + * 4. Implementations of built-in function signatures + * + * A series of functions which create ir_function_signatures and emit IR + * via ir_builder to implement them. + * + * 5. External API + * + * A few functions the rest of the compiler can use to interact with the + * built-in function module. For example, searching for a built-in by + * name and parameters. + */ + +#include +#include +#include "main/core.h" /* for struct gl_shader */ +#include "standalone_scaffolding.h" +#include "ir_builder.h" +#include "glsl_parser_extras.h" +#include "program/prog_instruction.h" +#include + +using namespace ir_builder; + +/** + * Availability predicates: + * @{ + */ +static bool +always_available(const _mesa_glsl_parse_state *state) +{ + return true; +} + +static bool +compatibility_vs_only(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_VERTEX && + state->language_version <= 130 && + !state->es_shader; +} + +static bool +fs_only(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT; +} + +static bool +gs_only(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_GEOMETRY; +} + +static bool +v110(const _mesa_glsl_parse_state *state) +{ + return !state->es_shader; +} + +static bool +v110_fs_only(const _mesa_glsl_parse_state *state) +{ + return !state->es_shader && state->stage == MESA_SHADER_FRAGMENT; +} + +static bool +v120(const _mesa_glsl_parse_state *state) +{ + return state->is_version(120, 300); +} + +static bool +v130(const _mesa_glsl_parse_state *state) +{ + return state->is_version(130, 300); +} + +static bool +v130_fs_only(const _mesa_glsl_parse_state *state) +{ + return state->is_version(130, 300) && + state->stage == MESA_SHADER_FRAGMENT; +} + +static bool +v140(const _mesa_glsl_parse_state *state) +{ + return state->is_version(140, 0); +} + +static bool +texture_rectangle(const _mesa_glsl_parse_state *state) +{ + return state->ARB_texture_rectangle_enable; +} + +static bool +texture_external(const _mesa_glsl_parse_state *state) +{ + return state->OES_EGL_image_external_enable; +} + +/** True if texturing functions with explicit LOD are allowed. */ +static bool +lod_exists_in_stage(const _mesa_glsl_parse_state *state) +{ + /* Texturing functions with "Lod" in their name exist: + * - In the vertex shader stage (for all languages) + * - In any stage for GLSL 1.30+ or GLSL ES 3.00 + * - In any stage for desktop GLSL with ARB_shader_texture_lod enabled. + * + * Since ARB_shader_texture_lod can only be enabled on desktop GLSL, we + * don't need to explicitly check state->es_shader. + */ + return state->stage == MESA_SHADER_VERTEX || + state->is_version(130, 300) || + state->ARB_shader_texture_lod_enable; +} + +static bool +es_lod_exists_in_stage(const _mesa_glsl_parse_state *state) +{ + /* Texturing functions with "LodEXT" in their name exist: + * In the fragment shader, for ES1 shader, when EXT_shader_texture_lod + * is enabled. + */ + return + state->stage == MESA_SHADER_FRAGMENT && + state->es_shader && + state->is_version(110, 100) && + state->EXT_shader_texture_lod_enable; +} + +static bool +v110_lod(const _mesa_glsl_parse_state *state) +{ + return !state->es_shader && lod_exists_in_stage(state); +} + +static bool +shader_texture_lod(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shader_texture_lod_enable; +} + +static bool +es_shader_texture_lod(const _mesa_glsl_parse_state *state) +{ + return state->EXT_shader_texture_lod_enable; +} + +static bool +es_shadow_samplers(const _mesa_glsl_parse_state *state) +{ + return state->EXT_shadow_samplers_enable; +} + +static bool +shader_texture_lod_and_rect(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shader_texture_lod_enable && + state->ARB_texture_rectangle_enable; +} + +static bool +shader_bit_encoding(const _mesa_glsl_parse_state *state) +{ + return state->is_version(330, 300) || + state->ARB_shader_bit_encoding_enable || + state->ARB_gpu_shader5_enable; +} + +static bool +shader_integer_mix(const _mesa_glsl_parse_state *state) +{ + return v130(state) && state->EXT_shader_integer_mix_enable; +} + +static bool +shader_packing(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shading_language_packing_enable || + state->is_version(400, 0); +} + +static bool +shader_packing_or_es3(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shading_language_packing_enable || + state->is_version(400, 300); +} + +static bool +gpu_shader5(const _mesa_glsl_parse_state *state) +{ + return state->is_version(400, 0) || state->ARB_gpu_shader5_enable; +} + +static bool +texture_array_lod(const _mesa_glsl_parse_state *state) +{ + return lod_exists_in_stage(state) && + state->EXT_texture_array_enable; +} + +static bool +fs_texture_array(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + state->EXT_texture_array_enable; +} + +static bool +texture_array(const _mesa_glsl_parse_state *state) +{ + return state->EXT_texture_array_enable; +} + +static bool +texture_multisample(const _mesa_glsl_parse_state *state) +{ + return state->is_version(150, 0) || + state->ARB_texture_multisample_enable; +} + +static bool +fs_texture_cube_map_array(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + (state->is_version(400, 0) || + state->ARB_texture_cube_map_array_enable); +} + +static bool +texture_cube_map_array(const _mesa_glsl_parse_state *state) +{ + return state->is_version(400, 0) || + state->ARB_texture_cube_map_array_enable; +} + +static bool +texture_query_levels(const _mesa_glsl_parse_state *state) +{ + return state->is_version(430, 0) || + state->ARB_texture_query_levels_enable; +} + +static bool +texture_query_lod(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + state->ARB_texture_query_lod_enable; +} + +static bool +texture_gather(const _mesa_glsl_parse_state *state) +{ + return state->is_version(400, 0) || + state->ARB_texture_gather_enable || + state->ARB_gpu_shader5_enable; +} + +/* Only ARB_texture_gather but not GLSL 4.0 or ARB_gpu_shader5. + * used for relaxation of const offset requirements. + */ +static bool +texture_gather_only(const _mesa_glsl_parse_state *state) +{ + return !state->is_version(400, 0) && + !state->ARB_gpu_shader5_enable && + state->ARB_texture_gather_enable; +} + +/* Desktop GL or OES_standard_derivatives + fragment shader only */ +static bool +fs_oes_derivatives(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + (state->is_version(110, 300) || + state->OES_standard_derivatives_enable); +} + +static bool +tex1d_lod(const _mesa_glsl_parse_state *state) +{ + return !state->es_shader && lod_exists_in_stage(state); +} + +/** True if sampler3D exists */ +static bool +tex3d(const _mesa_glsl_parse_state *state) +{ + /* sampler3D exists in all desktop GLSL versions, GLSL ES 1.00 with the + * OES_texture_3D extension, and in GLSL ES 3.00. + */ + return !state->es_shader || + state->OES_texture_3D_enable || + state->language_version >= 300; +} + +static bool +fs_tex3d(const _mesa_glsl_parse_state *state) +{ + return state->stage == MESA_SHADER_FRAGMENT && + (!state->es_shader || state->OES_texture_3D_enable); +} + +static bool +tex3d_lod(const _mesa_glsl_parse_state *state) +{ + return tex3d(state) && lod_exists_in_stage(state); +} + +static bool +shader_atomic_counters(const _mesa_glsl_parse_state *state) +{ + return state->ARB_shader_atomic_counters_enable; +} + +static bool +shader_trinary_minmax(const _mesa_glsl_parse_state *state) +{ + return state->AMD_shader_trinary_minmax_enable; +} + +/** @} */ + +/******************************************************************************/ + +namespace { + +/** + * builtin_builder: A singleton object representing the core of the built-in + * function module. + * + * It generates IR for every built-in function signature, and organizes them + * into functions. + */ +class builtin_builder { +public: + builtin_builder(); + ~builtin_builder(); + + void initialize(); + void release(); + ir_function_signature *find(_mesa_glsl_parse_state *state, + const char *name, exec_list *actual_parameters); + + /** + * A shader to hold all the built-in signatures; created by this module. + * + * This includes signatures for every built-in, regardless of version or + * enabled extensions. The availability predicate associated with each + * signature allows matching_signature() to filter out the irrelevant ones. + */ + gl_shader *shader; + +private: + void *mem_ctx; + + /** Global variables used by built-in functions. */ + ir_variable *gl_ModelViewProjectionMatrix; + ir_variable *gl_Vertex; + + void create_shader(); + void create_intrinsics(); + void create_builtins(); + + /** + * IR builder helpers: + * + * These convenience functions assist in emitting IR, but don't necessarily + * fit in ir_builder itself. Many of them rely on having a mem_ctx class + * member available. + */ + ir_variable *in_var(const glsl_type *type, const char *name); + ir_variable *out_var(const glsl_type *type, const char *name); + ir_constant *imm(float f, unsigned vector_elements=1); + ir_constant *imm(int i, unsigned vector_elements=1); + ir_constant *imm(unsigned u, unsigned vector_elements=1); + ir_constant *imm(const glsl_type *type, const ir_constant_data &); + ir_dereference_variable *var_ref(ir_variable *var); + ir_dereference_array *array_ref(ir_variable *var, int i); + ir_swizzle *matrix_elt(ir_variable *var, int col, int row); + + ir_expression *asin_expr(ir_variable *x); + + /** + * Call function \param f with parameters specified as the linked + * list \param params of \c ir_variable objects. \param ret should + * point to the ir_variable that will hold the function return + * value, or be \c NULL if the function has void return type. + */ + ir_call *call(ir_function *f, ir_variable *ret, exec_list params); + + /** Create a new function and add the given signatures. */ + void add_function(const char *name, ...); + + ir_function_signature *new_sig(const glsl_type *return_type, + builtin_available_predicate avail, + int num_params, ...); + + /** + * Function signature generators: + * @{ + */ + ir_function_signature *unop(builtin_available_predicate avail, + ir_expression_operation opcode, + const glsl_type *return_type, + const glsl_type *param_type); + ir_function_signature *binop(ir_expression_operation opcode, + builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *param0_type, + const glsl_type *param1_type); + +#define B0(X) ir_function_signature *_##X(); +#define B1(X) ir_function_signature *_##X(const glsl_type *); +#define B2(X) ir_function_signature *_##X(const glsl_type *, const glsl_type *); +#define B3(X) ir_function_signature *_##X(const glsl_type *, const glsl_type *, const glsl_type *); +#define BA1(X) ir_function_signature *_##X(builtin_available_predicate, const glsl_type *); +#define BA2(X) ir_function_signature *_##X(builtin_available_predicate, const glsl_type *, const glsl_type *); + B1(radians) + B1(degrees) + B1(sin) + B1(cos) + B1(tan) + B1(asin) + B1(acos) + B1(atan2) + B1(atan) + B1(sinh) + B1(cosh) + B1(tanh) + B1(asinh) + B1(acosh) + B1(atanh) + B1(pow) + B1(exp) + B1(log) + B1(exp2) + B1(log2) + B1(sqrt) + B1(inversesqrt) + B1(abs) + B1(sign) + B1(floor) + B1(trunc) + B1(round) + B1(roundEven) + B1(ceil) + B1(fract) + B2(mod) + B1(modf) + BA2(min) + BA2(max) + BA2(clamp) + B2(mix_lrp) + ir_function_signature *_mix_sel(builtin_available_predicate avail, + const glsl_type *val_type, + const glsl_type *blend_type); + B2(step) + B2(smoothstep) + B1(isnan) + B1(isinf) + B1(floatBitsToInt) + B1(floatBitsToUint) + B1(intBitsToFloat) + B1(uintBitsToFloat) + ir_function_signature *_packUnorm2x16(builtin_available_predicate avail); + ir_function_signature *_packSnorm2x16(builtin_available_predicate avail); + ir_function_signature *_packUnorm4x8(builtin_available_predicate avail); + ir_function_signature *_packSnorm4x8(builtin_available_predicate avail); + ir_function_signature *_unpackUnorm2x16(builtin_available_predicate avail); + ir_function_signature *_unpackSnorm2x16(builtin_available_predicate avail); + ir_function_signature *_unpackUnorm4x8(builtin_available_predicate avail); + ir_function_signature *_unpackSnorm4x8(builtin_available_predicate avail); + ir_function_signature *_packHalf2x16(builtin_available_predicate avail); + ir_function_signature *_unpackHalf2x16(builtin_available_predicate avail); + B1(length) + B1(distance); + B1(dot); + B1(cross); + B1(normalize); + B0(ftransform); + B1(faceforward); + B1(reflect); + B1(refract); + B1(matrixCompMult); + B1(outerProduct); + B0(determinant_mat2); + B0(determinant_mat3); + B0(determinant_mat4); + B0(inverse_mat2); + B0(inverse_mat3); + B0(inverse_mat4); + B1(transpose); + BA1(lessThan); + BA1(lessThanEqual); + BA1(greaterThan); + BA1(greaterThanEqual); + BA1(equal); + BA1(notEqual); + B1(any); + B1(all); + B1(not); + B2(textureSize); + ir_function_signature *_textureSize(builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *sampler_type); + +/** Flags to _texture() */ +#define TEX_PROJECT 1 +#define TEX_OFFSET 2 +#define TEX_COMPONENT 4 +#define TEX_OFFSET_NONCONST 8 +#define TEX_OFFSET_ARRAY 16 + + ir_function_signature *_texture(ir_texture_opcode opcode, + builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *sampler_type, + const glsl_type *coord_type, + int flags = 0); + B0(textureCubeArrayShadow); + ir_function_signature *_texelFetch(builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *sampler_type, + const glsl_type *coord_type, + const glsl_type *offset_type = NULL); + + B0(EmitVertex) + B0(EndPrimitive) + + B2(textureQueryLod); + B1(textureQueryLevels); + B1(dFdx); + B1(dFdy); + B1(fwidth); + B1(noise1); + B1(noise2); + B1(noise3); + B1(noise4); + + B1(bitfieldExtract) + B1(bitfieldInsert) + B1(bitfieldReverse) + B1(bitCount) + B1(findLSB) + B1(findMSB) + B1(fma) + B2(ldexp) + B2(frexp) + B1(uaddCarry) + B1(usubBorrow) + B1(mulExtended) + + ir_function_signature *_atomic_intrinsic(builtin_available_predicate avail); + ir_function_signature *_atomic_op(const char *intrinsic, + builtin_available_predicate avail); + + B1(min3) + B1(max3) + B1(mid3) + +#undef B0 +#undef B1 +#undef B2 +#undef B3 +#undef BA1 +#undef BA2 + /** @} */ +}; + +} /* anonymous namespace */ + +/** + * Core builtin_builder functionality: + * @{ + */ +builtin_builder::builtin_builder() + : shader(NULL), + gl_ModelViewProjectionMatrix(NULL), + gl_Vertex(NULL) +{ + mem_ctx = NULL; +} + +builtin_builder::~builtin_builder() +{ + ralloc_free(mem_ctx); +} + +ir_function_signature * +builtin_builder::find(_mesa_glsl_parse_state *state, + const char *name, exec_list *actual_parameters) +{ + /* The shader currently being compiled requested a built-in function; + * it needs to link against builtin_builder::shader in order to get them. + * + * Even if we don't find a matching signature, we still need to do this so + * that the "no matching signature" error will list potential candidates + * from the available built-ins. + */ + state->uses_builtin_functions = true; + + ir_function *f = shader->symbols->get_function(name); + if (f == NULL) + return NULL; + + ir_function_signature *sig = f->matching_signature(state, actual_parameters); + if (sig == NULL) + return NULL; + + return sig; +} + +void +builtin_builder::initialize() +{ + /* If already initialized, don't do it again. */ + if (mem_ctx != NULL) + return; + + mem_ctx = ralloc_context(NULL); + create_shader(); + create_intrinsics(); + create_builtins(); +} + +void +builtin_builder::release() +{ + ralloc_free(mem_ctx); + mem_ctx = NULL; + + ralloc_free(shader); + shader = NULL; +} + +void +builtin_builder::create_shader() +{ + /* The target doesn't actually matter. There's no target for generic + * GLSL utility code that could be linked against any stage, so just + * arbitrarily pick GL_VERTEX_SHADER. + */ + shader = _mesa_new_shader(NULL, 0, GL_VERTEX_SHADER); + shader->symbols = new(mem_ctx) glsl_symbol_table; + + gl_ModelViewProjectionMatrix = + new(mem_ctx) ir_variable(glsl_type::mat4_type, + "gl_ModelViewProjectionMatrix", + ir_var_uniform, glsl_precision_high); + + shader->symbols->add_variable(gl_ModelViewProjectionMatrix); + + gl_Vertex = in_var(glsl_type::vec4_type, "gl_Vertex"); + shader->symbols->add_variable(gl_Vertex); +} + +/** @} */ + +/** + * Create ir_function and ir_function_signature objects for each + * intrinsic. + */ +void +builtin_builder::create_intrinsics() +{ + add_function("__intrinsic_atomic_read", + _atomic_intrinsic(shader_atomic_counters), + NULL); + add_function("__intrinsic_atomic_increment", + _atomic_intrinsic(shader_atomic_counters), + NULL); + add_function("__intrinsic_atomic_predecrement", + _atomic_intrinsic(shader_atomic_counters), + NULL); +} + +/** + * Create ir_function and ir_function_signature objects for each built-in. + * + * Contains a list of every available built-in. + */ +void +builtin_builder::create_builtins() +{ +#define F(NAME) \ + add_function(#NAME, \ + _##NAME(glsl_type::float_type), \ + _##NAME(glsl_type::vec2_type), \ + _##NAME(glsl_type::vec3_type), \ + _##NAME(glsl_type::vec4_type), \ + NULL); + +#define FI(NAME) \ + add_function(#NAME, \ + _##NAME(glsl_type::float_type), \ + _##NAME(glsl_type::vec2_type), \ + _##NAME(glsl_type::vec3_type), \ + _##NAME(glsl_type::vec4_type), \ + _##NAME(glsl_type::int_type), \ + _##NAME(glsl_type::ivec2_type), \ + _##NAME(glsl_type::ivec3_type), \ + _##NAME(glsl_type::ivec4_type), \ + NULL); + +#define FIU(NAME) \ + add_function(#NAME, \ + _##NAME(always_available, glsl_type::float_type), \ + _##NAME(always_available, glsl_type::vec2_type), \ + _##NAME(always_available, glsl_type::vec3_type), \ + _##NAME(always_available, glsl_type::vec4_type), \ + \ + _##NAME(always_available, glsl_type::int_type), \ + _##NAME(always_available, glsl_type::ivec2_type), \ + _##NAME(always_available, glsl_type::ivec3_type), \ + _##NAME(always_available, glsl_type::ivec4_type), \ + \ + _##NAME(v130, glsl_type::uint_type), \ + _##NAME(v130, glsl_type::uvec2_type), \ + _##NAME(v130, glsl_type::uvec3_type), \ + _##NAME(v130, glsl_type::uvec4_type), \ + NULL); + +#define IU(NAME) \ + add_function(#NAME, \ + _##NAME(glsl_type::int_type), \ + _##NAME(glsl_type::ivec2_type), \ + _##NAME(glsl_type::ivec3_type), \ + _##NAME(glsl_type::ivec4_type), \ + \ + _##NAME(glsl_type::uint_type), \ + _##NAME(glsl_type::uvec2_type), \ + _##NAME(glsl_type::uvec3_type), \ + _##NAME(glsl_type::uvec4_type), \ + NULL); + +#define FIUB(NAME) \ + add_function(#NAME, \ + _##NAME(always_available, glsl_type::float_type), \ + _##NAME(always_available, glsl_type::vec2_type), \ + _##NAME(always_available, glsl_type::vec3_type), \ + _##NAME(always_available, glsl_type::vec4_type), \ + \ + _##NAME(always_available, glsl_type::int_type), \ + _##NAME(always_available, glsl_type::ivec2_type), \ + _##NAME(always_available, glsl_type::ivec3_type), \ + _##NAME(always_available, glsl_type::ivec4_type), \ + \ + _##NAME(v130, glsl_type::uint_type), \ + _##NAME(v130, glsl_type::uvec2_type), \ + _##NAME(v130, glsl_type::uvec3_type), \ + _##NAME(v130, glsl_type::uvec4_type), \ + \ + _##NAME(always_available, glsl_type::bool_type), \ + _##NAME(always_available, glsl_type::bvec2_type), \ + _##NAME(always_available, glsl_type::bvec3_type), \ + _##NAME(always_available, glsl_type::bvec4_type), \ + NULL); + +#define FIU2_MIXED(NAME) \ + add_function(#NAME, \ + _##NAME(always_available, glsl_type::float_type, glsl_type::float_type), \ + _##NAME(always_available, glsl_type::vec2_type, glsl_type::float_type), \ + _##NAME(always_available, glsl_type::vec3_type, glsl_type::float_type), \ + _##NAME(always_available, glsl_type::vec4_type, glsl_type::float_type), \ + \ + _##NAME(always_available, glsl_type::vec2_type, glsl_type::vec2_type), \ + _##NAME(always_available, glsl_type::vec3_type, glsl_type::vec3_type), \ + _##NAME(always_available, glsl_type::vec4_type, glsl_type::vec4_type), \ + \ + _##NAME(always_available, glsl_type::int_type, glsl_type::int_type), \ + _##NAME(always_available, glsl_type::ivec2_type, glsl_type::int_type), \ + _##NAME(always_available, glsl_type::ivec3_type, glsl_type::int_type), \ + _##NAME(always_available, glsl_type::ivec4_type, glsl_type::int_type), \ + \ + _##NAME(always_available, glsl_type::ivec2_type, glsl_type::ivec2_type), \ + _##NAME(always_available, glsl_type::ivec3_type, glsl_type::ivec3_type), \ + _##NAME(always_available, glsl_type::ivec4_type, glsl_type::ivec4_type), \ + \ + _##NAME(v130, glsl_type::uint_type, glsl_type::uint_type), \ + _##NAME(v130, glsl_type::uvec2_type, glsl_type::uint_type), \ + _##NAME(v130, glsl_type::uvec3_type, glsl_type::uint_type), \ + _##NAME(v130, glsl_type::uvec4_type, glsl_type::uint_type), \ + \ + _##NAME(v130, glsl_type::uvec2_type, glsl_type::uvec2_type), \ + _##NAME(v130, glsl_type::uvec3_type, glsl_type::uvec3_type), \ + _##NAME(v130, glsl_type::uvec4_type, glsl_type::uvec4_type), \ + NULL); + + F(radians) + F(degrees) + F(sin) + F(cos) + F(tan) + F(asin) + F(acos) + + add_function("atan", + _atan(glsl_type::float_type), + _atan(glsl_type::vec2_type), + _atan(glsl_type::vec3_type), + _atan(glsl_type::vec4_type), + _atan2(glsl_type::float_type), + _atan2(glsl_type::vec2_type), + _atan2(glsl_type::vec3_type), + _atan2(glsl_type::vec4_type), + NULL); + + F(sinh) + F(cosh) + F(tanh) + F(asinh) + F(acosh) + F(atanh) + F(pow) + F(exp) + F(log) + F(exp2) + F(log2) + F(sqrt) + F(inversesqrt) + FI(abs) + FI(sign) + F(floor) + F(trunc) + F(round) + F(roundEven) + F(ceil) + F(fract) + + add_function("mod", + _mod(glsl_type::float_type, glsl_type::float_type), + _mod(glsl_type::vec2_type, glsl_type::float_type), + _mod(glsl_type::vec3_type, glsl_type::float_type), + _mod(glsl_type::vec4_type, glsl_type::float_type), + + _mod(glsl_type::vec2_type, glsl_type::vec2_type), + _mod(glsl_type::vec3_type, glsl_type::vec3_type), + _mod(glsl_type::vec4_type, glsl_type::vec4_type), + NULL); + + F(modf) + + FIU2_MIXED(min) + FIU2_MIXED(max) + FIU2_MIXED(clamp) + + add_function("mix", + _mix_lrp(glsl_type::float_type, glsl_type::float_type), + _mix_lrp(glsl_type::vec2_type, glsl_type::float_type), + _mix_lrp(glsl_type::vec3_type, glsl_type::float_type), + _mix_lrp(glsl_type::vec4_type, glsl_type::float_type), + + _mix_lrp(glsl_type::vec2_type, glsl_type::vec2_type), + _mix_lrp(glsl_type::vec3_type, glsl_type::vec3_type), + _mix_lrp(glsl_type::vec4_type, glsl_type::vec4_type), + + _mix_sel(v130, glsl_type::float_type, glsl_type::bool_type), + _mix_sel(v130, glsl_type::vec2_type, glsl_type::bvec2_type), + _mix_sel(v130, glsl_type::vec3_type, glsl_type::bvec3_type), + _mix_sel(v130, glsl_type::vec4_type, glsl_type::bvec4_type), + + _mix_sel(shader_integer_mix, glsl_type::int_type, glsl_type::bool_type), + _mix_sel(shader_integer_mix, glsl_type::ivec2_type, glsl_type::bvec2_type), + _mix_sel(shader_integer_mix, glsl_type::ivec3_type, glsl_type::bvec3_type), + _mix_sel(shader_integer_mix, glsl_type::ivec4_type, glsl_type::bvec4_type), + + _mix_sel(shader_integer_mix, glsl_type::uint_type, glsl_type::bool_type), + _mix_sel(shader_integer_mix, glsl_type::uvec2_type, glsl_type::bvec2_type), + _mix_sel(shader_integer_mix, glsl_type::uvec3_type, glsl_type::bvec3_type), + _mix_sel(shader_integer_mix, glsl_type::uvec4_type, glsl_type::bvec4_type), + + _mix_sel(shader_integer_mix, glsl_type::bool_type, glsl_type::bool_type), + _mix_sel(shader_integer_mix, glsl_type::bvec2_type, glsl_type::bvec2_type), + _mix_sel(shader_integer_mix, glsl_type::bvec3_type, glsl_type::bvec3_type), + _mix_sel(shader_integer_mix, glsl_type::bvec4_type, glsl_type::bvec4_type), + NULL); + + add_function("step", + _step(glsl_type::float_type, glsl_type::float_type), + _step(glsl_type::float_type, glsl_type::vec2_type), + _step(glsl_type::float_type, glsl_type::vec3_type), + _step(glsl_type::float_type, glsl_type::vec4_type), + + _step(glsl_type::vec2_type, glsl_type::vec2_type), + _step(glsl_type::vec3_type, glsl_type::vec3_type), + _step(glsl_type::vec4_type, glsl_type::vec4_type), + NULL); + + add_function("smoothstep", + _smoothstep(glsl_type::float_type, glsl_type::float_type), + _smoothstep(glsl_type::float_type, glsl_type::vec2_type), + _smoothstep(glsl_type::float_type, glsl_type::vec3_type), + _smoothstep(glsl_type::float_type, glsl_type::vec4_type), + + _smoothstep(glsl_type::vec2_type, glsl_type::vec2_type), + _smoothstep(glsl_type::vec3_type, glsl_type::vec3_type), + _smoothstep(glsl_type::vec4_type, glsl_type::vec4_type), + NULL); + + F(isnan) + F(isinf) + + F(floatBitsToInt) + F(floatBitsToUint) + add_function("intBitsToFloat", + _intBitsToFloat(glsl_type::int_type), + _intBitsToFloat(glsl_type::ivec2_type), + _intBitsToFloat(glsl_type::ivec3_type), + _intBitsToFloat(glsl_type::ivec4_type), + NULL); + add_function("uintBitsToFloat", + _uintBitsToFloat(glsl_type::uint_type), + _uintBitsToFloat(glsl_type::uvec2_type), + _uintBitsToFloat(glsl_type::uvec3_type), + _uintBitsToFloat(glsl_type::uvec4_type), + NULL); + + add_function("packUnorm2x16", _packUnorm2x16(shader_packing_or_es3), NULL); + add_function("packSnorm2x16", _packSnorm2x16(shader_packing_or_es3), NULL); + add_function("packUnorm4x8", _packUnorm4x8(shader_packing), NULL); + add_function("packSnorm4x8", _packSnorm4x8(shader_packing), NULL); + add_function("unpackUnorm2x16", _unpackUnorm2x16(shader_packing_or_es3), NULL); + add_function("unpackSnorm2x16", _unpackSnorm2x16(shader_packing_or_es3), NULL); + add_function("unpackUnorm4x8", _unpackUnorm4x8(shader_packing), NULL); + add_function("unpackSnorm4x8", _unpackSnorm4x8(shader_packing), NULL); + add_function("packHalf2x16", _packHalf2x16(shader_packing_or_es3), NULL); + add_function("unpackHalf2x16", _unpackHalf2x16(shader_packing_or_es3), NULL); + + F(length) + F(distance) + F(dot) + + add_function("cross", _cross(glsl_type::vec3_type), NULL); + + F(normalize) + add_function("ftransform", _ftransform(), NULL); + F(faceforward) + F(reflect) + F(refract) + // ... + add_function("matrixCompMult", + _matrixCompMult(glsl_type::mat2_type), + _matrixCompMult(glsl_type::mat3_type), + _matrixCompMult(glsl_type::mat4_type), + _matrixCompMult(glsl_type::mat2x3_type), + _matrixCompMult(glsl_type::mat2x4_type), + _matrixCompMult(glsl_type::mat3x2_type), + _matrixCompMult(glsl_type::mat3x4_type), + _matrixCompMult(glsl_type::mat4x2_type), + _matrixCompMult(glsl_type::mat4x3_type), + NULL); + add_function("outerProduct", + _outerProduct(glsl_type::mat2_type), + _outerProduct(glsl_type::mat3_type), + _outerProduct(glsl_type::mat4_type), + _outerProduct(glsl_type::mat2x3_type), + _outerProduct(glsl_type::mat2x4_type), + _outerProduct(glsl_type::mat3x2_type), + _outerProduct(glsl_type::mat3x4_type), + _outerProduct(glsl_type::mat4x2_type), + _outerProduct(glsl_type::mat4x3_type), + NULL); + add_function("determinant", + _determinant_mat2(), + _determinant_mat3(), + _determinant_mat4(), + NULL); + add_function("inverse", + _inverse_mat2(), + _inverse_mat3(), + _inverse_mat4(), + NULL); + add_function("transpose", + _transpose(glsl_type::mat2_type), + _transpose(glsl_type::mat3_type), + _transpose(glsl_type::mat4_type), + _transpose(glsl_type::mat2x3_type), + _transpose(glsl_type::mat2x4_type), + _transpose(glsl_type::mat3x2_type), + _transpose(glsl_type::mat3x4_type), + _transpose(glsl_type::mat4x2_type), + _transpose(glsl_type::mat4x3_type), + NULL); + FIU(lessThan) + FIU(lessThanEqual) + FIU(greaterThan) + FIU(greaterThanEqual) + FIUB(notEqual) + FIUB(equal) + + add_function("any", + _any(glsl_type::bvec2_type), + _any(glsl_type::bvec3_type), + _any(glsl_type::bvec4_type), + NULL); + + add_function("all", + _all(glsl_type::bvec2_type), + _all(glsl_type::bvec3_type), + _all(glsl_type::bvec4_type), + NULL); + + add_function("not", + _not(glsl_type::bvec2_type), + _not(glsl_type::bvec3_type), + _not(glsl_type::bvec4_type), + NULL); + + add_function("textureSize", + _textureSize(v130, glsl_type::int_type, glsl_type::sampler1D_type), + _textureSize(v130, glsl_type::int_type, glsl_type::isampler1D_type), + _textureSize(v130, glsl_type::int_type, glsl_type::usampler1D_type), + + _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2D_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::isampler2D_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::usampler2D_type), + + _textureSize(v130, glsl_type::ivec3_type, glsl_type::sampler3D_type), + _textureSize(v130, glsl_type::ivec3_type, glsl_type::isampler3D_type), + _textureSize(v130, glsl_type::ivec3_type, glsl_type::usampler3D_type), + + _textureSize(v130, glsl_type::ivec2_type, glsl_type::samplerCube_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::isamplerCube_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::usamplerCube_type), + + _textureSize(v130, glsl_type::int_type, glsl_type::sampler1DShadow_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2DShadow_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::samplerCubeShadow_type), + + _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler1DArray_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::isampler1DArray_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::usampler1DArray_type), + _textureSize(v130, glsl_type::ivec3_type, glsl_type::sampler2DArray_type), + _textureSize(v130, glsl_type::ivec3_type, glsl_type::isampler2DArray_type), + _textureSize(v130, glsl_type::ivec3_type, glsl_type::usampler2DArray_type), + + _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler1DArrayShadow_type), + _textureSize(v130, glsl_type::ivec3_type, glsl_type::sampler2DArrayShadow_type), + + _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::samplerCubeArray_type), + _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::isamplerCubeArray_type), + _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::usamplerCubeArray_type), + _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::samplerCubeArrayShadow_type), + + _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2DRect_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::isampler2DRect_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::usampler2DRect_type), + _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2DRectShadow_type), + + _textureSize(v140, glsl_type::int_type, glsl_type::samplerBuffer_type), + _textureSize(v140, glsl_type::int_type, glsl_type::isamplerBuffer_type), + _textureSize(v140, glsl_type::int_type, glsl_type::usamplerBuffer_type), + _textureSize(texture_multisample, glsl_type::ivec2_type, glsl_type::sampler2DMS_type), + _textureSize(texture_multisample, glsl_type::ivec2_type, glsl_type::isampler2DMS_type), + _textureSize(texture_multisample, glsl_type::ivec2_type, glsl_type::usampler2DMS_type), + + _textureSize(texture_multisample, glsl_type::ivec3_type, glsl_type::sampler2DMSArray_type), + _textureSize(texture_multisample, glsl_type::ivec3_type, glsl_type::isampler2DMSArray_type), + _textureSize(texture_multisample, glsl_type::ivec3_type, glsl_type::usampler2DMSArray_type), + NULL); + + add_function("texture", + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type), + + _texture(ir_tex, texture_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_tex, texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_tex, texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type), + /* samplerCubeArrayShadow is special; it has an extra parameter + * for the shadow comparitor since there is no vec5 type. + */ + _textureCubeArrayShadow(), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type), + + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type), + + _texture(ir_txb, fs_texture_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_txb, fs_texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_txb, fs_texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type), + + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + NULL); + + add_function("textureLod", + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type), + + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type), + + _texture(ir_txl, texture_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_txl, texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_txl, texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type), + + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + NULL); + + add_function("textureOffset", + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET), + NULL); + + add_function("textureProj", + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txb, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texelFetch", + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::int_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::int_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::int_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::ivec2_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::ivec3_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::ivec3_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::ivec3_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::ivec2_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::ivec2_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::ivec3_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::ivec3_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::ivec3_type), + + _texelFetch(v140, glsl_type::vec4_type, glsl_type::samplerBuffer_type, glsl_type::int_type), + _texelFetch(v140, glsl_type::ivec4_type, glsl_type::isamplerBuffer_type, glsl_type::int_type), + _texelFetch(v140, glsl_type::uvec4_type, glsl_type::usamplerBuffer_type, glsl_type::int_type), + + _texelFetch(texture_multisample, glsl_type::vec4_type, glsl_type::sampler2DMS_type, glsl_type::ivec2_type), + _texelFetch(texture_multisample, glsl_type::ivec4_type, glsl_type::isampler2DMS_type, glsl_type::ivec2_type), + _texelFetch(texture_multisample, glsl_type::uvec4_type, glsl_type::usampler2DMS_type, glsl_type::ivec2_type), + + _texelFetch(texture_multisample, glsl_type::vec4_type, glsl_type::sampler2DMSArray_type, glsl_type::ivec3_type), + _texelFetch(texture_multisample, glsl_type::ivec4_type, glsl_type::isampler2DMSArray_type, glsl_type::ivec3_type), + _texelFetch(texture_multisample, glsl_type::uvec4_type, glsl_type::usampler2DMSArray_type, glsl_type::ivec3_type), + NULL); + + add_function("texelFetchOffset", + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::int_type, glsl_type::int_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::int_type, glsl_type::int_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::int_type, glsl_type::int_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type), + + _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type), + _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type), + + NULL); + + add_function("textureProjOffset", + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txb, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txb, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txb, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + NULL); + + add_function("textureLodOffset", + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET), + NULL); + + add_function("textureProjLod", + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("textureProjLodOffset", + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + NULL); + + add_function("textureGrad", + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type), + + _texture(ir_txd, texture_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_txd, texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_txd, texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type), + NULL); + + add_function("textureGradOffset", + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET), + NULL); + + add_function("textureProjGrad", + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("textureProjGradOffset", + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET), + NULL); + + add_function("EmitVertex", _EmitVertex(), NULL); + add_function("EndPrimitive", _EndPrimitive(), NULL); + + add_function("textureQueryLOD", + _textureQueryLod(glsl_type::sampler1D_type, glsl_type::float_type), + _textureQueryLod(glsl_type::isampler1D_type, glsl_type::float_type), + _textureQueryLod(glsl_type::usampler1D_type, glsl_type::float_type), + + _textureQueryLod(glsl_type::sampler2D_type, glsl_type::vec2_type), + _textureQueryLod(glsl_type::isampler2D_type, glsl_type::vec2_type), + _textureQueryLod(glsl_type::usampler2D_type, glsl_type::vec2_type), + + _textureQueryLod(glsl_type::sampler3D_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::isampler3D_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::usampler3D_type, glsl_type::vec3_type), + + _textureQueryLod(glsl_type::samplerCube_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::isamplerCube_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::usamplerCube_type, glsl_type::vec3_type), + + _textureQueryLod(glsl_type::sampler1DArray_type, glsl_type::float_type), + _textureQueryLod(glsl_type::isampler1DArray_type, glsl_type::float_type), + _textureQueryLod(glsl_type::usampler1DArray_type, glsl_type::float_type), + + _textureQueryLod(glsl_type::sampler2DArray_type, glsl_type::vec2_type), + _textureQueryLod(glsl_type::isampler2DArray_type, glsl_type::vec2_type), + _textureQueryLod(glsl_type::usampler2DArray_type, glsl_type::vec2_type), + + _textureQueryLod(glsl_type::samplerCubeArray_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::isamplerCubeArray_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::usamplerCubeArray_type, glsl_type::vec3_type), + + _textureQueryLod(glsl_type::sampler1DShadow_type, glsl_type::float_type), + _textureQueryLod(glsl_type::sampler2DShadow_type, glsl_type::vec2_type), + _textureQueryLod(glsl_type::samplerCubeShadow_type, glsl_type::vec3_type), + _textureQueryLod(glsl_type::sampler1DArrayShadow_type, glsl_type::float_type), + _textureQueryLod(glsl_type::sampler2DArrayShadow_type, glsl_type::vec2_type), + _textureQueryLod(glsl_type::samplerCubeArrayShadow_type, glsl_type::vec3_type), + NULL); + + add_function("textureQueryLevels", + _textureQueryLevels(glsl_type::sampler1D_type), + _textureQueryLevels(glsl_type::sampler2D_type), + _textureQueryLevels(glsl_type::sampler3D_type), + _textureQueryLevels(glsl_type::samplerCube_type), + _textureQueryLevels(glsl_type::sampler1DArray_type), + _textureQueryLevels(glsl_type::sampler2DArray_type), + _textureQueryLevels(glsl_type::samplerCubeArray_type), + _textureQueryLevels(glsl_type::sampler1DShadow_type), + _textureQueryLevels(glsl_type::sampler2DShadow_type), + _textureQueryLevels(glsl_type::samplerCubeShadow_type), + _textureQueryLevels(glsl_type::sampler1DArrayShadow_type), + _textureQueryLevels(glsl_type::sampler2DArrayShadow_type), + _textureQueryLevels(glsl_type::samplerCubeArrayShadow_type), + + _textureQueryLevels(glsl_type::isampler1D_type), + _textureQueryLevels(glsl_type::isampler2D_type), + _textureQueryLevels(glsl_type::isampler3D_type), + _textureQueryLevels(glsl_type::isamplerCube_type), + _textureQueryLevels(glsl_type::isampler1DArray_type), + _textureQueryLevels(glsl_type::isampler2DArray_type), + _textureQueryLevels(glsl_type::isamplerCubeArray_type), + + _textureQueryLevels(glsl_type::usampler1D_type), + _textureQueryLevels(glsl_type::usampler2D_type), + _textureQueryLevels(glsl_type::usampler3D_type), + _textureQueryLevels(glsl_type::usamplerCube_type), + _textureQueryLevels(glsl_type::usampler1DArray_type), + _textureQueryLevels(glsl_type::usampler2DArray_type), + _textureQueryLevels(glsl_type::usamplerCubeArray_type), + + NULL); + + add_function("texture1D", + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + NULL); + + add_function("texture1DArray", + _texture(ir_tex, texture_array, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + _texture(ir_txb, fs_texture_array, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + NULL); + + add_function("texture1DProj", + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture1DLod", + _texture(ir_txl, tex1d_lod, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + NULL); + + add_function("texture1DArrayLod", + _texture(ir_txl, texture_array_lod, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type), + NULL); + + add_function("texture1DProjLod", + _texture(ir_txl, tex1d_lod, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txl, tex1d_lod, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture2D", + _texture(ir_tex, always_available, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_txb, fs_only, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_tex, texture_external, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::vec2_type), + NULL); + + add_function("texture2DArray", + _texture(ir_tex, texture_array, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + _texture(ir_txb, fs_texture_array, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + NULL); + + add_function("texture2DProj", + _texture(ir_tex, always_available, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, always_available, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, fs_only, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txb, fs_only, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, texture_external, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, texture_external, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture2DLod", + _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + NULL); + + add_function("texture2DArrayLod", + _texture(ir_txl, texture_array_lod, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + NULL); + + add_function("texture2DProjLod", + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture3D", + _texture(ir_tex, tex3d, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + _texture(ir_txb, fs_tex3d, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + NULL); + + add_function("texture3DProj", + _texture(ir_tex, tex3d, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, fs_tex3d, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture3DLod", + _texture(ir_txl, tex3d_lod, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + NULL); + + add_function("texture3DProjLod", + _texture(ir_txl, tex3d_lod, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("textureCube", + _texture(ir_tex, always_available, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_txb, fs_only, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + NULL); + + add_function("textureCubeLod", + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + NULL); + + add_function("texture2DRect", + _texture(ir_tex, texture_rectangle, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type), + NULL); + + add_function("texture2DRectProj", + _texture(ir_tex, texture_rectangle, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, texture_rectangle, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture2DLodEXT", + _texture(ir_txl, es_lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + NULL); + add_function("texture2DProjLodEXT", + _texture(ir_txl, es_lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txl, es_lod_exists_in_stage, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + add_function("textureCubeLodEXT", + _texture(ir_txl, es_lod_exists_in_stage, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + NULL); + + add_function("shadow1D", + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow1DArray", + _texture(ir_tex, texture_array, glsl_type::vec4_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + _texture(ir_txb, fs_texture_array, glsl_type::vec4_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow2D", + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + NULL); + add_function("shadow2DEXT", + _texture(ir_tex, es_shadow_samplers, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow2DArray", + _texture(ir_tex, texture_array, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type), + _texture(ir_txb, fs_texture_array, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type), + NULL); + + add_function("shadow1DProj", + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("shadow2DProj", + _texture(ir_tex, v110, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_txb, v110_fs_only, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + add_function("shadow2DProjEXT", + _texture(ir_tex, es_shadow_samplers, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("shadow1DLod", + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow2DLod", + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow1DArrayLod", + _texture(ir_txl, texture_array_lod, glsl_type::vec4_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow1DProjLod", + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("shadow2DProjLod", + _texture(ir_txl, v110_lod, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("shadow2DRect", + _texture(ir_tex, texture_rectangle, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow2DRectProj", + _texture(ir_tex, texture_rectangle, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture1DGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), + NULL); + + add_function("texture1DProjGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT), + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture2DGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + NULL); + + add_function("texture2DProjGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture3DGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type), + NULL); + + add_function("texture3DProjGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("textureCubeGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + NULL); + + add_function("texture2DGradEXT", + _texture(ir_txd, es_shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + NULL); + add_function("texture2DProjGradEXT", + _texture(ir_txd, es_shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, es_shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + add_function("textureCubeGradEXT", + _texture(ir_txd, es_shader_texture_lod, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + NULL); + + add_function("shadow1DGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow1DProjGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("shadow2DGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow2DProjGradARB", + _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("texture2DRectGradARB", + _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type), + NULL); + + add_function("texture2DRectProjGradARB", + _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("shadow2DRectGradARB", + _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type), + NULL); + + add_function("shadow2DRectProjGradARB", + _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT), + NULL); + + add_function("textureGather", + _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type), + _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type), + _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type), + + _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type), + _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type), + _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type), + + _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type), + _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type), + _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type), + + _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type), + _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::samplerCubeShadow_type, glsl_type::vec3_type), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::samplerCubeArrayShadow_type, glsl_type::vec4_type), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec2_type), + NULL); + + add_function("textureGatherOffset", + _texture(ir_tg4, texture_gather_only, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tg4, texture_gather_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + _texture(ir_tg4, texture_gather_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET), + + _texture(ir_tg4, texture_gather_only, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tg4, texture_gather_only, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + _texture(ir_tg4, texture_gather_only, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST), + NULL); + + add_function("textureGatherOffsets", + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT), + + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY), + _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY), + NULL); + + F(dFdx) + F(dFdy) + F(fwidth) + F(noise1) + F(noise2) + F(noise3) + F(noise4) + + IU(bitfieldExtract) + IU(bitfieldInsert) + IU(bitfieldReverse) + IU(bitCount) + IU(findLSB) + IU(findMSB) + F(fma) + + add_function("ldexp", + _ldexp(glsl_type::float_type, glsl_type::int_type), + _ldexp(glsl_type::vec2_type, glsl_type::ivec2_type), + _ldexp(glsl_type::vec3_type, glsl_type::ivec3_type), + _ldexp(glsl_type::vec4_type, glsl_type::ivec4_type), + NULL); + + add_function("frexp", + _frexp(glsl_type::float_type, glsl_type::int_type), + _frexp(glsl_type::vec2_type, glsl_type::ivec2_type), + _frexp(glsl_type::vec3_type, glsl_type::ivec3_type), + _frexp(glsl_type::vec4_type, glsl_type::ivec4_type), + NULL); + add_function("uaddCarry", + _uaddCarry(glsl_type::uint_type), + _uaddCarry(glsl_type::uvec2_type), + _uaddCarry(glsl_type::uvec3_type), + _uaddCarry(glsl_type::uvec4_type), + NULL); + add_function("usubBorrow", + _usubBorrow(glsl_type::uint_type), + _usubBorrow(glsl_type::uvec2_type), + _usubBorrow(glsl_type::uvec3_type), + _usubBorrow(glsl_type::uvec4_type), + NULL); + add_function("imulExtended", + _mulExtended(glsl_type::int_type), + _mulExtended(glsl_type::ivec2_type), + _mulExtended(glsl_type::ivec3_type), + _mulExtended(glsl_type::ivec4_type), + NULL); + add_function("umulExtended", + _mulExtended(glsl_type::uint_type), + _mulExtended(glsl_type::uvec2_type), + _mulExtended(glsl_type::uvec3_type), + _mulExtended(glsl_type::uvec4_type), + NULL); + + add_function("atomicCounter", + _atomic_op("__intrinsic_atomic_read", + shader_atomic_counters), + NULL); + add_function("atomicCounterIncrement", + _atomic_op("__intrinsic_atomic_increment", + shader_atomic_counters), + NULL); + add_function("atomicCounterDecrement", + _atomic_op("__intrinsic_atomic_predecrement", + shader_atomic_counters), + NULL); + + add_function("min3", + _min3(glsl_type::float_type), + _min3(glsl_type::vec2_type), + _min3(glsl_type::vec3_type), + _min3(glsl_type::vec4_type), + + _min3(glsl_type::int_type), + _min3(glsl_type::ivec2_type), + _min3(glsl_type::ivec3_type), + _min3(glsl_type::ivec4_type), + + _min3(glsl_type::uint_type), + _min3(glsl_type::uvec2_type), + _min3(glsl_type::uvec3_type), + _min3(glsl_type::uvec4_type), + NULL); + + add_function("max3", + _max3(glsl_type::float_type), + _max3(glsl_type::vec2_type), + _max3(glsl_type::vec3_type), + _max3(glsl_type::vec4_type), + + _max3(glsl_type::int_type), + _max3(glsl_type::ivec2_type), + _max3(glsl_type::ivec3_type), + _max3(glsl_type::ivec4_type), + + _max3(glsl_type::uint_type), + _max3(glsl_type::uvec2_type), + _max3(glsl_type::uvec3_type), + _max3(glsl_type::uvec4_type), + NULL); + + add_function("mid3", + _mid3(glsl_type::float_type), + _mid3(glsl_type::vec2_type), + _mid3(glsl_type::vec3_type), + _mid3(glsl_type::vec4_type), + + _mid3(glsl_type::int_type), + _mid3(glsl_type::ivec2_type), + _mid3(glsl_type::ivec3_type), + _mid3(glsl_type::ivec4_type), + + _mid3(glsl_type::uint_type), + _mid3(glsl_type::uvec2_type), + _mid3(glsl_type::uvec3_type), + _mid3(glsl_type::uvec4_type), + NULL); + +#undef F +#undef FI +#undef FIU +#undef FIUB +#undef FIU2_MIXED +} + +void +builtin_builder::add_function(const char *name, ...) +{ + va_list ap; + + ir_function *f = new(mem_ctx) ir_function(name); + + va_start(ap, name); + while (true) { + ir_function_signature *sig = va_arg(ap, ir_function_signature *); + if (sig == NULL) + break; + + if (false) { + exec_list stuff; + stuff.push_tail(sig); + validate_ir_tree(&stuff); + } + + f->add_signature(sig); + } + va_end(ap); + + shader->symbols->add_function(f); +} + +ir_variable * +builtin_builder::in_var(const glsl_type *type, const char *name) +{ + return new(mem_ctx) ir_variable(type, name, ir_var_function_in, glsl_precision_undefined); +} + +ir_variable * +builtin_builder::out_var(const glsl_type *type, const char *name) +{ + return new(mem_ctx) ir_variable(type, name, ir_var_function_out, glsl_precision_undefined); +} + +ir_constant * +builtin_builder::imm(float f, unsigned vector_elements) +{ + return new(mem_ctx) ir_constant(f, vector_elements); +} + +ir_constant * +builtin_builder::imm(int i, unsigned vector_elements) +{ + return new(mem_ctx) ir_constant(i, vector_elements); +} + +ir_constant * +builtin_builder::imm(unsigned u, unsigned vector_elements) +{ + return new(mem_ctx) ir_constant(u, vector_elements); +} + +ir_constant * +builtin_builder::imm(const glsl_type *type, const ir_constant_data &data) +{ + return new(mem_ctx) ir_constant(type, &data); +} + +ir_dereference_variable * +builtin_builder::var_ref(ir_variable *var) +{ + return new(mem_ctx) ir_dereference_variable(var); +} + +ir_dereference_array * +builtin_builder::array_ref(ir_variable *var, int idx) +{ + return new(mem_ctx) ir_dereference_array(var, imm(idx)); +} + +/** Return an element of a matrix */ +ir_swizzle * +builtin_builder::matrix_elt(ir_variable *var, int column, int row) +{ + return swizzle(array_ref(var, column), row, 1); +} + +/** + * Implementations of built-in functions: + * @{ + */ +ir_function_signature * +builtin_builder::new_sig(const glsl_type *return_type, + builtin_available_predicate avail, + int num_params, + ...) +{ + va_list ap; + + ir_function_signature *sig = + new(mem_ctx) ir_function_signature(return_type, glsl_precision_undefined, avail); + + exec_list plist; + va_start(ap, num_params); + for (int i = 0; i < num_params; i++) { + plist.push_tail(va_arg(ap, ir_variable *)); + } + va_end(ap); + + sig->replace_parameters(&plist); + return sig; +} + +#define MAKE_SIG(return_type, avail, ...) \ + ir_function_signature *sig = \ + new_sig(return_type, avail, __VA_ARGS__); \ + ir_factory body(&sig->body, mem_ctx); \ + sig->is_defined = true; + +#define MAKE_INTRINSIC(return_type, avail, ...) \ + ir_function_signature *sig = \ + new_sig(return_type, avail, __VA_ARGS__); \ + sig->is_intrinsic = true; + +ir_function_signature * +builtin_builder::unop(builtin_available_predicate avail, + ir_expression_operation opcode, + const glsl_type *return_type, + const glsl_type *param_type) +{ + ir_variable *x = in_var(param_type, "x"); + MAKE_SIG(return_type, avail, 1, x); + body.emit(ret(expr(opcode, x))); + return sig; +} + +#define UNOP(NAME, OPCODE, AVAIL) \ +ir_function_signature * \ +builtin_builder::_##NAME(const glsl_type *type) \ +{ \ + return unop(&AVAIL, OPCODE, type, type); \ +} + +ir_function_signature * +builtin_builder::binop(ir_expression_operation opcode, + builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *param0_type, + const glsl_type *param1_type) +{ + ir_variable *x = in_var(param0_type, "x"); + ir_variable *y = in_var(param1_type, "y"); + MAKE_SIG(return_type, avail, 2, x, y); + body.emit(ret(expr(opcode, x, y))); + return sig; +} + +#define BINOP(NAME, OPCODE, AVAIL) \ +ir_function_signature * \ +builtin_builder::_##NAME(const glsl_type *return_type, \ + const glsl_type *param0_type, \ + const glsl_type *param1_type) \ +{ \ + return binop(&AVAIL, OPCODE, return_type, param0_type, param1_type); \ +} + +/** + * Angle and Trigonometry Functions @{ + */ + +ir_function_signature * +builtin_builder::_radians(const glsl_type *type) +{ + ir_variable *degrees = in_var(type, "degrees"); + MAKE_SIG(type, always_available, 1, degrees); + body.emit(ret(mul(degrees, imm(0.0174532925f)))); + return sig; +} + +ir_function_signature * +builtin_builder::_degrees(const glsl_type *type) +{ + ir_variable *radians = in_var(type, "radians"); + MAKE_SIG(type, always_available, 1, radians); + body.emit(ret(mul(radians, imm(57.29578f)))); + return sig; +} + +UNOP(sin, ir_unop_sin, always_available) +UNOP(cos, ir_unop_cos, always_available) + +ir_function_signature * +builtin_builder::_tan(const glsl_type *type) +{ + ir_variable *theta = in_var(type, "theta"); + MAKE_SIG(type, always_available, 1, theta); + body.emit(ret(div(sin(theta), cos(theta)))); + return sig; +} + +ir_expression * +builtin_builder::asin_expr(ir_variable *x) +{ + return mul(sign(x), + sub(imm(1.5707964f), + mul(sqrt(sub(imm(1.0f), abs(x))), + add(imm(1.5707964f), + mul(abs(x), + add(imm(-0.21460183f), + mul(abs(x), + add(imm(0.086566724f), + mul(abs(x), imm(-0.03102955f)))))))))); +} + +ir_call * +builtin_builder::call(ir_function *f, ir_variable *ret, exec_list params) +{ + exec_list actual_params; + + foreach_list(node, ¶ms) { + ir_variable *var = (ir_variable *) node; + actual_params.push_tail(var_ref(var)); + } + + ir_function_signature *sig = + f->exact_matching_signature(NULL, &actual_params); + if (!sig) + return NULL; + + ir_dereference_variable *deref = + (sig->return_type->is_void() ? NULL : var_ref(ret)); + + return new(mem_ctx) ir_call(sig, deref, &actual_params); +} + +ir_function_signature * +builtin_builder::_asin(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, always_available, 1, x); + + body.emit(ret(asin_expr(x))); + + return sig; +} + +ir_function_signature * +builtin_builder::_acos(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, always_available, 1, x); + + body.emit(ret(sub(imm(1.5707964f), asin_expr(x)))); + + return sig; +} + +ir_function_signature * +builtin_builder::_atan2(const glsl_type *type) +{ + ir_variable *vec_y = in_var(type, "vec_y"); + ir_variable *vec_x = in_var(type, "vec_x"); + MAKE_SIG(type, always_available, 2, vec_y, vec_x); + + ir_variable *vec_result = body.make_temp(type, "vec_result"); + ir_variable *r = body.make_temp(glsl_type::float_type, "r"); + for (unsigned i = 0; i < type->vector_elements; i++) { + ir_variable *y = body.make_temp(glsl_type::float_type, "y"); + ir_variable *x = body.make_temp(glsl_type::float_type, "x"); + body.emit(assign(y, swizzle(vec_y, i, 1))); + body.emit(assign(x, swizzle(vec_x, i, 1))); + + /* If |x| >= 1.0e-8 * |y|: */ + ir_if *outer_if = + new(mem_ctx) ir_if(greater(abs(x), mul(imm(1.0e-8f), abs(y)))); + + ir_factory outer_then(&outer_if->then_instructions, mem_ctx); + + /* Then...call atan(y/x) */ + ir_variable *y_over_x = outer_then.make_temp(glsl_type::float_type, "y_over_x"); + outer_then.emit(assign(y_over_x, div(y, x))); + outer_then.emit(assign(r, mul(y_over_x, rsq(add(mul(y_over_x, y_over_x), + imm(1.0f)))))); + outer_then.emit(assign(r, asin_expr(r))); + + /* ...and fix it up: */ + ir_if *inner_if = new(mem_ctx) ir_if(less(x, imm(0.0f))); + inner_if->then_instructions.push_tail( + if_tree(gequal(y, imm(0.0f)), + assign(r, add(r, imm(3.141593f))), + assign(r, sub(r, imm(3.141593f))))); + outer_then.emit(inner_if); + + /* Else... */ + outer_if->else_instructions.push_tail( + assign(r, mul(sign(y), imm(1.5707965f)))); + + body.emit(outer_if); + + body.emit(assign(vec_result, r, 1 << i)); + } + body.emit(ret(vec_result)); + + return sig; +} + +ir_function_signature * +builtin_builder::_atan(const glsl_type *type) +{ + ir_variable *y_over_x = in_var(type, "y_over_x"); + MAKE_SIG(type, always_available, 1, y_over_x); + + ir_variable *t = body.make_temp(type, "t"); + body.emit(assign(t, mul(y_over_x, rsq(add(mul(y_over_x, y_over_x), + imm(1.0f)))))); + + body.emit(ret(asin_expr(t))); + + return sig; +} + +ir_function_signature * +builtin_builder::_sinh(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, v130, 1, x); + + /* 0.5 * (e^x - e^(-x)) */ + body.emit(ret(mul(imm(0.5f), sub(exp(x), exp(neg(x)))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_cosh(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, v130, 1, x); + + /* 0.5 * (e^x + e^(-x)) */ + body.emit(ret(mul(imm(0.5f), add(exp(x), exp(neg(x)))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_tanh(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, v130, 1, x); + + /* (e^x - e^(-x)) / (e^x + e^(-x)) */ + body.emit(ret(div(sub(exp(x), exp(neg(x))), + add(exp(x), exp(neg(x)))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_asinh(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, v130, 1, x); + + body.emit(ret(mul(sign(x), log(add(abs(x), sqrt(add(mul(x, x), + imm(1.0f)))))))); + return sig; +} + +ir_function_signature * +builtin_builder::_acosh(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, v130, 1, x); + + body.emit(ret(log(add(x, sqrt(sub(mul(x, x), imm(1.0f))))))); + return sig; +} + +ir_function_signature * +builtin_builder::_atanh(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, v130, 1, x); + + body.emit(ret(mul(imm(0.5f), log(div(add(imm(1.0f), x), + sub(imm(1.0f), x)))))); + return sig; +} +/** @} */ + +/** + * Exponential Functions @{ + */ + +ir_function_signature * +builtin_builder::_pow(const glsl_type *type) +{ + return binop(ir_binop_pow, always_available, type, type, type); +} + +UNOP(exp, ir_unop_exp, always_available) +UNOP(log, ir_unop_log, always_available) +UNOP(exp2, ir_unop_exp2, always_available) +UNOP(log2, ir_unop_log2, always_available) +UNOP(sqrt, ir_unop_sqrt, always_available) +UNOP(inversesqrt, ir_unop_rsq, always_available) + +/** @} */ + +UNOP(abs, ir_unop_abs, always_available) +UNOP(sign, ir_unop_sign, always_available) +UNOP(floor, ir_unop_floor, always_available) +UNOP(trunc, ir_unop_trunc, v130) +UNOP(round, ir_unop_round_even, always_available) +UNOP(roundEven, ir_unop_round_even, always_available) +UNOP(ceil, ir_unop_ceil, always_available) +UNOP(fract, ir_unop_fract, always_available) + +ir_function_signature * +builtin_builder::_mod(const glsl_type *x_type, const glsl_type *y_type) +{ + return binop(ir_binop_mod, always_available, x_type, x_type, y_type); +} + +ir_function_signature * +builtin_builder::_modf(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *i = out_var(type, "i"); + MAKE_SIG(type, v130, 2, x, i); + + ir_variable *t = body.make_temp(type, "t"); + body.emit(assign(t, expr(ir_unop_trunc, x))); + body.emit(assign(i, t)); + body.emit(ret(sub(x, t))); + + return sig; +} + +ir_function_signature * +builtin_builder::_min(builtin_available_predicate avail, + const glsl_type *x_type, const glsl_type *y_type) +{ + return binop(ir_binop_min, avail, x_type, x_type, y_type); +} + +ir_function_signature * +builtin_builder::_max(builtin_available_predicate avail, + const glsl_type *x_type, const glsl_type *y_type) +{ + return binop(ir_binop_max, avail, x_type, x_type, y_type); +} + +ir_function_signature * +builtin_builder::_clamp(builtin_available_predicate avail, + const glsl_type *val_type, const glsl_type *bound_type) +{ + ir_variable *x = in_var(val_type, "x"); + ir_variable *minVal = in_var(bound_type, "minVal"); + ir_variable *maxVal = in_var(bound_type, "maxVal"); + MAKE_SIG(val_type, avail, 3, x, minVal, maxVal); + + body.emit(ret(clamp(x, minVal, maxVal))); + + return sig; +} + +ir_function_signature * +builtin_builder::_mix_lrp(const glsl_type *val_type, const glsl_type *blend_type) +{ + ir_variable *x = in_var(val_type, "x"); + ir_variable *y = in_var(val_type, "y"); + ir_variable *a = in_var(blend_type, "a"); + MAKE_SIG(val_type, always_available, 3, x, y, a); + + body.emit(ret(lrp(x, y, a))); + + return sig; +} + +ir_function_signature * +builtin_builder::_mix_sel(builtin_available_predicate avail, + const glsl_type *val_type, + const glsl_type *blend_type) +{ + ir_variable *x = in_var(val_type, "x"); + ir_variable *y = in_var(val_type, "y"); + ir_variable *a = in_var(blend_type, "a"); + MAKE_SIG(val_type, avail, 3, x, y, a); + + /* csel matches the ternary operator in that a selector of true choses the + * first argument. This differs from mix(x, y, false) which choses the + * second argument (to remain consistent with the interpolating version of + * mix() which takes a blend factor from 0.0 to 1.0 where 0.0 is only x. + * + * To handle the behavior mismatch, reverse the x and y arguments. + */ + body.emit(ret(csel(a, y, x))); + + return sig; +} + +ir_function_signature * +builtin_builder::_step(const glsl_type *edge_type, const glsl_type *x_type) +{ + ir_variable *edge = in_var(edge_type, "edge"); + ir_variable *x = in_var(x_type, "x"); + MAKE_SIG(x_type, always_available, 2, edge, x); + + ir_variable *t = body.make_temp(x_type, "t"); + if (x_type->vector_elements == 1) { + /* Both are floats */ + body.emit(assign(t, b2f(gequal(x, edge)))); + } else if (edge_type->vector_elements == 1) { + /* x is a vector but edge is a float */ + for (unsigned i = 0; i < x_type->vector_elements; i++) { + body.emit(assign(t, b2f(gequal(swizzle(x, i, 1), edge)), 1 << i)); + } + } else { + /* Both are vectors */ + for (unsigned i = 0; i < x_type->vector_elements; i++) { + body.emit(assign(t, b2f(gequal(swizzle(x, i, 1), swizzle(edge, i, 1))), + 1 << i)); + } + } + body.emit(ret(t)); + + return sig; +} + +ir_function_signature * +builtin_builder::_smoothstep(const glsl_type *edge_type, const glsl_type *x_type) +{ + ir_variable *edge0 = in_var(edge_type, "edge0"); + ir_variable *edge1 = in_var(edge_type, "edge1"); + ir_variable *x = in_var(x_type, "x"); + MAKE_SIG(x_type, always_available, 3, edge0, edge1, x); + + /* From the GLSL 1.10 specification: + * + * genType t; + * t = clamp((x - edge0) / (edge1 - edge0), 0, 1); + * return t * t * (3 - 2 * t); + */ + + ir_variable *t = body.make_temp(x_type, "t"); + body.emit(assign(t, clamp(div(sub(x, edge0), sub(edge1, edge0)), + imm(0.0f), imm(1.0f)))); + + body.emit(ret(mul(t, mul(t, sub(imm(3.0f), mul(imm(2.0f), t)))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_isnan(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::bvec(type->vector_elements), v130, 1, x); + + body.emit(ret(nequal(x, x))); + + return sig; +} + +ir_function_signature * +builtin_builder::_isinf(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::bvec(type->vector_elements), v130, 1, x); + + ir_constant_data infinities; + for (unsigned i = 0; i < type->vector_elements; i++) { + infinities.f[i] = std::numeric_limits::infinity(); + } + + body.emit(ret(equal(abs(x), imm(type, infinities)))); + + return sig; +} + +ir_function_signature * +builtin_builder::_floatBitsToInt(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::ivec(type->vector_elements), shader_bit_encoding, 1, x); + body.emit(ret(bitcast_f2i(x))); + return sig; +} + +ir_function_signature * +builtin_builder::_floatBitsToUint(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::uvec(type->vector_elements), shader_bit_encoding, 1, x); + body.emit(ret(bitcast_f2u(x))); + return sig; +} + +ir_function_signature * +builtin_builder::_intBitsToFloat(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::vec(type->vector_elements), shader_bit_encoding, 1, x); + body.emit(ret(bitcast_i2f(x))); + return sig; +} + +ir_function_signature * +builtin_builder::_uintBitsToFloat(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::vec(type->vector_elements), shader_bit_encoding, 1, x); + body.emit(ret(bitcast_u2f(x))); + return sig; +} + +ir_function_signature * +builtin_builder::_packUnorm2x16(builtin_available_predicate avail) +{ + ir_variable *v = in_var(glsl_type::vec2_type, "v"); + MAKE_SIG(glsl_type::uint_type, avail, 1, v); + body.emit(ret(expr(ir_unop_pack_unorm_2x16, v))); + return sig; +} + +ir_function_signature * +builtin_builder::_packSnorm2x16(builtin_available_predicate avail) +{ + ir_variable *v = in_var(glsl_type::vec2_type, "v"); + MAKE_SIG(glsl_type::uint_type, avail, 1, v); + body.emit(ret(expr(ir_unop_pack_snorm_2x16, v))); + return sig; +} + +ir_function_signature * +builtin_builder::_packUnorm4x8(builtin_available_predicate avail) +{ + ir_variable *v = in_var(glsl_type::vec4_type, "v"); + MAKE_SIG(glsl_type::uint_type, avail, 1, v); + body.emit(ret(expr(ir_unop_pack_unorm_4x8, v))); + return sig; +} + +ir_function_signature * +builtin_builder::_packSnorm4x8(builtin_available_predicate avail) +{ + ir_variable *v = in_var(glsl_type::vec4_type, "v"); + MAKE_SIG(glsl_type::uint_type, avail, 1, v); + body.emit(ret(expr(ir_unop_pack_snorm_4x8, v))); + return sig; +} + +ir_function_signature * +builtin_builder::_unpackUnorm2x16(builtin_available_predicate avail) +{ + ir_variable *p = in_var(glsl_type::uint_type, "p"); + MAKE_SIG(glsl_type::vec2_type, avail, 1, p); + body.emit(ret(expr(ir_unop_unpack_unorm_2x16, p))); + return sig; +} + +ir_function_signature * +builtin_builder::_unpackSnorm2x16(builtin_available_predicate avail) +{ + ir_variable *p = in_var(glsl_type::uint_type, "p"); + MAKE_SIG(glsl_type::vec2_type, avail, 1, p); + body.emit(ret(expr(ir_unop_unpack_snorm_2x16, p))); + return sig; +} + + +ir_function_signature * +builtin_builder::_unpackUnorm4x8(builtin_available_predicate avail) +{ + ir_variable *p = in_var(glsl_type::uint_type, "p"); + MAKE_SIG(glsl_type::vec4_type, avail, 1, p); + body.emit(ret(expr(ir_unop_unpack_unorm_4x8, p))); + return sig; +} + +ir_function_signature * +builtin_builder::_unpackSnorm4x8(builtin_available_predicate avail) +{ + ir_variable *p = in_var(glsl_type::uint_type, "p"); + MAKE_SIG(glsl_type::vec4_type, avail, 1, p); + body.emit(ret(expr(ir_unop_unpack_snorm_4x8, p))); + return sig; +} + +ir_function_signature * +builtin_builder::_packHalf2x16(builtin_available_predicate avail) +{ + ir_variable *v = in_var(glsl_type::vec2_type, "v"); + MAKE_SIG(glsl_type::uint_type, avail, 1, v); + body.emit(ret(expr(ir_unop_pack_half_2x16, v))); + return sig; +} + +ir_function_signature * +builtin_builder::_unpackHalf2x16(builtin_available_predicate avail) +{ + ir_variable *p = in_var(glsl_type::uint_type, "p"); + MAKE_SIG(glsl_type::vec2_type, avail, 1, p); + body.emit(ret(expr(ir_unop_unpack_half_2x16, p))); + return sig; +} + +ir_function_signature * +builtin_builder::_length(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(glsl_type::float_type, always_available, 1, x); + + body.emit(ret(sqrt(dotlike(x, x)))); + + return sig; +} + +ir_function_signature * +builtin_builder::_distance(const glsl_type *type) +{ + ir_variable *p0 = in_var(type, "p0"); + ir_variable *p1 = in_var(type, "p1"); + MAKE_SIG(glsl_type::float_type, always_available, 2, p0, p1); + + if (type->vector_elements == 1) { + body.emit(ret(abs(sub(p0, p1)))); + } else { + ir_variable *p = body.make_temp(type, "p"); + body.emit(assign(p, sub(p0, p1))); + body.emit(ret(sqrt(dot(p, p)))); + } + + return sig; +} + +ir_function_signature * +builtin_builder::_dot(const glsl_type *type) +{ + if (type->vector_elements == 1) + return binop(ir_binop_mul, always_available, type, type, type); + + return binop(ir_binop_dot, always_available, + glsl_type::float_type, type, type); +} + +ir_function_signature * +builtin_builder::_cross(const glsl_type *type) +{ + ir_variable *a = in_var(type, "a"); + ir_variable *b = in_var(type, "b"); + MAKE_SIG(type, always_available, 2, a, b); + + int yzx = MAKE_SWIZZLE4(SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_X, 0); + int zxy = MAKE_SWIZZLE4(SWIZZLE_Z, SWIZZLE_X, SWIZZLE_Y, 0); + + body.emit(ret(sub(mul(swizzle(a, yzx, 3), swizzle(b, zxy, 3)), + mul(swizzle(a, zxy, 3), swizzle(b, yzx, 3))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_normalize(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + MAKE_SIG(type, always_available, 1, x); + + if (type->vector_elements == 1) { + body.emit(ret(sign(x))); + } else { + body.emit(ret(expr(ir_unop_normalize, x))); + } + + return sig; +} + +ir_function_signature * +builtin_builder::_ftransform() +{ + MAKE_SIG(glsl_type::vec4_type, compatibility_vs_only, 0); + + body.emit(ret(new(mem_ctx) ir_expression(ir_binop_mul, + glsl_type::vec4_type, + var_ref(gl_ModelViewProjectionMatrix), + var_ref(gl_Vertex)))); + + /* FINISHME: Once the ir_expression() constructor handles type inference + * for matrix operations, we can simplify this to: + * + * body.emit(ret(mul(gl_ModelViewProjectionMatrix, gl_Vertex))); + */ + return sig; +} + +ir_function_signature * +builtin_builder::_faceforward(const glsl_type *type) +{ + ir_variable *N = in_var(type, "N"); + ir_variable *I = in_var(type, "I"); + ir_variable *Nref = in_var(type, "Nref"); + MAKE_SIG(type, always_available, 3, N, I, Nref); + + body.emit(if_tree(less(dotlike(Nref, I), imm(0.0f)), + ret(N), ret(neg(N)))); + + return sig; +} + +ir_function_signature * +builtin_builder::_reflect(const glsl_type *type) +{ + ir_variable *I = in_var(type, "I"); + ir_variable *N = in_var(type, "N"); + MAKE_SIG(type, always_available, 2, I, N); + + /* I - 2 * dot(N, I) * N */ + body.emit(ret(sub(I, mul(imm(2.0f), mul(dotlike(N, I), N))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_refract(const glsl_type *type) +{ + ir_variable *I = in_var(type, "I"); + ir_variable *N = in_var(type, "N"); + ir_variable *eta = in_var(glsl_type::float_type, "eta"); + MAKE_SIG(type, always_available, 3, I, N, eta); + + ir_variable *n_dot_i = body.make_temp(glsl_type::float_type, "n_dot_i"); + body.emit(assign(n_dot_i, dotlike(N, I))); + + /* From the GLSL 1.10 specification: + * k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)) + * if (k < 0.0) + * return genType(0.0) + * else + * return eta * I - (eta * dot(N, I) + sqrt(k)) * N + */ + ir_variable *k = body.make_temp(glsl_type::float_type, "k"); + body.emit(assign(k, sub(imm(1.0f), + mul(eta, mul(eta, sub(imm(1.0f), + mul(n_dot_i, n_dot_i))))))); + body.emit(if_tree(less(k, imm(0.0f)), + ret(ir_constant::zero(mem_ctx, type)), + ret(sub(mul(eta, I), + mul(add(mul(eta, n_dot_i), sqrt(k)), N))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_matrixCompMult(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + MAKE_SIG(type, always_available, 2, x, y); + + ir_variable *z = body.make_temp(type, "z"); + for (unsigned i = 0; i < type->matrix_columns; i++) { + body.emit(assign(array_ref(z, i), mul(array_ref(x, i), array_ref(y, i)))); + } + body.emit(ret(z)); + + return sig; +} + +ir_function_signature * +builtin_builder::_outerProduct(const glsl_type *type) +{ + ir_variable *c = in_var(glsl_type::vec(type->vector_elements), "c"); + ir_variable *r = in_var(glsl_type::vec(type->matrix_columns), "r"); + MAKE_SIG(type, v120, 2, c, r); + + ir_variable *m = body.make_temp(type, "m"); + for (unsigned i = 0; i < type->matrix_columns; i++) { + body.emit(assign(array_ref(m, i), mul(c, swizzle(r, i, 1)))); + } + body.emit(ret(m)); + + return sig; +} + +ir_function_signature * +builtin_builder::_transpose(const glsl_type *orig_type) +{ + const glsl_type *transpose_type = + glsl_type::get_instance(GLSL_TYPE_FLOAT, + orig_type->matrix_columns, + orig_type->vector_elements); + + ir_variable *m = in_var(orig_type, "m"); + MAKE_SIG(transpose_type, v120, 1, m); + + ir_variable *t = body.make_temp(transpose_type, "t"); + for (unsigned i = 0; i < orig_type->matrix_columns; i++) { + for (unsigned j = 0; j < orig_type->vector_elements; j++) { + body.emit(assign(array_ref(t, j), + matrix_elt(m, i, j), + 1 << i)); + } + } + body.emit(ret(t)); + + return sig; +} + +ir_function_signature * +builtin_builder::_determinant_mat2() +{ + ir_variable *m = in_var(glsl_type::mat2_type, "m"); + MAKE_SIG(glsl_type::float_type, v120, 1, m); + + body.emit(ret(sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 1, 1)), + mul(matrix_elt(m, 1, 0), matrix_elt(m, 0, 1))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_determinant_mat3() +{ + ir_variable *m = in_var(glsl_type::mat3_type, "m"); + MAKE_SIG(glsl_type::float_type, v120, 1, m); + + ir_expression *f1 = + sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 2)), + mul(matrix_elt(m, 1, 2), matrix_elt(m, 2, 1))); + + ir_expression *f2 = + sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 2)), + mul(matrix_elt(m, 1, 2), matrix_elt(m, 2, 0))); + + ir_expression *f3 = + sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 1)), + mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 0))); + + body.emit(ret(add(sub(mul(matrix_elt(m, 0, 0), f1), + mul(matrix_elt(m, 0, 1), f2)), + mul(matrix_elt(m, 0, 2), f3)))); + + return sig; +} + +ir_function_signature * +builtin_builder::_determinant_mat4() +{ + ir_variable *m = in_var(glsl_type::mat4_type, "m"); + MAKE_SIG(glsl_type::float_type, v120, 1, m); + + ir_variable *SubFactor00 = body.make_temp(glsl_type::float_type, "SubFactor00"); + ir_variable *SubFactor01 = body.make_temp(glsl_type::float_type, "SubFactor01"); + ir_variable *SubFactor02 = body.make_temp(glsl_type::float_type, "SubFactor02"); + ir_variable *SubFactor03 = body.make_temp(glsl_type::float_type, "SubFactor03"); + ir_variable *SubFactor04 = body.make_temp(glsl_type::float_type, "SubFactor04"); + ir_variable *SubFactor05 = body.make_temp(glsl_type::float_type, "SubFactor05"); + ir_variable *SubFactor06 = body.make_temp(glsl_type::float_type, "SubFactor06"); + ir_variable *SubFactor07 = body.make_temp(glsl_type::float_type, "SubFactor07"); + ir_variable *SubFactor08 = body.make_temp(glsl_type::float_type, "SubFactor08"); + ir_variable *SubFactor09 = body.make_temp(glsl_type::float_type, "SubFactor09"); + ir_variable *SubFactor10 = body.make_temp(glsl_type::float_type, "SubFactor10"); + ir_variable *SubFactor11 = body.make_temp(glsl_type::float_type, "SubFactor11"); + ir_variable *SubFactor12 = body.make_temp(glsl_type::float_type, "SubFactor12"); + ir_variable *SubFactor13 = body.make_temp(glsl_type::float_type, "SubFactor13"); + ir_variable *SubFactor14 = body.make_temp(glsl_type::float_type, "SubFactor14"); + ir_variable *SubFactor15 = body.make_temp(glsl_type::float_type, "SubFactor15"); + ir_variable *SubFactor16 = body.make_temp(glsl_type::float_type, "SubFactor16"); + ir_variable *SubFactor17 = body.make_temp(glsl_type::float_type, "SubFactor17"); + ir_variable *SubFactor18 = body.make_temp(glsl_type::float_type, "SubFactor18"); + + body.emit(assign(SubFactor00, sub(mul(matrix_elt(m, 2, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 2, 3))))); + body.emit(assign(SubFactor01, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 3))))); + body.emit(assign(SubFactor02, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 2))))); + body.emit(assign(SubFactor03, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 3))))); + body.emit(assign(SubFactor04, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 2))))); + body.emit(assign(SubFactor05, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 1))))); + body.emit(assign(SubFactor06, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor07, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor08, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor09, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor10, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor11, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor12, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 1))))); + body.emit(assign(SubFactor13, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 2), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor14, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor15, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor16, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor17, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor18, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 1)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 1))))); + + ir_variable *adj_0 = body.make_temp(glsl_type::vec4_type, "adj_0"); + + body.emit(assign(adj_0, + add(sub(mul(matrix_elt(m, 1, 1), SubFactor00), + mul(matrix_elt(m, 1, 2), SubFactor01)), + mul(matrix_elt(m, 1, 3), SubFactor02)), + WRITEMASK_X)); + body.emit(assign(adj_0, neg( + add(sub(mul(matrix_elt(m, 1, 0), SubFactor00), + mul(matrix_elt(m, 1, 2), SubFactor03)), + mul(matrix_elt(m, 1, 3), SubFactor04))), + WRITEMASK_Y)); + body.emit(assign(adj_0, + add(sub(mul(matrix_elt(m, 1, 0), SubFactor01), + mul(matrix_elt(m, 1, 1), SubFactor03)), + mul(matrix_elt(m, 1, 3), SubFactor05)), + WRITEMASK_Z)); + body.emit(assign(adj_0, neg( + add(sub(mul(matrix_elt(m, 1, 0), SubFactor02), + mul(matrix_elt(m, 1, 1), SubFactor04)), + mul(matrix_elt(m, 1, 2), SubFactor05))), + WRITEMASK_W)); + + body.emit(ret(dot(array_ref(m, 0), adj_0))); + + return sig; +} + +ir_function_signature * +builtin_builder::_inverse_mat2() +{ + ir_variable *m = in_var(glsl_type::mat2_type, "m"); + MAKE_SIG(glsl_type::mat2_type, v120, 1, m); + + ir_variable *adj = body.make_temp(glsl_type::mat2_type, "adj"); + body.emit(assign(array_ref(adj, 0), matrix_elt(m, 1, 1), 1 << 0)); + body.emit(assign(array_ref(adj, 0), neg(matrix_elt(m, 0, 1)), 1 << 1)); + body.emit(assign(array_ref(adj, 1), neg(matrix_elt(m, 1, 0)), 1 << 0)); + body.emit(assign(array_ref(adj, 1), matrix_elt(m, 0, 0), 1 << 1)); + + ir_expression *det = + sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 1, 1)), + mul(matrix_elt(m, 1, 0), matrix_elt(m, 0, 1))); + + body.emit(ret(div(adj, det))); + return sig; +} + +ir_function_signature * +builtin_builder::_inverse_mat3() +{ + ir_variable *m = in_var(glsl_type::mat3_type, "m"); + MAKE_SIG(glsl_type::mat3_type, v120, 1, m); + + ir_variable *f11_22_21_12 = body.make_temp(glsl_type::float_type, "f11_22_21_12"); + ir_variable *f10_22_20_12 = body.make_temp(glsl_type::float_type, "f10_22_20_12"); + ir_variable *f10_21_20_11 = body.make_temp(glsl_type::float_type, "f10_21_20_11"); + + body.emit(assign(f11_22_21_12, + sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 2)), + mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 2))))); + body.emit(assign(f10_22_20_12, + sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 2)), + mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 2))))); + body.emit(assign(f10_21_20_11, + sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 1)), + mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 1))))); + + ir_variable *adj = body.make_temp(glsl_type::mat3_type, "adj"); + body.emit(assign(array_ref(adj, 0), f11_22_21_12, WRITEMASK_X)); + body.emit(assign(array_ref(adj, 1), neg(f10_22_20_12), WRITEMASK_X)); + body.emit(assign(array_ref(adj, 2), f10_21_20_11, WRITEMASK_X)); + + body.emit(assign(array_ref(adj, 0), neg( + sub(mul(matrix_elt(m, 0, 1), matrix_elt(m, 2, 2)), + mul(matrix_elt(m, 2, 1), matrix_elt(m, 0, 2)))), + WRITEMASK_Y)); + body.emit(assign(array_ref(adj, 1), + sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 2, 2)), + mul(matrix_elt(m, 2, 0), matrix_elt(m, 0, 2))), + WRITEMASK_Y)); + body.emit(assign(array_ref(adj, 2), neg( + sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 2, 1)), + mul(matrix_elt(m, 2, 0), matrix_elt(m, 0, 1)))), + WRITEMASK_Y)); + + body.emit(assign(array_ref(adj, 0), + sub(mul(matrix_elt(m, 0, 1), matrix_elt(m, 1, 2)), + mul(matrix_elt(m, 1, 1), matrix_elt(m, 0, 2))), + WRITEMASK_Z)); + body.emit(assign(array_ref(adj, 1), neg( + sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 1, 2)), + mul(matrix_elt(m, 1, 0), matrix_elt(m, 0, 2)))), + WRITEMASK_Z)); + body.emit(assign(array_ref(adj, 2), + sub(mul(matrix_elt(m, 0, 0), matrix_elt(m, 1, 1)), + mul(matrix_elt(m, 1, 0), matrix_elt(m, 0, 1))), + WRITEMASK_Z)); + + ir_expression *det = + add(sub(mul(matrix_elt(m, 0, 0), f11_22_21_12), + mul(matrix_elt(m, 0, 1), f10_22_20_12)), + mul(matrix_elt(m, 0, 2), f10_21_20_11)); + + body.emit(ret(div(adj, det))); + + return sig; +} + +ir_function_signature * +builtin_builder::_inverse_mat4() +{ + ir_variable *m = in_var(glsl_type::mat4_type, "m"); + MAKE_SIG(glsl_type::mat4_type, v120, 1, m); + + ir_variable *SubFactor00 = body.make_temp(glsl_type::float_type, "SubFactor00"); + ir_variable *SubFactor01 = body.make_temp(glsl_type::float_type, "SubFactor01"); + ir_variable *SubFactor02 = body.make_temp(glsl_type::float_type, "SubFactor02"); + ir_variable *SubFactor03 = body.make_temp(glsl_type::float_type, "SubFactor03"); + ir_variable *SubFactor04 = body.make_temp(glsl_type::float_type, "SubFactor04"); + ir_variable *SubFactor05 = body.make_temp(glsl_type::float_type, "SubFactor05"); + ir_variable *SubFactor06 = body.make_temp(glsl_type::float_type, "SubFactor06"); + ir_variable *SubFactor07 = body.make_temp(glsl_type::float_type, "SubFactor07"); + ir_variable *SubFactor08 = body.make_temp(glsl_type::float_type, "SubFactor08"); + ir_variable *SubFactor09 = body.make_temp(glsl_type::float_type, "SubFactor09"); + ir_variable *SubFactor10 = body.make_temp(glsl_type::float_type, "SubFactor10"); + ir_variable *SubFactor11 = body.make_temp(glsl_type::float_type, "SubFactor11"); + ir_variable *SubFactor12 = body.make_temp(glsl_type::float_type, "SubFactor12"); + ir_variable *SubFactor13 = body.make_temp(glsl_type::float_type, "SubFactor13"); + ir_variable *SubFactor14 = body.make_temp(glsl_type::float_type, "SubFactor14"); + ir_variable *SubFactor15 = body.make_temp(glsl_type::float_type, "SubFactor15"); + ir_variable *SubFactor16 = body.make_temp(glsl_type::float_type, "SubFactor16"); + ir_variable *SubFactor17 = body.make_temp(glsl_type::float_type, "SubFactor17"); + ir_variable *SubFactor18 = body.make_temp(glsl_type::float_type, "SubFactor18"); + + body.emit(assign(SubFactor00, sub(mul(matrix_elt(m, 2, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 2, 3))))); + body.emit(assign(SubFactor01, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 3))))); + body.emit(assign(SubFactor02, sub(mul(matrix_elt(m, 2, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 2, 2))))); + body.emit(assign(SubFactor03, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 3))))); + body.emit(assign(SubFactor04, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 2))))); + body.emit(assign(SubFactor05, sub(mul(matrix_elt(m, 2, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 2, 1))))); + body.emit(assign(SubFactor06, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 2), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor07, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor08, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor09, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor10, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 2)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor11, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 3, 3)), mul(matrix_elt(m, 3, 1), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor12, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 3, 1)), mul(matrix_elt(m, 3, 0), matrix_elt(m, 1, 1))))); + body.emit(assign(SubFactor13, sub(mul(matrix_elt(m, 1, 2), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 2), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor14, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor15, sub(mul(matrix_elt(m, 1, 1), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 1), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor16, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 3)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 3))))); + body.emit(assign(SubFactor17, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 2)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 2))))); + body.emit(assign(SubFactor18, sub(mul(matrix_elt(m, 1, 0), matrix_elt(m, 2, 1)), mul(matrix_elt(m, 2, 0), matrix_elt(m, 1, 1))))); + + ir_variable *adj = body.make_temp(glsl_type::mat4_type, "adj"); + body.emit(assign(array_ref(adj, 0), + add(sub(mul(matrix_elt(m, 1, 1), SubFactor00), + mul(matrix_elt(m, 1, 2), SubFactor01)), + mul(matrix_elt(m, 1, 3), SubFactor02)), + WRITEMASK_X)); + body.emit(assign(array_ref(adj, 1), neg( + add(sub(mul(matrix_elt(m, 1, 0), SubFactor00), + mul(matrix_elt(m, 1, 2), SubFactor03)), + mul(matrix_elt(m, 1, 3), SubFactor04))), + WRITEMASK_X)); + body.emit(assign(array_ref(adj, 2), + add(sub(mul(matrix_elt(m, 1, 0), SubFactor01), + mul(matrix_elt(m, 1, 1), SubFactor03)), + mul(matrix_elt(m, 1, 3), SubFactor05)), + WRITEMASK_X)); + body.emit(assign(array_ref(adj, 3), neg( + add(sub(mul(matrix_elt(m, 1, 0), SubFactor02), + mul(matrix_elt(m, 1, 1), SubFactor04)), + mul(matrix_elt(m, 1, 2), SubFactor05))), + WRITEMASK_X)); + + body.emit(assign(array_ref(adj, 0), neg( + add(sub(mul(matrix_elt(m, 0, 1), SubFactor00), + mul(matrix_elt(m, 0, 2), SubFactor01)), + mul(matrix_elt(m, 0, 3), SubFactor02))), + WRITEMASK_Y)); + body.emit(assign(array_ref(adj, 1), + add(sub(mul(matrix_elt(m, 0, 0), SubFactor00), + mul(matrix_elt(m, 0, 2), SubFactor03)), + mul(matrix_elt(m, 0, 3), SubFactor04)), + WRITEMASK_Y)); + body.emit(assign(array_ref(adj, 2), neg( + add(sub(mul(matrix_elt(m, 0, 0), SubFactor01), + mul(matrix_elt(m, 0, 1), SubFactor03)), + mul(matrix_elt(m, 0, 3), SubFactor05))), + WRITEMASK_Y)); + body.emit(assign(array_ref(adj, 3), + add(sub(mul(matrix_elt(m, 0, 0), SubFactor02), + mul(matrix_elt(m, 0, 1), SubFactor04)), + mul(matrix_elt(m, 0, 2), SubFactor05)), + WRITEMASK_Y)); + + body.emit(assign(array_ref(adj, 0), + add(sub(mul(matrix_elt(m, 0, 1), SubFactor06), + mul(matrix_elt(m, 0, 2), SubFactor07)), + mul(matrix_elt(m, 0, 3), SubFactor08)), + WRITEMASK_Z)); + body.emit(assign(array_ref(adj, 1), neg( + add(sub(mul(matrix_elt(m, 0, 0), SubFactor06), + mul(matrix_elt(m, 0, 2), SubFactor09)), + mul(matrix_elt(m, 0, 3), SubFactor10))), + WRITEMASK_Z)); + body.emit(assign(array_ref(adj, 2), + add(sub(mul(matrix_elt(m, 0, 0), SubFactor11), + mul(matrix_elt(m, 0, 1), SubFactor09)), + mul(matrix_elt(m, 0, 3), SubFactor12)), + WRITEMASK_Z)); + body.emit(assign(array_ref(adj, 3), neg( + add(sub(mul(matrix_elt(m, 0, 0), SubFactor08), + mul(matrix_elt(m, 0, 1), SubFactor10)), + mul(matrix_elt(m, 0, 2), SubFactor12))), + WRITEMASK_Z)); + + body.emit(assign(array_ref(adj, 0), neg( + add(sub(mul(matrix_elt(m, 0, 1), SubFactor13), + mul(matrix_elt(m, 0, 2), SubFactor14)), + mul(matrix_elt(m, 0, 3), SubFactor15))), + WRITEMASK_W)); + body.emit(assign(array_ref(adj, 1), + add(sub(mul(matrix_elt(m, 0, 0), SubFactor13), + mul(matrix_elt(m, 0, 2), SubFactor16)), + mul(matrix_elt(m, 0, 3), SubFactor17)), + WRITEMASK_W)); + body.emit(assign(array_ref(adj, 2), neg( + add(sub(mul(matrix_elt(m, 0, 0), SubFactor14), + mul(matrix_elt(m, 0, 1), SubFactor16)), + mul(matrix_elt(m, 0, 3), SubFactor18))), + WRITEMASK_W)); + body.emit(assign(array_ref(adj, 3), + add(sub(mul(matrix_elt(m, 0, 0), SubFactor15), + mul(matrix_elt(m, 0, 1), SubFactor17)), + mul(matrix_elt(m, 0, 2), SubFactor18)), + WRITEMASK_W)); + + ir_expression *det = + add(mul(matrix_elt(m, 0, 0), matrix_elt(adj, 0, 0)), + add(mul(matrix_elt(m, 0, 1), matrix_elt(adj, 1, 0)), + add(mul(matrix_elt(m, 0, 2), matrix_elt(adj, 2, 0)), + mul(matrix_elt(m, 0, 3), matrix_elt(adj, 3, 0))))); + + body.emit(ret(div(adj, det))); + + return sig; +} + + +ir_function_signature * +builtin_builder::_lessThan(builtin_available_predicate avail, + const glsl_type *type) +{ + return binop(ir_binop_less, avail, + glsl_type::bvec(type->vector_elements), type, type); +} + +ir_function_signature * +builtin_builder::_lessThanEqual(builtin_available_predicate avail, + const glsl_type *type) +{ + return binop(ir_binop_lequal, avail, + glsl_type::bvec(type->vector_elements), type, type); +} + +ir_function_signature * +builtin_builder::_greaterThan(builtin_available_predicate avail, + const glsl_type *type) +{ + return binop(ir_binop_greater, avail, + glsl_type::bvec(type->vector_elements), type, type); +} + +ir_function_signature * +builtin_builder::_greaterThanEqual(builtin_available_predicate avail, + const glsl_type *type) +{ + return binop(ir_binop_gequal, avail, + glsl_type::bvec(type->vector_elements), type, type); +} + +ir_function_signature * +builtin_builder::_equal(builtin_available_predicate avail, + const glsl_type *type) +{ + return binop(ir_binop_equal, avail, + glsl_type::bvec(type->vector_elements), type, type); +} + +ir_function_signature * +builtin_builder::_notEqual(builtin_available_predicate avail, + const glsl_type *type) +{ + return binop(ir_binop_nequal, avail, + glsl_type::bvec(type->vector_elements), type, type); +} + +ir_function_signature * +builtin_builder::_any(const glsl_type *type) +{ + return unop(always_available, ir_unop_any, glsl_type::bool_type, type); +} + +ir_function_signature * +builtin_builder::_all(const glsl_type *type) +{ + ir_variable *v = in_var(type, "v"); + MAKE_SIG(glsl_type::bool_type, always_available, 1, v); + + switch (type->vector_elements) { + case 2: + body.emit(ret(logic_and(swizzle_x(v), swizzle_y(v)))); + break; + case 3: + body.emit(ret(logic_and(logic_and(swizzle_x(v), swizzle_y(v)), + swizzle_z(v)))); + break; + case 4: + body.emit(ret(logic_and(logic_and(logic_and(swizzle_x(v), swizzle_y(v)), + swizzle_z(v)), + swizzle_w(v)))); + break; + } + + return sig; +} + +UNOP(not, ir_unop_logic_not, always_available) + +static bool +has_lod(const glsl_type *sampler_type) +{ + assert(sampler_type->is_sampler()); + + switch (sampler_type->sampler_dimensionality) { + case GLSL_SAMPLER_DIM_RECT: + case GLSL_SAMPLER_DIM_BUF: + case GLSL_SAMPLER_DIM_MS: + return false; + default: + return true; + } +} + +ir_function_signature * +builtin_builder::_textureSize(builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *sampler_type) +{ + ir_variable *s = in_var(sampler_type, "sampler"); + /* The sampler always exists; add optional lod later. */ + MAKE_SIG(return_type, avail, 1, s); + + ir_texture *tex = new(mem_ctx) ir_texture(ir_txs); + tex->set_sampler(new(mem_ctx) ir_dereference_variable(s), return_type); + + if (has_lod(sampler_type)) { + ir_variable *lod = in_var(glsl_type::int_type, "lod"); + sig->parameters.push_tail(lod); + tex->lod_info.lod = var_ref(lod); + } else { + tex->lod_info.lod = imm(0u); + } + + body.emit(ret(tex)); + + return sig; +} + +ir_function_signature * +builtin_builder::_texture(ir_texture_opcode opcode, + builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *sampler_type, + const glsl_type *coord_type, + int flags) +{ + ir_variable *s = in_var(sampler_type, "sampler"); + ir_variable *P = in_var(coord_type, "P"); + /* The sampler and coordinate always exist; add optional parameters later. */ + MAKE_SIG(return_type, avail, 2, s, P); + + ir_texture *tex = new(mem_ctx) ir_texture(opcode); + tex->set_sampler(var_ref(s), return_type); + + const int coord_size = sampler_type->sampler_coordinate_components(); + + // removed for glsl optimizer + //if (coord_size == coord_type->vector_elements) { + tex->coordinate = var_ref(P); + //} else { + // /* The incoming coordinate also has the projector or shadow comparitor, + // * so we need to swizzle those away. + // */ + // tex->coordinate = swizzle_for_size(P, coord_size); + //} + +#if 0 // removed for glsl optimizer + /* The projector is always in the last component. */ + if (flags & TEX_PROJECT) + tex->projector = swizzle(P, coord_type->vector_elements - 1, 1); + + if (sampler_type->sampler_shadow) { + if (opcode == ir_tg4) { + /* gather has refz as a separate parameter, immediately after the + * coordinate + */ + ir_variable *refz = in_var(glsl_type::float_type, "refz"); + sig->parameters.push_tail(refz); + tex->shadow_comparitor = var_ref(refz); + } else { + /* The shadow comparitor is normally in the Z component, but a few types + * have sufficiently large coordinates that it's in W. + */ + tex->shadow_comparitor = swizzle(P, MAX2(coord_size, SWIZZLE_Z), 1); + } + } +#endif // #if 0 + + if (opcode == ir_txl) { + ir_variable *lod = in_var(glsl_type::float_type, "lod"); + sig->parameters.push_tail(lod); + tex->lod_info.lod = var_ref(lod); + } else if (opcode == ir_txd) { + int grad_size = coord_size - (sampler_type->sampler_array ? 1 : 0); + ir_variable *dPdx = in_var(glsl_type::vec(grad_size), "dPdx"); + ir_variable *dPdy = in_var(glsl_type::vec(grad_size), "dPdy"); + sig->parameters.push_tail(dPdx); + sig->parameters.push_tail(dPdy); + tex->lod_info.grad.dPdx = var_ref(dPdx); + tex->lod_info.grad.dPdy = var_ref(dPdy); + } + + if (flags & (TEX_OFFSET | TEX_OFFSET_NONCONST)) { + int offset_size = coord_size - (sampler_type->sampler_array ? 1 : 0); + ir_variable *offset = + new(mem_ctx) ir_variable(glsl_type::ivec(offset_size), "offset", + (flags & TEX_OFFSET) ? ir_var_const_in : ir_var_function_in, glsl_precision_undefined); + sig->parameters.push_tail(offset); + tex->offset = var_ref(offset); + } + + if (flags & TEX_OFFSET_ARRAY) { + ir_variable *offsets = + new(mem_ctx) ir_variable(glsl_type::get_array_instance(glsl_type::ivec2_type, 4), + "offsets", ir_var_const_in, glsl_precision_undefined); + sig->parameters.push_tail(offsets); + tex->offset = var_ref(offsets); + } + + if (opcode == ir_tg4) { + if (flags & TEX_COMPONENT) { + ir_variable *component = + new(mem_ctx) ir_variable(glsl_type::int_type, "comp", ir_var_const_in, glsl_precision_undefined); + sig->parameters.push_tail(component); + tex->lod_info.component = var_ref(component); + } + else { + tex->lod_info.component = imm(0); + } + } + + /* The "bias" parameter comes /after/ the "offset" parameter, which is + * inconsistent with both textureLodOffset and textureGradOffset. + */ + if (opcode == ir_txb) { + ir_variable *bias = in_var(glsl_type::float_type, "bias"); + sig->parameters.push_tail(bias); + tex->lod_info.bias = var_ref(bias); + } + + body.emit(ret(tex)); + + return sig; +} + +ir_function_signature * +builtin_builder::_textureCubeArrayShadow() +{ + ir_variable *s = in_var(glsl_type::samplerCubeArrayShadow_type, "sampler"); + ir_variable *P = in_var(glsl_type::vec4_type, "P"); + ir_variable *compare = in_var(glsl_type::float_type, "compare"); + MAKE_SIG(glsl_type::float_type, texture_cube_map_array, 3, s, P, compare); + + ir_texture *tex = new(mem_ctx) ir_texture(ir_tex); + tex->set_sampler(var_ref(s), glsl_type::float_type); + + tex->coordinate = var_ref(P); + //tex->shadow_comparitor = var_ref(compare); //@TODO ? + + body.emit(ret(tex)); + + return sig; +} + +ir_function_signature * +builtin_builder::_texelFetch(builtin_available_predicate avail, + const glsl_type *return_type, + const glsl_type *sampler_type, + const glsl_type *coord_type, + const glsl_type *offset_type) +{ + ir_variable *s = in_var(sampler_type, "sampler"); + ir_variable *P = in_var(coord_type, "P"); + /* The sampler and coordinate always exist; add optional parameters later. */ + MAKE_SIG(return_type, avail, 2, s, P); + + ir_texture *tex = new(mem_ctx) ir_texture(ir_txf); + tex->coordinate = var_ref(P); + tex->set_sampler(var_ref(s), return_type); + + if (sampler_type->sampler_dimensionality == GLSL_SAMPLER_DIM_MS) { + ir_variable *sample = in_var(glsl_type::int_type, "sample"); + sig->parameters.push_tail(sample); + tex->lod_info.sample_index = var_ref(sample); + tex->op = ir_txf_ms; + } else if (has_lod(sampler_type)) { + ir_variable *lod = in_var(glsl_type::int_type, "lod"); + sig->parameters.push_tail(lod); + tex->lod_info.lod = var_ref(lod); + } else { + tex->lod_info.lod = imm(0u); + } + + if (offset_type != NULL) { + ir_variable *offset = + new(mem_ctx) ir_variable(offset_type, "offset", ir_var_const_in, glsl_precision_undefined); + sig->parameters.push_tail(offset); + tex->offset = var_ref(offset); + } + + body.emit(ret(tex)); + + return sig; +} + +ir_function_signature * +builtin_builder::_EmitVertex() +{ + MAKE_SIG(glsl_type::void_type, gs_only, 0); + + body.emit(new(mem_ctx) ir_emit_vertex()); + + return sig; +} + +ir_function_signature * +builtin_builder::_EndPrimitive() +{ + MAKE_SIG(glsl_type::void_type, gs_only, 0); + + body.emit(new(mem_ctx) ir_end_primitive()); + + return sig; +} + +ir_function_signature * +builtin_builder::_textureQueryLod(const glsl_type *sampler_type, + const glsl_type *coord_type) +{ + ir_variable *s = in_var(sampler_type, "sampler"); + ir_variable *coord = in_var(coord_type, "coord"); + /* The sampler and coordinate always exist; add optional parameters later. */ + MAKE_SIG(glsl_type::vec2_type, texture_query_lod, 2, s, coord); + + ir_texture *tex = new(mem_ctx) ir_texture(ir_lod); + tex->coordinate = var_ref(coord); + tex->set_sampler(var_ref(s), glsl_type::vec2_type); + + body.emit(ret(tex)); + + return sig; +} + +ir_function_signature * +builtin_builder::_textureQueryLevels(const glsl_type *sampler_type) +{ + ir_variable *s = in_var(sampler_type, "sampler"); + const glsl_type *return_type = glsl_type::int_type; + MAKE_SIG(return_type, texture_query_levels, 1, s); + + ir_texture *tex = new(mem_ctx) ir_texture(ir_query_levels); + tex->set_sampler(var_ref(s), return_type); + + body.emit(ret(tex)); + + return sig; +} + +UNOP(dFdx, ir_unop_dFdx, fs_oes_derivatives) +UNOP(dFdy, ir_unop_dFdy, fs_oes_derivatives) + +ir_function_signature * +builtin_builder::_fwidth(const glsl_type *type) +{ + ir_variable *p = in_var(type, "p"); + MAKE_SIG(type, fs_oes_derivatives, 1, p); + + body.emit(ret(add(abs(expr(ir_unop_dFdx, p)), abs(expr(ir_unop_dFdy, p))))); + + return sig; +} + +ir_function_signature * +builtin_builder::_noise1(const glsl_type *type) +{ + return unop(v110, ir_unop_noise, glsl_type::float_type, type); +} + +ir_function_signature * +builtin_builder::_noise2(const glsl_type *type) +{ + ir_variable *p = in_var(type, "p"); + MAKE_SIG(glsl_type::vec2_type, v110, 1, p); + + ir_constant_data b_offset; + b_offset.f[0] = 601.0f; + b_offset.f[1] = 313.0f; + b_offset.f[2] = 29.0f; + b_offset.f[3] = 277.0f; + + ir_variable *a = body.make_temp(glsl_type::float_type, "a"); + ir_variable *b = body.make_temp(glsl_type::float_type, "b"); + ir_variable *t = body.make_temp(glsl_type::vec2_type, "t"); + body.emit(assign(a, expr(ir_unop_noise, p))); + body.emit(assign(b, expr(ir_unop_noise, add(p, imm(type, b_offset))))); + body.emit(assign(t, a, WRITEMASK_X)); + body.emit(assign(t, b, WRITEMASK_Y)); + body.emit(ret(t)); + + return sig; +} + +ir_function_signature * +builtin_builder::_noise3(const glsl_type *type) +{ + ir_variable *p = in_var(type, "p"); + MAKE_SIG(glsl_type::vec3_type, v110, 1, p); + + ir_constant_data b_offset; + b_offset.f[0] = 601.0f; + b_offset.f[1] = 313.0f; + b_offset.f[2] = 29.0f; + b_offset.f[3] = 277.0f; + + ir_constant_data c_offset; + c_offset.f[0] = 1559.0f; + c_offset.f[1] = 113.0f; + c_offset.f[2] = 1861.0f; + c_offset.f[3] = 797.0f; + + ir_variable *a = body.make_temp(glsl_type::float_type, "a"); + ir_variable *b = body.make_temp(glsl_type::float_type, "b"); + ir_variable *c = body.make_temp(glsl_type::float_type, "c"); + ir_variable *t = body.make_temp(glsl_type::vec3_type, "t"); + body.emit(assign(a, expr(ir_unop_noise, p))); + body.emit(assign(b, expr(ir_unop_noise, add(p, imm(type, b_offset))))); + body.emit(assign(c, expr(ir_unop_noise, add(p, imm(type, c_offset))))); + body.emit(assign(t, a, WRITEMASK_X)); + body.emit(assign(t, b, WRITEMASK_Y)); + body.emit(assign(t, c, WRITEMASK_Z)); + body.emit(ret(t)); + + return sig; +} + +ir_function_signature * +builtin_builder::_noise4(const glsl_type *type) +{ + ir_variable *p = in_var(type, "p"); + MAKE_SIG(glsl_type::vec4_type, v110, 1, p); + + ir_variable *_p = body.make_temp(type, "_p"); + + ir_constant_data p_offset; + p_offset.f[0] = 1559.0f; + p_offset.f[1] = 113.0f; + p_offset.f[2] = 1861.0f; + p_offset.f[3] = 797.0f; + + body.emit(assign(_p, add(p, imm(type, p_offset)))); + + ir_constant_data offset; + offset.f[0] = 601.0f; + offset.f[1] = 313.0f; + offset.f[2] = 29.0f; + offset.f[3] = 277.0f; + + ir_variable *a = body.make_temp(glsl_type::float_type, "a"); + ir_variable *b = body.make_temp(glsl_type::float_type, "b"); + ir_variable *c = body.make_temp(glsl_type::float_type, "c"); + ir_variable *d = body.make_temp(glsl_type::float_type, "d"); + ir_variable *t = body.make_temp(glsl_type::vec4_type, "t"); + body.emit(assign(a, expr(ir_unop_noise, p))); + body.emit(assign(b, expr(ir_unop_noise, add(p, imm(type, offset))))); + body.emit(assign(c, expr(ir_unop_noise, _p))); + body.emit(assign(d, expr(ir_unop_noise, add(_p, imm(type, offset))))); + body.emit(assign(t, a, WRITEMASK_X)); + body.emit(assign(t, b, WRITEMASK_Y)); + body.emit(assign(t, c, WRITEMASK_Z)); + body.emit(assign(t, d, WRITEMASK_W)); + body.emit(ret(t)); + + return sig; +} + +ir_function_signature * +builtin_builder::_bitfieldExtract(const glsl_type *type) +{ + ir_variable *value = in_var(type, "value"); + ir_variable *offset = in_var(glsl_type::int_type, "offset"); + ir_variable *bits = in_var(glsl_type::int_type, "bits"); + MAKE_SIG(type, gpu_shader5, 3, value, offset, bits); + + body.emit(ret(expr(ir_triop_bitfield_extract, value, offset, bits))); + + return sig; +} + +ir_function_signature * +builtin_builder::_bitfieldInsert(const glsl_type *type) +{ + ir_variable *base = in_var(type, "base"); + ir_variable *insert = in_var(type, "insert"); + ir_variable *offset = in_var(glsl_type::int_type, "offset"); + ir_variable *bits = in_var(glsl_type::int_type, "bits"); + MAKE_SIG(type, gpu_shader5, 4, base, insert, offset, bits); + + body.emit(ret(bitfield_insert(base, insert, offset, bits))); + + return sig; +} + +UNOP(bitfieldReverse, ir_unop_bitfield_reverse, gpu_shader5) + +ir_function_signature * +builtin_builder::_bitCount(const glsl_type *type) +{ + return unop(gpu_shader5, ir_unop_bit_count, + glsl_type::ivec(type->vector_elements), type); +} + +ir_function_signature * +builtin_builder::_findLSB(const glsl_type *type) +{ + return unop(gpu_shader5, ir_unop_find_lsb, + glsl_type::ivec(type->vector_elements), type); +} + +ir_function_signature * +builtin_builder::_findMSB(const glsl_type *type) +{ + return unop(gpu_shader5, ir_unop_find_msb, + glsl_type::ivec(type->vector_elements), type); +} + +ir_function_signature * +builtin_builder::_fma(const glsl_type *type) +{ + ir_variable *a = in_var(type, "a"); + ir_variable *b = in_var(type, "b"); + ir_variable *c = in_var(type, "c"); + MAKE_SIG(type, gpu_shader5, 3, a, b, c); + + body.emit(ret(ir_builder::fma(a, b, c))); + + return sig; +} + +ir_function_signature * +builtin_builder::_ldexp(const glsl_type *x_type, const glsl_type *exp_type) +{ + return binop(ir_binop_ldexp, gpu_shader5, x_type, x_type, exp_type); +} + +ir_function_signature * +builtin_builder::_frexp(const glsl_type *x_type, const glsl_type *exp_type) +{ + ir_variable *x = in_var(x_type, "x"); + ir_variable *exponent = out_var(exp_type, "exp"); + MAKE_SIG(x_type, gpu_shader5, 2, x, exponent); + + const unsigned vec_elem = x_type->vector_elements; + const glsl_type *bvec = glsl_type::get_instance(GLSL_TYPE_BOOL, vec_elem, 1); + const glsl_type *uvec = glsl_type::get_instance(GLSL_TYPE_UINT, vec_elem, 1); + + /* Single-precision floating-point values are stored as + * 1 sign bit; + * 8 exponent bits; + * 23 mantissa bits. + * + * An exponent shift of 23 will shift the mantissa out, leaving only the + * exponent and sign bit (which itself may be zero, if the absolute value + * was taken before the bitcast and shift. + */ + ir_constant *exponent_shift = imm(23); + ir_constant *exponent_bias = imm(-126, vec_elem); + + ir_constant *sign_mantissa_mask = imm(0x807fffffu, vec_elem); + + /* Exponent of floating-point values in the range [0.5, 1.0). */ + ir_constant *exponent_value = imm(0x3f000000u, vec_elem); + + ir_variable *is_not_zero = body.make_temp(bvec, "is_not_zero"); + body.emit(assign(is_not_zero, nequal(abs(x), imm(0.0f, vec_elem)))); + + /* Since abs(x) ensures that the sign bit is zero, we don't need to bitcast + * to unsigned integers to ensure that 1 bits aren't shifted in. + */ + body.emit(assign(exponent, rshift(bitcast_f2i(abs(x)), exponent_shift))); + body.emit(assign(exponent, add(exponent, csel(is_not_zero, exponent_bias, + imm(0, vec_elem))))); + + ir_variable *bits = body.make_temp(uvec, "bits"); + body.emit(assign(bits, bitcast_f2u(x))); + body.emit(assign(bits, bit_and(bits, sign_mantissa_mask))); + body.emit(assign(bits, bit_or(bits, csel(is_not_zero, exponent_value, + imm(0u, vec_elem))))); + body.emit(ret(bitcast_u2f(bits))); + + return sig; +} + +ir_function_signature * +builtin_builder::_uaddCarry(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + ir_variable *carry = out_var(type, "carry"); + MAKE_SIG(type, gpu_shader5, 3, x, y, carry); + + body.emit(assign(carry, ir_builder::carry(x, y))); + body.emit(ret(add(x, y))); + + return sig; +} + +ir_function_signature * +builtin_builder::_usubBorrow(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + ir_variable *borrow = out_var(type, "borrow"); + MAKE_SIG(type, gpu_shader5, 3, x, y, borrow); + + body.emit(assign(borrow, ir_builder::borrow(x, y))); + body.emit(ret(sub(x, y))); + + return sig; +} + +/** + * For both imulExtended() and umulExtended() built-ins. + */ +ir_function_signature * +builtin_builder::_mulExtended(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + ir_variable *msb = out_var(type, "msb"); + ir_variable *lsb = out_var(type, "lsb"); + MAKE_SIG(glsl_type::void_type, gpu_shader5, 4, x, y, msb, lsb); + + body.emit(assign(msb, imul_high(x, y))); + body.emit(assign(lsb, mul(x, y))); + + return sig; +} + +ir_function_signature * +builtin_builder::_atomic_intrinsic(builtin_available_predicate avail) +{ + ir_variable *counter = in_var(glsl_type::atomic_uint_type, "counter"); + MAKE_INTRINSIC(glsl_type::uint_type, avail, 1, counter); + return sig; +} + +ir_function_signature * +builtin_builder::_atomic_op(const char *intrinsic, + builtin_available_predicate avail) +{ + ir_variable *counter = in_var(glsl_type::atomic_uint_type, "atomic_counter"); + MAKE_SIG(glsl_type::uint_type, avail, 1, counter); + + ir_variable *retval = body.make_temp(glsl_type::uint_type, "atomic_retval"); + body.emit(call(shader->symbols->get_function(intrinsic), retval, + sig->parameters)); + body.emit(ret(retval)); + return sig; +} + +ir_function_signature * +builtin_builder::_min3(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + ir_variable *z = in_var(type, "z"); + MAKE_SIG(type, shader_trinary_minmax, 3, x, y, z); + + ir_expression *min3 = min2(x, min2(y,z)); + body.emit(ret(min3)); + + return sig; +} + +ir_function_signature * +builtin_builder::_max3(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + ir_variable *z = in_var(type, "z"); + MAKE_SIG(type, shader_trinary_minmax, 3, x, y, z); + + ir_expression *max3 = max2(x, max2(y,z)); + body.emit(ret(max3)); + + return sig; +} + +ir_function_signature * +builtin_builder::_mid3(const glsl_type *type) +{ + ir_variable *x = in_var(type, "x"); + ir_variable *y = in_var(type, "y"); + ir_variable *z = in_var(type, "z"); + MAKE_SIG(type, shader_trinary_minmax, 3, x, y, z); + + ir_expression *mid3 = max2(min2(x, y), max2(min2(x, z), min2(y, z))); + body.emit(ret(mid3)); + + return sig; +} + +/** @} */ + +/******************************************************************************/ + +/* The singleton instance of builtin_builder. */ +static builtin_builder builtins; + +/** + * External API (exposing the built-in module to the rest of the compiler): + * @{ + */ +void +_mesa_glsl_initialize_builtin_functions() +{ + builtins.initialize(); +} + +void +_mesa_glsl_release_builtin_functions() +{ + builtins.release(); +} + +ir_function_signature * +_mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state, + const char *name, exec_list *actual_parameters) +{ + return builtins.find(state, name, actual_parameters); +} + +gl_shader * +_mesa_glsl_get_builtin_function_shader() +{ + return builtins.shader; +} + +/** @} */ diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_stubs.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_stubs.cpp deleted file mode 100644 index dfa5d324e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_stubs.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright © 2010 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include "glsl_parser_extras.h" - -/* A dummy file. When compiling prototypes, we don't care about builtins. - * We really don't want to half-compile builtin_functions.cpp and fail, though. - */ -void -_mesa_glsl_release_functions(void) -{ -} - -void -_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state) -{ - (void) state; -} diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_type_macros.h b/3rdparty/glsl-optimizer/src/glsl/builtin_type_macros.h new file mode 100644 index 000000000..06b4dbd0f --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_type_macros.h @@ -0,0 +1,122 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file builtin_type_macros.h + * + * This contains definitions for all GLSL built-in types, regardless of what + * language version or extension might provide them. + */ + +#include "glsl_types.h" + +DECL_TYPE(error, GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0) +DECL_TYPE(void, GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0) + +DECL_TYPE(bool, GL_BOOL, GLSL_TYPE_BOOL, 1, 1) +DECL_TYPE(bvec2, GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1) +DECL_TYPE(bvec3, GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1) +DECL_TYPE(bvec4, GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1) + +DECL_TYPE(int, GL_INT, GLSL_TYPE_INT, 1, 1) +DECL_TYPE(ivec2, GL_INT_VEC2, GLSL_TYPE_INT, 2, 1) +DECL_TYPE(ivec3, GL_INT_VEC3, GLSL_TYPE_INT, 3, 1) +DECL_TYPE(ivec4, GL_INT_VEC4, GLSL_TYPE_INT, 4, 1) + +DECL_TYPE(uint, GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1) +DECL_TYPE(uvec2, GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1) +DECL_TYPE(uvec3, GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1) +DECL_TYPE(uvec4, GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1) + +DECL_TYPE(float, GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1) +DECL_TYPE(vec2, GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1) +DECL_TYPE(vec3, GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1) +DECL_TYPE(vec4, GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1) + +DECL_TYPE(mat2, GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2) +DECL_TYPE(mat3, GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3) +DECL_TYPE(mat4, GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4) + +DECL_TYPE(mat2x3, GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2) +DECL_TYPE(mat2x4, GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2) +DECL_TYPE(mat3x2, GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3) +DECL_TYPE(mat3x4, GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3) +DECL_TYPE(mat4x2, GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4) +DECL_TYPE(mat4x3, GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4) + +DECL_TYPE(sampler1D, GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2D, GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler3D, GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(samplerCube, GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler1DArray, GL_SAMPLER_1D_ARRAY, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DArray, GL_SAMPLER_2D_ARRAY, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT) +DECL_TYPE(samplerCubeArray, GL_SAMPLER_CUBE_MAP_ARRAY, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DRect, GL_SAMPLER_2D_RECT, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(samplerBuffer, GL_SAMPLER_BUFFER, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DMS, GL_SAMPLER_2D_MULTISAMPLE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DMSArray, GL_SAMPLER_2D_MULTISAMPLE_ARRAY, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_FLOAT) + +DECL_TYPE(isampler1D, GL_INT_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isampler2D, GL_INT_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isampler3D, GL_INT_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isamplerCube, GL_INT_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isampler1DArray, GL_INT_SAMPLER_1D_ARRAY, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT) +DECL_TYPE(isampler2DArray, GL_INT_SAMPLER_2D_ARRAY, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT) +DECL_TYPE(isamplerCubeArray, GL_INT_SAMPLER_CUBE_MAP_ARRAY, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_INT) +DECL_TYPE(isampler2DRect, GL_INT_SAMPLER_2D_RECT, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isamplerBuffer, GL_INT_SAMPLER_BUFFER, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isampler2DMS, GL_INT_SAMPLER_2D_MULTISAMPLE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_INT) +DECL_TYPE(isampler2DMSArray, GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_INT) + +DECL_TYPE(usampler1D, GL_UNSIGNED_INT_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usampler2D, GL_UNSIGNED_INT_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usampler3D, GL_UNSIGNED_INT_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usamplerCube, GL_UNSIGNED_INT_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usampler1DArray, GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT) +DECL_TYPE(usampler2DArray, GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT) +DECL_TYPE(usamplerCubeArray, GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY, GLSL_SAMPLER_DIM_CUBE, 0, 1, GLSL_TYPE_UINT) +DECL_TYPE(usampler2DRect, GL_UNSIGNED_INT_SAMPLER_2D_RECT, GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usamplerBuffer, GL_UNSIGNED_INT_SAMPLER_BUFFER, GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usampler2DMS, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, GLSL_SAMPLER_DIM_MS, 0, 0, GLSL_TYPE_UINT) +DECL_TYPE(usampler2DMSArray, GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GLSL_SAMPLER_DIM_MS, 0, 1, GLSL_TYPE_UINT) + +DECL_TYPE(sampler1DShadow, GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DShadow, GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(samplerCubeShadow, GL_SAMPLER_CUBE_SHADOW, GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler1DArrayShadow, GL_SAMPLER_1D_ARRAY_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DArrayShadow, GL_SAMPLER_2D_ARRAY_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT) +DECL_TYPE(samplerCubeArrayShadow, GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW, GLSL_SAMPLER_DIM_CUBE, 1, 1, GLSL_TYPE_FLOAT) +DECL_TYPE(sampler2DRectShadow, GL_SAMPLER_2D_RECT_SHADOW, GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT) + +DECL_TYPE(samplerExternalOES, GL_SAMPLER_EXTERNAL_OES, GLSL_SAMPLER_DIM_EXTERNAL, 0, 0, GLSL_TYPE_FLOAT) + +DECL_TYPE(atomic_uint, GL_UNSIGNED_INT_ATOMIC_COUNTER, GLSL_TYPE_ATOMIC_UINT, 1, 1) + +STRUCT_TYPE(gl_DepthRangeParameters) +STRUCT_TYPE(gl_PointParameters) +STRUCT_TYPE(gl_MaterialParameters) +STRUCT_TYPE(gl_LightSourceParameters) +STRUCT_TYPE(gl_LightModelParameters) +STRUCT_TYPE(gl_LightModelProducts) +STRUCT_TYPE(gl_LightProducts) +STRUCT_TYPE(gl_FogParameters) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp new file mode 100644 index 000000000..14042d41e --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp @@ -0,0 +1,298 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file builtin_types.cpp + * + * The glsl_type class has static members to represent all the built-in types + * (such as the glsl_type::_float_type flyweight) as well as convenience pointer + * accessors (such as glsl_type::float_type). Those global variables are + * declared and initialized in this file. + * + * This also contains _mesa_glsl_initialize_types(), a function which populates + * a symbol table with the available built-in types for a particular language + * version and set of enabled extensions. + */ + +#include "glsl_types.h" +#include "glsl_parser_extras.h" + +/** + * Declarations of type flyweights (glsl_type::_foo_type) and + * convenience pointers (glsl_type::foo_type). + * @{ + */ +#define DECL_TYPE(NAME, ...) \ + const glsl_type glsl_type::_##NAME##_type = glsl_type(__VA_ARGS__, #NAME); \ + const glsl_type *const glsl_type::NAME##_type = &glsl_type::_##NAME##_type; + +#define STRUCT_TYPE(NAME) \ + const glsl_type glsl_type::_struct_##NAME##_type = \ + glsl_type(NAME##_fields, Elements(NAME##_fields), #NAME); \ + const glsl_type *const glsl_type::struct_##NAME##_type = \ + &glsl_type::_struct_##NAME##_type; + +static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = { + { glsl_type::float_type, "near", false, glsl_precision_high, -1 }, + { glsl_type::float_type, "far", false, glsl_precision_high, -1 }, + { glsl_type::float_type, "diff", false, glsl_precision_high, -1 }, +}; + +static const struct glsl_struct_field gl_PointParameters_fields[] = { + { glsl_type::float_type, "size", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "sizeMin", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "sizeMax", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "fadeThresholdSize", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "distanceConstantAttenuation", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "distanceLinearAttenuation", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "distanceQuadraticAttenuation", false, glsl_precision_undefined, -1 }, +}; + +static const struct glsl_struct_field gl_MaterialParameters_fields[] = { + { glsl_type::vec4_type, "emission", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "diffuse", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "specular", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "shininess", false, glsl_precision_undefined, -1 }, +}; + +static const struct glsl_struct_field gl_LightSourceParameters_fields[] = { + { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "diffuse", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "specular", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "position", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "halfVector", false, glsl_precision_undefined, -1 }, + { glsl_type::vec3_type, "spotDirection", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "spotExponent", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "spotCutoff", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "spotCosCutoff", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "constantAttenuation", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "linearAttenuation", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "quadraticAttenuation", false, glsl_precision_undefined, -1 }, +}; + +static const struct glsl_struct_field gl_LightModelParameters_fields[] = { + { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, +}; + +static const struct glsl_struct_field gl_LightModelProducts_fields[] = { + { glsl_type::vec4_type, "sceneColor", false, glsl_precision_undefined, -1 }, +}; + +static const struct glsl_struct_field gl_LightProducts_fields[] = { + { glsl_type::vec4_type, "ambient", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "diffuse", false, glsl_precision_undefined, -1 }, + { glsl_type::vec4_type, "specular", false, glsl_precision_undefined, -1 }, +}; + +static const struct glsl_struct_field gl_FogParameters_fields[] = { + { glsl_type::vec4_type, "color", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "density", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "start", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "end", false, glsl_precision_undefined, -1 }, + { glsl_type::float_type, "scale", false, glsl_precision_undefined, -1 }, +}; + +#include "builtin_type_macros.h" +/** @} */ + +/** + * Code to populate a symbol table with the built-in types available in a + * particular shading language version. The table below contains tags every + * type with the GLSL/GLSL ES versions where it was introduced. + * + * @{ + */ +#define T(TYPE, MIN_GL, MIN_ES) \ + { glsl_type::TYPE##_type, MIN_GL, MIN_ES }, + +const static struct builtin_type_versions { + const glsl_type *const type; + int min_gl; + int min_es; +} builtin_type_versions[] = { + T(void, 110, 100) + T(bool, 110, 100) + T(bvec2, 110, 100) + T(bvec3, 110, 100) + T(bvec4, 110, 100) + T(int, 110, 100) + T(ivec2, 110, 100) + T(ivec3, 110, 100) + T(ivec4, 110, 100) + T(uint, 130, 300) + T(uvec2, 130, 300) + T(uvec3, 130, 300) + T(uvec4, 130, 300) + T(float, 110, 100) + T(vec2, 110, 100) + T(vec3, 110, 100) + T(vec4, 110, 100) + T(mat2, 110, 100) + T(mat3, 110, 100) + T(mat4, 110, 100) + T(mat2x3, 120, 300) + T(mat2x4, 120, 300) + T(mat3x2, 120, 300) + T(mat3x4, 120, 300) + T(mat4x2, 120, 300) + T(mat4x3, 120, 300) + + T(sampler1D, 110, 999) + T(sampler2D, 110, 100) + T(sampler3D, 110, 300) + T(samplerCube, 110, 100) + T(sampler1DArray, 130, 999) + T(sampler2DArray, 130, 300) + T(samplerCubeArray, 400, 999) + T(sampler2DRect, 140, 999) + T(samplerBuffer, 140, 999) + T(sampler2DMS, 150, 999) + T(sampler2DMSArray, 150, 999) + + T(isampler1D, 130, 999) + T(isampler2D, 130, 300) + T(isampler3D, 130, 300) + T(isamplerCube, 130, 300) + T(isampler1DArray, 130, 999) + T(isampler2DArray, 130, 300) + T(isamplerCubeArray, 400, 999) + T(isampler2DRect, 140, 999) + T(isamplerBuffer, 140, 999) + T(isampler2DMS, 150, 999) + T(isampler2DMSArray, 150, 999) + + T(usampler1D, 130, 999) + T(usampler2D, 130, 300) + T(usampler3D, 130, 300) + T(usamplerCube, 130, 300) + T(usampler1DArray, 130, 999) + T(usampler2DArray, 130, 300) + T(usamplerCubeArray, 400, 999) + T(usampler2DRect, 140, 999) + T(usamplerBuffer, 140, 999) + T(usampler2DMS, 150, 999) + T(usampler2DMSArray, 150, 999) + + T(sampler1DShadow, 110, 999) + T(sampler2DShadow, 110, 300) + T(samplerCubeShadow, 130, 300) + T(sampler1DArrayShadow, 130, 999) + T(sampler2DArrayShadow, 130, 300) + T(samplerCubeArrayShadow, 400, 999) + T(sampler2DRectShadow, 140, 999) + + T(struct_gl_DepthRangeParameters, 110, 100) + + T(atomic_uint, 420, 999) +}; + +const glsl_type *const deprecated_types[] = { + glsl_type::struct_gl_PointParameters_type, + glsl_type::struct_gl_MaterialParameters_type, + glsl_type::struct_gl_LightSourceParameters_type, + glsl_type::struct_gl_LightModelParameters_type, + glsl_type::struct_gl_LightModelProducts_type, + glsl_type::struct_gl_LightProducts_type, + glsl_type::struct_gl_FogParameters_type, +}; + +static inline void +add_type(glsl_symbol_table *symbols, const glsl_type *const type) +{ + symbols->add_type(type->name, type); +} + +/** + * Populate the symbol table with available built-in types. + */ +void +_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) +{ + struct glsl_symbol_table *symbols = state->symbols; + + for (unsigned i = 0; i < Elements(builtin_type_versions); i++) { + const struct builtin_type_versions *const t = &builtin_type_versions[i]; + if (state->is_version(t->min_gl, t->min_es)) { + add_type(symbols, t->type); + } + } + + /* Add deprecated structure types. While these were deprecated in 1.30, + * they're still present. We've removed them in 1.40+ (OpenGL 3.1+). + */ + if (!state->es_shader && state->language_version < 140) { + for (unsigned i = 0; i < Elements(deprecated_types); i++) { + add_type(symbols, deprecated_types[i]); + } + } + + /* Add types for enabled extensions. They may have already been added + * by the version-based loop, but attempting to add them a second time + * is harmless. + */ + if (state->ARB_texture_cube_map_array_enable) { + add_type(symbols, glsl_type::samplerCubeArray_type); + add_type(symbols, glsl_type::samplerCubeArrayShadow_type); + add_type(symbols, glsl_type::isamplerCubeArray_type); + add_type(symbols, glsl_type::usamplerCubeArray_type); + } + + if (state->ARB_texture_multisample_enable) { + add_type(symbols, glsl_type::sampler2DMS_type); + add_type(symbols, glsl_type::isampler2DMS_type); + add_type(symbols, glsl_type::usampler2DMS_type); + add_type(symbols, glsl_type::sampler2DMSArray_type); + add_type(symbols, glsl_type::isampler2DMSArray_type); + add_type(symbols, glsl_type::usampler2DMSArray_type); + } + + if (state->ARB_texture_rectangle_enable) { + add_type(symbols, glsl_type::sampler2DRect_type); + add_type(symbols, glsl_type::sampler2DRectShadow_type); + } + + if (state->EXT_texture_array_enable) { + add_type(symbols, glsl_type::sampler1DArray_type); + add_type(symbols, glsl_type::sampler2DArray_type); + add_type(symbols, glsl_type::sampler1DArrayShadow_type); + add_type(symbols, glsl_type::sampler2DArrayShadow_type); + } + + if (state->OES_EGL_image_external_enable) { + add_type(symbols, glsl_type::samplerExternalOES_type); + } + + if (state->EXT_shadow_samplers_enable) { + add_type(symbols, glsl_type::sampler2DShadow_type); + } + + if (state->OES_texture_3D_enable) { + add_type(symbols, glsl_type::sampler3D_type); + } + + if (state->ARB_shader_atomic_counters_enable) { + add_type(symbols, glsl_type::atomic_uint_type); + } +} +/** @} */ diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_types.h b/3rdparty/glsl-optimizer/src/glsl/builtin_types.h deleted file mode 100644 index d75c56261..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_types.h +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -const glsl_type glsl_type::_error_type = - glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, ""); - -const glsl_type glsl_type::_void_type = - glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void"); - -const glsl_type glsl_type::_sampler3D_type = - glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT, - "sampler3D"); - -const glsl_type *const glsl_type::error_type = & glsl_type::_error_type; -const glsl_type *const glsl_type::void_type = & glsl_type::_void_type; - -/** \name Core built-in types - * - * These types exist in all versions of GLSL. - */ -/*@{*/ - -const glsl_type glsl_type::builtin_core_types[] = { - glsl_type(GL_BOOL, GLSL_TYPE_BOOL, 1, 1, "bool"), - glsl_type(GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1, "bvec2"), - glsl_type(GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1, "bvec3"), - glsl_type(GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1, "bvec4"), - glsl_type(GL_INT, GLSL_TYPE_INT, 1, 1, "int"), - glsl_type(GL_INT_VEC2, GLSL_TYPE_INT, 2, 1, "ivec2"), - glsl_type(GL_INT_VEC3, GLSL_TYPE_INT, 3, 1, "ivec3"), - glsl_type(GL_INT_VEC4, GLSL_TYPE_INT, 4, 1, "ivec4"), - glsl_type(GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1, "float"), - glsl_type(GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1, "vec2"), - glsl_type(GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1, "vec3"), - glsl_type(GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1, "vec4"), - glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"), - glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"), - glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"), - glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT, - "sampler2D"), - glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT, - "samplerCube"), -}; - -const glsl_type *const glsl_type::bool_type = & builtin_core_types[0]; -const glsl_type *const glsl_type::bvec2_type = & builtin_core_types[1]; -const glsl_type *const glsl_type::bvec3_type = & builtin_core_types[2]; -const glsl_type *const glsl_type::bvec4_type = & builtin_core_types[3]; -const glsl_type *const glsl_type::int_type = & builtin_core_types[4]; -const glsl_type *const glsl_type::ivec2_type = & builtin_core_types[5]; -const glsl_type *const glsl_type::ivec3_type = & builtin_core_types[6]; -const glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7]; -const glsl_type *const glsl_type::float_type = & builtin_core_types[8]; -const glsl_type *const glsl_type::vec2_type = & builtin_core_types[9]; -const glsl_type *const glsl_type::vec3_type = & builtin_core_types[10]; -const glsl_type *const glsl_type::vec4_type = & builtin_core_types[11]; -const glsl_type *const glsl_type::mat2_type = & builtin_core_types[12]; -const glsl_type *const glsl_type::mat3_type = & builtin_core_types[13]; -const glsl_type *const glsl_type::mat4_type = & builtin_core_types[14]; -/*@}*/ - -/** \name GLSL structures that have not been deprecated. - */ -/*@{*/ - -static const struct glsl_struct_field gl_DepthRangeParameters_fields[] = { - { glsl_type::float_type, "near" }, - { glsl_type::float_type, "far" }, - { glsl_type::float_type, "diff" }, -}; - -const glsl_type glsl_type::builtin_structure_types[] = { - glsl_type(gl_DepthRangeParameters_fields, - Elements(gl_DepthRangeParameters_fields), - "gl_DepthRangeParameters"), -}; -/*@}*/ - -/** \name GLSL 1.00 / 1.10 structures that are deprecated in GLSL 1.30 - */ -/*@{*/ - -static const struct glsl_struct_field gl_PointParameters_fields[] = { - { glsl_type::float_type, "size" }, - { glsl_type::float_type, "sizeMin" }, - { glsl_type::float_type, "sizeMax" }, - { glsl_type::float_type, "fadeThresholdSize" }, - { glsl_type::float_type, "distanceConstantAttenuation" }, - { glsl_type::float_type, "distanceLinearAttenuation" }, - { glsl_type::float_type, "distanceQuadraticAttenuation" }, -}; - -static const struct glsl_struct_field gl_MaterialParameters_fields[] = { - { glsl_type::vec4_type, "emission" }, - { glsl_type::vec4_type, "ambient" }, - { glsl_type::vec4_type, "diffuse" }, - { glsl_type::vec4_type, "specular" }, - { glsl_type::float_type, "shininess" }, -}; - -static const struct glsl_struct_field gl_LightSourceParameters_fields[] = { - { glsl_type::vec4_type, "ambient" }, - { glsl_type::vec4_type, "diffuse" }, - { glsl_type::vec4_type, "specular" }, - { glsl_type::vec4_type, "position" }, - { glsl_type::vec4_type, "halfVector" }, - { glsl_type::vec3_type, "spotDirection" }, - { glsl_type::float_type, "spotExponent" }, - { glsl_type::float_type, "spotCutoff" }, - { glsl_type::float_type, "spotCosCutoff" }, - { glsl_type::float_type, "constantAttenuation" }, - { glsl_type::float_type, "linearAttenuation" }, - { glsl_type::float_type, "quadraticAttenuation" }, -}; - -static const struct glsl_struct_field gl_LightModelParameters_fields[] = { - { glsl_type::vec4_type, "ambient" }, -}; - -static const struct glsl_struct_field gl_LightModelProducts_fields[] = { - { glsl_type::vec4_type, "sceneColor" }, -}; - -static const struct glsl_struct_field gl_LightProducts_fields[] = { - { glsl_type::vec4_type, "ambient" }, - { glsl_type::vec4_type, "diffuse" }, - { glsl_type::vec4_type, "specular" }, -}; - -static const struct glsl_struct_field gl_FogParameters_fields[] = { - { glsl_type::vec4_type, "color" }, - { glsl_type::float_type, "density" }, - { glsl_type::float_type, "start" }, - { glsl_type::float_type, "end" }, - { glsl_type::float_type, "scale" }, -}; - -const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = { - glsl_type(gl_PointParameters_fields, - Elements(gl_PointParameters_fields), - "gl_PointParameters"), - glsl_type(gl_MaterialParameters_fields, - Elements(gl_MaterialParameters_fields), - "gl_MaterialParameters"), - glsl_type(gl_LightSourceParameters_fields, - Elements(gl_LightSourceParameters_fields), - "gl_LightSourceParameters"), - glsl_type(gl_LightModelParameters_fields, - Elements(gl_LightModelParameters_fields), - "gl_LightModelParameters"), - glsl_type(gl_LightModelProducts_fields, - Elements(gl_LightModelProducts_fields), - "gl_LightModelProducts"), - glsl_type(gl_LightProducts_fields, - Elements(gl_LightProducts_fields), - "gl_LightProducts"), - glsl_type(gl_FogParameters_fields, - Elements(gl_FogParameters_fields), - "gl_FogParameters"), -}; -/*@}*/ - -/** \name Types in GLSL 1.10 (but not GLSL ES 1.00) - */ -/*@{*/ -const glsl_type glsl_type::builtin_110_types[] = { - glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT, - "sampler1D"), - glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT, - "sampler1DShadow"), - glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT, - "sampler2DShadow"), -}; -/*@}*/ - -/** \name Types added in GLSL 1.20 - */ -/*@{*/ - -const glsl_type glsl_type::builtin_120_types[] = { - glsl_type(GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2, "mat2x3"), - glsl_type(GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2, "mat2x4"), - glsl_type(GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3, "mat3x2"), - glsl_type(GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3, "mat3x4"), - glsl_type(GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4, "mat4x2"), - glsl_type(GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4, "mat4x3"), -}; -const glsl_type *const glsl_type::mat2x3_type = & builtin_120_types[0]; -const glsl_type *const glsl_type::mat2x4_type = & builtin_120_types[1]; -const glsl_type *const glsl_type::mat3x2_type = & builtin_120_types[2]; -const glsl_type *const glsl_type::mat3x4_type = & builtin_120_types[3]; -const glsl_type *const glsl_type::mat4x2_type = & builtin_120_types[4]; -const glsl_type *const glsl_type::mat4x3_type = & builtin_120_types[5]; -/*@}*/ - -/** \name Types added in GLSL 1.30 - */ -/*@{*/ - -const glsl_type glsl_type::builtin_130_types[] = { - glsl_type(GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1, "uint"), - glsl_type(GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1, "uvec2"), - glsl_type(GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1, "uvec3"), - glsl_type(GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1, "uvec4"), - - /* 1D and 2D texture arrays - several of these are included only in - * builtin_EXT_texture_array_types. - */ - glsl_type(GL_INT_SAMPLER_1D_ARRAY, - GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT, "isampler1DArray"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, - GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT, "usampler1DArray"), - glsl_type(GL_INT_SAMPLER_2D_ARRAY, - GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT, "isampler2DArray"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, - GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT, "usampler2DArray"), - - /* cube shadow samplers */ - glsl_type(GL_SAMPLER_CUBE_SHADOW, - GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT, "samplerCubeShadow"), - - /* signed and unsigned integer samplers */ - glsl_type(GL_INT_SAMPLER_1D, - GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT, "isampler1D"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_1D, - GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT, "usampler1D"), - glsl_type(GL_INT_SAMPLER_2D, - GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT, "isampler2D"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_2D, - GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT, "usampler2D"), - glsl_type(GL_INT_SAMPLER_3D, - GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT, "isampler3D"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_3D, - GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT, "usampler3D"), - glsl_type(GL_INT_SAMPLER_CUBE, - GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT, "isamplerCube"), - glsl_type(GL_INT_SAMPLER_CUBE, - GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT, "usamplerCube"), -}; - -const glsl_type *const glsl_type::uint_type = & builtin_130_types[0]; -const glsl_type *const glsl_type::uvec2_type = & builtin_130_types[1]; -const glsl_type *const glsl_type::uvec3_type = & builtin_130_types[2]; -const glsl_type *const glsl_type::uvec4_type = & builtin_130_types[3]; -/*@}*/ - - -/** \name Types added in GLSL 1.40 - */ -/*@{*/ -const glsl_type glsl_type::builtin_140_types[] = { - glsl_type(GL_INT_SAMPLER_2D_RECT, - GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_INT, "isampler2DRect"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_RECT, - GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_UINT, "usampler2DRect"), -}; -/*@}*/ - -/** \name Sampler types added by GL_ARB_texture_rectangle - */ -/*@{*/ - -const glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = { - glsl_type(GL_SAMPLER_2D_RECT, - GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT, "sampler2DRect"), - glsl_type(GL_SAMPLER_2D_RECT_SHADOW, - GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT, "sampler2DRectShadow"), -}; -/*@}*/ - -/** \name Sampler types added by GL_EXT_texture_array - */ -/*@{*/ - -const glsl_type glsl_type::builtin_EXT_texture_array_types[] = { - glsl_type(GL_SAMPLER_1D_ARRAY, - GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"), - glsl_type(GL_SAMPLER_2D_ARRAY, - GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"), - glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW, - GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"), - glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW, - GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"), -}; -/*@}*/ - -/** \name Sampler types added by GL_EXT_texture_buffer_object - */ -/*@{*/ - -const glsl_type glsl_type::builtin_EXT_texture_buffer_object_types[] = { - glsl_type(GL_SAMPLER_BUFFER, - GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT, "samplerBuffer"), - glsl_type(GL_INT_SAMPLER_BUFFER, - GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT, "isamplerBuffer"), - glsl_type(GL_UNSIGNED_INT_SAMPLER_BUFFER, - GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT, "usamplerBuffer"), -}; -/*@}*/ - -/** \name Sampler types added by GL_OES_EGL_image_external - */ -/*@{*/ - -const glsl_type glsl_type::builtin_OES_EGL_image_external_types[] = { - glsl_type(GL_SAMPLER_EXTERNAL_OES, - GLSL_SAMPLER_DIM_EXTERNAL, 0, 0, GLSL_TYPE_FLOAT, "samplerExternalOES"), -}; -/*@}*/ diff --git a/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp b/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp index 764ab28fe..322d2ebfd 100644 --- a/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp @@ -29,12 +29,12 @@ #include "program/prog_statevars.h" #include "program/prog_instruction.h" +// these two are ripped from mesa/main/uniforms.h in upstream struct gl_builtin_uniform_element { const char *field; int tokens[STATE_LENGTH]; int swizzle; }; - struct gl_builtin_uniform_desc { const char *name; struct gl_builtin_uniform_element *elements; @@ -42,101 +42,10 @@ struct gl_builtin_uniform_desc { }; - -static void generate_ARB_draw_buffers_variables(exec_list *, - struct _mesa_glsl_parse_state *, - bool, _mesa_glsl_parser_targets); - -static void -generate_ARB_draw_instanced_variables(exec_list *, - struct _mesa_glsl_parse_state *, - bool, _mesa_glsl_parser_targets); - -struct builtin_variable { - enum ir_variable_mode mode; - int slot; - const char *type; - const char *name; - glsl_precision prec; +static struct gl_builtin_uniform_element gl_NumSamples_elements[] = { + {NULL, {STATE_NUM_SAMPLES, 0, 0}, SWIZZLE_XXXX} }; -static const builtin_variable builtin_core_vs_variables[] = { - { ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_Position", glsl_precision_high }, - { ir_var_out, VERT_RESULT_PSIZ, "float", "gl_PointSize", glsl_precision_medium }, -}; - -static const builtin_variable builtin_core_fs_variables[] = { - { ir_var_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord", glsl_precision_medium }, - { ir_var_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing", glsl_precision_low }, - { ir_var_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor", glsl_precision_medium }, -}; - -static const builtin_variable builtin_100ES_fs_variables[] = { - { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord", glsl_precision_medium }, -}; - -static const builtin_variable builtin_110_fs_variables[] = { - { ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth", glsl_precision_medium }, -}; - -static const builtin_variable builtin_110_deprecated_fs_variables[] = { - { ir_var_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color", glsl_precision_medium }, - { ir_var_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor", glsl_precision_medium }, - { ir_var_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord", glsl_precision_medium }, -}; - -static const builtin_variable builtin_110_deprecated_vs_variables[] = { - { ir_var_in, VERT_ATTRIB_POS, "vec4", "gl_Vertex", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_NORMAL, "vec3", "gl_Normal", glsl_precision_medium }, - { ir_var_in, VERT_ATTRIB_COLOR0, "vec4", "gl_Color", glsl_precision_medium }, - { ir_var_in, VERT_ATTRIB_COLOR1, "vec4", "gl_SecondaryColor", glsl_precision_medium }, - { ir_var_in, VERT_ATTRIB_TEX0, "vec4", "gl_MultiTexCoord0", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX1, "vec4", "gl_MultiTexCoord1", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX2, "vec4", "gl_MultiTexCoord2", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX3, "vec4", "gl_MultiTexCoord3", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX4, "vec4", "gl_MultiTexCoord4", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX5, "vec4", "gl_MultiTexCoord5", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX6, "vec4", "gl_MultiTexCoord6", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_TEX7, "vec4", "gl_MultiTexCoord7", glsl_precision_high }, - { ir_var_in, VERT_ATTRIB_FOG, "float", "gl_FogCoord", glsl_precision_high }, - { ir_var_out, VERT_RESULT_CLIP_VERTEX, "vec4", "gl_ClipVertex", glsl_precision_high }, - { ir_var_out, VERT_RESULT_COL0, "vec4", "gl_FrontColor", glsl_precision_medium }, - { ir_var_out, VERT_RESULT_BFC0, "vec4", "gl_BackColor", glsl_precision_medium }, - { ir_var_out, VERT_RESULT_COL1, "vec4", "gl_FrontSecondaryColor", glsl_precision_medium }, - { ir_var_out, VERT_RESULT_BFC1, "vec4", "gl_BackSecondaryColor", glsl_precision_medium }, - { ir_var_out, VERT_RESULT_FOGC, "float", "gl_FogFragCoord", glsl_precision_medium }, -}; - -static const builtin_variable builtin_120_fs_variables[] = { - { ir_var_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord", glsl_precision_medium }, -}; - -static const builtin_variable builtin_130_vs_variables[] = { - { ir_var_system_value, SYSTEM_VALUE_VERTEX_ID, "int", "gl_VertexID", glsl_precision_high }, -}; - -static const builtin_variable builtin_110_deprecated_uniforms[] = { - { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrix", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrix", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrix", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat3", "gl_NormalMatrix", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverse", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverse", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverse", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixTranspose", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixTranspose", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixTranspose", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverseTranspose", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverseTranspose", glsl_precision_undefined }, - { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose", glsl_precision_undefined }, - { ir_var_uniform, -1, "float", "gl_NormalScale", glsl_precision_undefined }, - { ir_var_uniform, -1, "gl_LightModelParameters", "gl_LightModel", glsl_precision_undefined}, - - /* Mesa-internal ATI_envmap_bumpmap state. */ - { ir_var_uniform, -1, "vec2", "gl_BumpRotMatrix0MESA", glsl_precision_undefined}, - { ir_var_uniform, -1, "vec2", "gl_BumpRotMatrix1MESA", glsl_precision_undefined}, - { ir_var_uniform, -1, "vec4", "gl_FogParamsOptimizedMESA", glsl_precision_undefined}, -}; static struct gl_builtin_uniform_element gl_DepthRange_elements[] = { {"near", {STATE_DEPTH_RANGE, 0, 0}, SWIZZLE_XXXX}, @@ -343,6 +252,7 @@ static struct gl_builtin_uniform_element gl_NormalMatrix_elements[] = { #define STATEVAR(name) {#name, name ## _elements, Elements(name ## _elements)} static const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = { + STATEVAR(gl_NumSamples), STATEVAR(gl_DepthRange), STATEVAR(gl_ClipPlane), STATEVAR(gl_Point), @@ -397,32 +307,174 @@ static const struct gl_builtin_uniform_desc _mesa_builtin_uniform_desc[] = { {NULL, NULL, 0} }; -static ir_variable * -add_variable(exec_list *instructions, glsl_symbol_table *symtab, - const char *name, const glsl_type *type, - enum ir_variable_mode mode, int slot, glsl_precision prec = glsl_precision_undefined) -{ - ir_variable *var = new(symtab) ir_variable(type, name, mode, prec); - switch (var->mode) { +namespace { + +/** + * Data structure that accumulates fields for the gl_PerVertex interface + * block. + */ +class per_vertex_accumulator +{ +public: + per_vertex_accumulator(); + void add_field(int slot, const glsl_type *type, const char *name, glsl_precision prec); + const glsl_type *construct_interface_instance() const; + +private: + glsl_struct_field fields[10]; + unsigned num_fields; +}; + + +per_vertex_accumulator::per_vertex_accumulator() + : fields(), + num_fields(0) +{ +} + + +void +per_vertex_accumulator::add_field(int slot, const glsl_type *type, + const char *name, glsl_precision prec) +{ + assert(this->num_fields < ARRAY_SIZE(this->fields)); + this->fields[this->num_fields].type = type; + this->fields[this->num_fields].name = name; + this->fields[this->num_fields].row_major = false; + this->fields[this->num_fields].precision = prec; + this->fields[this->num_fields].location = slot; + this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE; + this->fields[this->num_fields].centroid = 0; + this->fields[this->num_fields].sample = 0; + this->num_fields++; +} + + +const glsl_type * +per_vertex_accumulator::construct_interface_instance() const +{ + return glsl_type::get_interface_instance(this->fields, this->num_fields, + GLSL_INTERFACE_PACKING_STD140, + "gl_PerVertex"); +} + + +class builtin_variable_generator +{ +public: + builtin_variable_generator(exec_list *instructions, + struct _mesa_glsl_parse_state *state); + void generate_constants(); + void generate_uniforms(); + void generate_vs_special_vars(); + void generate_gs_special_vars(); + void generate_fs_special_vars(); + void generate_varyings(); + +private: + const glsl_type *array(const glsl_type *base, unsigned elements) + { + return glsl_type::get_array_instance(base, elements); + } + + const glsl_type *type(const char *name) + { + return symtab->get_type(name); + } + + ir_variable *add_input(int slot, const glsl_type *type, const char *name, glsl_precision prec) + { + return add_variable(name, type, ir_var_shader_in, slot, prec); + } + + ir_variable *add_output(int slot, const glsl_type *type, const char *name, glsl_precision prec) + { + return add_variable(name, type, ir_var_shader_out, slot, prec); + } + + ir_variable *add_system_value(int slot, const glsl_type *type, + const char *name, glsl_precision prec) + { + return add_variable(name, type, ir_var_system_value, slot, prec); + } + + ir_variable *add_variable(const char *name, const glsl_type *type, + enum ir_variable_mode mode, int slot, glsl_precision prec); + ir_variable *add_uniform(const glsl_type *type, const char *name, glsl_precision prec); + ir_variable *add_const(const char *name, int value); + void add_varying(int slot, const glsl_type *type, const char *name, + const char *name_as_gs_input, glsl_precision prec); + + exec_list * const instructions; + struct _mesa_glsl_parse_state * const state; + glsl_symbol_table * const symtab; + + /** + * True if compatibility-profile-only variables should be included. (In + * desktop GL, these are always included when the GLSL version is 1.30 and + * or below). + */ + const bool compatibility; + + const glsl_type * const bool_t; + const glsl_type * const int_t; + const glsl_type * const float_t; + const glsl_type * const vec2_t; + const glsl_type * const vec3_t; + const glsl_type * const vec4_t; + const glsl_type * const mat3_t; + const glsl_type * const mat4_t; + + per_vertex_accumulator per_vertex_in; + per_vertex_accumulator per_vertex_out; +}; + + +builtin_variable_generator::builtin_variable_generator( + exec_list *instructions, struct _mesa_glsl_parse_state *state) + : instructions(instructions), state(state), symtab(state->symbols), + compatibility(!state->is_version(140, 100)), + bool_t(glsl_type::bool_type), int_t(glsl_type::int_type), + float_t(glsl_type::float_type), vec2_t(glsl_type::vec2_type), + vec3_t(glsl_type::vec3_type), vec4_t(glsl_type::vec4_type), + mat3_t(glsl_type::mat3_type), mat4_t(glsl_type::mat4_type) +{ +} + + +ir_variable * +builtin_variable_generator::add_variable(const char *name, + const glsl_type *type, + enum ir_variable_mode mode, int slot, glsl_precision prec) + +{ + if (!this->state->es_shader) + prec = glsl_precision_undefined; + ir_variable *var = new(symtab) ir_variable(type, name, mode, prec); + var->data.how_declared = ir_var_declared_implicitly; + + switch (var->data.mode) { case ir_var_auto: - case ir_var_in: - case ir_var_const_in: + case ir_var_shader_in: case ir_var_uniform: case ir_var_system_value: - var->read_only = true; + var->data.read_only = true; break; - case ir_var_inout: - case ir_var_out: + case ir_var_shader_out: break; default: + /* The only variables that are added using this function should be + * uniforms, shader inputs, and shader outputs, constants (which use + * ir_var_auto), and system values. + */ assert(0); break; } - var->location = slot; - var->explicit_location = (slot >= 0); - var->explicit_index = 0; + var->data.location = slot; + var->data.explicit_location = (slot >= 0); + var->data.explicit_index = 0; /* Once the variable is created an initialized, add it to the symbol table * and add the declaration to the IR stream. @@ -433,12 +485,12 @@ add_variable(exec_list *instructions, glsl_symbol_table *symtab, return var; } -static ir_variable * -add_uniform(exec_list *instructions, glsl_symbol_table *symtab, - const char *name, const glsl_type *type, glsl_precision prec = glsl_precision_undefined) + +ir_variable * +builtin_variable_generator::add_uniform(const glsl_type *type, + const char *name, glsl_precision prec) { - ir_variable *const uni = - add_variable(instructions, symtab, name, type, ir_var_uniform, -1, prec); + ir_variable *const uni = add_variable(name, type, ir_var_uniform, -1, prec); unsigned i; for (i = 0; _mesa_builtin_uniform_desc[i].name != NULL; i++) { @@ -481,600 +533,473 @@ add_uniform(exec_list *instructions, glsl_symbol_table *symtab, return uni; } -static void -add_builtin_variable(exec_list *instructions, glsl_symbol_table *symtab, - const builtin_variable *proto, bool use_precision) + +ir_variable * +builtin_variable_generator::add_const(const char *name, int value) { - /* Create a new variable declaration from the description supplied by - * the caller. - */ - const glsl_type *const type = symtab->get_type(proto->type); - - assert(type != NULL); - - if (proto->mode == ir_var_uniform) { - add_uniform(instructions, symtab, proto->name, type, use_precision ? proto->prec : glsl_precision_undefined); - } else { - add_variable(instructions, symtab, proto->name, type, proto->mode, - proto->slot, use_precision ? proto->prec : glsl_precision_undefined); - } -} - -static ir_variable * -add_builtin_constant(exec_list *instructions, glsl_symbol_table *symtab, - const char *name, int value) -{ - ir_variable *const var = add_variable(instructions, symtab, - name, glsl_type::int_type, + ir_variable *const var = add_variable(name, glsl_type::int_type, ir_var_auto, -1, glsl_precision_undefined); var->constant_value = new(var) ir_constant(value); var->constant_initializer = new(var) ir_constant(value); - var->has_initializer = true; + var->data.has_initializer = true; return var; } -/* Several constants in GLSL ES have different names than normal desktop GLSL. - * Therefore, this function should only be called on the ES path. - */ -static void -generate_100ES_uniforms(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + +void +builtin_variable_generator::generate_constants() { - glsl_symbol_table *const symtab = state->symbols; + add_const("gl_MaxVertexAttribs", state->Const.MaxVertexAttribs); + add_const("gl_MaxVertexTextureImageUnits", + state->Const.MaxVertexTextureImageUnits); + add_const("gl_MaxCombinedTextureImageUnits", + state->Const.MaxCombinedTextureImageUnits); + add_const("gl_MaxTextureImageUnits", state->Const.MaxTextureImageUnits); + add_const("gl_MaxDrawBuffers", state->Const.MaxDrawBuffers); - add_builtin_constant(instructions, symtab, "gl_MaxVertexAttribs", - state->Const.MaxVertexAttribs); - add_builtin_constant(instructions, symtab, "gl_MaxVertexUniformVectors", - state->Const.MaxVertexUniformComponents); - add_builtin_constant(instructions, symtab, "gl_MaxVaryingVectors", - state->Const.MaxVaryingFloats / 4); - add_builtin_constant(instructions, symtab, "gl_MaxVertexTextureImageUnits", - state->Const.MaxVertexTextureImageUnits); - add_builtin_constant(instructions, symtab, "gl_MaxCombinedTextureImageUnits", - state->Const.MaxCombinedTextureImageUnits); - add_builtin_constant(instructions, symtab, "gl_MaxTextureImageUnits", - state->Const.MaxTextureImageUnits); - add_builtin_constant(instructions, symtab, "gl_MaxFragmentUniformVectors", - state->Const.MaxFragmentUniformComponents); + /* Max uniforms/varyings: GLSL ES counts these in units of vectors; desktop + * GL counts them in units of "components" or "floats". + */ + if (state->es_shader) { + add_const("gl_MaxVertexUniformVectors", + state->Const.MaxVertexUniformComponents / 4); + add_const("gl_MaxFragmentUniformVectors", + state->Const.MaxFragmentUniformComponents / 4); - add_uniform(instructions, symtab, "gl_DepthRange", - state->symbols->get_type("gl_DepthRangeParameters"), glsl_precision_undefined); + /* In GLSL ES 3.00, gl_MaxVaryingVectors was split out to separate + * vertex and fragment shader constants. + */ + if (state->is_version(0, 300)) { + add_const("gl_MaxVertexOutputVectors", + state->ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4); + add_const("gl_MaxFragmentInputVectors", + state->ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4); + } else { + add_const("gl_MaxVaryingVectors", + state->ctx->Const.MaxVarying); + } + } else { + add_const("gl_MaxVertexUniformComponents", + state->Const.MaxVertexUniformComponents); + + /* Note: gl_MaxVaryingFloats was deprecated in GLSL 1.30+, but not + * removed + */ + add_const("gl_MaxVaryingFloats", state->ctx->Const.MaxVarying * 4); + + add_const("gl_MaxFragmentUniformComponents", + state->Const.MaxFragmentUniformComponents); + } + + /* Texel offsets were introduced in ARB_shading_language_420pack (which + * requires desktop GLSL version 130), and adopted into desktop GLSL + * version 4.20 and GLSL ES version 3.00. + */ + if ((state->is_version(130, 0) && + state->ARB_shading_language_420pack_enable) || + state->is_version(420, 300)) { + add_const("gl_MinProgramTexelOffset", + state->Const.MinProgramTexelOffset); + add_const("gl_MaxProgramTexelOffset", + state->Const.MaxProgramTexelOffset); + } + + if (state->is_version(130, 0)) { + add_const("gl_MaxClipDistances", state->Const.MaxClipPlanes); + add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4); + } + + if (state->is_version(150, 0)) { + add_const("gl_MaxVertexOutputComponents", + state->Const.MaxVertexOutputComponents); + add_const("gl_MaxGeometryInputComponents", + state->Const.MaxGeometryInputComponents); + add_const("gl_MaxGeometryOutputComponents", + state->Const.MaxGeometryOutputComponents); + add_const("gl_MaxFragmentInputComponents", + state->Const.MaxFragmentInputComponents); + add_const("gl_MaxGeometryTextureImageUnits", + state->Const.MaxGeometryTextureImageUnits); + add_const("gl_MaxGeometryOutputVertices", + state->Const.MaxGeometryOutputVertices); + add_const("gl_MaxGeometryTotalOutputComponents", + state->Const.MaxGeometryTotalOutputComponents); + add_const("gl_MaxGeometryUniformComponents", + state->Const.MaxGeometryUniformComponents); + + /* Note: the GLSL 1.50-4.40 specs require + * gl_MaxGeometryVaryingComponents to be present, and to be at least 64. + * But they do not define what it means (and there does not appear to be + * any corresponding constant in the GL specs). However, + * ARB_geometry_shader4 defines MAX_GEOMETRY_VARYING_COMPONENTS_ARB to + * be the maximum number of components available for use as geometry + * outputs. So we assume this is a synonym for + * gl_MaxGeometryOutputComponents. + */ + add_const("gl_MaxGeometryVaryingComponents", + state->Const.MaxGeometryOutputComponents); + } + + if (compatibility) { + /* Note: gl_MaxLights stopped being listed as an explicit constant in + * GLSL 1.30, however it continues to be referred to (as a minimum size + * for compatibility-mode uniforms) all the way up through GLSL 4.30, so + * this seems like it was probably an oversight. + */ + add_const("gl_MaxLights", state->Const.MaxLights); + + add_const("gl_MaxClipPlanes", state->Const.MaxClipPlanes); + + /* Note: gl_MaxTextureUnits wasn't made compatibility-only until GLSL + * 1.50, however this seems like it was probably an oversight. + */ + add_const("gl_MaxTextureUnits", state->Const.MaxTextureUnits); + + /* Note: gl_MaxTextureCoords was left out of GLSL 1.40, but it was + * re-introduced in GLSL 1.50, so this seems like it was probably an + * oversight. + */ + add_const("gl_MaxTextureCoords", state->Const.MaxTextureCoords); + } + + if (state->ARB_shader_atomic_counters_enable) { + add_const("gl_MaxVertexAtomicCounters", + state->Const.MaxVertexAtomicCounters); + add_const("gl_MaxGeometryAtomicCounters", + state->Const.MaxGeometryAtomicCounters); + add_const("gl_MaxFragmentAtomicCounters", + state->Const.MaxFragmentAtomicCounters); + add_const("gl_MaxCombinedAtomicCounters", + state->Const.MaxCombinedAtomicCounters); + add_const("gl_MaxAtomicCounterBindings", + state->Const.MaxAtomicBufferBindings); + add_const("gl_MaxTessControlAtomicCounters", 0); + add_const("gl_MaxTessEvaluationAtomicCounters", 0); + } } -static void -generate_110_uniforms(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool add_deprecated) + +/** + * Generate uniform variables (which exist in all types of shaders). + */ +void +builtin_variable_generator::generate_uniforms() { - glsl_symbol_table *const symtab = state->symbols; + add_uniform(int_t, "gl_NumSamples", glsl_precision_undefined); + add_uniform(type("gl_DepthRangeParameters"), "gl_DepthRange", glsl_precision_undefined); + add_uniform(array(vec4_t, VERT_ATTRIB_MAX), "gl_CurrentAttribVertMESA", glsl_precision_undefined); + add_uniform(array(vec4_t, VARYING_SLOT_MAX), "gl_CurrentAttribFragMESA", glsl_precision_undefined); - if (add_deprecated) { - for (unsigned i = 0 - ; i < Elements(builtin_110_deprecated_uniforms) - ; i++) { - add_builtin_variable(instructions, symtab, - & builtin_110_deprecated_uniforms[i], state->es_shader); - } - } + if (compatibility) { + add_uniform(mat4_t, "gl_ModelViewMatrix", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ProjectionMatrix", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrix", glsl_precision_undefined); + add_uniform(mat3_t, "gl_NormalMatrix", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewMatrixInverse", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ProjectionMatrixInverse", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverse", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewMatrixTranspose", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ProjectionMatrixTranspose", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrixTranspose", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewMatrixInverseTranspose", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ProjectionMatrixInverseTranspose", glsl_precision_undefined); + add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverseTranspose", glsl_precision_undefined); + add_uniform(float_t, "gl_NormalScale", glsl_precision_undefined); + add_uniform(type("gl_LightModelParameters"), "gl_LightModel", glsl_precision_undefined); + add_uniform(vec2_t, "gl_BumpRotMatrix0MESA", glsl_precision_undefined); + add_uniform(vec2_t, "gl_BumpRotMatrix1MESA", glsl_precision_undefined); + add_uniform(vec4_t, "gl_FogParamsOptimizedMESA", glsl_precision_undefined); - if (add_deprecated) { - add_builtin_constant(instructions, symtab, "gl_MaxLights", - state->Const.MaxLights); - add_builtin_constant(instructions, symtab, "gl_MaxClipPlanes", - state->Const.MaxClipPlanes); - add_builtin_constant(instructions, symtab, "gl_MaxTextureUnits", - state->Const.MaxTextureUnits); - add_builtin_constant(instructions, symtab, "gl_MaxTextureCoords", - state->Const.MaxTextureCoords); - } - add_builtin_constant(instructions, symtab, "gl_MaxVertexAttribs", - state->Const.MaxVertexAttribs); - add_builtin_constant(instructions, symtab, "gl_MaxVertexUniformComponents", - state->Const.MaxVertexUniformComponents); - add_builtin_constant(instructions, symtab, "gl_MaxVaryingFloats", - state->Const.MaxVaryingFloats); - add_builtin_constant(instructions, symtab, "gl_MaxVertexTextureImageUnits", - state->Const.MaxVertexTextureImageUnits); - add_builtin_constant(instructions, symtab, "gl_MaxCombinedTextureImageUnits", - state->Const.MaxCombinedTextureImageUnits); - add_builtin_constant(instructions, symtab, "gl_MaxTextureImageUnits", - state->Const.MaxTextureImageUnits); - add_builtin_constant(instructions, symtab, "gl_MaxFragmentUniformComponents", - state->Const.MaxFragmentUniformComponents); - - if (add_deprecated) { const glsl_type *const mat4_array_type = - glsl_type::get_array_instance(glsl_type::mat4_type, - state->Const.MaxTextureCoords); + array(mat4_t, state->Const.MaxTextureCoords); + add_uniform(mat4_array_type, "gl_TextureMatrix", glsl_precision_undefined); + add_uniform(mat4_array_type, "gl_TextureMatrixInverse", glsl_precision_undefined); + add_uniform(mat4_array_type, "gl_TextureMatrixTranspose", glsl_precision_undefined); + add_uniform(mat4_array_type, "gl_TextureMatrixInverseTranspose", glsl_precision_undefined); - add_uniform(instructions, symtab, "gl_TextureMatrix", mat4_array_type); - add_uniform(instructions, symtab, "gl_TextureMatrixInverse", mat4_array_type); - add_uniform(instructions, symtab, "gl_TextureMatrixTranspose", mat4_array_type); - add_uniform(instructions, symtab, "gl_TextureMatrixInverseTranspose", mat4_array_type); - } - - add_uniform(instructions, symtab, "gl_DepthRange", - symtab->get_type("gl_DepthRangeParameters")); - - if (add_deprecated) { - add_uniform(instructions, symtab, "gl_ClipPlane", - glsl_type::get_array_instance(glsl_type::vec4_type, - state->Const.MaxClipPlanes)); - add_uniform(instructions, symtab, "gl_Point", - symtab->get_type("gl_PointParameters")); + add_uniform(array(vec4_t, state->Const.MaxClipPlanes), "gl_ClipPlane", glsl_precision_undefined); + add_uniform(type("gl_PointParameters"), "gl_Point", glsl_precision_undefined); const glsl_type *const material_parameters_type = - symtab->get_type("gl_MaterialParameters"); - add_uniform(instructions, symtab, "gl_FrontMaterial", material_parameters_type); - add_uniform(instructions, symtab, "gl_BackMaterial", material_parameters_type); + type("gl_MaterialParameters"); + add_uniform(material_parameters_type, "gl_FrontMaterial", glsl_precision_undefined); + add_uniform(material_parameters_type, "gl_BackMaterial", glsl_precision_undefined); - const glsl_type *const light_source_array_type = - glsl_type::get_array_instance(symtab->get_type("gl_LightSourceParameters"), state->Const.MaxLights); - - add_uniform(instructions, symtab, "gl_LightSource", light_source_array_type); + add_uniform(array(type("gl_LightSourceParameters"), + state->Const.MaxLights), + "gl_LightSource", glsl_precision_undefined); const glsl_type *const light_model_products_type = - symtab->get_type("gl_LightModelProducts"); - add_uniform(instructions, symtab, "gl_FrontLightModelProduct", - light_model_products_type); - add_uniform(instructions, symtab, "gl_BackLightModelProduct", - light_model_products_type); + type("gl_LightModelProducts"); + add_uniform(light_model_products_type, "gl_FrontLightModelProduct", glsl_precision_undefined); + add_uniform(light_model_products_type, "gl_BackLightModelProduct", glsl_precision_undefined); const glsl_type *const light_products_type = - glsl_type::get_array_instance(symtab->get_type("gl_LightProducts"), - state->Const.MaxLights); - add_uniform(instructions, symtab, "gl_FrontLightProduct", light_products_type); - add_uniform(instructions, symtab, "gl_BackLightProduct", light_products_type); + array(type("gl_LightProducts"), state->Const.MaxLights); + add_uniform(light_products_type, "gl_FrontLightProduct", glsl_precision_undefined); + add_uniform(light_products_type, "gl_BackLightProduct", glsl_precision_undefined); - add_uniform(instructions, symtab, "gl_TextureEnvColor", - glsl_type::get_array_instance(glsl_type::vec4_type, - state->Const.MaxTextureUnits)); + add_uniform(array(vec4_t, state->Const.MaxTextureUnits), + "gl_TextureEnvColor", glsl_precision_undefined); const glsl_type *const texcoords_vec4 = - glsl_type::get_array_instance(glsl_type::vec4_type, - state->Const.MaxTextureCoords); - add_uniform(instructions, symtab, "gl_EyePlaneS", texcoords_vec4); - add_uniform(instructions, symtab, "gl_EyePlaneT", texcoords_vec4); - add_uniform(instructions, symtab, "gl_EyePlaneR", texcoords_vec4); - add_uniform(instructions, symtab, "gl_EyePlaneQ", texcoords_vec4); - add_uniform(instructions, symtab, "gl_ObjectPlaneS", texcoords_vec4); - add_uniform(instructions, symtab, "gl_ObjectPlaneT", texcoords_vec4); - add_uniform(instructions, symtab, "gl_ObjectPlaneR", texcoords_vec4); - add_uniform(instructions, symtab, "gl_ObjectPlaneQ", texcoords_vec4); + array(vec4_t, state->Const.MaxTextureCoords); + add_uniform(texcoords_vec4, "gl_EyePlaneS", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_EyePlaneT", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_EyePlaneR", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_EyePlaneQ", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_ObjectPlaneS", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_ObjectPlaneT", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_ObjectPlaneR", glsl_precision_undefined); + add_uniform(texcoords_vec4, "gl_ObjectPlaneQ", glsl_precision_undefined); - add_uniform(instructions, symtab, "gl_Fog", - symtab->get_type("gl_FogParameters")); + add_uniform(type("gl_FogParameters"), "gl_Fog", glsl_precision_undefined); } - - /* Mesa-internal current attrib state */ - const glsl_type *const vert_attribs = - glsl_type::get_array_instance(glsl_type::vec4_type, VERT_ATTRIB_MAX); - add_uniform(instructions, symtab, "gl_CurrentAttribVertMESA", vert_attribs); - const glsl_type *const frag_attribs = - glsl_type::get_array_instance(glsl_type::vec4_type, FRAG_ATTRIB_MAX); - add_uniform(instructions, symtab, "gl_CurrentAttribFragMESA", frag_attribs); -} - -/* This function should only be called for ES, not desktop GL. */ -static void -generate_100ES_vs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_core_vs_variables[i], state->es_shader); - } - - generate_100ES_uniforms(instructions, state); - - generate_ARB_draw_buffers_variables(instructions, state, false, - vertex_shader); } -static void -generate_110_vs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool add_deprecated) +/** + * Generate variables which only exist in vertex shaders. + */ +void +builtin_variable_generator::generate_vs_special_vars() { - for (unsigned i = 0; i < Elements(builtin_core_vs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_core_vs_variables[i], state->es_shader); - } - if (add_deprecated) { - for (unsigned i = 0 - ; i < Elements(builtin_110_deprecated_vs_variables) - ; i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_110_deprecated_vs_variables[i], state->es_shader); - } + if (state->is_version(130, 300)) + add_system_value(SYSTEM_VALUE_VERTEX_ID, int_t, "gl_VertexID", glsl_precision_high); + if (state->ARB_draw_instanced_enable) + add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceIDARB", glsl_precision_high); + if (state->ARB_draw_instanced_enable || state->is_version(140, 300)) + add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceID", glsl_precision_high); + if (state->AMD_vertex_shader_layer_enable) + add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer", glsl_precision_high); + if (compatibility) { + add_input(VERT_ATTRIB_POS, vec4_t, "gl_Vertex", glsl_precision_high); + add_input(VERT_ATTRIB_NORMAL, vec3_t, "gl_Normal", glsl_precision_medium); + add_input(VERT_ATTRIB_COLOR0, vec4_t, "gl_Color", glsl_precision_medium); + add_input(VERT_ATTRIB_COLOR1, vec4_t, "gl_SecondaryColor", glsl_precision_medium); + add_input(VERT_ATTRIB_TEX0, vec4_t, "gl_MultiTexCoord0", glsl_precision_high); + add_input(VERT_ATTRIB_TEX1, vec4_t, "gl_MultiTexCoord1", glsl_precision_high); + add_input(VERT_ATTRIB_TEX2, vec4_t, "gl_MultiTexCoord2", glsl_precision_high); + add_input(VERT_ATTRIB_TEX3, vec4_t, "gl_MultiTexCoord3", glsl_precision_high); + add_input(VERT_ATTRIB_TEX4, vec4_t, "gl_MultiTexCoord4", glsl_precision_high); + add_input(VERT_ATTRIB_TEX5, vec4_t, "gl_MultiTexCoord5", glsl_precision_high); + add_input(VERT_ATTRIB_TEX6, vec4_t, "gl_MultiTexCoord6", glsl_precision_high); + add_input(VERT_ATTRIB_TEX7, vec4_t, "gl_MultiTexCoord7", glsl_precision_high); + add_input(VERT_ATTRIB_FOG, float_t, "gl_FogCoord", glsl_precision_high); } - generate_110_uniforms(instructions, state, add_deprecated); +} - /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec: + +/** + * Generate variables which only exist in geometry shaders. + */ +void +builtin_variable_generator::generate_gs_special_vars() +{ + add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer", glsl_precision_high); + if (state->ARB_viewport_array_enable) + add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex", glsl_precision_high); + + /* Although gl_PrimitiveID appears in tessellation control and tessellation + * evaluation shaders, it has a different function there than it has in + * geometry shaders, so we treat it (and its counterpart gl_PrimitiveIDIn) + * as special geometry shader variables. * - * "As with all arrays, indices used to subscript gl_TexCoord must - * either be an integral constant expressions, or this array must be - * re-declared by the shader with a size. The size can be at most - * gl_MaxTextureCoords. Using indexes close to 0 may aid the - * implementation in preserving varying resources." + * Note that although the general convention of suffixing geometry shader + * input varyings with "In" was not adopted into GLSL 1.50, it is used in + * the specific case of gl_PrimitiveIDIn. So we don't need to treat + * gl_PrimitiveIDIn as an {ARB,EXT}_geometry_shader4-only variable. */ - const glsl_type *const vec4_array_type = - glsl_type::get_array_instance(glsl_type::vec4_type, 0); - - add_variable(instructions, state->symbols, - "gl_TexCoord", vec4_array_type, ir_var_out, VERT_RESULT_TEX0); - - generate_ARB_draw_buffers_variables(instructions, state, false, - vertex_shader); + ir_variable *var; + var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveIDIn", glsl_precision_high); + var->data.interpolation = INTERP_QUALIFIER_FLAT; + var = add_output(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID", glsl_precision_high); + var->data.interpolation = INTERP_QUALIFIER_FLAT; } -static void -generate_120_vs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool add_deprecated) +/** + * Generate variables which only exist in fragment shaders. + */ +void +builtin_variable_generator::generate_fs_special_vars() { - /* GLSL version 1.20 did not add any built-in variables in the vertex - * shader. - */ - generate_110_vs_variables(instructions, state, add_deprecated); -} + add_input(VARYING_SLOT_POS, vec4_t, "gl_FragCoord", glsl_precision_high); + add_input(VARYING_SLOT_FACE, bool_t, "gl_FrontFacing", glsl_precision_low); + if (state->is_version(120, 100)) + add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord", glsl_precision_medium); - -static void -generate_130_uniforms(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - glsl_symbol_table *const symtab = state->symbols; - - add_builtin_constant(instructions, symtab, "gl_MaxClipDistances", - state->Const.MaxClipPlanes); - add_builtin_constant(instructions, symtab, "gl_MaxVaryingComponents", - state->Const.MaxVaryingFloats); -} - - -static void -generate_130_vs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool add_deprecated) -{ - generate_120_vs_variables(instructions, state, add_deprecated); - - for (unsigned i = 0; i < Elements(builtin_130_vs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_130_vs_variables[i], state->es_shader); + if (state->is_version(150, 0)) { + ir_variable *var = + add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID", glsl_precision_high); + var->data.interpolation = INTERP_QUALIFIER_FLAT; } - generate_130_uniforms(instructions, state); - - /* From the GLSL 1.30 spec, section 7.1 (Vertex Shader Special - * Variables): - * - * The gl_ClipDistance array is predeclared as unsized and must - * be sized by the shader either redeclaring it with a size or - * indexing it only with integral constant expressions. - * - * We represent this in Mesa by initially declaring the array as - * size 0. + /* gl_FragColor and gl_FragData were deprecated starting in desktop GLSL + * 1.30, and were relegated to the compatibility profile in GLSL 4.20. + * They were removed from GLSL ES 3.00. */ - const glsl_type *const clip_distance_array_type = - glsl_type::get_array_instance(glsl_type::float_type, 0); - - add_variable(instructions, state->symbols, - "gl_ClipDistance", clip_distance_array_type, ir_var_out, - VERT_RESULT_CLIP_DIST0); - -} - - -static void -initialize_vs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - - switch (state->language_version) { - case 100: - generate_100ES_vs_variables(instructions, state); - break; - case 110: - generate_110_vs_variables(instructions, state, true); - break; - case 120: - generate_120_vs_variables(instructions, state, true); - break; - case 130: - generate_130_vs_variables(instructions, state, true); - break; - case 140: - generate_130_vs_variables(instructions, state, false); - break; + if (compatibility || !state->is_version(420, 300)) { + add_output(FRAG_RESULT_COLOR, vec4_t, "gl_FragColor", glsl_precision_medium); + add_output(FRAG_RESULT_DATA0, + array(vec4_t, state->Const.MaxDrawBuffers), "gl_FragData", glsl_precision_medium); } - generate_ARB_draw_instanced_variables(instructions, state, false, - vertex_shader); -} + /* gl_FragDepth has always been in desktop GLSL, but did not appear in GLSL + * ES 1.00. + */ + if (state->is_version(110, 300)) + add_output(FRAG_RESULT_DEPTH, float_t, "gl_FragDepth", glsl_precision_high); - -/* This function should only be called for ES, not desktop GL. */ -static void -generate_100ES_fs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_core_fs_variables[i], state->es_shader); + if (state->ARB_shader_stencil_export_enable) { + ir_variable *const var = + add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefARB", glsl_precision_high); + if (state->ARB_shader_stencil_export_warn) + var->warn_extension = "GL_ARB_shader_stencil_export"; } - for (unsigned i = 0; i < Elements(builtin_100ES_fs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_100ES_fs_variables[i], state->es_shader); + if (state->AMD_shader_stencil_export_enable) { + ir_variable *const var = + add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefAMD", glsl_precision_high); + if (state->AMD_shader_stencil_export_warn) + var->warn_extension = "GL_AMD_shader_stencil_export"; } if (state->EXT_frag_depth_enable) { - const builtin_variable fragDepthEXT = { ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepthEXT", glsl_precision_high }; - add_builtin_variable(instructions, state->symbols, &fragDepthEXT, state->es_shader); + ir_variable *const var = + add_output(FRAG_RESULT_DEPTH, float_t, "gl_FragDepthEXT", glsl_precision_high); + if (state->EXT_frag_depth_warn) + var->warn_extension = "GL_EXT_frag_depth"; } - generate_100ES_uniforms(instructions, state); + if (state->ARB_sample_shading_enable) { + add_system_value(SYSTEM_VALUE_SAMPLE_ID, int_t, "gl_SampleID", glsl_precision_high); + add_system_value(SYSTEM_VALUE_SAMPLE_POS, vec2_t, "gl_SamplePosition", glsl_precision_high); + /* From the ARB_sample_shading specification: + * "The number of elements in the array is ceil(/32), where + * is the maximum number of color samples supported by the + * implementation." + * Since no drivers expose more than 32x MSAA, we can simply set + * the array size to 1 rather than computing it. + */ + add_output(FRAG_RESULT_SAMPLE_MASK, array(int_t, 1), "gl_SampleMask", glsl_precision_high); + } - generate_ARB_draw_buffers_variables(instructions, state, false, - fragment_shader); + if (state->ARB_gpu_shader5_enable) { + add_system_value(SYSTEM_VALUE_SAMPLE_MASK_IN, array(int_t, 1), "gl_SampleMaskIn", glsl_precision_high); + } } -static void -generate_110_fs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool add_deprecated) + +/** + * Add a single "varying" variable. The variable's type and direction (input + * or output) are adjusted as appropriate for the type of shader being + * compiled. For geometry shaders using {ARB,EXT}_geometry_shader4, + * name_as_gs_input is used for the input (to avoid ambiguity). + */ +void +builtin_variable_generator::add_varying(int slot, const glsl_type *type, + const char *name, + const char *name_as_gs_input, + glsl_precision prec) { - for (unsigned i = 0; i < Elements(builtin_core_fs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_core_fs_variables[i], state->es_shader); + switch (state->stage) { + case MESA_SHADER_GEOMETRY: + this->per_vertex_in.add_field(slot, type, name, prec); + /* FALLTHROUGH */ + case MESA_SHADER_VERTEX: + this->per_vertex_out.add_field(slot, type, name, prec); + break; + case MESA_SHADER_FRAGMENT: + add_input(slot, type, name, prec); + break; + } +} + + +/** + * Generate variables that are used to communicate data from one shader stage + * to the next ("varyings"). + */ +void +builtin_variable_generator::generate_varyings() +{ +#define ADD_VARYING(loc, type, name, prec) \ + add_varying(loc, type, name, name "In", prec) + + /* gl_Position and gl_PointSize are not visible from fragment shaders. */ + if (state->stage != MESA_SHADER_FRAGMENT) { + ADD_VARYING(VARYING_SLOT_POS, vec4_t, "gl_Position", glsl_precision_high); + ADD_VARYING(VARYING_SLOT_PSIZ, float_t, "gl_PointSize", glsl_precision_high); } - for (unsigned i = 0; i < Elements(builtin_110_fs_variables); i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_110_fs_variables[i], state->es_shader); + if (state->is_version(130, 0)) { + ADD_VARYING(VARYING_SLOT_CLIP_DIST0, array(float_t, 0), + "gl_ClipDistance", glsl_precision_high); } - if (add_deprecated) { - for (unsigned i = 0 - ; i < Elements(builtin_110_deprecated_fs_variables) - ; i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_110_deprecated_fs_variables[i], state->es_shader); + if (compatibility) { + ADD_VARYING(VARYING_SLOT_TEX0, array(vec4_t, 0), "gl_TexCoord", glsl_precision_undefined); + ADD_VARYING(VARYING_SLOT_FOGC, float_t, "gl_FogFragCoord", glsl_precision_undefined); + if (state->stage == MESA_SHADER_FRAGMENT) { + ADD_VARYING(VARYING_SLOT_COL0, vec4_t, "gl_Color", glsl_precision_medium); + ADD_VARYING(VARYING_SLOT_COL1, vec4_t, "gl_SecondaryColor", glsl_precision_medium); + } else { + ADD_VARYING(VARYING_SLOT_CLIP_VERTEX, vec4_t, "gl_ClipVertex", glsl_precision_high); + ADD_VARYING(VARYING_SLOT_COL0, vec4_t, "gl_FrontColor", glsl_precision_medium); + ADD_VARYING(VARYING_SLOT_BFC0, vec4_t, "gl_BackColor", glsl_precision_medium); + ADD_VARYING(VARYING_SLOT_COL1, vec4_t, "gl_FrontSecondaryColor", glsl_precision_medium); + ADD_VARYING(VARYING_SLOT_BFC1, vec4_t, "gl_BackSecondaryColor", glsl_precision_medium); } } - generate_110_uniforms(instructions, state, add_deprecated); - - /* From page 54 (page 60 of the PDF) of the GLSL 1.20 spec: - * - * "As with all arrays, indices used to subscript gl_TexCoord must - * either be an integral constant expressions, or this array must be - * re-declared by the shader with a size. The size can be at most - * gl_MaxTextureCoords. Using indexes close to 0 may aid the - * implementation in preserving varying resources." - */ - const glsl_type *const vec4_array_type = - glsl_type::get_array_instance(glsl_type::vec4_type, 0); - - add_variable(instructions, state->symbols, - "gl_TexCoord", vec4_array_type, ir_var_in, FRAG_ATTRIB_TEX0); - - generate_ARB_draw_buffers_variables(instructions, state, false, - fragment_shader); -} - - -static void -generate_ARB_draw_buffers_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool warn, _mesa_glsl_parser_targets target) -{ - /* gl_MaxDrawBuffers is available in all shader stages. - */ - ir_variable *const mdb = - add_builtin_constant(instructions, state->symbols, "gl_MaxDrawBuffers", - state->Const.MaxDrawBuffers); - - if (warn) - mdb->warn_extension = "GL_ARB_draw_buffers"; - - /* gl_FragData is only available in the fragment shader. - */ - if (target == fragment_shader) { - const glsl_type *const vec4_array_type = - glsl_type::get_array_instance(glsl_type::vec4_type, - state->Const.MaxDrawBuffers); - - ir_variable *const fd = - add_variable(instructions, state->symbols, - "gl_FragData", vec4_array_type, - ir_var_out, FRAG_RESULT_DATA0); - - if (warn) - fd->warn_extension = "GL_ARB_draw_buffers"; + if (state->stage == MESA_SHADER_GEOMETRY) { + const glsl_type *per_vertex_in_type = + this->per_vertex_in.construct_interface_instance(); + add_variable("gl_in", array(per_vertex_in_type, 0), + ir_var_shader_in, -1, glsl_precision_undefined); + } + if (state->stage == MESA_SHADER_VERTEX || state->stage == MESA_SHADER_GEOMETRY) { + const glsl_type *per_vertex_out_type = + this->per_vertex_out.construct_interface_instance(); + const glsl_struct_field *fields = per_vertex_out_type->fields.structure; + for (unsigned i = 0; i < per_vertex_out_type->length; i++) { + ir_variable *var = + add_variable(fields[i].name, fields[i].type, ir_var_shader_out, + fields[i].location, fields[i].precision); + var->data.interpolation = fields[i].interpolation; + var->data.centroid = fields[i].centroid; + var->data.sample = fields[i].sample; + var->init_interface_type(per_vertex_out_type); + } } } -static void -generate_ARB_draw_instanced_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool warn, - _mesa_glsl_parser_targets target) -{ - /* gl_InstanceIDARB is only available in the vertex shader. - */ - if (target != vertex_shader) - return; +}; /* Anonymous namespace */ - if (state->ARB_draw_instanced_enable) { - ir_variable *inst = - add_variable(instructions, state->symbols, - "gl_InstanceIDARB", glsl_type::int_type, - ir_var_system_value, SYSTEM_VALUE_INSTANCE_ID); - - if (warn) - inst->warn_extension = "GL_ARB_draw_instanced"; - } - - if (state->ARB_draw_instanced_enable || state->language_version >= 140) { - /* Originally ARB_draw_instanced only specified that ARB decorated name. - * Since no vendor actually implemented that behavior and some apps use - * the undecorated name, the extension now specifies that both names are - * available. - */ - ir_variable *inst = - add_variable(instructions, state->symbols, - "gl_InstanceID", glsl_type::int_type, - ir_var_system_value, SYSTEM_VALUE_INSTANCE_ID); - - if (state->language_version < 140 && warn) - inst->warn_extension = "GL_ARB_draw_instanced"; - } -} - - -static void -generate_ARB_shader_stencil_export_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool warn) -{ - /* gl_FragStencilRefARB is only available in the fragment shader. - */ - ir_variable *const fd = - add_variable(instructions, state->symbols, - "gl_FragStencilRefARB", glsl_type::int_type, - ir_var_out, FRAG_RESULT_STENCIL); - - if (warn) - fd->warn_extension = "GL_ARB_shader_stencil_export"; -} - -static void -generate_AMD_shader_stencil_export_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool warn) -{ - /* gl_FragStencilRefAMD is only available in the fragment shader. - */ - ir_variable *const fd = - add_variable(instructions, state->symbols, - "gl_FragStencilRefAMD", glsl_type::int_type, - ir_var_out, FRAG_RESULT_STENCIL); - - if (warn) - fd->warn_extension = "GL_AMD_shader_stencil_export"; -} - -static void -generate_120_fs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - bool add_deprecated) -{ - generate_110_fs_variables(instructions, state, add_deprecated); - - for (unsigned i = 0 - ; i < Elements(builtin_120_fs_variables) - ; i++) { - add_builtin_variable(instructions, state->symbols, - & builtin_120_fs_variables[i], state->es_shader); - } -} - -static void -generate_fs_clipdistance(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - /* From the GLSL 1.30 spec, section 7.2 (Fragment Shader Special - * Variables): - * - * The built-in input variable gl_ClipDistance array contains linearly - * interpolated values for the vertex values written by the vertex shader - * to the gl_ClipDistance vertex output variable. This array must be - * sized in the fragment shader either implicitly or explicitly to be the - * same size as it was sized in the vertex shader. - * - * In other words, the array must be pre-declared as implicitly sized. We - * represent this in Mesa by initially declaring the array as size 0. - */ - const glsl_type *const clip_distance_array_type = - glsl_type::get_array_instance(glsl_type::float_type, 0); - - add_variable(instructions, state->symbols, - "gl_ClipDistance", clip_distance_array_type, ir_var_in, - FRAG_ATTRIB_CLIP_DIST0); -} - -static void -generate_130_fs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - generate_120_fs_variables(instructions, state, true); - - generate_130_uniforms(instructions, state); - generate_fs_clipdistance(instructions, state); -} - - -static void -generate_140_fs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - generate_120_fs_variables(instructions, state, false); - - generate_130_uniforms(instructions, state); - generate_fs_clipdistance(instructions, state); -} - -static void -initialize_fs_variables(exec_list *instructions, - struct _mesa_glsl_parse_state *state) -{ - - switch (state->language_version) { - case 100: - generate_100ES_fs_variables(instructions, state); - break; - case 110: - generate_110_fs_variables(instructions, state, true); - break; - case 120: - generate_120_fs_variables(instructions, state, true); - break; - case 130: - generate_130_fs_variables(instructions, state); - break; - case 140: - generate_140_fs_variables(instructions, state); - break; - } - - if (state->ARB_shader_stencil_export_enable) - generate_ARB_shader_stencil_export_variables(instructions, state, - state->ARB_shader_stencil_export_warn); - - if (state->AMD_shader_stencil_export_enable) - generate_AMD_shader_stencil_export_variables(instructions, state, - state->AMD_shader_stencil_export_warn); -} void _mesa_glsl_initialize_variables(exec_list *instructions, struct _mesa_glsl_parse_state *state) { - switch (state->target) { - case vertex_shader: - initialize_vs_variables(instructions, state); + builtin_variable_generator gen(instructions, state); + + gen.generate_constants(); + gen.generate_uniforms(); + + gen.generate_varyings(); + + switch (state->stage) { + case MESA_SHADER_VERTEX: + gen.generate_vs_special_vars(); break; - case geometry_shader: + case MESA_SHADER_GEOMETRY: + gen.generate_gs_special_vars(); break; - case fragment_shader: - initialize_fs_variables(instructions, state); + case MESA_SHADER_FRAGMENT: + gen.generate_fs_special_vars(); break; } } diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/glsl/inverse.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/glsl/inverse.glsl deleted file mode 100644 index ffb84f907..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/glsl/inverse.glsl +++ /dev/null @@ -1,106 +0,0 @@ -/* Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) - * Copyright © 2012 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#version 120 -mat2 inverse(mat2 m) -{ - mat2 adj; - adj[0][0] = m[1][1]; - adj[0][1] = -m[0][1]; - adj[1][0] = -m[1][0]; - adj[1][1] = m[0][0]; - float det = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - return adj / det; -} - -mat3 inverse(mat3 m) -{ - mat3 adj; - adj[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); - adj[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); - adj[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); - adj[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); - adj[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); - adj[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); - adj[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - adj[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); - adj[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); - - float det = (+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) - - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) - + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0])); - - return adj / det; -} - -mat4 inverse(mat4 m) -{ - float SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - float SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - float SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - float SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - float SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - float SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - float SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - float SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - float SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - float SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - float SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - float SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - float SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - float SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - float SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - float SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - float SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - float SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - float SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - mat4 adj; - - adj[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); - adj[1][0] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); - adj[2][0] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); - adj[3][0] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); - - adj[0][1] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); - adj[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); - adj[2][1] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); - adj[3][1] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); - - adj[0][2] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); - adj[1][2] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); - adj[2][2] = + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12); - adj[3][2] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12); - - adj[0][3] = - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15); - adj[1][3] = + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17); - adj[2][3] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18); - adj[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18); - - float det = (+ m[0][0] * adj[0][0] - + m[0][1] * adj[1][0] - + m[0][2] * adj[2][0] - + m[0][3] * adj[3][0]); - - return adj / det; -} - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/abs.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/abs.ir deleted file mode 100644 index d07d1d99e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/abs.ir +++ /dev/null @@ -1,41 +0,0 @@ -((function abs - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float abs (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 abs (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 abs (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 abs (var_ref arg0))))) - - (signature int - (parameters - (declare (in) int arg0)) - ((return (expression int abs (var_ref arg0))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0)) - ((return (expression ivec2 abs (var_ref arg0))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0)) - ((return (expression ivec3 abs (var_ref arg0))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0)) - ((return (expression ivec4 abs (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/acos.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/acos.ir deleted file mode 100644 index 8c3797e96..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/acos.ir +++ /dev/null @@ -1,29 +0,0 @@ -((function acos - (signature float - (parameters - (declare (in) float x)) - ((declare () float s) - (call asin (var_ref s) ((var_ref x))) - (return (expression float - (constant float (1.5707964)) (var_ref s))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((declare () vec2 s) - (call asin (var_ref s) ((var_ref x))) - (return (expression vec2 - (constant float (1.5707964)) (var_ref s))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((declare () vec3 s) - (call asin (var_ref s) ((var_ref x))) - (return (expression vec3 - (constant float (1.5707964)) (var_ref s))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((declare () vec4 s) - (call asin (var_ref s) ((var_ref x))) - (return (expression vec4 - (constant float (1.5707964)) (var_ref s))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/acosh.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/acosh.ir deleted file mode 100644 index 9a4c291ad..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/acosh.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function acosh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float log (expression float + (var_ref x) (expression float sqrt (expression float - (expression float * (var_ref x) (var_ref x)) (constant float (1))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 log (expression vec2 + (var_ref x) (expression vec2 sqrt (expression vec2 - (expression vec2 * (var_ref x) (var_ref x)) (constant float (1))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 log (expression vec3 + (var_ref x) (expression vec3 sqrt (expression vec3 - (expression vec3 * (var_ref x) (var_ref x)) (constant float (1))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 log (expression vec4 + (var_ref x) (expression vec4 sqrt (expression vec4 - (expression vec4 * (var_ref x) (var_ref x)) (constant float (1))))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/all.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/all.ir deleted file mode 100644 index 2cac0dfb6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/all.ir +++ /dev/null @@ -1,16 +0,0 @@ -((function all - (signature bool - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0)))))) - - (signature bool - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bool && (expression bool && (expression bool && (swiz x (var_ref arg0))(swiz y (var_ref arg0))) (swiz z (var_ref arg0))) (swiz w (var_ref arg0)))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/any.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/any.ir deleted file mode 100644 index cc6038a31..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/any.ir +++ /dev/null @@ -1,16 +0,0 @@ -((function any - (signature bool - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bool any (var_ref arg0))))) - - (signature bool - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bool any (var_ref arg0))))) - - (signature bool - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bool any (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/asin.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/asin.ir deleted file mode 100644 index 45d9e6729..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/asin.ir +++ /dev/null @@ -1,109 +0,0 @@ -((function asin - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * - (expression float sign (var_ref x)) - (expression float - - (constant float (1.5707964)) - (expression float * - (expression float sqrt - (expression float - - (constant float (1.0)) - (expression float abs (var_ref x)))) - (expression float + - (constant float (1.5707964)) - (expression float * - (expression float abs (var_ref x)) - (expression float + - (constant float (-0.21460183)) - (expression float * - (expression float abs (var_ref x)) - (expression float + - (constant float (0.086566724)) - (expression float * - (expression float abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * - (expression vec2 sign (var_ref x)) - (expression vec2 - - (constant float (1.5707964)) - (expression vec2 * - (expression vec2 sqrt - (expression vec2 - - (constant float (1.0)) - (expression vec2 abs (var_ref x)))) - (expression vec2 + - (constant float (1.5707964)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (expression vec2 + - (constant float (-0.21460183)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (expression vec2 + - (constant float (0.086566724)) - (expression vec2 * - (expression vec2 abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * - (expression vec3 sign (var_ref x)) - (expression vec3 - - (constant float (1.5707964)) - (expression vec3 * - (expression vec3 sqrt - (expression vec3 - - (constant float (1.0)) - (expression vec3 abs (var_ref x)))) - (expression vec3 + - (constant float (1.5707964)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (expression vec3 + - (constant float (-0.21460183)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (expression vec3 + - (constant float (0.086566724)) - (expression vec3 * - (expression vec3 abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * - (expression vec4 sign (var_ref x)) - (expression vec4 - - (constant float (1.5707964)) - (expression vec4 * - (expression vec4 sqrt - (expression vec4 - - (constant float (1.0)) - (expression vec4 abs (var_ref x)))) - (expression vec4 + - (constant float (1.5707964)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (expression vec4 + - (constant float (-0.21460183)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (expression vec4 + - (constant float (0.086566724)) - (expression vec4 * - (expression vec4 abs (var_ref x)) - (constant float (-0.03102955)) - )))))))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/asinh.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/asinh.ir deleted file mode 100644 index d2dc7102c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/asinh.ir +++ /dev/null @@ -1,53 +0,0 @@ -((function asinh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * - (expression float sign (var_ref x)) - (expression float log - (expression float + - (expression float abs (var_ref x)) - (expression float sqrt - (expression float + - (expression float * (var_ref x) (var_ref x)) - (constant float (1)))))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * - (expression vec2 sign (var_ref x)) - (expression vec2 log - (expression vec2 + - (expression vec2 abs (var_ref x)) - (expression vec2 sqrt - (expression vec2 + - (expression vec2 * (var_ref x) (var_ref x)) - (constant float (1)))))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * - (expression vec3 sign (var_ref x)) - (expression vec3 log - (expression vec3 + - (expression vec3 abs (var_ref x)) - (expression vec3 sqrt - (expression vec3 + - (expression vec3 * (var_ref x) (var_ref x)) - (constant float (1)))))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * - (expression vec4 sign (var_ref x)) - (expression vec4 log - (expression vec4 + - (expression vec4 abs (var_ref x)) - (expression vec4 sqrt - (expression vec4 + - (expression vec4 * (var_ref x) (var_ref x)) - (constant float (1)))))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/atan.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/atan.ir deleted file mode 100644 index a9dc08e97..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/atan.ir +++ /dev/null @@ -1,134 +0,0 @@ -((function atan - (signature float - (parameters - (declare (in) float y_over_x)) - ((declare () float s) - (call asin (var_ref s) - ((expression float * - (var_ref y_over_x) - (expression float rsq - (expression float + - (expression float * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0))))))) - (return (var_ref s)))) - - (signature vec2 - (parameters - (declare (in) vec2 y_over_x)) - ((declare () vec2 s) - (call asin (var_ref s) - ((expression vec2 * - (var_ref y_over_x) - (expression vec2 rsq - (expression vec2 + - (expression vec2 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0))))))) - (return (var_ref s)))) - - (signature vec3 - (parameters - (declare (in) vec3 y_over_x)) - ((declare () vec3 s) - (call asin (var_ref s) - ((expression vec3 * - (var_ref y_over_x) - (expression vec3 rsq - (expression vec3 + - (expression vec3 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0))))))) - (return (var_ref s)))) - - (signature vec4 - (parameters - (declare (in) vec4 y_over_x)) - ((declare () vec4 s) - (call asin (var_ref s) - ((expression vec4 * - (var_ref y_over_x) - (expression vec4 rsq - (expression vec4 + - (expression vec4 * - (var_ref y_over_x) - (var_ref y_over_x)) - (constant float (1.0))))))) - (return (var_ref s)))) - - (signature float - (parameters - (declare (in ) float y) - (declare (in ) float x) - ) - ( - (declare () float r) - (if (expression bool > - (expression float abs (var_ref x)) - (expression float * (constant float (1.0e-8)) (expression float abs (var_ref y)))) ( - (call atan (var_ref r) ((expression float / (var_ref y) (var_ref x)))) - (if (expression bool < (var_ref x) (constant float (0.000000)) ) ( - (if (expression bool >= (var_ref y) (constant float (0.000000)) ) - ((assign (x) (var_ref r) (expression float + (var_ref r) (constant float (3.141593))))) - ((assign (x) (var_ref r) (expression float - (var_ref r) (constant float (3.141593)))))) - ) - ( - )) - ) - ( - (declare () float sgn) - (assign (x) (var_ref sgn) (expression float sign (var_ref y))) - (assign (x) (var_ref r) (expression float * (var_ref sgn) (constant float (1.5707965)))) - )) - - (return (var_ref r) ) - )) - - - - (signature vec2 - (parameters - (declare (in) vec2 y) - (declare (in) vec2 x)) - ((declare () vec2 r) - (declare () float temp) - (call atan (var_ref temp) ((swiz x (var_ref y)) (swiz x (var_ref x)))) - (assign (x) (var_ref r) (var_ref temp)) - (call atan (var_ref temp) ((swiz y (var_ref y)) (swiz y (var_ref x)))) - (assign (y) (var_ref r) (var_ref temp)) - (return (var_ref r)))) - - (signature vec3 - (parameters - (declare (in) vec3 y) - (declare (in) vec3 x)) - ((declare () vec3 r) - (declare () float temp) - (call atan (var_ref temp) ((swiz x (var_ref y)) (swiz x (var_ref x)))) - (assign (x) (var_ref r) (var_ref temp)) - (call atan (var_ref temp) ((swiz y (var_ref y)) (swiz y (var_ref x)))) - (assign (y) (var_ref r) (var_ref temp)) - (call atan (var_ref temp) ((swiz z (var_ref y)) (swiz z (var_ref x)))) - (assign (z) (var_ref r) (var_ref temp)) - (return (var_ref r)))) - - (signature vec4 - (parameters - (declare (in) vec4 y) - (declare (in) vec4 x)) - ((declare () vec4 r) - (declare () float temp) - (call atan (var_ref temp) ((swiz x (var_ref y)) (swiz x (var_ref x)))) - (assign (x) (var_ref r) (var_ref temp)) - (call atan (var_ref temp) ((swiz y (var_ref y)) (swiz y (var_ref x)))) - (assign (y) (var_ref r) (var_ref temp)) - (call atan (var_ref temp) ((swiz z (var_ref y)) (swiz z (var_ref x)))) - (assign (z) (var_ref r) (var_ref temp)) - (call atan (var_ref temp) ((swiz w (var_ref y)) (swiz w (var_ref x)))) - (assign (w) (var_ref r) (var_ref temp)) - (return (var_ref r)))) - -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/atanh.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/atanh.ir deleted file mode 100644 index 5ef3596f0..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/atanh.ir +++ /dev/null @@ -1,37 +0,0 @@ -((function atanh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float log - (expression float / - (expression float + (constant float (1)) (var_ref x)) - (expression float - (constant float (1)) (var_ref x)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant float (0.5)) - (expression vec2 log - (expression vec2 / - (expression vec2 + (constant float (1)) (var_ref x)) - (expression vec2 - (constant float (1)) (var_ref x)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant float (0.5)) - (expression vec3 log - (expression vec3 / - (expression vec3 + (constant float (1)) (var_ref x)) - (expression vec3 - (constant float (1)) (var_ref x)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant float (0.5)) - (expression vec4 log - (expression vec4 / - (expression vec4 + (constant float (1)) (var_ref x)) - (expression vec4 - (constant float (1)) (var_ref x)))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/ceil.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/ceil.ir deleted file mode 100644 index a26a77504..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/ceil.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function ceil - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float ceil (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 ceil (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 ceil (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 ceil (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/clamp.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/clamp.ir deleted file mode 100644 index b86a11426..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/clamp.ir +++ /dev/null @@ -1,148 +0,0 @@ -((function clamp - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression float clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) vec2 arg2)) - ((return (expression vec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) vec3 arg2)) - ((return (expression vec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) vec4 arg2)) - ((return (expression vec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression vec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression int clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1) - (declare (in) ivec2 arg2)) - ((return (expression ivec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1) - (declare (in) ivec3 arg2)) - ((return (expression ivec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1) - (declare (in) ivec4 arg2)) - ((return (expression ivec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1) - (declare (in) int arg2)) - ((return (expression ivec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uint clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1) - (declare (in) uvec2 arg2)) - ((return (expression uvec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1) - (declare (in) uvec3 arg2)) - ((return (expression uvec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1) - (declare (in) uvec4 arg2)) - ((return (expression uvec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec2 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec3 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1) - (declare (in) uint arg2)) - ((return (expression uvec4 clamp (var_ref arg0) (var_ref arg1) (var_ref arg2))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cos.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cos.ir deleted file mode 100644 index 88f266ecc..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cos.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function cos - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float cos (var_ref angle))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 cos (var_ref angle))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 cos (var_ref angle))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 cos (var_ref angle))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cosh.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cosh.ir deleted file mode 100644 index 945743138..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cosh.ir +++ /dev/null @@ -1,30 +0,0 @@ -((function cosh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float + - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant float (0.5)) - (expression vec2 + - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant float (0.5)) - (expression vec3 + - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant float (0.5)) - (expression vec4 + - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cross.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cross.ir deleted file mode 100644 index 02991fe42..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/cross.ir +++ /dev/null @@ -1,9 +0,0 @@ -((function cross - (signature vec3 - (parameters - (declare (in) vec3 a) - (declare (in) vec3 b)) - ((return (expression vec3 - - (expression vec3 * (swiz yzx (var_ref a)) (swiz zxy (var_ref b))) - (expression vec3 * (swiz zxy (var_ref a)) (swiz yzx (var_ref b))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dFdx.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dFdx.ir deleted file mode 100644 index 30594d33c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dFdx.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function dFdx - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdx (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdx (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdx (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdx (var_ref p))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dFdy.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dFdy.ir deleted file mode 100644 index fb5798d3c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dFdy.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function dFdy - (signature float - (parameters - (declare (in) float p)) - ((return (expression float dFdy (var_ref p))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 dFdy (var_ref p))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 dFdy (var_ref p))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 dFdy (var_ref p))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/degrees.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/degrees.ir deleted file mode 100644 index dc0d7b9e2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/degrees.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function degrees - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (constant float (57.295780)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (constant float (57.295780)))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/distance.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/distance.ir deleted file mode 100644 index c249f8c99..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/distance.ir +++ /dev/null @@ -1,31 +0,0 @@ -((function distance - (signature float - (parameters - (declare (in) float p0) - (declare (in) float p1)) - ((return (expression float abs (expression float - (var_ref p0) (var_ref p1)))))) - - (signature float - (parameters - (declare (in) vec2 p0) - (declare (in) vec2 p1)) - ((declare () vec2 p) - (assign (xy) (var_ref p) (expression vec2 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec3 p0) - (declare (in) vec3 p1)) - ((declare () vec3 p) - (assign (xyz) (var_ref p) (expression vec3 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) - - (signature float - (parameters - (declare (in) vec4 p0) - (declare (in) vec4 p1)) - ((declare () vec4 p) - (assign (xyzw) (var_ref p) (expression vec4 - (var_ref p0) (var_ref p1))) - (return (expression float sqrt (expression float dot (var_ref p) (var_ref p)))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dot.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dot.ir deleted file mode 100644 index 1f27f3235..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/dot.ir +++ /dev/null @@ -1,25 +0,0 @@ -((function dot - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float * (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) - - (signature float - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression float dot (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/equal.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/equal.ir deleted file mode 100644 index a414b3e53..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/equal.ir +++ /dev/null @@ -1,73 +0,0 @@ -((function equal - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) bvec2 arg0) - (declare (in) bvec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0) - (declare (in) bvec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0) - (declare (in) bvec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 == (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 == (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/exp.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/exp.ir deleted file mode 100644 index a73bd6a7f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/exp.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function exp - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float exp (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 exp (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 exp (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 exp (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/exp2.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/exp2.ir deleted file mode 100644 index a842d3fe6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/exp2.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function exp2 - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float exp2 (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 exp2 (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 exp2 (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 exp2 (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/faceforward.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/faceforward.ir deleted file mode 100644 index 35b79571c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/faceforward.ir +++ /dev/null @@ -1,37 +0,0 @@ -((function faceforward - (signature float - (parameters - (declare (in) float N) - (declare (in) float I) - (declare (in) float Nref)) - ((if (expression bool < (expression float * (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression float neg (var_ref N))))))) - - (signature vec2 - (parameters - (declare (in) vec2 N) - (declare (in) vec2 I) - (declare (in) vec2 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec2 neg (var_ref N))))))) - - (signature vec3 - (parameters - (declare (in) vec3 N) - (declare (in) vec3 I) - (declare (in) vec3 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec3 neg (var_ref N))))))) - - (signature vec4 - (parameters - (declare (in) vec4 N) - (declare (in) vec4 I) - (declare (in) vec4 Nref)) - ((if (expression bool < (expression float dot (var_ref Nref) (var_ref I)) (constant float (0))) - ((return (var_ref N))) - ((return (expression vec4 neg (var_ref N))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floatBitsToInt.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floatBitsToInt.ir deleted file mode 100644 index a5db4b326..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floatBitsToInt.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function floatBitsToInt - (signature int - (parameters - (declare (in) float arg)) - ((return (expression int bitcast_f2i (var_ref arg))))) - - (signature ivec2 - (parameters - (declare (in) vec2 arg)) - ((return (expression ivec2 bitcast_f2i (var_ref arg))))) - - (signature ivec3 - (parameters - (declare (in) vec3 arg)) - ((return (expression ivec3 bitcast_f2i (var_ref arg))))) - - (signature ivec4 - (parameters - (declare (in) vec4 arg)) - ((return (expression ivec4 bitcast_f2i (var_ref arg))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floatBitsToUint.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floatBitsToUint.ir deleted file mode 100644 index 09463bd9a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floatBitsToUint.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function floatBitsToUint - (signature uint - (parameters - (declare (in) float arg)) - ((return (expression uint bitcast_f2u (var_ref arg))))) - - (signature uvec2 - (parameters - (declare (in) vec2 arg)) - ((return (expression uvec2 bitcast_f2u (var_ref arg))))) - - (signature uvec3 - (parameters - (declare (in) vec3 arg)) - ((return (expression uvec3 bitcast_f2u (var_ref arg))))) - - (signature uvec4 - (parameters - (declare (in) vec4 arg)) - ((return (expression uvec4 bitcast_f2u (var_ref arg))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floor.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floor.ir deleted file mode 100644 index 8dd805279..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/floor.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function floor - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float floor (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 floor (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 floor (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 floor (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/fract.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/fract.ir deleted file mode 100644 index 3f0763d1b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/fract.ir +++ /dev/null @@ -1,22 +0,0 @@ -((function fract - (signature float - (parameters - (declare (in) float x)) - ((return (expression float fract (var_ref x))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 fract (var_ref x))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 fract (var_ref x))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 fract (var_ref x))))) -)) - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/ftransform.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/ftransform.ir deleted file mode 100644 index 9ca63dc1e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/ftransform.ir +++ /dev/null @@ -1,9 +0,0 @@ -((declare (uniform) mat4 gl_ModelViewProjectionMatrix) - (declare (in) vec4 gl_Vertex) - (function ftransform - (signature vec4 - (parameters) - ((return (expression vec4 * - (var_ref gl_ModelViewProjectionMatrix) - (var_ref gl_Vertex))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/fwidth.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/fwidth.ir deleted file mode 100644 index 385e05d6a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/fwidth.ir +++ /dev/null @@ -1,29 +0,0 @@ -((function fwidth - (signature float - (parameters - (declare (in) float p)) - ((return (expression float + - (expression float abs (expression float dFdx (var_ref p))) - (expression float abs (expression float dFdy (var_ref p))))))) - - (signature vec2 - (parameters - (declare (in) vec2 p)) - ((return (expression vec2 + - (expression vec2 abs (expression vec2 dFdx (var_ref p))) - (expression vec2 abs (expression vec2 dFdy (var_ref p))))))) - - (signature vec3 - (parameters - (declare (in) vec3 p)) - ((return (expression vec3 + - (expression vec3 abs (expression vec3 dFdx (var_ref p))) - (expression vec3 abs (expression vec3 dFdy (var_ref p))))))) - - (signature vec4 - (parameters - (declare (in) vec4 p)) - ((return (expression vec4 + - (expression vec4 abs (expression vec4 dFdx (var_ref p))) - (expression vec4 abs (expression vec4 dFdy (var_ref p))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/greaterThan.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/greaterThan.ir deleted file mode 100644 index 18af86528..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/greaterThan.ir +++ /dev/null @@ -1,55 +0,0 @@ -((function greaterThan - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 > (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 > (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/greaterThanEqual.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/greaterThanEqual.ir deleted file mode 100644 index 6d3bc892c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/greaterThanEqual.ir +++ /dev/null @@ -1,55 +0,0 @@ -((function greaterThanEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 >= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 >= (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/intBitsToFloat.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/intBitsToFloat.ir deleted file mode 100644 index cc6aafe1a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/intBitsToFloat.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function intBitsToFloat - (signature float - (parameters - (declare (in) int arg)) - ((return (expression float bitcast_i2f (var_ref arg))))) - - (signature vec2 - (parameters - (declare (in) ivec2 arg)) - ((return (expression vec2 bitcast_i2f (var_ref arg))))) - - (signature vec3 - (parameters - (declare (in) ivec3 arg)) - ((return (expression vec3 bitcast_i2f (var_ref arg))))) - - (signature vec4 - (parameters - (declare (in) ivec4 arg)) - ((return (expression vec4 bitcast_i2f (var_ref arg))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/inversesqrt.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/inversesqrt.ir deleted file mode 100644 index 5b66d2b36..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/inversesqrt.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function inversesqrt - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float rsq (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 rsq (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 rsq (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 rsq (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/isinf.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/isinf.ir deleted file mode 100644 index 92922f6fa..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/isinf.ir +++ /dev/null @@ -1,17 +0,0 @@ -((function isinf - (signature bool - (parameters - (declare (in) float x)) - ((return (expression bool == (expression float abs (var_ref x)) (constant float (+INF)))))) - (signature bvec2 - (parameters - (declare (in) vec2 x)) - ((return (expression bvec2 == (expression vec2 abs (var_ref x)) (constant vec2 (+INF +INF)))))) - (signature bvec3 - (parameters - (declare (in) vec3 x)) - ((return (expression bvec3 == (expression vec3 abs (var_ref x)) (constant vec3 (+INF +INF +INF)))))) - (signature bvec4 - (parameters - (declare (in) vec4 x)) - ((return (expression bvec4 == (expression vec4 abs (var_ref x)) (constant vec4 (+INF +INF +INF +INF)))))))) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/isnan.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/isnan.ir deleted file mode 100644 index b67349f2a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/isnan.ir +++ /dev/null @@ -1,17 +0,0 @@ -((function isnan - (signature bool - (parameters - (declare (in) float x)) - ((return (expression bool != (var_ref x) (var_ref x))))) - (signature bvec2 - (parameters - (declare (in) vec2 x)) - ((return (expression bvec2 != (var_ref x) (var_ref x))))) - (signature bvec3 - (parameters - (declare (in) vec3 x)) - ((return (expression bvec3 != (var_ref x) (var_ref x))))) - (signature bvec4 - (parameters - (declare (in) vec4 x)) - ((return (expression bvec4 != (var_ref x) (var_ref x))))))) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/length.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/length.ir deleted file mode 100644 index b72334ee8..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/length.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function length - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float abs (var_ref arg0))))) - - (signature float - (parameters - (declare (in) vec2 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec3 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) - - (signature float - (parameters - (declare (in) vec4 arg0)) - ((return (expression float sqrt (expression float dot (var_ref arg0) (var_ref arg0)))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/lessThan.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/lessThan.ir deleted file mode 100644 index 8401fe9db..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/lessThan.ir +++ /dev/null @@ -1,55 +0,0 @@ -((function lessThan - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 < (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 < (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/lessThanEqual.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/lessThanEqual.ir deleted file mode 100644 index c1cdd3fb6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/lessThanEqual.ir +++ /dev/null @@ -1,55 +0,0 @@ -((function lessThanEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 <= (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 <= (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/log.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/log.ir deleted file mode 100644 index d168abb5a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/log.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function log - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float log (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 log (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 log (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 log (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/log2.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/log2.ir deleted file mode 100644 index b96c6276f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/log2.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function log2 - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float log2 (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 log2 (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 log2 (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 log2 (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/matrixCompMult.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/matrixCompMult.ir deleted file mode 100644 index 2400f11af..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/matrixCompMult.ir +++ /dev/null @@ -1,91 +0,0 @@ -((function matrixCompMult - (signature mat2 - (parameters - (declare (in) mat2 x) - (declare (in) mat2 y)) - ((declare () mat2 z) - (assign (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) -(return (var_ref z)))) - - (signature mat3 - (parameters - (declare (in) mat3 x) - (declare (in) mat3 y)) - ((declare () mat3 z) - (assign (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) -(return (var_ref z)))) - - (signature mat4 - (parameters - (declare (in) mat4 x) - (declare (in) mat4 y)) - ((declare () mat4 z) - (assign (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) - (assign (xyzw) (array_ref (var_ref z) (constant int (3))) (expression vec4 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) - - (signature mat2x3 - (parameters - (declare (in) mat2x3 x) - (declare (in) mat2x3 y)) - ((declare () mat2x3 z) - (assign (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) -(return (var_ref z)))) - - (signature mat3x2 - (parameters - (declare (in) mat3x2 x) - (declare (in) mat3x2 y)) - ((declare () mat3x2 z) - (assign (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) -(return (var_ref z)))) - - (signature mat2x4 - (parameters - (declare (in) mat2x4 x) - (declare (in) mat2x4 y)) - ((declare () mat2x4 z) - (assign (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) -(return (var_ref z)))) - - (signature mat4x2 - (parameters - (declare (in) mat4x2 x) - (declare (in) mat4x2 y)) - ((declare () mat4x2 z) - (assign (xy) (array_ref (var_ref z) (constant int (0))) (expression vec2 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xy) (array_ref (var_ref z) (constant int (1))) (expression vec2 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xy) (array_ref (var_ref z) (constant int (2))) (expression vec2 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) - (assign (xy) (array_ref (var_ref z) (constant int (3))) (expression vec2 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) - - (signature mat3x4 - (parameters - (declare (in) mat3x4 x) - (declare (in) mat3x4 y)) - ((declare () mat3x4 z) - (assign (xyzw) (array_ref (var_ref z) (constant int (0))) (expression vec4 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xyzw) (array_ref (var_ref z) (constant int (1))) (expression vec4 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xyzw) (array_ref (var_ref z) (constant int (2))) (expression vec4 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) -(return (var_ref z)))) - - (signature mat4x3 - (parameters - (declare (in) mat4x3 x) - (declare (in) mat4x3 y)) - ((declare () mat4x3 z) - (assign (xyz) (array_ref (var_ref z) (constant int (0))) (expression vec3 * (array_ref (var_ref x) (constant int (0))) (array_ref (var_ref y) (constant int (0))))) - (assign (xyz) (array_ref (var_ref z) (constant int (1))) (expression vec3 * (array_ref (var_ref x) (constant int (1))) (array_ref (var_ref y) (constant int (1))))) - (assign (xyz) (array_ref (var_ref z) (constant int (2))) (expression vec3 * (array_ref (var_ref x) (constant int (2))) (array_ref (var_ref y) (constant int (2))))) - (assign (xyz) (array_ref (var_ref z) (constant int (3))) (expression vec3 * (array_ref (var_ref x) (constant int (3))) (array_ref (var_ref y) (constant int (3))))) -(return (var_ref z)))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/max.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/max.ir deleted file mode 100644 index 2b5a02868..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/max.ir +++ /dev/null @@ -1,127 +0,0 @@ -((function max - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float max (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 max (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 max (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 max (var_ref arg0) (var_ref arg1))))) - - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1)) - ((return (expression int max (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1)) - ((return (expression ivec2 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1)) - ((return (expression ivec3 max (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1)) - ((return (expression ivec4 max (var_ref arg0) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1)) - ((return (expression uint max (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1)) - ((return (expression uvec2 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1)) - ((return (expression uvec3 max (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1)) - ((return (expression uvec4 max (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/min.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/min.ir deleted file mode 100644 index 2deef1118..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/min.ir +++ /dev/null @@ -1,127 +0,0 @@ -((function min - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float min (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 min (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 min (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 min (var_ref arg0) (var_ref arg1))))) - - (signature int - (parameters - (declare (in) int arg0) - (declare (in) int arg1)) - ((return (expression int min (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) int arg1)) - ((return (expression ivec2 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) int arg1)) - ((return (expression ivec3 min (var_ref arg0) (var_ref arg1))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) int arg1)) - ((return (expression ivec4 min (var_ref arg0) (var_ref arg1))))) - - (signature uint - (parameters - (declare (in) uint arg0) - (declare (in) uint arg1)) - ((return (expression uint min (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uint arg1)) - ((return (expression uvec2 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uint arg1)) - ((return (expression uvec3 min (var_ref arg0) (var_ref arg1))))) - - (signature uvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uint arg1)) - ((return (expression uvec4 min (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/mix.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/mix.ir deleted file mode 100644 index 3ea49c2a6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/mix.ir +++ /dev/null @@ -1,88 +0,0 @@ -((function mix - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1) - (declare (in) float arg2)) - ((return (expression float mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) vec2 arg2)) - ((return (expression vec2 mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) vec3 arg2)) - ((return (expression vec3 mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) vec4 arg2)) - ((return (expression vec4 mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1) - (declare (in) float arg2)) - ((return (expression vec2 mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1) - (declare (in) float arg2)) - ((return (expression vec3 mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1) - (declare (in) float arg2)) - ((return (expression vec4 mix (var_ref arg0) (var_ref arg1) (var_ref arg2))))) - - (signature float - (parameters - (declare (in) float v1) - (declare (in) float v2) - (declare (in) bool a)) - ((assign (var_ref a) (x) (var_ref v1) (var_ref v2)) - (return (var_ref v1)))) - - (signature vec2 - (parameters - (declare (in) vec2 v1) - (declare (in) vec2 v2) - (declare (in) bvec2 a)) - ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) - (return (var_ref v1)))) - - (signature vec3 - (parameters - (declare (in) vec3 v1) - (declare (in) vec3 v2) - (declare (in) bvec3 a)) - ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2))) - (return (var_ref v1)))) - - (signature vec4 - (parameters - (declare (in) vec4 v1) - (declare (in) vec4 v2) - (declare (in) bvec4 a)) - ((assign (swiz x (var_ref a)) (x) (var_ref v1) (swiz x (var_ref v2))) - (assign (swiz y (var_ref a)) (y) (var_ref v1) (swiz y (var_ref v2))) - (assign (swiz z (var_ref a)) (z) (var_ref v1) (swiz z (var_ref v2))) - (assign (swiz w (var_ref a)) (w) (var_ref v1) (swiz w (var_ref v2))) - (return (var_ref v1)))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/mod.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/mod.ir deleted file mode 100644 index aeaea240e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/mod.ir +++ /dev/null @@ -1,43 +0,0 @@ -((function mod - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float % (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) float arg1)) - ((return (expression vec2 % (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) float arg1)) - ((return (expression vec3 % (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) float arg1)) - ((return (expression vec4 % (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/modf.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/modf.ir deleted file mode 100644 index f4f631567..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/modf.ir +++ /dev/null @@ -1,37 +0,0 @@ -((function modf - (signature float - (parameters - (declare (in) float x) - (declare (out) float i)) - ((declare () float t) - (assign (x) (var_ref t) (expression float trunc (var_ref x))) - (assign (x) (var_ref i) (var_ref t)) - (return (expression float - (var_ref x) (var_ref t))))) - - (signature vec2 - (parameters - (declare (in) vec2 x) - (declare (out) vec2 i)) - ((declare () vec2 t) - (assign (xy) (var_ref t) (expression vec2 trunc (var_ref x))) - (assign (xy) (var_ref i) (var_ref t)) - (return (expression vec2 - (var_ref x) (var_ref t))))) - - (signature vec3 - (parameters - (declare (in) vec3 x) - (declare (out) vec3 i)) - ((declare () vec3 t) - (assign (xyz) (var_ref t) (expression vec3 trunc (var_ref x))) - (assign (xyz) (var_ref i) (var_ref t)) - (return (expression vec3 - (var_ref x) (var_ref t))))) - - (signature vec4 - (parameters - (declare (in) vec4 x) - (declare (out) vec4 i)) - ((declare () vec4 t) - (assign (xyzw) (var_ref t) (expression vec4 trunc (var_ref x))) - (assign (xyzw) (var_ref i) (var_ref t)) - (return (expression vec4 - (var_ref x) (var_ref t))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise1.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise1.ir deleted file mode 100644 index 115505610..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise1.ir +++ /dev/null @@ -1,18 +0,0 @@ -((function noise1 - (signature float - (parameters - (declare (in) float x)) - ((return (expression float noise (var_ref x))))) - (signature float - (parameters - (declare (in) vec2 x)) - ((return (expression float noise (var_ref x))))) - (signature float - (parameters - (declare (in) vec3 x)) - ((return (expression float noise (var_ref x))))) - (signature float - (parameters - (declare (in) vec4 x)) - ((return (expression float noise (var_ref x))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise2.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise2.ir deleted file mode 100644 index d3366145f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise2.ir +++ /dev/null @@ -1,61 +0,0 @@ -((function noise2 - (signature vec2 - (parameters (declare (in) vec4 p)) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) - - (signature vec2 - (parameters (declare (in) vec3 p)) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) - - (signature vec2 - (parameters - (declare (in ) vec2 p) - ) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) - - (signature vec2 - (parameters - (declare (in ) float p) - ) - ( - (declare () float a) - (declare () float b) - (declare () vec2 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (return (var_ref t)) - )) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise3.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise3.ir deleted file mode 100644 index 1d8aa3f30..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise3.ir +++ /dev/null @@ -1,73 +0,0 @@ -((function noise3 - (signature vec3 - (parameters (declare (in) vec4 p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (x) (var_ref c) (expression float noise (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) - - (signature vec3 - (parameters (declare (in) vec3 p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (x) (var_ref c) (expression float noise (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) - - (signature vec3 - (parameters (declare (in) vec2 p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (x) (var_ref c) (expression float noise (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) - - (signature vec3 - (parameters (declare (in) float p)) - ( - (declare () float a) - (declare () float b) - (declare () float c) - (declare () vec3 t) - - (assign (x) (var_ref a) (expression float noise (var_ref p))) - (assign (x) (var_ref b) (expression float noise (expression float + (var_ref p) (constant float (601.0))))) - (assign (x) (var_ref c) (expression float noise (expression float + (var_ref p) (constant float (1559.0))))) - - (assign (x) (var_ref t) (var_ref a)) - (assign (y) (var_ref t) (var_ref b)) - (assign (z) (var_ref t) (var_ref c)) - (return (var_ref t)) - )) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise4.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise4.ir deleted file mode 100644 index 494969654..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/noise4.ir +++ /dev/null @@ -1,97 +0,0 @@ -((function noise4 - (signature vec4 - (parameters (declare (in) vec4 p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () vec4 _p) - (assign (xyzw) (var_ref _p) (expression vec4 + (var_ref p) (constant vec4 (1559.0 113.0 1861.0 797.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression vec4 + (var_ref p) (constant vec4 (601.0 313.0 29.0 277.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression vec4 + (var_ref _p) (constant vec4 (601.0 313.0 29.0 277.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) - - (signature vec4 - (parameters (declare (in) vec3 p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () vec3 _p) - (assign (xyz) (var_ref _p) (expression vec3 + (var_ref p) (constant vec3 (1559.0 113.0 1861.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression vec3 + (var_ref p) (constant vec3 (601.0 313.0 29.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression vec3 + (var_ref _p) (constant vec3 (601.0 313.0 29.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) - - (signature vec4 - (parameters (declare (in) vec2 p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () vec2 _p) - (assign (xy) (var_ref _p) (expression vec2 + (var_ref p) (constant vec2 (1559.0 113.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression vec2 + (var_ref p) (constant vec2 (601.0 313.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression vec2 + (var_ref _p) (constant vec2 (601.0 313.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) - - (signature vec4 - (parameters (declare (in) float p)) - ( - (declare () float _x) - (declare () float _y) - (declare () float _z) - (declare () float _w) - (declare () vec4 _r) - - (declare () float _p) - (assign (x) (var_ref _p) (expression float + (var_ref p) (constant float (1559.0))) ) - - (assign (x) (var_ref _x) (expression float noise(var_ref p))) - (assign (x) (var_ref _y) (expression float noise(expression float + (var_ref p) (constant float (601.0))))) - (assign (x) (var_ref _z) (expression float noise(var_ref _p))) - (assign (x) (var_ref _w) (expression float noise(expression float + (var_ref _p) (constant float (601.0))))) - - (assign (x) (var_ref _r) (var_ref _x)) - (assign (y) (var_ref _r) (var_ref _y)) - (assign (z) (var_ref _r) (var_ref _z)) - (assign (w) (var_ref _r) (var_ref _w)) - (return (var_ref _r)) - )) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/normalize.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/normalize.ir deleted file mode 100644 index 33c5e02ee..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/normalize.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function normalize - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float sign (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 normalize (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 normalize (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 normalize (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/not.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/not.ir deleted file mode 100644 index b696b0655..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/not.ir +++ /dev/null @@ -1,16 +0,0 @@ -((function not - (signature bvec2 - (parameters - (declare (in) bvec2 arg0)) - ((return (expression bvec2 ! (var_ref arg0))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0)) - ((return (expression bvec3 ! (var_ref arg0))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0)) - ((return (expression bvec4 ! (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/notEqual.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/notEqual.ir deleted file mode 100644 index abaf1914c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/notEqual.ir +++ /dev/null @@ -1,73 +0,0 @@ -((function notEqual - (signature bvec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) bvec2 arg0) - (declare (in) bvec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) bvec3 arg0) - (declare (in) bvec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) bvec4 arg0) - (declare (in) bvec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) ivec2 arg0) - (declare (in) ivec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) ivec3 arg0) - (declare (in) ivec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) ivec4 arg0) - (declare (in) ivec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec2 - (parameters - (declare (in) uvec2 arg0) - (declare (in) uvec2 arg1)) - ((return (expression bvec2 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec3 - (parameters - (declare (in) uvec3 arg0) - (declare (in) uvec3 arg1)) - ((return (expression bvec3 != (var_ref arg0) (var_ref arg1))))) - - (signature bvec4 - (parameters - (declare (in) uvec4 arg0) - (declare (in) uvec4 arg1)) - ((return (expression bvec4 != (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/outerProduct.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/outerProduct.ir deleted file mode 100644 index 0e3f375bb..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/outerProduct.ir +++ /dev/null @@ -1,92 +0,0 @@ -((function outerProduct - (signature mat2 - (parameters - (declare (in) vec2 u) - (declare (in) vec2 v)) - ((declare () mat2 m) - (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat2x3 - (parameters - (declare (in) vec3 u) - (declare (in) vec2 v)) - ((declare () mat2x3 m) - (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat2x4 - (parameters - (declare (in) vec4 u) - (declare (in) vec2 v)) - ((declare () mat2x4 m) - (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (return (var_ref m)))) - - (signature mat3x2 - (parameters - (declare (in) vec2 u) - (declare (in) vec3 v)) - ((declare () mat3x2 m) - (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)) - )) - - (signature mat3 - (parameters - (declare (in) vec3 u) - (declare (in) vec3 v)) - ((declare () mat3 m) - (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)))) - - (signature mat3x4 - (parameters - (declare (in) vec4 u) - (declare (in) vec3 v)) - ((declare () mat3x4 m) - (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) - (return (var_ref m)))) - - (signature mat4x2 - (parameters - (declare (in) vec2 u) - (declare (in) vec4 v)) - ((declare () mat4x2 m) - (assign (xy) (array_ref (var_ref m) (constant int (0))) (expression vec2 * (var_ref u) (swiz x (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (1))) (expression vec2 * (var_ref u) (swiz y (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (2))) (expression vec2 * (var_ref u) (swiz z (var_ref v)))) - (assign (xy) (array_ref (var_ref m) (constant int (3))) (expression vec2 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) - - (signature mat4x3 - (parameters - (declare (in) vec3 u) - (declare (in) vec4 v)) - ((declare () mat4x3 m) - (assign (xyz) (array_ref (var_ref m) (constant int (0))) (expression vec3 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (1))) (expression vec3 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (2))) (expression vec3 * (var_ref u) (swiz z (var_ref v)))) - (assign (xyz) (array_ref (var_ref m) (constant int (3))) (expression vec3 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) - - (signature mat4 - (parameters - (declare (in) vec4 u) - (declare (in) vec4 v)) - ((declare () mat4 m) - (assign (xyzw) (array_ref (var_ref m) (constant int (0))) (expression vec4 * (var_ref u) (swiz x (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (1))) (expression vec4 * (var_ref u) (swiz y (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (2))) (expression vec4 * (var_ref u) (swiz z (var_ref v)))) - (assign (xyzw) (array_ref (var_ref m) (constant int (3))) (expression vec4 * (var_ref u) (swiz w (var_ref v)))) - (return (var_ref m)))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/pow.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/pow.ir deleted file mode 100644 index a61bc4418..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/pow.ir +++ /dev/null @@ -1,25 +0,0 @@ -((function pow - (signature float - (parameters - (declare (in) float arg0) - (declare (in) float arg1)) - ((return (expression float pow (var_ref arg0) (var_ref arg1))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0) - (declare (in) vec2 arg1)) - ((return (expression vec2 pow (var_ref arg0) (var_ref arg1))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0) - (declare (in) vec3 arg1)) - ((return (expression vec3 pow (var_ref arg0) (var_ref arg1))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0) - (declare (in) vec4 arg1)) - ((return (expression vec4 pow (var_ref arg0) (var_ref arg1))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/radians.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/radians.ir deleted file mode 100644 index a419101cf..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/radians.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function radians - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float * (var_ref arg0) (constant float (0.0174532925)))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 * (var_ref arg0) (constant float (0.0174532925)))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 * (var_ref arg0) (constant float (0.0174532925)))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 * (var_ref arg0) (constant float (0.0174532925)))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/reflect.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/reflect.ir deleted file mode 100644 index 1fa394e3c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/reflect.ir +++ /dev/null @@ -1,58 +0,0 @@ -((function reflect - (signature float - (parameters - (declare (in) float i) - (declare (in) float n)) - ((return (expression float - - (var_ref i) - (expression float * - (constant float (2.0)) - (expression float * - (expression float * - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec2 - (parameters - (declare (in) vec2 i) - (declare (in) vec2 n)) - ((return (expression vec2 - - (var_ref i) - (expression vec2 * - (constant float (2.0)) - (expression vec2 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec3 - (parameters - (declare (in) vec3 i) - (declare (in) vec3 n)) - ((return (expression vec3 - - (var_ref i) - (expression vec3 * - (constant float (2.0)) - (expression vec3 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - - (signature vec4 - (parameters - (declare (in) vec4 i) - (declare (in) vec4 n)) - ((return (expression vec4 - - (var_ref i) - (expression vec4 * - (constant float (2.0)) - (expression vec4 * - (expression float dot - (var_ref n) - (var_ref i)) - (var_ref n))))))) - -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/refract.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/refract.ir deleted file mode 100644 index 60899f01c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/refract.ir +++ /dev/null @@ -1,102 +0,0 @@ -((function refract - (signature float - (parameters - (declare (in) float i) - (declare (in) float n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float * (var_ref n) (var_ref i)) - (expression float * (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant float (0.0)))) - ((return (expression float - - (expression float * (var_ref eta) (var_ref i)) - (expression float * - (expression float + - (expression float * (var_ref eta) - (expression float * (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 i) - (declare (in) vec2 n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec2 (0.0 0.0)))) - ((return (expression vec2 - - (expression vec2 * (var_ref eta) (var_ref i)) - (expression vec2 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 i) - (declare (in) vec3 n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec3 (0.0 0.0 0.0)))) - ((return (expression vec3 - - (expression vec3 * (var_ref eta) (var_ref i)) - (expression vec3 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 i) - (declare (in) vec4 n) - (declare (in) float eta)) - ((declare () float k) - (assign (x) (var_ref k) - (expression float - (constant float (1.0)) - (expression float * (var_ref eta) - (expression float * (var_ref eta) - (expression float - (constant float (1.0)) - (expression float * - (expression float dot (var_ref n) (var_ref i)) - (expression float dot (var_ref n) (var_ref i)))))))) - (if (expression bool < (var_ref k) (constant float (0.0))) - ((return (constant vec4 (0.0 0.0 0.0 0.0)))) - ((return (expression vec4 - - (expression vec4 * (var_ref eta) (var_ref i)) - (expression vec4 * - (expression float + - (expression float * (var_ref eta) - (expression float dot (var_ref n) (var_ref i))) - (expression float sqrt (var_ref k))) - (var_ref n)))))))) - -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/round.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/round.ir deleted file mode 100644 index d0d425bd6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/round.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function round - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float round_even (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 round_even (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 round_even (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 round_even (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/roundEven.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/roundEven.ir deleted file mode 100644 index a9c99b6f4..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/roundEven.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function roundEven - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float round_even (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 round_even (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 round_even (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 round_even (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sign.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sign.ir deleted file mode 100644 index 1f51718da..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sign.ir +++ /dev/null @@ -1,42 +0,0 @@ -((function sign - (signature float - (parameters - (declare (in) float x)) - ((return (expression float sign (var_ref x))))) - - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 sign (var_ref x))))) - - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 sign (var_ref x))))) - - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 sign (var_ref x))))) - - (signature int - (parameters - (declare (in) int x)) - ((return (expression int sign (var_ref x))))) - - (signature ivec2 - (parameters - (declare (in) ivec2 x)) - ((return (expression ivec2 sign (var_ref x))))) - - (signature ivec3 - (parameters - (declare (in) ivec3 x)) - ((return (expression ivec3 sign (var_ref x))))) - - (signature ivec4 - (parameters - (declare (in) ivec4 x)) - ((return (expression ivec4 sign (var_ref x))))) -)) - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sin.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sin.ir deleted file mode 100644 index e6009d8ef..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sin.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function sin - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float sin (var_ref angle))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 sin (var_ref angle))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 sin (var_ref angle))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 sin (var_ref angle))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sinh.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sinh.ir deleted file mode 100644 index 31edd30e5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sinh.ir +++ /dev/null @@ -1,30 +0,0 @@ -((function sinh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float * (constant float (0.5)) - (expression float - - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 * (constant float (0.5)) - (expression vec2 - - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 * (constant float (0.5)) - (expression vec3 - - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 * (constant float (0.5)) - (expression vec4 - - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/smoothstep.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/smoothstep.ir deleted file mode 100644 index 94c98b29e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/smoothstep.ir +++ /dev/null @@ -1,100 +0,0 @@ -((function smoothstep - (signature float - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) float x)) - ((declare () float t) - (assign (x) (var_ref t) - (expression float max - (expression float min - (expression float / (expression float - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression float * (var_ref t) (expression float * (var_ref t) (expression float - (constant float (3.0)) (expression float * (constant float (2.0)) (var_ref t)))))))) - (signature vec2 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (xy) (var_ref t) - (expression vec2 max - (expression vec2 min - (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec3 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (xyz) (var_ref t) - (expression vec3 max - (expression vec3 min - (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t)))))))) - - - (signature vec4 - (parameters - (declare (in) float edge0) - (declare (in) float edge1) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (xyzw) (var_ref t) - (expression vec4 max - (expression vec4 min - (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression float - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec2 - (parameters - (declare (in) vec2 edge0) - (declare (in) vec2 edge1) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (xy) (var_ref t) - (expression vec2 max - (expression vec2 min - (expression vec2 / (expression vec2 - (var_ref x) (var_ref edge0)) (expression vec2 - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec2 * (var_ref t) (expression vec2 * (var_ref t) (expression vec2 - (constant float (3.0)) (expression vec2 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec3 - (parameters - (declare (in) vec3 edge0) - (declare (in) vec3 edge1) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (xyz) (var_ref t) - (expression vec3 max - (expression vec3 min - (expression vec3 / (expression vec3 - (var_ref x) (var_ref edge0)) (expression vec3 - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec3 * (var_ref t) (expression vec3 * (var_ref t) (expression vec3 - (constant float (3.0)) (expression vec3 * (constant float (2.0)) (var_ref t)))))))) - - (signature vec4 - (parameters - (declare (in) vec4 edge0) - (declare (in) vec4 edge1) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (xyzw) (var_ref t) - (expression vec4 max - (expression vec4 min - (expression vec4 / (expression vec4 - (var_ref x) (var_ref edge0)) (expression vec4 - (var_ref edge1) (var_ref edge0))) - (constant float (1.0))) - (constant float (0.0)))) - (return (expression vec4 * (var_ref t) (expression vec4 * (var_ref t) (expression vec4 - (constant float (3.0)) (expression vec4 * (constant float (2.0)) (var_ref t)))))))) -)) - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sqrt.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sqrt.ir deleted file mode 100644 index 0302d164a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/sqrt.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function sqrt - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float sqrt (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 sqrt (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 sqrt (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 sqrt (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/step.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/step.ir deleted file mode 100644 index efcd7bc80..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/step.ir +++ /dev/null @@ -1,68 +0,0 @@ -((function step - (signature float - (parameters - (declare (in) float edge) - (declare (in) float x)) - ((return (expression float b2f (expression bool >= (var_ref x) (var_ref edge)))))) - - (signature vec2 - (parameters - (declare (in) float edge) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec3 - (parameters - (declare (in) float edge) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec4 - (parameters - (declare (in) float edge) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(var_ref edge)))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(var_ref edge)))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(var_ref edge)))) - (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) - (return (var_ref t)))) - - (signature vec2 - (parameters - (declare (in) vec2 edge) - (declare (in) vec2 x)) - ((declare () vec2 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (return (var_ref t)))) - - (signature vec3 - (parameters - (declare (in) vec3 edge) - (declare (in) vec3 x)) - ((declare () vec3 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) - (return (var_ref t)))) - - (signature vec4 - (parameters - (declare (in) vec4 edge) - (declare (in) vec4 x)) - ((declare () vec4 t) - (assign (x) (var_ref t) (expression float b2f (expression bool >= (swiz x (var_ref x))(swiz x (var_ref edge))))) - (assign (y) (var_ref t) (expression float b2f (expression bool >= (swiz y (var_ref x))(swiz y (var_ref edge))))) - (assign (z) (var_ref t) (expression float b2f (expression bool >= (swiz z (var_ref x))(swiz z (var_ref edge))))) - (assign (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(swiz w (var_ref edge))))) - (return (var_ref t)))) -)) - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/tan.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/tan.ir deleted file mode 100644 index 997986318..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/tan.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function tan - (signature float - (parameters - (declare (in) float angle)) - ((return (expression float / (expression float sin (var_ref angle)) (expression float cos (var_ref angle)))))) - - (signature vec2 - (parameters - (declare (in) vec2 angle)) - ((return (expression vec2 / (expression vec2 sin (var_ref angle)) (expression vec2 cos (var_ref angle)))))) - - (signature vec3 - (parameters - (declare (in) vec3 angle)) - ((return (expression vec3 / (expression vec3 sin (var_ref angle)) (expression vec3 cos (var_ref angle)))))) - - (signature vec4 - (parameters - (declare (in) vec4 angle)) - ((return (expression vec4 / (expression vec4 sin (var_ref angle)) (expression vec4 cos (var_ref angle)))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/tanh.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/tanh.ir deleted file mode 100644 index 3b7271bf7..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/tanh.ir +++ /dev/null @@ -1,42 +0,0 @@ -((function tanh - (signature float - (parameters - (declare (in) float x)) - ((return (expression float / - (expression float - - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))) - (expression float + - (expression float exp (var_ref x)) - (expression float exp (expression float neg (var_ref x)))))))) - (signature vec2 - (parameters - (declare (in) vec2 x)) - ((return (expression vec2 / - (expression vec2 - - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))) - (expression vec2 + - (expression vec2 exp (var_ref x)) - (expression vec2 exp (expression vec2 neg (var_ref x)))))))) - (signature vec3 - (parameters - (declare (in) vec3 x)) - ((return (expression vec3 / - (expression vec3 - - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))) - (expression vec3 + - (expression vec3 exp (var_ref x)) - (expression vec3 exp (expression vec3 neg (var_ref x)))))))) - (signature vec4 - (parameters - (declare (in) vec4 x)) - ((return (expression vec4 / - (expression vec4 - - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))) - (expression vec4 + - (expression vec4 exp (var_ref x)) - (expression vec4 exp (expression vec4 neg (var_ref x)))))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/transpose.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/transpose.ir deleted file mode 100644 index 043327d23..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/transpose.ir +++ /dev/null @@ -1,139 +0,0 @@ -((function transpose - (signature mat2 - (parameters - (declare (in) mat2 m)) - ((declare () mat2 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat3x2 - (parameters - (declare (in) mat2x3 m)) - ((declare () mat3x2 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat4x2 - (parameters - (declare (in) mat2x4 m)) - ((declare () mat4x2 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) -(return (var_ref t)))) - - (signature mat2x3 - (parameters - (declare (in) mat3x2 m)) - ((declare () mat2x3 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat3 - (parameters - (declare (in) mat3 m)) - ((declare () mat3 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat4x3 - (parameters - (declare (in) mat3x4 m)) - ((declare () mat4x3 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) -(return (var_ref t)))) - - (signature mat2x4 - (parameters - (declare (in) mat4x2 m)) - ((declare () mat2x4 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) - - (signature mat3x4 - (parameters - (declare (in) mat4x3 m)) - ((declare () mat3x4 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) - - (signature mat4 - (parameters - (declare (in) mat4 m)) - ((declare () mat4 t) - (assign (x) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (0))))) - (assign (x) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (0))))) - (assign (y) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (1))))) - (assign (y) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (1))))) - (assign (z) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (2))))) - (assign (z) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (2))))) - (assign (w) (array_ref (var_ref t) (constant int (0))) (swiz x (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (1))) (swiz y (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (2))) (swiz z (array_ref (var_ref m) (constant int (3))))) - (assign (w) (array_ref (var_ref t) (constant int (3))) (swiz w (array_ref (var_ref m) (constant int (3))))) -(return (var_ref t)))) -) - -) - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/trunc.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/trunc.ir deleted file mode 100644 index d320a2a77..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/trunc.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function trunc - (signature float - (parameters - (declare (in) float arg0)) - ((return (expression float trunc (var_ref arg0))))) - - (signature vec2 - (parameters - (declare (in) vec2 arg0)) - ((return (expression vec2 trunc (var_ref arg0))))) - - (signature vec3 - (parameters - (declare (in) vec3 arg0)) - ((return (expression vec3 trunc (var_ref arg0))))) - - (signature vec4 - (parameters - (declare (in) vec4 arg0)) - ((return (expression vec4 trunc (var_ref arg0))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/uintBitsToFloat.ir b/3rdparty/glsl-optimizer/src/glsl/builtins/ir/uintBitsToFloat.ir deleted file mode 100644 index 1073d7618..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/ir/uintBitsToFloat.ir +++ /dev/null @@ -1,21 +0,0 @@ -((function uintBitsToFloat - (signature float - (parameters - (declare (in) uint arg)) - ((return (expression float bitcast_u2f (var_ref arg))))) - - (signature vec2 - (parameters - (declare (in) uvec2 arg)) - ((return (expression vec2 bitcast_u2f (var_ref arg))))) - - (signature vec3 - (parameters - (declare (in) uvec3 arg)) - ((return (expression vec3 bitcast_u2f (var_ref arg))))) - - (signature vec4 - (parameters - (declare (in) uvec4 arg)) - ((return (expression vec4 bitcast_u2f (var_ref arg))))) -)) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.frag deleted file mode 100644 index 904aa303c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.frag +++ /dev/null @@ -1,6 +0,0 @@ -#version 100 -vec4 texture2D (sampler2D sampler, vec2 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); - -vec4 textureCube (samplerCube sampler, vec3 coord, float bias); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.glsl deleted file mode 100644 index 0d60a7f35..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.glsl +++ /dev/null @@ -1,296 +0,0 @@ -#version 100 -/* - * 8.1 - Angle and Trigonometry Functions - */ -float radians(float degrees); -vec2 radians(vec2 degrees); -vec3 radians(vec3 degrees); -vec4 radians(vec4 degrees); - -float degrees(float radians); -vec2 degrees(vec2 radians); -vec3 degrees(vec3 radians); -vec4 degrees(vec4 radians); - -float sin(float angle); -vec2 sin(vec2 angle); -vec3 sin(vec3 angle); -vec4 sin(vec4 angle); - -float cos(float angle); -vec2 cos(vec2 angle); -vec3 cos(vec3 angle); -vec4 cos(vec4 angle); - -float tan(float angle); -vec2 tan(vec2 angle); -vec3 tan(vec3 angle); -vec4 tan(vec4 angle); - -float asin(float angle); -vec2 asin(vec2 angle); -vec3 asin(vec3 angle); -vec4 asin(vec4 angle); - -float acos(float angle); -vec2 acos(vec2 angle); -vec3 acos(vec3 angle); -vec4 acos(vec4 angle); - -float atan(float y, float x); -vec2 atan(vec2 y, vec2 x); -vec3 atan(vec3 y, vec3 x); -vec4 atan(vec4 y, vec4 x); - -float atan(float y_over_x); -vec2 atan(vec2 y_over_x); -vec3 atan(vec3 y_over_x); -vec4 atan(vec4 y_over_x); - -/* - * 8.2 - Exponential Functions - */ -float pow(float x, float y); -vec2 pow(vec2 x, vec2 y); -vec3 pow(vec3 x, vec3 y); -vec4 pow(vec4 x, vec4 y); - -float exp(float x); -vec2 exp(vec2 x); -vec3 exp(vec3 x); -vec4 exp(vec4 x); - -float log(float x); -vec2 log(vec2 x); -vec3 log(vec3 x); -vec4 log(vec4 x); - -float exp2(float x); -vec2 exp2(vec2 x); -vec3 exp2(vec3 x); -vec4 exp2(vec4 x); - -float log2(float x); -vec2 log2(vec2 x); -vec3 log2(vec3 x); -vec4 log2(vec4 x); - -float sqrt(float x); -vec2 sqrt(vec2 x); -vec3 sqrt(vec3 x); -vec4 sqrt(vec4 x); - -float inversesqrt(float x); -vec2 inversesqrt(vec2 x); -vec3 inversesqrt(vec3 x); -vec4 inversesqrt(vec4 x); - -/* - * 8.3 - Common Functions - */ -float abs(float x); -vec2 abs(vec2 x); -vec3 abs(vec3 x); -vec4 abs(vec4 x); - -float sign(float x); -vec2 sign(vec2 x); -vec3 sign(vec3 x); -vec4 sign(vec4 x); - -float floor(float x); -vec2 floor(vec2 x); -vec3 floor(vec3 x); -vec4 floor(vec4 x); - -float ceil(float x); -vec2 ceil(vec2 x); -vec3 ceil(vec3 x); -vec4 ceil(vec4 x); - -float fract(float x); -vec2 fract(vec2 x); -vec3 fract(vec3 x); -vec4 fract(vec4 x); - -float mod(float x, float y); -vec2 mod(vec2 x, float y); -vec3 mod(vec3 x, float y); -vec4 mod(vec4 x, float y); - -vec2 mod(vec2 x, vec2 y); -vec3 mod(vec3 x, vec3 y); -vec4 mod(vec4 x, vec4 y); - -float min(float x, float y); -vec2 min(vec2 x, vec2 y); -vec3 min(vec3 x, vec3 y); -vec4 min(vec4 x, vec4 y); - -vec2 min(vec2 x, float y); -vec3 min(vec3 x, float y); -vec4 min(vec4 x, float y); - -float max(float x, float y); -vec2 max(vec2 x, vec2 y); -vec3 max(vec3 x, vec3 y); -vec4 max(vec4 x, vec4 y); - -vec2 max(vec2 x, float y); -vec3 max(vec3 x, float y); -vec4 max(vec4 x, float y); - -float clamp(float x, float minVal, float maxVal); -vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); -vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); -vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); - -vec2 clamp(vec2 x, float minVal, float maxVal); -vec3 clamp(vec3 x, float minVal, float maxVal); -vec4 clamp(vec4 x, float minVal, float maxVal); - -float mix(float x, float y, float a); -vec2 mix(vec2 x, vec2 y, vec2 a); -vec3 mix(vec3 x, vec3 y, vec3 a); -vec4 mix(vec4 x, vec4 y, vec4 a); - -vec2 mix(vec2 x, vec2 y, float a); -vec3 mix(vec3 x, vec3 y, float a); -vec4 mix(vec4 x, vec4 y, float a); - -float step(float edge, float x); -vec2 step(vec2 edge, vec2 x); -vec3 step(vec3 edge, vec3 x); -vec4 step(vec4 edge, vec4 x); - -vec2 step(float edge, vec2 x); -vec3 step(float edge, vec3 x); -vec4 step(float edge, vec4 x); - -float smoothstep(float edge0, float edge1, float x); -vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); -vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); -vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); - -vec2 smoothstep(float edge0, float edge1, vec2 x); -vec3 smoothstep(float edge0, float edge1, vec3 x); -vec4 smoothstep(float edge0, float edge1, vec4 x); - -/* - * 8.4 - Geometric Functions - */ -float length(float x); -float length(vec2 x); -float length(vec3 x); -float length(vec4 x); - -float distance(float p0, float p1); -float distance(vec2 p0, vec2 p1); -float distance(vec3 p0, vec3 p1); -float distance(vec4 p0, vec4 p1); - -float dot(float x, float y); -float dot(vec2 x, vec2 y); -float dot(vec3 x, vec3 y); -float dot(vec4 x, vec4 y); - -vec3 cross(vec3 x, vec3 y); - -float normalize(float x); -vec2 normalize(vec2 x); -vec3 normalize(vec3 x); -vec4 normalize(vec4 x); - -float faceforward(float N, float I, float Nref); -vec2 faceforward(vec2 N, vec2 I, vec2 Nref); -vec3 faceforward(vec3 N, vec3 I, vec3 Nref); -vec4 faceforward(vec4 N, vec4 I, vec4 Nref); - -float reflect(float I, float N); -vec2 reflect(vec2 I, vec2 N); -vec3 reflect(vec3 I, vec3 N); -vec4 reflect(vec4 I, vec4 N); - -float refract(float I, float N, float eta); -vec2 refract(vec2 I, vec2 N, float eta); -vec3 refract(vec3 I, vec3 N, float eta); -vec4 refract(vec4 I, vec4 N, float eta); - -/* - * 8.5 - Matrix Functions - */ -mat2 matrixCompMult(mat2 x, mat2 y); -mat3 matrixCompMult(mat3 x, mat3 y); -mat4 matrixCompMult(mat4 x, mat4 y); - -/* - * 8.6 - Vector Relational Functions - */ -bvec2 lessThan( vec2 x, vec2 y); -bvec3 lessThan( vec3 x, vec3 y); -bvec4 lessThan( vec4 x, vec4 y); -bvec2 lessThan(ivec2 x, ivec2 y); -bvec3 lessThan(ivec3 x, ivec3 y); -bvec4 lessThan(ivec4 x, ivec4 y); - -bvec2 lessThanEqual( vec2 x, vec2 y); -bvec3 lessThanEqual( vec3 x, vec3 y); -bvec4 lessThanEqual( vec4 x, vec4 y); -bvec2 lessThanEqual(ivec2 x, ivec2 y); -bvec3 lessThanEqual(ivec3 x, ivec3 y); -bvec4 lessThanEqual(ivec4 x, ivec4 y); - -bvec2 greaterThan( vec2 x, vec2 y); -bvec3 greaterThan( vec3 x, vec3 y); -bvec4 greaterThan( vec4 x, vec4 y); -bvec2 greaterThan(ivec2 x, ivec2 y); -bvec3 greaterThan(ivec3 x, ivec3 y); -bvec4 greaterThan(ivec4 x, ivec4 y); - -bvec2 greaterThanEqual( vec2 x, vec2 y); -bvec3 greaterThanEqual( vec3 x, vec3 y); -bvec4 greaterThanEqual( vec4 x, vec4 y); -bvec2 greaterThanEqual(ivec2 x, ivec2 y); -bvec3 greaterThanEqual(ivec3 x, ivec3 y); -bvec4 greaterThanEqual(ivec4 x, ivec4 y); - -bvec2 equal( vec2 x, vec2 y); -bvec3 equal( vec3 x, vec3 y); -bvec4 equal( vec4 x, vec4 y); -bvec2 equal(ivec2 x, ivec2 y); -bvec3 equal(ivec3 x, ivec3 y); -bvec4 equal(ivec4 x, ivec4 y); -bvec2 equal(bvec2 x, bvec2 y); -bvec3 equal(bvec3 x, bvec3 y); -bvec4 equal(bvec4 x, bvec4 y); - -bvec2 notEqual( vec2 x, vec2 y); -bvec3 notEqual( vec3 x, vec3 y); -bvec4 notEqual( vec4 x, vec4 y); -bvec2 notEqual(ivec2 x, ivec2 y); -bvec3 notEqual(ivec3 x, ivec3 y); -bvec4 notEqual(ivec4 x, ivec4 y); -bvec2 notEqual(bvec2 x, bvec2 y); -bvec3 notEqual(bvec3 x, bvec3 y); -bvec4 notEqual(bvec4 x, bvec4 y); - -bool any(bvec2 x); -bool any(bvec3 x); -bool any(bvec4 x); - -bool all(bvec2 x); -bool all(bvec3 x); -bool all(bvec4 x); - -bvec2 not(bvec2 x); -bvec3 not(bvec3 x); -bvec4 not(bvec4 x); - -/* - * 8.7 - Texture Lookup Functions - */ -vec4 texture2D (sampler2D sampler, vec2 coord); -vec4 texture2DProj (sampler2D sampler, vec3 coord); -vec4 texture2DProj (sampler2D sampler, vec4 coord); - -vec4 textureCube (samplerCube sampler, vec3 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.vert deleted file mode 100644 index 8f7ea61f7..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/100.vert +++ /dev/null @@ -1,6 +0,0 @@ -#version 100 -vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); - -vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.frag deleted file mode 100644 index cc1e34295..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.frag +++ /dev/null @@ -1,40 +0,0 @@ -#version 110 -/* - * 8.7 - Texture Lookup Functions - * "The bias parameter is not accepted in a vertex shader." - */ -vec4 texture1D (sampler1D sampler, float coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); - -vec4 texture2D (sampler2D sampler, vec2 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); - -vec4 texture3D (sampler3D sampler, vec3 coord, float bias); -vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); - -vec4 textureCube (samplerCube sampler, vec3 coord, float bias); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); - -/* - * 8.8 - Fragment Processing Functions - */ -float dFdx(float p); -vec2 dFdx(vec2 p); -vec3 dFdx(vec3 p); -vec4 dFdx(vec4 p); - -float dFdy(float p); -vec2 dFdy(vec2 p); -vec3 dFdy(vec3 p); -vec4 dFdy(vec4 p); - -float fwidth(float p); -vec2 fwidth(vec2 p); -vec3 fwidth(vec3 p); -vec4 fwidth(vec4 p); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.glsl deleted file mode 100644 index 821978b7d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.glsl +++ /dev/null @@ -1,332 +0,0 @@ -#version 110 -/* - * 8.1 - Angle and Trigonometry Functions - */ -float radians(float degrees); -vec2 radians(vec2 degrees); -vec3 radians(vec3 degrees); -vec4 radians(vec4 degrees); - -float degrees(float radians); -vec2 degrees(vec2 radians); -vec3 degrees(vec3 radians); -vec4 degrees(vec4 radians); - -float sin(float angle); -vec2 sin(vec2 angle); -vec3 sin(vec3 angle); -vec4 sin(vec4 angle); - -float cos(float angle); -vec2 cos(vec2 angle); -vec3 cos(vec3 angle); -vec4 cos(vec4 angle); - -float tan(float angle); -vec2 tan(vec2 angle); -vec3 tan(vec3 angle); -vec4 tan(vec4 angle); - -float asin(float angle); -vec2 asin(vec2 angle); -vec3 asin(vec3 angle); -vec4 asin(vec4 angle); - -float acos(float angle); -vec2 acos(vec2 angle); -vec3 acos(vec3 angle); -vec4 acos(vec4 angle); - -float atan(float y, float x); -vec2 atan(vec2 y, vec2 x); -vec3 atan(vec3 y, vec3 x); -vec4 atan(vec4 y, vec4 x); - -float atan(float y_over_x); -vec2 atan(vec2 y_over_x); -vec3 atan(vec3 y_over_x); -vec4 atan(vec4 y_over_x); - -/* - * 8.2 - Exponential Functions - */ -float pow(float x, float y); -vec2 pow(vec2 x, vec2 y); -vec3 pow(vec3 x, vec3 y); -vec4 pow(vec4 x, vec4 y); - -float exp(float x); -vec2 exp(vec2 x); -vec3 exp(vec3 x); -vec4 exp(vec4 x); - -float log(float x); -vec2 log(vec2 x); -vec3 log(vec3 x); -vec4 log(vec4 x); - -float exp2(float x); -vec2 exp2(vec2 x); -vec3 exp2(vec3 x); -vec4 exp2(vec4 x); - -float log2(float x); -vec2 log2(vec2 x); -vec3 log2(vec3 x); -vec4 log2(vec4 x); - -float sqrt(float x); -vec2 sqrt(vec2 x); -vec3 sqrt(vec3 x); -vec4 sqrt(vec4 x); - -float inversesqrt(float x); -vec2 inversesqrt(vec2 x); -vec3 inversesqrt(vec3 x); -vec4 inversesqrt(vec4 x); - -/* - * 8.3 - Common Functions - */ -float abs(float x); -vec2 abs(vec2 x); -vec3 abs(vec3 x); -vec4 abs(vec4 x); - -float sign(float x); -vec2 sign(vec2 x); -vec3 sign(vec3 x); -vec4 sign(vec4 x); - -float floor(float x); -vec2 floor(vec2 x); -vec3 floor(vec3 x); -vec4 floor(vec4 x); - -float ceil(float x); -vec2 ceil(vec2 x); -vec3 ceil(vec3 x); -vec4 ceil(vec4 x); - -float fract(float x); -vec2 fract(vec2 x); -vec3 fract(vec3 x); -vec4 fract(vec4 x); - -float mod(float x, float y); -vec2 mod(vec2 x, float y); -vec3 mod(vec3 x, float y); -vec4 mod(vec4 x, float y); - -vec2 mod(vec2 x, vec2 y); -vec3 mod(vec3 x, vec3 y); -vec4 mod(vec4 x, vec4 y); - -float min(float x, float y); -vec2 min(vec2 x, vec2 y); -vec3 min(vec3 x, vec3 y); -vec4 min(vec4 x, vec4 y); - -vec2 min(vec2 x, float y); -vec3 min(vec3 x, float y); -vec4 min(vec4 x, float y); - -float max(float x, float y); -vec2 max(vec2 x, vec2 y); -vec3 max(vec3 x, vec3 y); -vec4 max(vec4 x, vec4 y); - -vec2 max(vec2 x, float y); -vec3 max(vec3 x, float y); -vec4 max(vec4 x, float y); - -float clamp(float x, float minVal, float maxVal); -vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); -vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); -vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); - -vec2 clamp(vec2 x, float minVal, float maxVal); -vec3 clamp(vec3 x, float minVal, float maxVal); -vec4 clamp(vec4 x, float minVal, float maxVal); - -float mix(float x, float y, float a); -vec2 mix(vec2 x, vec2 y, vec2 a); -vec3 mix(vec3 x, vec3 y, vec3 a); -vec4 mix(vec4 x, vec4 y, vec4 a); - -vec2 mix(vec2 x, vec2 y, float a); -vec3 mix(vec3 x, vec3 y, float a); -vec4 mix(vec4 x, vec4 y, float a); - -float step(float edge, float x); -vec2 step(vec2 edge, vec2 x); -vec3 step(vec3 edge, vec3 x); -vec4 step(vec4 edge, vec4 x); - -vec2 step(float edge, vec2 x); -vec3 step(float edge, vec3 x); -vec4 step(float edge, vec4 x); - -float smoothstep(float edge0, float edge1, float x); -vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); -vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); -vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); - -vec2 smoothstep(float edge0, float edge1, vec2 x); -vec3 smoothstep(float edge0, float edge1, vec3 x); -vec4 smoothstep(float edge0, float edge1, vec4 x); - -/* - * 8.4 - Geometric Functions - */ -float length(float x); -float length(vec2 x); -float length(vec3 x); -float length(vec4 x); - -float distance(float p0, float p1); -float distance(vec2 p0, vec2 p1); -float distance(vec3 p0, vec3 p1); -float distance(vec4 p0, vec4 p1); - -float dot(float x, float y); -float dot(vec2 x, vec2 y); -float dot(vec3 x, vec3 y); -float dot(vec4 x, vec4 y); - -vec3 cross(vec3 x, vec3 y); - -float normalize(float x); -vec2 normalize(vec2 x); -vec3 normalize(vec3 x); -vec4 normalize(vec4 x); - -float faceforward(float N, float I, float Nref); -vec2 faceforward(vec2 N, vec2 I, vec2 Nref); -vec3 faceforward(vec3 N, vec3 I, vec3 Nref); -vec4 faceforward(vec4 N, vec4 I, vec4 Nref); - -float reflect(float I, float N); -vec2 reflect(vec2 I, vec2 N); -vec3 reflect(vec3 I, vec3 N); -vec4 reflect(vec4 I, vec4 N); - -float refract(float I, float N, float eta); -vec2 refract(vec2 I, vec2 N, float eta); -vec3 refract(vec3 I, vec3 N, float eta); -vec4 refract(vec4 I, vec4 N, float eta); - - -/* - * 8.5 - Matrix Functions - */ -mat2 matrixCompMult(mat2 x, mat2 y); -mat3 matrixCompMult(mat3 x, mat3 y); -mat4 matrixCompMult(mat4 x, mat4 y); - -/* - * 8.6 - Vector Relational Functions - */ -bvec2 lessThan( vec2 x, vec2 y); -bvec3 lessThan( vec3 x, vec3 y); -bvec4 lessThan( vec4 x, vec4 y); -bvec2 lessThan(ivec2 x, ivec2 y); -bvec3 lessThan(ivec3 x, ivec3 y); -bvec4 lessThan(ivec4 x, ivec4 y); - -bvec2 lessThanEqual( vec2 x, vec2 y); -bvec3 lessThanEqual( vec3 x, vec3 y); -bvec4 lessThanEqual( vec4 x, vec4 y); -bvec2 lessThanEqual(ivec2 x, ivec2 y); -bvec3 lessThanEqual(ivec3 x, ivec3 y); -bvec4 lessThanEqual(ivec4 x, ivec4 y); - -bvec2 greaterThan( vec2 x, vec2 y); -bvec3 greaterThan( vec3 x, vec3 y); -bvec4 greaterThan( vec4 x, vec4 y); -bvec2 greaterThan(ivec2 x, ivec2 y); -bvec3 greaterThan(ivec3 x, ivec3 y); -bvec4 greaterThan(ivec4 x, ivec4 y); - -bvec2 greaterThanEqual( vec2 x, vec2 y); -bvec3 greaterThanEqual( vec3 x, vec3 y); -bvec4 greaterThanEqual( vec4 x, vec4 y); -bvec2 greaterThanEqual(ivec2 x, ivec2 y); -bvec3 greaterThanEqual(ivec3 x, ivec3 y); -bvec4 greaterThanEqual(ivec4 x, ivec4 y); - -bvec2 equal( vec2 x, vec2 y); -bvec3 equal( vec3 x, vec3 y); -bvec4 equal( vec4 x, vec4 y); -bvec2 equal(ivec2 x, ivec2 y); -bvec3 equal(ivec3 x, ivec3 y); -bvec4 equal(ivec4 x, ivec4 y); -bvec2 equal(bvec2 x, bvec2 y); -bvec3 equal(bvec3 x, bvec3 y); -bvec4 equal(bvec4 x, bvec4 y); - -bvec2 notEqual( vec2 x, vec2 y); -bvec3 notEqual( vec3 x, vec3 y); -bvec4 notEqual( vec4 x, vec4 y); -bvec2 notEqual(ivec2 x, ivec2 y); -bvec3 notEqual(ivec3 x, ivec3 y); -bvec4 notEqual(ivec4 x, ivec4 y); -bvec2 notEqual(bvec2 x, bvec2 y); -bvec3 notEqual(bvec3 x, bvec3 y); -bvec4 notEqual(bvec4 x, bvec4 y); - -bool any(bvec2 x); -bool any(bvec3 x); -bool any(bvec4 x); - -bool all(bvec2 x); -bool all(bvec3 x); -bool all(bvec4 x); - -bvec2 not(bvec2 x); -bvec3 not(bvec3 x); -bvec4 not(bvec4 x); - -/* - * 8.7 - Texture Lookup Functions - */ -vec4 texture1D (sampler1D sampler, float coord); -vec4 texture1DProj (sampler1D sampler, vec2 coord); -vec4 texture1DProj (sampler1D sampler, vec4 coord); - -vec4 texture2D (sampler2D sampler, vec2 coord); -vec4 texture2DProj (sampler2D sampler, vec3 coord); -vec4 texture2DProj (sampler2D sampler, vec4 coord); - -vec4 texture3D (sampler3D sampler, vec3 coord); -vec4 texture3DProj (sampler3D sampler, vec4 coord); - -vec4 textureCube (samplerCube sampler, vec3 coord); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); - -/* - * 8.9 - Noise Functions - */ -float noise1(float x); -float noise1(vec2 x); -float noise1(vec3 x); -float noise1(vec4 x); - -vec2 noise2(float x); -vec2 noise2(vec2 x); -vec2 noise2(vec3 x); -vec2 noise2(vec4 x); - -vec3 noise3(float x); -vec3 noise3(vec2 x); -vec3 noise3(vec3 x); -vec3 noise3(vec4 x); - -vec4 noise4(float x); -vec4 noise4(vec2 x); -vec4 noise4(vec3 x); -vec4 noise4(vec4 x); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.vert deleted file mode 100644 index 2d323416e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/110.vert +++ /dev/null @@ -1,25 +0,0 @@ -#version 110 - -vec4 ftransform(); - -/* - * 8.7 - Texture Lookup Functions - * "The built-ins suffixed with "Lod" are only allowed in a vertex shader." - */ -vec4 texture1DLod (sampler1D sampler, float coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); - -vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); - -vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); -vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); - -vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); - -vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); -vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); -vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.frag deleted file mode 100644 index 2080792fc..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.frag +++ /dev/null @@ -1,39 +0,0 @@ -#version 120 -/* - * 8.7 - Texture Lookup Functions - */ -vec4 texture1D (sampler1D sampler, float coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); - -vec4 texture2D (sampler2D sampler, vec2 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); - -vec4 texture3D (sampler3D sampler, vec3 coord, float bias); -vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); - -vec4 textureCube (samplerCube sampler, vec3 coord, float bias); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); - -/* - * 8.8 - Fragment Processing Functions - */ -float dFdx(float p); -vec2 dFdx(vec2 p); -vec3 dFdx(vec3 p); -vec4 dFdx(vec4 p); - -float dFdy(float p); -vec2 dFdy(vec2 p); -vec3 dFdy(vec3 p); -vec4 dFdy(vec4 p); - -float fwidth(float p); -vec2 fwidth(vec2 p); -vec3 fwidth(vec3 p); -vec4 fwidth(vec4 p); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.glsl deleted file mode 100644 index c01d1dc71..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.glsl +++ /dev/null @@ -1,364 +0,0 @@ -#version 120 -/* - * 8.1 - Angle and Trigonometry Functions - */ -float radians(float degrees); -vec2 radians(vec2 degrees); -vec3 radians(vec3 degrees); -vec4 radians(vec4 degrees); - -float degrees(float radians); -vec2 degrees(vec2 radians); -vec3 degrees(vec3 radians); -vec4 degrees(vec4 radians); - -float sin(float angle); -vec2 sin(vec2 angle); -vec3 sin(vec3 angle); -vec4 sin(vec4 angle); - -float cos(float angle); -vec2 cos(vec2 angle); -vec3 cos(vec3 angle); -vec4 cos(vec4 angle); - -float tan(float angle); -vec2 tan(vec2 angle); -vec3 tan(vec3 angle); -vec4 tan(vec4 angle); - -float asin(float angle); -vec2 asin(vec2 angle); -vec3 asin(vec3 angle); -vec4 asin(vec4 angle); - -float acos(float angle); -vec2 acos(vec2 angle); -vec3 acos(vec3 angle); -vec4 acos(vec4 angle); - -float atan(float y, float x); -vec2 atan(vec2 y, vec2 x); -vec3 atan(vec3 y, vec3 x); -vec4 atan(vec4 y, vec4 x); - -float atan(float y_over_x); -vec2 atan(vec2 y_over_x); -vec3 atan(vec3 y_over_x); -vec4 atan(vec4 y_over_x); - -/* - * 8.2 - Exponential Functions - */ -float pow(float x, float y); -vec2 pow(vec2 x, vec2 y); -vec3 pow(vec3 x, vec3 y); -vec4 pow(vec4 x, vec4 y); - -float exp(float x); -vec2 exp(vec2 x); -vec3 exp(vec3 x); -vec4 exp(vec4 x); - -float log(float x); -vec2 log(vec2 x); -vec3 log(vec3 x); -vec4 log(vec4 x); - -float exp2(float x); -vec2 exp2(vec2 x); -vec3 exp2(vec3 x); -vec4 exp2(vec4 x); - -float log2(float x); -vec2 log2(vec2 x); -vec3 log2(vec3 x); -vec4 log2(vec4 x); - -float sqrt(float x); -vec2 sqrt(vec2 x); -vec3 sqrt(vec3 x); -vec4 sqrt(vec4 x); - -float inversesqrt(float x); -vec2 inversesqrt(vec2 x); -vec3 inversesqrt(vec3 x); -vec4 inversesqrt(vec4 x); - -/* - * 8.3 - Common Functions - */ -float abs(float x); -vec2 abs(vec2 x); -vec3 abs(vec3 x); -vec4 abs(vec4 x); - -float sign(float x); -vec2 sign(vec2 x); -vec3 sign(vec3 x); -vec4 sign(vec4 x); - -float floor(float x); -vec2 floor(vec2 x); -vec3 floor(vec3 x); -vec4 floor(vec4 x); - -float ceil(float x); -vec2 ceil(vec2 x); -vec3 ceil(vec3 x); -vec4 ceil(vec4 x); - -float fract(float x); -vec2 fract(vec2 x); -vec3 fract(vec3 x); -vec4 fract(vec4 x); - -float mod(float x, float y); -vec2 mod(vec2 x, float y); -vec3 mod(vec3 x, float y); -vec4 mod(vec4 x, float y); - -vec2 mod(vec2 x, vec2 y); -vec3 mod(vec3 x, vec3 y); -vec4 mod(vec4 x, vec4 y); - -float min(float x, float y); -vec2 min(vec2 x, vec2 y); -vec3 min(vec3 x, vec3 y); -vec4 min(vec4 x, vec4 y); - -vec2 min(vec2 x, float y); -vec3 min(vec3 x, float y); -vec4 min(vec4 x, float y); - -float max(float x, float y); -vec2 max(vec2 x, vec2 y); -vec3 max(vec3 x, vec3 y); -vec4 max(vec4 x, vec4 y); - -vec2 max(vec2 x, float y); -vec3 max(vec3 x, float y); -vec4 max(vec4 x, float y); - -float clamp(float x, float minVal, float maxVal); -vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); -vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); -vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); - -vec2 clamp(vec2 x, float minVal, float maxVal); -vec3 clamp(vec3 x, float minVal, float maxVal); -vec4 clamp(vec4 x, float minVal, float maxVal); - -float mix(float x, float y, float a); -vec2 mix(vec2 x, vec2 y, vec2 a); -vec3 mix(vec3 x, vec3 y, vec3 a); -vec4 mix(vec4 x, vec4 y, vec4 a); - -vec2 mix(vec2 x, vec2 y, float a); -vec3 mix(vec3 x, vec3 y, float a); -vec4 mix(vec4 x, vec4 y, float a); - -float step(float edge, float x); -vec2 step(vec2 edge, vec2 x); -vec3 step(vec3 edge, vec3 x); -vec4 step(vec4 edge, vec4 x); - -vec2 step(float edge, vec2 x); -vec3 step(float edge, vec3 x); -vec4 step(float edge, vec4 x); - -float smoothstep(float edge0, float edge1, float x); -vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); -vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); -vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); - -vec2 smoothstep(float edge0, float edge1, vec2 x); -vec3 smoothstep(float edge0, float edge1, vec3 x); -vec4 smoothstep(float edge0, float edge1, vec4 x); - -/* - * 8.4 - Geometric Functions - */ -float length(float x); -float length(vec2 x); -float length(vec3 x); -float length(vec4 x); - -float distance(float p0, float p1); -float distance(vec2 p0, vec2 p1); -float distance(vec3 p0, vec3 p1); -float distance(vec4 p0, vec4 p1); - -float dot(float x, float y); -float dot(vec2 x, vec2 y); -float dot(vec3 x, vec3 y); -float dot(vec4 x, vec4 y); - -vec3 cross(vec3 x, vec3 y); - -float normalize(float x); -vec2 normalize(vec2 x); -vec3 normalize(vec3 x); -vec4 normalize(vec4 x); - -float faceforward(float N, float I, float Nref); -vec2 faceforward(vec2 N, vec2 I, vec2 Nref); -vec3 faceforward(vec3 N, vec3 I, vec3 Nref); -vec4 faceforward(vec4 N, vec4 I, vec4 Nref); - -float reflect(float I, float N); -vec2 reflect(vec2 I, vec2 N); -vec3 reflect(vec3 I, vec3 N); -vec4 reflect(vec4 I, vec4 N); - -float refract(float I, float N, float eta); -vec2 refract(vec2 I, vec2 N, float eta); -vec3 refract(vec3 I, vec3 N, float eta); -vec4 refract(vec4 I, vec4 N, float eta); - - -/* - * 8.5 - Matrix Functions - */ -mat2 matrixCompMult(mat2 x, mat2 y); -mat3 matrixCompMult(mat3 x, mat3 y); -mat4 matrixCompMult(mat4 x, mat4 y); -mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); -mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); -mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); -mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); -mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); -mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); - -mat2 outerProduct(vec2 c, vec2 r); -mat3 outerProduct(vec3 c, vec3 r); -mat4 outerProduct(vec4 c, vec4 r); - -mat2x3 outerProduct(vec3 c, vec2 r); -mat3x2 outerProduct(vec2 c, vec3 r); - -mat2x4 outerProduct(vec4 c, vec2 r); -mat4x2 outerProduct(vec2 c, vec4 r); - -mat3x4 outerProduct(vec4 c, vec3 r); -mat4x3 outerProduct(vec3 c, vec4 r); - -mat2 transpose(mat2 m); -mat3 transpose(mat3 m); -mat4 transpose(mat4 m); - -mat2x3 transpose(mat3x2 m); -mat3x2 transpose(mat2x3 m); - -mat2x4 transpose(mat4x2 m); -mat4x2 transpose(mat2x4 m); - -mat3x4 transpose(mat4x3 m); -mat4x3 transpose(mat3x4 m); - -/* - * 8.6 - Vector Relational Functions - */ -bvec2 lessThan( vec2 x, vec2 y); -bvec3 lessThan( vec3 x, vec3 y); -bvec4 lessThan( vec4 x, vec4 y); -bvec2 lessThan(ivec2 x, ivec2 y); -bvec3 lessThan(ivec3 x, ivec3 y); -bvec4 lessThan(ivec4 x, ivec4 y); - -bvec2 lessThanEqual( vec2 x, vec2 y); -bvec3 lessThanEqual( vec3 x, vec3 y); -bvec4 lessThanEqual( vec4 x, vec4 y); -bvec2 lessThanEqual(ivec2 x, ivec2 y); -bvec3 lessThanEqual(ivec3 x, ivec3 y); -bvec4 lessThanEqual(ivec4 x, ivec4 y); - -bvec2 greaterThan( vec2 x, vec2 y); -bvec3 greaterThan( vec3 x, vec3 y); -bvec4 greaterThan( vec4 x, vec4 y); -bvec2 greaterThan(ivec2 x, ivec2 y); -bvec3 greaterThan(ivec3 x, ivec3 y); -bvec4 greaterThan(ivec4 x, ivec4 y); - -bvec2 greaterThanEqual( vec2 x, vec2 y); -bvec3 greaterThanEqual( vec3 x, vec3 y); -bvec4 greaterThanEqual( vec4 x, vec4 y); -bvec2 greaterThanEqual(ivec2 x, ivec2 y); -bvec3 greaterThanEqual(ivec3 x, ivec3 y); -bvec4 greaterThanEqual(ivec4 x, ivec4 y); - -bvec2 equal( vec2 x, vec2 y); -bvec3 equal( vec3 x, vec3 y); -bvec4 equal( vec4 x, vec4 y); -bvec2 equal(ivec2 x, ivec2 y); -bvec3 equal(ivec3 x, ivec3 y); -bvec4 equal(ivec4 x, ivec4 y); -bvec2 equal(bvec2 x, bvec2 y); -bvec3 equal(bvec3 x, bvec3 y); -bvec4 equal(bvec4 x, bvec4 y); - -bvec2 notEqual( vec2 x, vec2 y); -bvec3 notEqual( vec3 x, vec3 y); -bvec4 notEqual( vec4 x, vec4 y); -bvec2 notEqual(ivec2 x, ivec2 y); -bvec3 notEqual(ivec3 x, ivec3 y); -bvec4 notEqual(ivec4 x, ivec4 y); -bvec2 notEqual(bvec2 x, bvec2 y); -bvec3 notEqual(bvec3 x, bvec3 y); -bvec4 notEqual(bvec4 x, bvec4 y); - -bool any(bvec2 x); -bool any(bvec3 x); -bool any(bvec4 x); - -bool all(bvec2 x); -bool all(bvec3 x); -bool all(bvec4 x); - -bvec2 not(bvec2 x); -bvec3 not(bvec3 x); -bvec4 not(bvec4 x); - -/* - * 8.7 - Texture Lookup Functions - */ -vec4 texture1D (sampler1D sampler, float coord); -vec4 texture1DProj (sampler1D sampler, vec2 coord); -vec4 texture1DProj (sampler1D sampler, vec4 coord); - -vec4 texture2D (sampler2D sampler, vec2 coord); -vec4 texture2DProj (sampler2D sampler, vec3 coord); -vec4 texture2DProj (sampler2D sampler, vec4 coord); - -vec4 texture3D (sampler3D sampler, vec3 coord); -vec4 texture3DProj (sampler3D sampler, vec4 coord); - -vec4 textureCube (samplerCube sampler, vec3 coord); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); - -/* - * 8.9 - Noise Functions - */ -float noise1(float x); -float noise1(vec2 x); -float noise1(vec3 x); -float noise1(vec4 x); - -vec2 noise2(float x); -vec2 noise2(vec2 x); -vec2 noise2(vec3 x); -vec2 noise2(vec4 x); - -vec3 noise3(float x); -vec3 noise3(vec2 x); -vec3 noise3(vec3 x); -vec3 noise3(vec4 x); - -vec4 noise4(float x); -vec4 noise4(vec2 x); -vec4 noise4(vec3 x); -vec4 noise4(vec4 x); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.vert deleted file mode 100644 index 41a1d96c4..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/120.vert +++ /dev/null @@ -1,21 +0,0 @@ -#version 120 - -vec4 ftransform(); - -vec4 texture1DLod (sampler1D sampler, float coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); - -vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); - -vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); -vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); - -vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); - -vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); -vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); -vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.frag deleted file mode 100644 index d0233b8a2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.frag +++ /dev/null @@ -1,141 +0,0 @@ -#version 130 - -/* texture - bias variants */ - vec4 texture( sampler1D sampler, float P, float bias); -ivec4 texture(isampler1D sampler, float P, float bias); -uvec4 texture(usampler1D sampler, float P, float bias); - - vec4 texture( sampler2D sampler, vec2 P, float bias); -ivec4 texture(isampler2D sampler, vec2 P, float bias); -uvec4 texture(usampler2D sampler, vec2 P, float bias); - - vec4 texture( sampler3D sampler, vec3 P, float bias); -ivec4 texture(isampler3D sampler, vec3 P, float bias); -uvec4 texture(usampler3D sampler, vec3 P, float bias); - - vec4 texture( samplerCube sampler, vec3 P, float bias); -ivec4 texture(isamplerCube sampler, vec3 P, float bias); -uvec4 texture(usamplerCube sampler, vec3 P, float bias); - -float texture(sampler1DShadow sampler, vec3 P, float bias); -float texture(sampler2DShadow sampler, vec3 P, float bias); -float texture(samplerCubeShadow sampler, vec4 P, float bias); - - vec4 texture( sampler1DArray sampler, vec2 P, float bias); -ivec4 texture(isampler1DArray sampler, vec2 P, float bias); -uvec4 texture(usampler1DArray sampler, vec2 P, float bias); - - vec4 texture( sampler2DArray sampler, vec3 P, float bias); -ivec4 texture(isampler2DArray sampler, vec3 P, float bias); -uvec4 texture(usampler2DArray sampler, vec3 P, float bias); - -float texture(sampler1DArrayShadow sampler, vec3 P, float bias); - -/* textureProj - bias variants */ - vec4 textureProj( sampler1D sampler, vec2 P, float bias); -ivec4 textureProj(isampler1D sampler, vec2 P, float bias); -uvec4 textureProj(usampler1D sampler, vec2 P, float bias); - vec4 textureProj( sampler1D sampler, vec4 P, float bias); -ivec4 textureProj(isampler1D sampler, vec4 P, float bias); -uvec4 textureProj(usampler1D sampler, vec4 P, float bias); - - vec4 textureProj( sampler2D sampler, vec3 P, float bias); -ivec4 textureProj(isampler2D sampler, vec3 P, float bias); -uvec4 textureProj(usampler2D sampler, vec3 P, float bias); - vec4 textureProj( sampler2D sampler, vec4 P, float bias); -ivec4 textureProj(isampler2D sampler, vec4 P, float bias); -uvec4 textureProj(usampler2D sampler, vec4 P, float bias); - - vec4 textureProj( sampler3D sampler, vec4 P, float bias); -ivec4 textureProj(isampler3D sampler, vec4 P, float bias); -uvec4 textureProj(usampler3D sampler, vec4 P, float bias); - -float textureProj(sampler1DShadow sampler, vec4 P, float bias); -float textureProj(sampler2DShadow sampler, vec4 P, float bias); - -/* textureOffset - bias variants */ - vec4 textureOffset( sampler1D sampler, float P, int offset, float bias); -ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias); -uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias); - - vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias); -ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset, float bias); -uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset, float bias); - - vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset, float bias); -ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset, float bias); -uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset, float bias); - -float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias); -float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias); - - vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset, float bias); -ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset, float bias); -uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset, float bias); - - vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset, float bias); -ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset, float bias); -uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset, float bias); - -float textureOffset(sampler1DArrayShadow samp, vec3 P, int offset, float bias); - -/* textureProjOffsetOffset - bias variants */ - vec4 textureProjOffset( sampler1D sampler, vec2 P, int offset, float bias); -ivec4 textureProjOffset(isampler1D sampler, vec2 P, int offset, float bias); -uvec4 textureProjOffset(usampler1D sampler, vec2 P, int offset, float bias); - vec4 textureProjOffset( sampler1D sampler, vec4 P, int offset, float bias); -ivec4 textureProjOffset(isampler1D sampler, vec4 P, int offset, float bias); -uvec4 textureProjOffset(usampler1D sampler, vec4 P, int offset, float bias); - - vec4 textureProjOffset( sampler2D sampler, vec3 P, ivec2 offset, float bias); -ivec4 textureProjOffset(isampler2D sampler, vec3 P, ivec2 offset, float bias); -uvec4 textureProjOffset(usampler2D sampler, vec3 P, ivec2 offset, float bias); - vec4 textureProjOffset( sampler2D sampler, vec4 P, ivec2 offset, float bias); -ivec4 textureProjOffset(isampler2D sampler, vec4 P, ivec2 offset, float bias); -uvec4 textureProjOffset(usampler2D sampler, vec4 P, ivec2 offset, float bias); - - vec4 textureProjOffset( sampler3D sampler, vec4 P, ivec3 offset, float bias); -ivec4 textureProjOffset(isampler3D sampler, vec4 P, ivec3 offset, float bias); -uvec4 textureProjOffset(usampler3D sampler, vec4 P, ivec3 offset, float bias); - -float textureProjOffset(sampler1DShadow s, vec4 P, int offset, float bias); -float textureProjOffset(sampler2DShadow s, vec4 P, ivec2 offset, float bias); - -/* - * The following texture functions are deprecated: - */ -vec4 texture1D (sampler1D sampler, float coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); - -vec4 texture2D (sampler2D sampler, vec2 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); - -vec4 texture3D (sampler3D sampler, vec3 coord, float bias); -vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); - -vec4 textureCube (samplerCube sampler, vec3 coord, float bias); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); - -/* - * 8.8 - Fragment Processing Functions - */ -float dFdx(float p); -vec2 dFdx(vec2 p); -vec3 dFdx(vec3 p); -vec4 dFdx(vec4 p); - -float dFdy(float p); -vec2 dFdy(vec2 p); -vec3 dFdy(vec3 p); -vec4 dFdy(vec4 p); - -float fwidth(float p); -vec2 fwidth(vec2 p); -vec3 fwidth(vec3 p); -vec4 fwidth(vec4 p); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.glsl deleted file mode 100644 index 15f973b17..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.glsl +++ /dev/null @@ -1,904 +0,0 @@ -#version 130 -/* - * 8.1 - Angle and Trigonometry Functions - */ -float radians(float degrees); -vec2 radians(vec2 degrees); -vec3 radians(vec3 degrees); -vec4 radians(vec4 degrees); - -float degrees(float radians); -vec2 degrees(vec2 radians); -vec3 degrees(vec3 radians); -vec4 degrees(vec4 radians); - -float sin(float angle); -vec2 sin(vec2 angle); -vec3 sin(vec3 angle); -vec4 sin(vec4 angle); - -float cos(float angle); -vec2 cos(vec2 angle); -vec3 cos(vec3 angle); -vec4 cos(vec4 angle); - -float tan(float angle); -vec2 tan(vec2 angle); -vec3 tan(vec3 angle); -vec4 tan(vec4 angle); - -float asin(float angle); -vec2 asin(vec2 angle); -vec3 asin(vec3 angle); -vec4 asin(vec4 angle); - -float acos(float angle); -vec2 acos(vec2 angle); -vec3 acos(vec3 angle); -vec4 acos(vec4 angle); - -float atan(float y, float x); -vec2 atan(vec2 y, vec2 x); -vec3 atan(vec3 y, vec3 x); -vec4 atan(vec4 y, vec4 x); - -float atan(float y_over_x); -vec2 atan(vec2 y_over_x); -vec3 atan(vec3 y_over_x); -vec4 atan(vec4 y_over_x); - -float sinh(float x); -vec2 sinh(vec2 x); -vec3 sinh(vec3 x); -vec4 sinh(vec4 x); - -float cosh(float x); -vec2 cosh(vec2 x); -vec3 cosh(vec3 x); -vec4 cosh(vec4 x); - -float tanh(float x); -vec2 tanh(vec2 x); -vec3 tanh(vec3 x); -vec4 tanh(vec4 x); - -float asinh(float x); -vec2 asinh(vec2 x); -vec3 asinh(vec3 x); -vec4 asinh(vec4 x); - -float acosh(float x); -vec2 acosh(vec2 x); -vec3 acosh(vec3 x); -vec4 acosh(vec4 x); - -float atanh(float x); -vec2 atanh(vec2 x); -vec3 atanh(vec3 x); -vec4 atanh(vec4 x); - -/* - * 8.2 - Exponential Functions - */ -float pow(float x, float y); -vec2 pow(vec2 x, vec2 y); -vec3 pow(vec3 x, vec3 y); -vec4 pow(vec4 x, vec4 y); - -float exp(float x); -vec2 exp(vec2 x); -vec3 exp(vec3 x); -vec4 exp(vec4 x); - -float log(float x); -vec2 log(vec2 x); -vec3 log(vec3 x); -vec4 log(vec4 x); - -float exp2(float x); -vec2 exp2(vec2 x); -vec3 exp2(vec3 x); -vec4 exp2(vec4 x); - -float log2(float x); -vec2 log2(vec2 x); -vec3 log2(vec3 x); -vec4 log2(vec4 x); - -float sqrt(float x); -vec2 sqrt(vec2 x); -vec3 sqrt(vec3 x); -vec4 sqrt(vec4 x); - -float inversesqrt(float x); -vec2 inversesqrt(vec2 x); -vec3 inversesqrt(vec3 x); -vec4 inversesqrt(vec4 x); - -/* - * 8.3 - Common Functions - */ -float abs(float x); -vec2 abs(vec2 x); -vec3 abs(vec3 x); -vec4 abs(vec4 x); -int abs(int x); -ivec2 abs(ivec2 x); -ivec3 abs(ivec3 x); -ivec4 abs(ivec4 x); - -float sign(float x); -vec2 sign(vec2 x); -vec3 sign(vec3 x); -vec4 sign(vec4 x); -int sign(int x); -ivec2 sign(ivec2 x); -ivec3 sign(ivec3 x); -ivec4 sign(ivec4 x); - -float floor(float x); -vec2 floor(vec2 x); -vec3 floor(vec3 x); -vec4 floor(vec4 x); - -float trunc(float x); -vec2 trunc(vec2 x); -vec3 trunc(vec3 x); -vec4 trunc(vec4 x); - -float round(float x); -vec2 round(vec2 x); -vec3 round(vec3 x); -vec4 round(vec4 x); - -float roundEven(float x); -vec2 roundEven(vec2 x); -vec3 roundEven(vec3 x); -vec4 roundEven(vec4 x); - -float ceil(float x); -vec2 ceil(vec2 x); -vec3 ceil(vec3 x); -vec4 ceil(vec4 x); - -float fract(float x); -vec2 fract(vec2 x); -vec3 fract(vec3 x); -vec4 fract(vec4 x); - -float mod(float x, float y); -vec2 mod(vec2 x, float y); -vec3 mod(vec3 x, float y); -vec4 mod(vec4 x, float y); - -vec2 mod(vec2 x, vec2 y); -vec3 mod(vec3 x, vec3 y); -vec4 mod(vec4 x, vec4 y); - -float modf(float x, out float i); -vec2 modf(vec2 x, out vec2 i); -vec3 modf(vec3 x, out vec3 i); -vec4 modf(vec4 x, out vec4 i); - -float min(float x, float y); -vec2 min(vec2 x, vec2 y); -vec3 min(vec3 x, vec3 y); -vec4 min(vec4 x, vec4 y); - -vec2 min(vec2 x, float y); -vec3 min(vec3 x, float y); -vec4 min(vec4 x, float y); - -int min(int x, int y); -ivec2 min(ivec2 x, ivec2 y); -ivec3 min(ivec3 x, ivec3 y); -ivec4 min(ivec4 x, ivec4 y); - -ivec2 min(ivec2 x, int y); -ivec3 min(ivec3 x, int y); -ivec4 min(ivec4 x, int y); - -uint min(uint x, uint y); -uvec2 min(uvec2 x, uvec2 y); -uvec3 min(uvec3 x, uvec3 y); -uvec4 min(uvec4 x, uvec4 y); - -uvec2 min(uvec2 x, uint y); -uvec3 min(uvec3 x, uint y); -uvec4 min(uvec4 x, uint y); - -float max(float x, float y); -vec2 max(vec2 x, vec2 y); -vec3 max(vec3 x, vec3 y); -vec4 max(vec4 x, vec4 y); - -vec2 max(vec2 x, float y); -vec3 max(vec3 x, float y); -vec4 max(vec4 x, float y); - -int max(int x, int y); -ivec2 max(ivec2 x, ivec2 y); -ivec3 max(ivec3 x, ivec3 y); -ivec4 max(ivec4 x, ivec4 y); - -ivec2 max(ivec2 x, int y); -ivec3 max(ivec3 x, int y); -ivec4 max(ivec4 x, int y); - -uint max(uint x, uint y); -uvec2 max(uvec2 x, uvec2 y); -uvec3 max(uvec3 x, uvec3 y); -uvec4 max(uvec4 x, uvec4 y); - -uvec2 max(uvec2 x, uint y); -uvec3 max(uvec3 x, uint y); -uvec4 max(uvec4 x, uint y); - -float clamp(float x, float minVal, float maxVal); -vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); -vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); -vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); - -vec2 clamp(vec2 x, float minVal, float maxVal); -vec3 clamp(vec3 x, float minVal, float maxVal); -vec4 clamp(vec4 x, float minVal, float maxVal); - -int clamp(int x, int minVal, int maxVal); -ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal); -ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal); -ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal); - -ivec2 clamp(ivec2 x, int minVal, int maxVal); -ivec3 clamp(ivec3 x, int minVal, int maxVal); -ivec4 clamp(ivec4 x, int minVal, int maxVal); - -uint clamp(uint x, uint minVal, uint maxVal); -uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal); -uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal); -uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal); - -uvec2 clamp(uvec2 x, uint minVal, uint maxVal); -uvec3 clamp(uvec3 x, uint minVal, uint maxVal); -uvec4 clamp(uvec4 x, uint minVal, uint maxVal); - -float mix(float x, float y, float a); -vec2 mix(vec2 x, vec2 y, vec2 a); -vec3 mix(vec3 x, vec3 y, vec3 a); -vec4 mix(vec4 x, vec4 y, vec4 a); - -vec2 mix(vec2 x, vec2 y, float a); -vec3 mix(vec3 x, vec3 y, float a); -vec4 mix(vec4 x, vec4 y, float a); - -float mix(float x, float y, bool a); -vec2 mix(vec2 x, vec2 y, bvec2 a); -vec3 mix(vec3 x, vec3 y, bvec3 a); -vec4 mix(vec4 x, vec4 y, bvec4 a); - -float step(float edge, float x); -vec2 step(vec2 edge, vec2 x); -vec3 step(vec3 edge, vec3 x); -vec4 step(vec4 edge, vec4 x); - -vec2 step(float edge, vec2 x); -vec3 step(float edge, vec3 x); -vec4 step(float edge, vec4 x); - -float smoothstep(float edge0, float edge1, float x); -vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); -vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); -vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); - -vec2 smoothstep(float edge0, float edge1, vec2 x); -vec3 smoothstep(float edge0, float edge1, vec3 x); -vec4 smoothstep(float edge0, float edge1, vec4 x); - -bool isnan(float x); -bvec2 isnan(vec2 x); -bvec3 isnan(vec3 x); -bvec4 isnan(vec4 x); - -bool isinf(float x); -bvec2 isinf(vec2 x); -bvec3 isinf(vec3 x); -bvec4 isinf(vec4 x); - -/* - * 8.4 - Geometric Functions - */ -float length(float x); -float length(vec2 x); -float length(vec3 x); -float length(vec4 x); - -float distance(float p0, float p1); -float distance(vec2 p0, vec2 p1); -float distance(vec3 p0, vec3 p1); -float distance(vec4 p0, vec4 p1); - -float dot(float x, float y); -float dot(vec2 x, vec2 y); -float dot(vec3 x, vec3 y); -float dot(vec4 x, vec4 y); - -vec3 cross(vec3 x, vec3 y); - -float normalize(float x); -vec2 normalize(vec2 x); -vec3 normalize(vec3 x); -vec4 normalize(vec4 x); - -float faceforward(float N, float I, float Nref); -vec2 faceforward(vec2 N, vec2 I, vec2 Nref); -vec3 faceforward(vec3 N, vec3 I, vec3 Nref); -vec4 faceforward(vec4 N, vec4 I, vec4 Nref); - -float reflect(float I, float N); -vec2 reflect(vec2 I, vec2 N); -vec3 reflect(vec3 I, vec3 N); -vec4 reflect(vec4 I, vec4 N); - -float refract(float I, float N, float eta); -vec2 refract(vec2 I, vec2 N, float eta); -vec3 refract(vec3 I, vec3 N, float eta); -vec4 refract(vec4 I, vec4 N, float eta); - - -/* - * 8.5 - Matrix Functions - */ -mat2 matrixCompMult(mat2 x, mat2 y); -mat3 matrixCompMult(mat3 x, mat3 y); -mat4 matrixCompMult(mat4 x, mat4 y); -mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); -mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); -mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); -mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); -mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); -mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); - -mat2 outerProduct(vec2 c, vec2 r); -mat3 outerProduct(vec3 c, vec3 r); -mat4 outerProduct(vec4 c, vec4 r); - -mat2x3 outerProduct(vec3 c, vec2 r); -mat3x2 outerProduct(vec2 c, vec3 r); - -mat2x4 outerProduct(vec4 c, vec2 r); -mat4x2 outerProduct(vec2 c, vec4 r); - -mat3x4 outerProduct(vec4 c, vec3 r); -mat4x3 outerProduct(vec3 c, vec4 r); - -mat2 transpose(mat2 m); -mat3 transpose(mat3 m); -mat4 transpose(mat4 m); - -mat2x3 transpose(mat3x2 m); -mat3x2 transpose(mat2x3 m); - -mat2x4 transpose(mat4x2 m); -mat4x2 transpose(mat2x4 m); - -mat3x4 transpose(mat4x3 m); -mat4x3 transpose(mat3x4 m); - -/* - * 8.6 - Vector Relational Functions - */ -bvec2 lessThan( vec2 x, vec2 y); -bvec3 lessThan( vec3 x, vec3 y); -bvec4 lessThan( vec4 x, vec4 y); -bvec2 lessThan(ivec2 x, ivec2 y); -bvec3 lessThan(ivec3 x, ivec3 y); -bvec4 lessThan(ivec4 x, ivec4 y); -bvec2 lessThan(uvec2 x, uvec2 y); -bvec3 lessThan(uvec3 x, uvec3 y); -bvec4 lessThan(uvec4 x, uvec4 y); - -bvec2 lessThanEqual( vec2 x, vec2 y); -bvec3 lessThanEqual( vec3 x, vec3 y); -bvec4 lessThanEqual( vec4 x, vec4 y); -bvec2 lessThanEqual(ivec2 x, ivec2 y); -bvec3 lessThanEqual(ivec3 x, ivec3 y); -bvec4 lessThanEqual(ivec4 x, ivec4 y); -bvec2 lessThanEqual(uvec2 x, uvec2 y); -bvec3 lessThanEqual(uvec3 x, uvec3 y); -bvec4 lessThanEqual(uvec4 x, uvec4 y); - -bvec2 greaterThan( vec2 x, vec2 y); -bvec3 greaterThan( vec3 x, vec3 y); -bvec4 greaterThan( vec4 x, vec4 y); -bvec2 greaterThan(ivec2 x, ivec2 y); -bvec3 greaterThan(ivec3 x, ivec3 y); -bvec4 greaterThan(ivec4 x, ivec4 y); -bvec2 greaterThan(uvec2 x, uvec2 y); -bvec3 greaterThan(uvec3 x, uvec3 y); -bvec4 greaterThan(uvec4 x, uvec4 y); - -bvec2 greaterThanEqual( vec2 x, vec2 y); -bvec3 greaterThanEqual( vec3 x, vec3 y); -bvec4 greaterThanEqual( vec4 x, vec4 y); -bvec2 greaterThanEqual(ivec2 x, ivec2 y); -bvec3 greaterThanEqual(ivec3 x, ivec3 y); -bvec4 greaterThanEqual(ivec4 x, ivec4 y); -bvec2 greaterThanEqual(uvec2 x, uvec2 y); -bvec3 greaterThanEqual(uvec3 x, uvec3 y); -bvec4 greaterThanEqual(uvec4 x, uvec4 y); - -bvec2 equal( vec2 x, vec2 y); -bvec3 equal( vec3 x, vec3 y); -bvec4 equal( vec4 x, vec4 y); -bvec2 equal(ivec2 x, ivec2 y); -bvec3 equal(ivec3 x, ivec3 y); -bvec4 equal(ivec4 x, ivec4 y); -bvec2 equal(uvec2 x, uvec2 y); -bvec3 equal(uvec3 x, uvec3 y); -bvec4 equal(uvec4 x, uvec4 y); -bvec2 equal(bvec2 x, bvec2 y); -bvec3 equal(bvec3 x, bvec3 y); -bvec4 equal(bvec4 x, bvec4 y); - -bvec2 notEqual( vec2 x, vec2 y); -bvec3 notEqual( vec3 x, vec3 y); -bvec4 notEqual( vec4 x, vec4 y); -bvec2 notEqual(ivec2 x, ivec2 y); -bvec3 notEqual(ivec3 x, ivec3 y); -bvec4 notEqual(ivec4 x, ivec4 y); -bvec2 notEqual(uvec2 x, uvec2 y); -bvec3 notEqual(uvec3 x, uvec3 y); -bvec4 notEqual(uvec4 x, uvec4 y); -bvec2 notEqual(bvec2 x, bvec2 y); -bvec3 notEqual(bvec3 x, bvec3 y); -bvec4 notEqual(bvec4 x, bvec4 y); - -bool any(bvec2 x); -bool any(bvec3 x); -bool any(bvec4 x); - -bool all(bvec2 x); -bool all(bvec3 x); -bool all(bvec4 x); - -bvec2 not(bvec2 x); -bvec3 not(bvec3 x); -bvec4 not(bvec4 x); - -/* - * 8.7 - Texture Lookup Functions - */ - -/* textureSize */ -int textureSize( sampler1D sampler, int lod); -int textureSize(isampler1D sampler, int lod); -int textureSize(usampler1D sampler, int lod); - -ivec2 textureSize( sampler2D sampler, int lod); -ivec2 textureSize(isampler2D sampler, int lod); -ivec2 textureSize(usampler2D sampler, int lod); - -ivec3 textureSize( sampler3D sampler, int lod); -ivec3 textureSize(isampler3D sampler, int lod); -ivec3 textureSize(usampler3D sampler, int lod); - -ivec2 textureSize( samplerCube sampler, int lod); -ivec2 textureSize(isamplerCube sampler, int lod); -ivec2 textureSize(usamplerCube sampler, int lod); - -int textureSize(sampler1DShadow sampler, int lod); -ivec2 textureSize(sampler2DShadow sampler, int lod); -ivec2 textureSize(samplerCubeShadow sampler, int lod); - -ivec2 textureSize( sampler1DArray sampler, int lod); -ivec2 textureSize(isampler1DArray sampler, int lod); -ivec2 textureSize(usampler1DArray sampler, int lod); -ivec3 textureSize( sampler2DArray sampler, int lod); -ivec3 textureSize(isampler2DArray sampler, int lod); -ivec3 textureSize(usampler2DArray sampler, int lod); - -ivec2 textureSize(sampler1DArrayShadow sampler, int lod); -ivec3 textureSize(sampler2DArrayShadow sampler, int lod); - -/* texture - no bias */ - vec4 texture( sampler1D sampler, float P); -ivec4 texture(isampler1D sampler, float P); -uvec4 texture(usampler1D sampler, float P); - - vec4 texture( sampler2D sampler, vec2 P); -ivec4 texture(isampler2D sampler, vec2 P); -uvec4 texture(usampler2D sampler, vec2 P); - - vec4 texture( sampler3D sampler, vec3 P); -ivec4 texture(isampler3D sampler, vec3 P); -uvec4 texture(usampler3D sampler, vec3 P); - - vec4 texture( samplerCube sampler, vec3 P); -ivec4 texture(isamplerCube sampler, vec3 P); -uvec4 texture(usamplerCube sampler, vec3 P); - -float texture(sampler1DShadow sampler, vec3 P); -float texture(sampler2DShadow sampler, vec3 P); -float texture(samplerCubeShadow sampler, vec4 P); - - vec4 texture( sampler1DArray sampler, vec2 P); -ivec4 texture(isampler1DArray sampler, vec2 P); -uvec4 texture(usampler1DArray sampler, vec2 P); - - vec4 texture( sampler2DArray sampler, vec3 P); -ivec4 texture(isampler2DArray sampler, vec3 P); -uvec4 texture(usampler2DArray sampler, vec3 P); - -float texture(sampler1DArrayShadow sampler, vec3 P); -float texture(sampler2DArrayShadow sampler, vec4 P); - -/* textureProj - no bias */ - vec4 textureProj( sampler1D sampler, vec2 P); -ivec4 textureProj(isampler1D sampler, vec2 P); -uvec4 textureProj(usampler1D sampler, vec2 P); - vec4 textureProj( sampler1D sampler, vec4 P); -ivec4 textureProj(isampler1D sampler, vec4 P); -uvec4 textureProj(usampler1D sampler, vec4 P); - - vec4 textureProj( sampler2D sampler, vec3 P); -ivec4 textureProj(isampler2D sampler, vec3 P); -uvec4 textureProj(usampler2D sampler, vec3 P); - vec4 textureProj( sampler2D sampler, vec4 P); -ivec4 textureProj(isampler2D sampler, vec4 P); -uvec4 textureProj(usampler2D sampler, vec4 P); - - vec4 textureProj( sampler3D sampler, vec4 P); -ivec4 textureProj(isampler3D sampler, vec4 P); -uvec4 textureProj(usampler3D sampler, vec4 P); - -float textureProj(sampler1DShadow sampler, vec4 P); -float textureProj(sampler2DShadow sampler, vec4 P); - -/* textureLod */ - vec4 textureLod( sampler1D sampler, float P, float lod); -ivec4 textureLod(isampler1D sampler, float P, float lod); -uvec4 textureLod(usampler1D sampler, float P, float lod); - - vec4 textureLod( sampler2D sampler, vec2 P, float lod); -ivec4 textureLod(isampler2D sampler, vec2 P, float lod); -uvec4 textureLod(usampler2D sampler, vec2 P, float lod); - - vec4 textureLod( sampler3D sampler, vec3 P, float lod); -ivec4 textureLod(isampler3D sampler, vec3 P, float lod); -uvec4 textureLod(usampler3D sampler, vec3 P, float lod); - - vec4 textureLod( samplerCube sampler, vec3 P, float lod); -ivec4 textureLod(isamplerCube sampler, vec3 P, float lod); -uvec4 textureLod(usamplerCube sampler, vec3 P, float lod); - -float textureLod(sampler1DShadow sampler, vec3 P, float lod); -float textureLod(sampler2DShadow sampler, vec3 P, float lod); - - vec4 textureLod( sampler1DArray sampler, vec2 P, float lod); -ivec4 textureLod(isampler1DArray sampler, vec2 P, float lod); -uvec4 textureLod(usampler1DArray sampler, vec2 P, float lod); - - vec4 textureLod( sampler2DArray sampler, vec3 P, float lod); -ivec4 textureLod(isampler2DArray sampler, vec3 P, float lod); -uvec4 textureLod(usampler2DArray sampler, vec3 P, float lod); - -float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod); - -/* textureOffset - no bias */ - vec4 textureOffset( sampler1D sampler, float P, int offset); -ivec4 textureOffset(isampler1D sampler, float P, int offset); -uvec4 textureOffset(usampler1D sampler, float P, int offset); - - vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset); -ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset); -uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset); - - vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset); -ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset); -uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset); - -float textureOffset(sampler1DShadow sampler, vec3 P, int offset); -float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset); - - vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset); -ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset); -uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset); - - vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset); -ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset); -uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset); - -float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset); - -/* texelFetch */ - vec4 texelFetch( sampler1D sampler, int P, int lod); -ivec4 texelFetch(isampler1D sampler, int P, int lod); -uvec4 texelFetch(usampler1D sampler, int P, int lod); - - vec4 texelFetch( sampler2D sampler, ivec2 P, int lod); -ivec4 texelFetch(isampler2D sampler, ivec2 P, int lod); -uvec4 texelFetch(usampler2D sampler, ivec2 P, int lod); - - vec4 texelFetch( sampler3D sampler, ivec3 P, int lod); -ivec4 texelFetch(isampler3D sampler, ivec3 P, int lod); -uvec4 texelFetch(usampler3D sampler, ivec3 P, int lod); - - vec4 texelFetch( sampler1DArray sampler, ivec2 P, int lod); -ivec4 texelFetch(isampler1DArray sampler, ivec2 P, int lod); -uvec4 texelFetch(usampler1DArray sampler, ivec2 P, int lod); - - vec4 texelFetch( sampler2DArray sampler, ivec3 P, int lod); -ivec4 texelFetch(isampler2DArray sampler, ivec3 P, int lod); -uvec4 texelFetch(usampler2DArray sampler, ivec3 P, int lod); - -/* texelFetchOffset */ - vec4 texelFetchOffset( sampler1D sampler, int P, int lod, int offset); -ivec4 texelFetchOffset(isampler1D sampler, int P, int lod, int offset); -uvec4 texelFetchOffset(usampler1D sampler, int P, int lod, int offset); - - vec4 texelFetchOffset( sampler2D sampler, ivec2 P, int lod, ivec2 offset); -ivec4 texelFetchOffset(isampler2D sampler, ivec2 P, int lod, ivec2 offset); -uvec4 texelFetchOffset(usampler2D sampler, ivec2 P, int lod, ivec2 offset); - - vec4 texelFetchOffset( sampler3D sampler, ivec3 P, int lod, ivec3 offset); -ivec4 texelFetchOffset(isampler3D sampler, ivec3 P, int lod, ivec3 offset); -uvec4 texelFetchOffset(usampler3D sampler, ivec3 P, int lod, ivec3 offset); - - vec4 texelFetchOffset( sampler1DArray sampler, ivec2 P, int lod, int offset); -ivec4 texelFetchOffset(isampler1DArray sampler, ivec2 P, int lod, int offset); -uvec4 texelFetchOffset(usampler1DArray sampler, ivec2 P, int lod, int offset); - - vec4 texelFetchOffset( sampler2DArray sampler, ivec3 P, int lod, ivec2 offset); -ivec4 texelFetchOffset(isampler2DArray sampler, ivec3 P, int lod, ivec2 offset); -uvec4 texelFetchOffset(usampler2DArray sampler, ivec3 P, int lod, ivec2 offset); - -/* textureProjOffset - no bias */ - vec4 textureProjOffset( sampler1D sampler, vec2 P, int offset); -ivec4 textureProjOffset(isampler1D sampler, vec2 P, int offset); -uvec4 textureProjOffset(usampler1D sampler, vec2 P, int offset); - vec4 textureProjOffset( sampler1D sampler, vec4 P, int offset); -ivec4 textureProjOffset(isampler1D sampler, vec4 P, int offset); -uvec4 textureProjOffset(usampler1D sampler, vec4 P, int offset); - - vec4 textureProjOffset( sampler2D sampler, vec3 P, ivec2 offset); -ivec4 textureProjOffset(isampler2D sampler, vec3 P, ivec2 offset); -uvec4 textureProjOffset(usampler2D sampler, vec3 P, ivec2 offset); - vec4 textureProjOffset( sampler2D sampler, vec4 P, ivec2 offset); -ivec4 textureProjOffset(isampler2D sampler, vec4 P, ivec2 offset); -uvec4 textureProjOffset(usampler2D sampler, vec4 P, ivec2 offset); - - vec4 textureProjOffset( sampler3D sampler, vec4 P, ivec3 offset); -ivec4 textureProjOffset(isampler3D sampler, vec4 P, ivec3 offset); -uvec4 textureProjOffset(usampler3D sampler, vec4 P, ivec3 offset); - -float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset); -float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset); - -/* textureLodOffset */ - vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); -ivec4 textureLodOffset(isampler1D sampler, float P, float lod, int offset); -uvec4 textureLodOffset(usampler1D sampler, float P, float lod, int offset); - - vec4 textureLodOffset( sampler2D sampler, vec2 P, float lod, ivec2 offset); -ivec4 textureLodOffset(isampler2D sampler, vec2 P, float lod, ivec2 offset); -uvec4 textureLodOffset(usampler2D sampler, vec2 P, float lod, ivec2 offset); - - vec4 textureLodOffset( sampler3D sampler, vec3 P, float lod, ivec3 offset); -ivec4 textureLodOffset(isampler3D sampler, vec3 P, float lod, ivec3 offset); -uvec4 textureLodOffset(usampler3D sampler, vec3 P, float lod, ivec3 offset); - -float textureLodOffset(sampler1DShadow samp, vec3 P, float lod, int offset); -float textureLodOffset(sampler2DShadow samp, vec3 P, float lod, ivec2 offset); - - vec4 textureLodOffset( sampler1DArray sampler, vec2 P, float lod, int offset); -ivec4 textureLodOffset(isampler1DArray sampler, vec2 P, float lod, int offset); -uvec4 textureLodOffset(usampler1DArray sampler, vec2 P, float lod, int offset); - - vec4 textureLodOffset( sampler2DArray samp, vec3 P, float lod, ivec2 offset); -ivec4 textureLodOffset(isampler2DArray samp, vec3 P, float lod, ivec2 offset); -uvec4 textureLodOffset(usampler2DArray samp, vec3 P, float lod, ivec2 offset); - -float textureLodOffset(sampler1DArrayShadow s, vec3 P, float lod, int offset); - -/* textureProjLod */ - vec4 textureProjLod( sampler1D sampler, vec2 P, float lod); -ivec4 textureProjLod(isampler1D sampler, vec2 P, float lod); -uvec4 textureProjLod(usampler1D sampler, vec2 P, float lod); - vec4 textureProjLod( sampler1D sampler, vec4 P, float lod); -ivec4 textureProjLod(isampler1D sampler, vec4 P, float lod); -uvec4 textureProjLod(usampler1D sampler, vec4 P, float lod); - - vec4 textureProjLod( sampler2D sampler, vec3 P, float lod); -ivec4 textureProjLod(isampler2D sampler, vec3 P, float lod); -uvec4 textureProjLod(usampler2D sampler, vec3 P, float lod); - vec4 textureProjLod( sampler2D sampler, vec4 P, float lod); -ivec4 textureProjLod(isampler2D sampler, vec4 P, float lod); -uvec4 textureProjLod(usampler2D sampler, vec4 P, float lod); - - vec4 textureProjLod( sampler3D sampler, vec4 P, float lod); -ivec4 textureProjLod(isampler3D sampler, vec4 P, float lod); -uvec4 textureProjLod(usampler3D sampler, vec4 P, float lod); - -float textureProjLod(sampler1DShadow sampler, vec4 P, float lod); -float textureProjLod(sampler2DShadow sampler, vec4 P, float lod); - -/* textureProjLodOffset */ - vec4 textureProjLodOffset( sampler1D sampler, vec2 P, float lod, int offset); -ivec4 textureProjLodOffset(isampler1D sampler, vec2 P, float lod, int offset); -uvec4 textureProjLodOffset(usampler1D sampler, vec2 P, float lod, int offset); - vec4 textureProjLodOffset( sampler1D sampler, vec4 P, float lod, int offset); -ivec4 textureProjLodOffset(isampler1D sampler, vec4 P, float lod, int offset); -uvec4 textureProjLodOffset(usampler1D sampler, vec4 P, float lod, int offset); - - vec4 textureProjLodOffset( sampler2D sampler, vec3 P, float lod, ivec2 offset); -ivec4 textureProjLodOffset(isampler2D sampler, vec3 P, float lod, ivec2 offset); -uvec4 textureProjLodOffset(usampler2D sampler, vec3 P, float lod, ivec2 offset); - vec4 textureProjLodOffset( sampler2D sampler, vec4 P, float lod, ivec2 offset); -ivec4 textureProjLodOffset(isampler2D sampler, vec4 P, float lod, ivec2 offset); -uvec4 textureProjLodOffset(usampler2D sampler, vec4 P, float lod, ivec2 offset); - - vec4 textureProjLodOffset( sampler3D sampler, vec4 P, float lod, ivec3 offset); -ivec4 textureProjLodOffset(isampler3D sampler, vec4 P, float lod, ivec3 offset); -uvec4 textureProjLodOffset(usampler3D sampler, vec4 P, float lod, ivec3 offset); - -float textureProjLodOffset(sampler1DShadow s, vec4 P, float lod, int offset); -float textureProjLodOffset(sampler2DShadow s, vec4 P, float lod, ivec2 offset); - -/* textureGrad */ - vec4 textureGrad( sampler1D sampler, float P, float dPdx, float dPdy); -ivec4 textureGrad(isampler1D sampler, float P, float dPdx, float dPdy); -uvec4 textureGrad(usampler1D sampler, float P, float dPdx, float dPdy); - - vec4 textureGrad( sampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); -ivec4 textureGrad(isampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); -uvec4 textureGrad(usampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); - - vec4 textureGrad( sampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); -ivec4 textureGrad(isampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); -uvec4 textureGrad(usampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); - - vec4 textureGrad( samplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); -ivec4 textureGrad(isamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); -uvec4 textureGrad(usamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); - -float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy); -float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); -float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy); - - vec4 textureGrad( sampler1DArray sampler, vec2 P, float dPdx, float dPdy); -ivec4 textureGrad(isampler1DArray sampler, vec2 P, float dPdx, float dPdy); -uvec4 textureGrad(usampler1DArray sampler, vec2 P, float dPdx, float dPdy); - - vec4 textureGrad( sampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); -ivec4 textureGrad(isampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); -uvec4 textureGrad(usampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); - -float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy); -float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); - -/* textureGradOffset */ - vec4 textureGradOffset( sampler1D s, float P, float dx, float dy, int off); -ivec4 textureGradOffset(isampler1D s, float P, float dx, float dy, int offset); -uvec4 textureGradOffset(usampler1D s, float P, float dx, float dy, int offset); - - vec4 textureGradOffset( sampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); -ivec4 textureGradOffset(isampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); -uvec4 textureGradOffset(usampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); - - vec4 textureGradOffset( sampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); -ivec4 textureGradOffset(isampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); -uvec4 textureGradOffset(usampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); - -float textureGradOffset(sampler1DShadow s, vec3 P, float dx, float dy, int off); -float textureGradOffset(sampler2DShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - - vec4 textureGradOffset( sampler1DArray s, vec2 P, float dx, float dy, int off); -ivec4 textureGradOffset(isampler1DArray s, vec2 P, float dx, float dy, int off); -uvec4 textureGradOffset(usampler1DArray s, vec2 P, float dx, float dy, int off); - - vec4 textureGradOffset( sampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureGradOffset(isampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureGradOffset(usampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - -float textureGradOffset(sampler1DArrayShadow s, vec3 P, float dx, float dy, int o); -float textureGradOffset(sampler2DArrayShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); - -/* textureProjGrad */ - vec4 textureProjGrad( sampler1D sampler, vec2 P, float dPdx, float dPdy); -ivec4 textureProjGrad(isampler1D sampler, vec2 P, float dPdx, float dPdy); -uvec4 textureProjGrad(usampler1D sampler, vec2 P, float dPdx, float dPdy); - vec4 textureProjGrad( sampler1D sampler, vec4 P, float dPdx, float dPdy); -ivec4 textureProjGrad(isampler1D sampler, vec4 P, float dPdx, float dPdy); -uvec4 textureProjGrad(usampler1D sampler, vec4 P, float dPdx, float dPdy); - - vec4 textureProjGrad( sampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); -ivec4 textureProjGrad(isampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); -uvec4 textureProjGrad(usampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); - vec4 textureProjGrad( sampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); -ivec4 textureProjGrad(isampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); -uvec4 textureProjGrad(usampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); - - vec4 textureProjGrad( sampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); -ivec4 textureProjGrad(isampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); -uvec4 textureProjGrad(usampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); - -float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy); -float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); - -/* textureProjGradOffset */ - vec4 textureProjGradOffset( sampler1D s, vec2 P, float dx, float dy, int off); -ivec4 textureProjGradOffset(isampler1D s, vec2 P, float dx, float dy, int off); -uvec4 textureProjGradOffset(usampler1D s, vec2 P, float dx, float dy, int off); - vec4 textureProjGradOffset( sampler1D s, vec4 P, float dx, float dy, int off); -ivec4 textureProjGradOffset(isampler1D s, vec4 P, float dx, float dy, int off); -uvec4 textureProjGradOffset(usampler1D s, vec4 P, float dx, float dy, int off); - - vec4 textureProjGradOffset( sampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureProjGradOffset(isampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureProjGradOffset(usampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - vec4 textureProjGradOffset( sampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureProjGradOffset(isampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureProjGradOffset(usampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); - - vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); -ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); -uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); - -float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o); -float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); - -/* - * The following texture functions are deprecated: - */ -vec4 texture1D (sampler1D sampler, float coord); -vec4 texture1DProj (sampler1D sampler, vec2 coord); -vec4 texture1DProj (sampler1D sampler, vec4 coord); -vec4 texture1DLod (sampler1D sampler, float coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); - -vec4 texture2D (sampler2D sampler, vec2 coord); -vec4 texture2DProj (sampler2D sampler, vec3 coord); -vec4 texture2DProj (sampler2D sampler, vec4 coord); -vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); - -vec4 texture3D (sampler3D sampler, vec3 coord); -vec4 texture3DProj (sampler3D sampler, vec4 coord); -vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); -vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); - -vec4 textureCube (samplerCube sampler, vec3 coord); -vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); -vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); -vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); -vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); - -/* - * 8.9 - Noise Functions - */ -float noise1(float x); -float noise1(vec2 x); -float noise1(vec3 x); -float noise1(vec4 x); - -vec2 noise2(float x); -vec2 noise2(vec2 x); -vec2 noise2(vec3 x); -vec2 noise2(vec4 x); - -vec3 noise3(float x); -vec3 noise3(vec2 x); -vec3 noise3(vec3 x); -vec3 noise3(vec4 x); - -vec4 noise4(float x); -vec4 noise4(vec2 x); -vec4 noise4(vec3 x); -vec4 noise4(vec4 x); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.vert deleted file mode 100644 index 99d127eb8..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/130.vert +++ /dev/null @@ -1,2 +0,0 @@ -#version 130 -vec4 ftransform(); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/140.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/140.frag deleted file mode 100644 index 2e50a1567..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/140.frag +++ /dev/null @@ -1,140 +0,0 @@ -#version 140 -/* texture - bias variants */ - vec4 texture( sampler1D sampler, float P, float bias); -ivec4 texture(isampler1D sampler, float P, float bias); -uvec4 texture(usampler1D sampler, float P, float bias); - - vec4 texture( sampler2D sampler, vec2 P, float bias); -ivec4 texture(isampler2D sampler, vec2 P, float bias); -uvec4 texture(usampler2D sampler, vec2 P, float bias); - - vec4 texture( sampler3D sampler, vec3 P, float bias); -ivec4 texture(isampler3D sampler, vec3 P, float bias); -uvec4 texture(usampler3D sampler, vec3 P, float bias); - - vec4 texture( samplerCube sampler, vec3 P, float bias); -ivec4 texture(isamplerCube sampler, vec3 P, float bias); -uvec4 texture(usamplerCube sampler, vec3 P, float bias); - -float texture(sampler1DShadow sampler, vec3 P, float bias); -float texture(sampler2DShadow sampler, vec3 P, float bias); -float texture(samplerCubeShadow sampler, vec4 P, float bias); - - vec4 texture( sampler1DArray sampler, vec2 P, float bias); -ivec4 texture(isampler1DArray sampler, vec2 P, float bias); -uvec4 texture(usampler1DArray sampler, vec2 P, float bias); - - vec4 texture( sampler2DArray sampler, vec3 P, float bias); -ivec4 texture(isampler2DArray sampler, vec3 P, float bias); -uvec4 texture(usampler2DArray sampler, vec3 P, float bias); - -float texture(sampler1DArrayShadow sampler, vec3 P, float bias); - -/* textureProj - bias variants */ - vec4 textureProj( sampler1D sampler, vec2 P, float bias); -ivec4 textureProj(isampler1D sampler, vec2 P, float bias); -uvec4 textureProj(usampler1D sampler, vec2 P, float bias); - vec4 textureProj( sampler1D sampler, vec4 P, float bias); -ivec4 textureProj(isampler1D sampler, vec4 P, float bias); -uvec4 textureProj(usampler1D sampler, vec4 P, float bias); - - vec4 textureProj( sampler2D sampler, vec3 P, float bias); -ivec4 textureProj(isampler2D sampler, vec3 P, float bias); -uvec4 textureProj(usampler2D sampler, vec3 P, float bias); - vec4 textureProj( sampler2D sampler, vec4 P, float bias); -ivec4 textureProj(isampler2D sampler, vec4 P, float bias); -uvec4 textureProj(usampler2D sampler, vec4 P, float bias); - - vec4 textureProj( sampler3D sampler, vec4 P, float bias); -ivec4 textureProj(isampler3D sampler, vec4 P, float bias); -uvec4 textureProj(usampler3D sampler, vec4 P, float bias); - -float textureProj(sampler1DShadow sampler, vec4 P, float bias); -float textureProj(sampler2DShadow sampler, vec4 P, float bias); - -/* textureOffset - bias variants */ - vec4 textureOffset( sampler1D sampler, float P, int offset, float bias); -ivec4 textureOffset(isampler1D sampler, float P, int offset, float bias); -uvec4 textureOffset(usampler1D sampler, float P, int offset, float bias); - - vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset, float bias); -ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset, float bias); -uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset, float bias); - - vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset, float bias); -ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset, float bias); -uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset, float bias); - -float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias); -float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias); - - vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset, float bias); -ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset, float bias); -uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset, float bias); - - vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset, float bias); -ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset, float bias); -uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset, float bias); - -float textureOffset(sampler1DArrayShadow samp, vec3 P, int offset, float bias); - -/* textureProjOffsetOffset - bias variants */ - vec4 textureProjOffset( sampler1D sampler, vec2 P, int offset, float bias); -ivec4 textureProjOffset(isampler1D sampler, vec2 P, int offset, float bias); -uvec4 textureProjOffset(usampler1D sampler, vec2 P, int offset, float bias); - vec4 textureProjOffset( sampler1D sampler, vec4 P, int offset, float bias); -ivec4 textureProjOffset(isampler1D sampler, vec4 P, int offset, float bias); -uvec4 textureProjOffset(usampler1D sampler, vec4 P, int offset, float bias); - - vec4 textureProjOffset( sampler2D sampler, vec3 P, ivec2 offset, float bias); -ivec4 textureProjOffset(isampler2D sampler, vec3 P, ivec2 offset, float bias); -uvec4 textureProjOffset(usampler2D sampler, vec3 P, ivec2 offset, float bias); - vec4 textureProjOffset( sampler2D sampler, vec4 P, ivec2 offset, float bias); -ivec4 textureProjOffset(isampler2D sampler, vec4 P, ivec2 offset, float bias); -uvec4 textureProjOffset(usampler2D sampler, vec4 P, ivec2 offset, float bias); - - vec4 textureProjOffset( sampler3D sampler, vec4 P, ivec3 offset, float bias); -ivec4 textureProjOffset(isampler3D sampler, vec4 P, ivec3 offset, float bias); -uvec4 textureProjOffset(usampler3D sampler, vec4 P, ivec3 offset, float bias); - -float textureProjOffset(sampler1DShadow s, vec4 P, int offset, float bias); -float textureProjOffset(sampler2DShadow s, vec4 P, ivec2 offset, float bias); - -/* - * The following texture functions are deprecated: - */ -vec4 texture1D (sampler1D sampler, float coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec2 coord, float bias); -vec4 texture1DProj (sampler1D sampler, vec4 coord, float bias); - -vec4 texture2D (sampler2D sampler, vec2 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias); -vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias); - -vec4 texture3D (sampler3D sampler, vec3 coord, float bias); -vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); - -vec4 textureCube (samplerCube sampler, vec3 coord, float bias); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord, float bias); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord, float bias); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord, float bias); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord, float bias); - -/* - * 8.8 - Fragment Processing Functions - */ -float dFdx(float p); -vec2 dFdx(vec2 p); -vec3 dFdx(vec3 p); -vec4 dFdx(vec4 p); - -float dFdy(float p); -vec2 dFdy(vec2 p); -vec3 dFdy(vec3 p); -vec4 dFdy(vec4 p); - -float fwidth(float p); -vec2 fwidth(vec2 p); -vec3 fwidth(vec3 p); -vec4 fwidth(vec4 p); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/140.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/140.glsl deleted file mode 100644 index 90e04816d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/140.glsl +++ /dev/null @@ -1,989 +0,0 @@ -#version 140 -/* - * 8.1 - Angle and Trigonometry Functions - */ -float radians(float degrees); -vec2 radians(vec2 degrees); -vec3 radians(vec3 degrees); -vec4 radians(vec4 degrees); - -float degrees(float radians); -vec2 degrees(vec2 radians); -vec3 degrees(vec3 radians); -vec4 degrees(vec4 radians); - -float sin(float angle); -vec2 sin(vec2 angle); -vec3 sin(vec3 angle); -vec4 sin(vec4 angle); - -float cos(float angle); -vec2 cos(vec2 angle); -vec3 cos(vec3 angle); -vec4 cos(vec4 angle); - -float tan(float angle); -vec2 tan(vec2 angle); -vec3 tan(vec3 angle); -vec4 tan(vec4 angle); - -float asin(float angle); -vec2 asin(vec2 angle); -vec3 asin(vec3 angle); -vec4 asin(vec4 angle); - -float acos(float angle); -vec2 acos(vec2 angle); -vec3 acos(vec3 angle); -vec4 acos(vec4 angle); - -float atan(float y, float x); -vec2 atan(vec2 y, vec2 x); -vec3 atan(vec3 y, vec3 x); -vec4 atan(vec4 y, vec4 x); - -float atan(float y_over_x); -vec2 atan(vec2 y_over_x); -vec3 atan(vec3 y_over_x); -vec4 atan(vec4 y_over_x); - -float sinh(float x); -vec2 sinh(vec2 x); -vec3 sinh(vec3 x); -vec4 sinh(vec4 x); - -float cosh(float x); -vec2 cosh(vec2 x); -vec3 cosh(vec3 x); -vec4 cosh(vec4 x); - -float tanh(float x); -vec2 tanh(vec2 x); -vec3 tanh(vec3 x); -vec4 tanh(vec4 x); - -float asinh(float x); -vec2 asinh(vec2 x); -vec3 asinh(vec3 x); -vec4 asinh(vec4 x); - -float acosh(float x); -vec2 acosh(vec2 x); -vec3 acosh(vec3 x); -vec4 acosh(vec4 x); - -float atanh(float x); -vec2 atanh(vec2 x); -vec3 atanh(vec3 x); -vec4 atanh(vec4 x); - -/* - * 8.2 - Exponential Functions - */ -float pow(float x, float y); -vec2 pow(vec2 x, vec2 y); -vec3 pow(vec3 x, vec3 y); -vec4 pow(vec4 x, vec4 y); - -float exp(float x); -vec2 exp(vec2 x); -vec3 exp(vec3 x); -vec4 exp(vec4 x); - -float log(float x); -vec2 log(vec2 x); -vec3 log(vec3 x); -vec4 log(vec4 x); - -float exp2(float x); -vec2 exp2(vec2 x); -vec3 exp2(vec3 x); -vec4 exp2(vec4 x); - -float log2(float x); -vec2 log2(vec2 x); -vec3 log2(vec3 x); -vec4 log2(vec4 x); - -float sqrt(float x); -vec2 sqrt(vec2 x); -vec3 sqrt(vec3 x); -vec4 sqrt(vec4 x); - -float inversesqrt(float x); -vec2 inversesqrt(vec2 x); -vec3 inversesqrt(vec3 x); -vec4 inversesqrt(vec4 x); - -/* - * 8.3 - Common Functions - */ -float abs(float x); -vec2 abs(vec2 x); -vec3 abs(vec3 x); -vec4 abs(vec4 x); -int abs(int x); -ivec2 abs(ivec2 x); -ivec3 abs(ivec3 x); -ivec4 abs(ivec4 x); - -float sign(float x); -vec2 sign(vec2 x); -vec3 sign(vec3 x); -vec4 sign(vec4 x); -int sign(int x); -ivec2 sign(ivec2 x); -ivec3 sign(ivec3 x); -ivec4 sign(ivec4 x); - -float floor(float x); -vec2 floor(vec2 x); -vec3 floor(vec3 x); -vec4 floor(vec4 x); - -float trunc(float x); -vec2 trunc(vec2 x); -vec3 trunc(vec3 x); -vec4 trunc(vec4 x); - -float round(float x); -vec2 round(vec2 x); -vec3 round(vec3 x); -vec4 round(vec4 x); - -float roundEven(float x); -vec2 roundEven(vec2 x); -vec3 roundEven(vec3 x); -vec4 roundEven(vec4 x); - -float ceil(float x); -vec2 ceil(vec2 x); -vec3 ceil(vec3 x); -vec4 ceil(vec4 x); - -float fract(float x); -vec2 fract(vec2 x); -vec3 fract(vec3 x); -vec4 fract(vec4 x); - -float mod(float x, float y); -vec2 mod(vec2 x, float y); -vec3 mod(vec3 x, float y); -vec4 mod(vec4 x, float y); - -vec2 mod(vec2 x, vec2 y); -vec3 mod(vec3 x, vec3 y); -vec4 mod(vec4 x, vec4 y); - -float modf(float x, out float i); -vec2 modf(vec2 x, out vec2 i); -vec3 modf(vec3 x, out vec3 i); -vec4 modf(vec4 x, out vec4 i); - -float min(float x, float y); -vec2 min(vec2 x, vec2 y); -vec3 min(vec3 x, vec3 y); -vec4 min(vec4 x, vec4 y); - -vec2 min(vec2 x, float y); -vec3 min(vec3 x, float y); -vec4 min(vec4 x, float y); - -int min(int x, int y); -ivec2 min(ivec2 x, ivec2 y); -ivec3 min(ivec3 x, ivec3 y); -ivec4 min(ivec4 x, ivec4 y); - -ivec2 min(ivec2 x, int y); -ivec3 min(ivec3 x, int y); -ivec4 min(ivec4 x, int y); - -uint min(uint x, uint y); -uvec2 min(uvec2 x, uvec2 y); -uvec3 min(uvec3 x, uvec3 y); -uvec4 min(uvec4 x, uvec4 y); - -uvec2 min(uvec2 x, uint y); -uvec3 min(uvec3 x, uint y); -uvec4 min(uvec4 x, uint y); - -float max(float x, float y); -vec2 max(vec2 x, vec2 y); -vec3 max(vec3 x, vec3 y); -vec4 max(vec4 x, vec4 y); - -vec2 max(vec2 x, float y); -vec3 max(vec3 x, float y); -vec4 max(vec4 x, float y); - -int max(int x, int y); -ivec2 max(ivec2 x, ivec2 y); -ivec3 max(ivec3 x, ivec3 y); -ivec4 max(ivec4 x, ivec4 y); - -ivec2 max(ivec2 x, int y); -ivec3 max(ivec3 x, int y); -ivec4 max(ivec4 x, int y); - -uint max(uint x, uint y); -uvec2 max(uvec2 x, uvec2 y); -uvec3 max(uvec3 x, uvec3 y); -uvec4 max(uvec4 x, uvec4 y); - -uvec2 max(uvec2 x, uint y); -uvec3 max(uvec3 x, uint y); -uvec4 max(uvec4 x, uint y); - -float clamp(float x, float minVal, float maxVal); -vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal); -vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal); -vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal); - -vec2 clamp(vec2 x, float minVal, float maxVal); -vec3 clamp(vec3 x, float minVal, float maxVal); -vec4 clamp(vec4 x, float minVal, float maxVal); - -int clamp(int x, int minVal, int maxVal); -ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal); -ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal); -ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal); - -ivec2 clamp(ivec2 x, int minVal, int maxVal); -ivec3 clamp(ivec3 x, int minVal, int maxVal); -ivec4 clamp(ivec4 x, int minVal, int maxVal); - -uint clamp(uint x, uint minVal, uint maxVal); -uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal); -uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal); -uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal); - -uvec2 clamp(uvec2 x, uint minVal, uint maxVal); -uvec3 clamp(uvec3 x, uint minVal, uint maxVal); -uvec4 clamp(uvec4 x, uint minVal, uint maxVal); - -float mix(float x, float y, float a); -vec2 mix(vec2 x, vec2 y, vec2 a); -vec3 mix(vec3 x, vec3 y, vec3 a); -vec4 mix(vec4 x, vec4 y, vec4 a); - -vec2 mix(vec2 x, vec2 y, float a); -vec3 mix(vec3 x, vec3 y, float a); -vec4 mix(vec4 x, vec4 y, float a); - -float mix(float x, float y, bool a); -vec2 mix(vec2 x, vec2 y, bvec2 a); -vec3 mix(vec3 x, vec3 y, bvec3 a); -vec4 mix(vec4 x, vec4 y, bvec4 a); - -float step(float edge, float x); -vec2 step(vec2 edge, vec2 x); -vec3 step(vec3 edge, vec3 x); -vec4 step(vec4 edge, vec4 x); - -vec2 step(float edge, vec2 x); -vec3 step(float edge, vec3 x); -vec4 step(float edge, vec4 x); - -float smoothstep(float edge0, float edge1, float x); -vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x); -vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x); -vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x); - -vec2 smoothstep(float edge0, float edge1, vec2 x); -vec3 smoothstep(float edge0, float edge1, vec3 x); -vec4 smoothstep(float edge0, float edge1, vec4 x); - -bool isnan(float x); -bvec2 isnan(vec2 x); -bvec3 isnan(vec3 x); -bvec4 isnan(vec4 x); - -bool isinf(float x); -bvec2 isinf(vec2 x); -bvec3 isinf(vec3 x); -bvec4 isinf(vec4 x); - -/* - * 8.4 - Geometric Functions - */ -float length(float x); -float length(vec2 x); -float length(vec3 x); -float length(vec4 x); - -float distance(float p0, float p1); -float distance(vec2 p0, vec2 p1); -float distance(vec3 p0, vec3 p1); -float distance(vec4 p0, vec4 p1); - -float dot(float x, float y); -float dot(vec2 x, vec2 y); -float dot(vec3 x, vec3 y); -float dot(vec4 x, vec4 y); - -vec3 cross(vec3 x, vec3 y); - -float normalize(float x); -vec2 normalize(vec2 x); -vec3 normalize(vec3 x); -vec4 normalize(vec4 x); - -float faceforward(float N, float I, float Nref); -vec2 faceforward(vec2 N, vec2 I, vec2 Nref); -vec3 faceforward(vec3 N, vec3 I, vec3 Nref); -vec4 faceforward(vec4 N, vec4 I, vec4 Nref); - -float reflect(float I, float N); -vec2 reflect(vec2 I, vec2 N); -vec3 reflect(vec3 I, vec3 N); -vec4 reflect(vec4 I, vec4 N); - -float refract(float I, float N, float eta); -vec2 refract(vec2 I, vec2 N, float eta); -vec3 refract(vec3 I, vec3 N, float eta); -vec4 refract(vec4 I, vec4 N, float eta); - - -/* - * 8.5 - Matrix Functions - */ -mat2 matrixCompMult(mat2 x, mat2 y); -mat3 matrixCompMult(mat3 x, mat3 y); -mat4 matrixCompMult(mat4 x, mat4 y); -mat2x3 matrixCompMult(mat2x3 x, mat2x3 y); -mat2x4 matrixCompMult(mat2x4 x, mat2x4 y); -mat3x2 matrixCompMult(mat3x2 x, mat3x2 y); -mat3x4 matrixCompMult(mat3x4 x, mat3x4 y); -mat4x2 matrixCompMult(mat4x2 x, mat4x2 y); -mat4x3 matrixCompMult(mat4x3 x, mat4x3 y); - -mat2 outerProduct(vec2 c, vec2 r); -mat3 outerProduct(vec3 c, vec3 r); -mat4 outerProduct(vec4 c, vec4 r); - -mat2x3 outerProduct(vec3 c, vec2 r); -mat3x2 outerProduct(vec2 c, vec3 r); - -mat2x4 outerProduct(vec4 c, vec2 r); -mat4x2 outerProduct(vec2 c, vec4 r); - -mat3x4 outerProduct(vec4 c, vec3 r); -mat4x3 outerProduct(vec3 c, vec4 r); - -mat2 transpose(mat2 m); -mat3 transpose(mat3 m); -mat4 transpose(mat4 m); - -mat2x3 transpose(mat3x2 m); -mat3x2 transpose(mat2x3 m); - -mat2x4 transpose(mat4x2 m); -mat4x2 transpose(mat2x4 m); - -mat3x4 transpose(mat4x3 m); -mat4x3 transpose(mat3x4 m); - -mat2 inverse(mat2 m); -mat3 inverse(mat3 m); -mat4 inverse(mat4 m); - -/* - * 8.6 - Vector Relational Functions - */ -bvec2 lessThan( vec2 x, vec2 y); -bvec3 lessThan( vec3 x, vec3 y); -bvec4 lessThan( vec4 x, vec4 y); -bvec2 lessThan(ivec2 x, ivec2 y); -bvec3 lessThan(ivec3 x, ivec3 y); -bvec4 lessThan(ivec4 x, ivec4 y); -bvec2 lessThan(uvec2 x, uvec2 y); -bvec3 lessThan(uvec3 x, uvec3 y); -bvec4 lessThan(uvec4 x, uvec4 y); - -bvec2 lessThanEqual( vec2 x, vec2 y); -bvec3 lessThanEqual( vec3 x, vec3 y); -bvec4 lessThanEqual( vec4 x, vec4 y); -bvec2 lessThanEqual(ivec2 x, ivec2 y); -bvec3 lessThanEqual(ivec3 x, ivec3 y); -bvec4 lessThanEqual(ivec4 x, ivec4 y); -bvec2 lessThanEqual(uvec2 x, uvec2 y); -bvec3 lessThanEqual(uvec3 x, uvec3 y); -bvec4 lessThanEqual(uvec4 x, uvec4 y); - -bvec2 greaterThan( vec2 x, vec2 y); -bvec3 greaterThan( vec3 x, vec3 y); -bvec4 greaterThan( vec4 x, vec4 y); -bvec2 greaterThan(ivec2 x, ivec2 y); -bvec3 greaterThan(ivec3 x, ivec3 y); -bvec4 greaterThan(ivec4 x, ivec4 y); -bvec2 greaterThan(uvec2 x, uvec2 y); -bvec3 greaterThan(uvec3 x, uvec3 y); -bvec4 greaterThan(uvec4 x, uvec4 y); - -bvec2 greaterThanEqual( vec2 x, vec2 y); -bvec3 greaterThanEqual( vec3 x, vec3 y); -bvec4 greaterThanEqual( vec4 x, vec4 y); -bvec2 greaterThanEqual(ivec2 x, ivec2 y); -bvec3 greaterThanEqual(ivec3 x, ivec3 y); -bvec4 greaterThanEqual(ivec4 x, ivec4 y); -bvec2 greaterThanEqual(uvec2 x, uvec2 y); -bvec3 greaterThanEqual(uvec3 x, uvec3 y); -bvec4 greaterThanEqual(uvec4 x, uvec4 y); - -bvec2 equal( vec2 x, vec2 y); -bvec3 equal( vec3 x, vec3 y); -bvec4 equal( vec4 x, vec4 y); -bvec2 equal(ivec2 x, ivec2 y); -bvec3 equal(ivec3 x, ivec3 y); -bvec4 equal(ivec4 x, ivec4 y); -bvec2 equal(uvec2 x, uvec2 y); -bvec3 equal(uvec3 x, uvec3 y); -bvec4 equal(uvec4 x, uvec4 y); -bvec2 equal(bvec2 x, bvec2 y); -bvec3 equal(bvec3 x, bvec3 y); -bvec4 equal(bvec4 x, bvec4 y); - -bvec2 notEqual( vec2 x, vec2 y); -bvec3 notEqual( vec3 x, vec3 y); -bvec4 notEqual( vec4 x, vec4 y); -bvec2 notEqual(ivec2 x, ivec2 y); -bvec3 notEqual(ivec3 x, ivec3 y); -bvec4 notEqual(ivec4 x, ivec4 y); -bvec2 notEqual(uvec2 x, uvec2 y); -bvec3 notEqual(uvec3 x, uvec3 y); -bvec4 notEqual(uvec4 x, uvec4 y); -bvec2 notEqual(bvec2 x, bvec2 y); -bvec3 notEqual(bvec3 x, bvec3 y); -bvec4 notEqual(bvec4 x, bvec4 y); - -bool any(bvec2 x); -bool any(bvec3 x); -bool any(bvec4 x); - -bool all(bvec2 x); -bool all(bvec3 x); -bool all(bvec4 x); - -bvec2 not(bvec2 x); -bvec3 not(bvec3 x); -bvec4 not(bvec4 x); - -/* - * 8.7 - Texture Lookup Functions - */ - -/* textureSize */ -int textureSize( sampler1D sampler, int lod); -int textureSize(isampler1D sampler, int lod); -int textureSize(usampler1D sampler, int lod); - -ivec2 textureSize( sampler2D sampler, int lod); -ivec2 textureSize(isampler2D sampler, int lod); -ivec2 textureSize(usampler2D sampler, int lod); - -ivec3 textureSize( sampler3D sampler, int lod); -ivec3 textureSize(isampler3D sampler, int lod); -ivec3 textureSize(usampler3D sampler, int lod); - -ivec2 textureSize( samplerCube sampler, int lod); -ivec2 textureSize(isamplerCube sampler, int lod); -ivec2 textureSize(usamplerCube sampler, int lod); - -int textureSize(sampler1DShadow sampler, int lod); -ivec2 textureSize(sampler2DShadow sampler, int lod); -ivec2 textureSize(samplerCubeShadow sampler, int lod); - -ivec2 textureSize( sampler1DArray sampler, int lod); -ivec2 textureSize(isampler1DArray sampler, int lod); -ivec2 textureSize(usampler1DArray sampler, int lod); -ivec3 textureSize( sampler2DArray sampler, int lod); -ivec3 textureSize(isampler2DArray sampler, int lod); -ivec3 textureSize(usampler2DArray sampler, int lod); - -ivec2 textureSize(sampler1DArrayShadow sampler, int lod); -ivec3 textureSize(sampler2DArrayShadow sampler, int lod); - -ivec2 textureSize(sampler2DRect sampler); -ivec2 textureSize(isampler2DRect sampler); -ivec2 textureSize(usampler2DRect sampler); -ivec2 textureSize(sampler2DRectShadow sampler); - -int textureSize( samplerBuffer sampler); -int textureSize(isamplerBuffer sampler); -int textureSize(usamplerBuffer sampler); - -/* texture - no bias */ - vec4 texture( sampler1D sampler, float P); -ivec4 texture(isampler1D sampler, float P); -uvec4 texture(usampler1D sampler, float P); - - vec4 texture( sampler2D sampler, vec2 P); -ivec4 texture(isampler2D sampler, vec2 P); -uvec4 texture(usampler2D sampler, vec2 P); - - vec4 texture( sampler3D sampler, vec3 P); -ivec4 texture(isampler3D sampler, vec3 P); -uvec4 texture(usampler3D sampler, vec3 P); - - vec4 texture( samplerCube sampler, vec3 P); -ivec4 texture(isamplerCube sampler, vec3 P); -uvec4 texture(usamplerCube sampler, vec3 P); - -float texture(sampler1DShadow sampler, vec3 P); -float texture(sampler2DShadow sampler, vec3 P); -float texture(samplerCubeShadow sampler, vec4 P); - - vec4 texture( sampler1DArray sampler, vec2 P); -ivec4 texture(isampler1DArray sampler, vec2 P); -uvec4 texture(usampler1DArray sampler, vec2 P); - - vec4 texture( sampler2DArray sampler, vec3 P); -ivec4 texture(isampler2DArray sampler, vec3 P); -uvec4 texture(usampler2DArray sampler, vec3 P); - -float texture(sampler1DArrayShadow sampler, vec3 P); -float texture(sampler2DArrayShadow sampler, vec4 P); - - vec4 texture( sampler2DRect sampler, vec2 P); -ivec4 texture(isampler2DRect sampler, vec2 P); -uvec4 texture(usampler2DRect sampler, vec2 P); - -float texture(sampler2DRectShadow sampler, vec3 P); - -/* textureProj - no bias */ - vec4 textureProj( sampler1D sampler, vec2 P); -ivec4 textureProj(isampler1D sampler, vec2 P); -uvec4 textureProj(usampler1D sampler, vec2 P); - vec4 textureProj( sampler1D sampler, vec4 P); -ivec4 textureProj(isampler1D sampler, vec4 P); -uvec4 textureProj(usampler1D sampler, vec4 P); - - vec4 textureProj( sampler2D sampler, vec3 P); -ivec4 textureProj(isampler2D sampler, vec3 P); -uvec4 textureProj(usampler2D sampler, vec3 P); - vec4 textureProj( sampler2D sampler, vec4 P); -ivec4 textureProj(isampler2D sampler, vec4 P); -uvec4 textureProj(usampler2D sampler, vec4 P); - - vec4 textureProj( sampler3D sampler, vec4 P); -ivec4 textureProj(isampler3D sampler, vec4 P); -uvec4 textureProj(usampler3D sampler, vec4 P); - -float textureProj(sampler1DShadow sampler, vec4 P); -float textureProj(sampler2DShadow sampler, vec4 P); - - vec4 textureProj( sampler2DRect sampler, vec3 P); -ivec4 textureProj(isampler2DRect sampler, vec3 P); -uvec4 textureProj(usampler2DRect sampler, vec3 P); - vec4 textureProj( sampler2DRect sampler, vec4 P); -ivec4 textureProj(isampler2DRect sampler, vec4 P); -uvec4 textureProj(usampler2DRect sampler, vec4 P); - -float textureProj(sampler2DRectShadow sampler, vec4 P); - -/* textureLod */ - vec4 textureLod( sampler1D sampler, float P, float lod); -ivec4 textureLod(isampler1D sampler, float P, float lod); -uvec4 textureLod(usampler1D sampler, float P, float lod); - - vec4 textureLod( sampler2D sampler, vec2 P, float lod); -ivec4 textureLod(isampler2D sampler, vec2 P, float lod); -uvec4 textureLod(usampler2D sampler, vec2 P, float lod); - - vec4 textureLod( sampler3D sampler, vec3 P, float lod); -ivec4 textureLod(isampler3D sampler, vec3 P, float lod); -uvec4 textureLod(usampler3D sampler, vec3 P, float lod); - - vec4 textureLod( samplerCube sampler, vec3 P, float lod); -ivec4 textureLod(isamplerCube sampler, vec3 P, float lod); -uvec4 textureLod(usamplerCube sampler, vec3 P, float lod); - -float textureLod(sampler1DShadow sampler, vec3 P, float lod); -float textureLod(sampler2DShadow sampler, vec3 P, float lod); - - vec4 textureLod( sampler1DArray sampler, vec2 P, float lod); -ivec4 textureLod(isampler1DArray sampler, vec2 P, float lod); -uvec4 textureLod(usampler1DArray sampler, vec2 P, float lod); - - vec4 textureLod( sampler2DArray sampler, vec3 P, float lod); -ivec4 textureLod(isampler2DArray sampler, vec3 P, float lod); -uvec4 textureLod(usampler2DArray sampler, vec3 P, float lod); - -float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod); - -/* textureOffset - no bias */ - vec4 textureOffset( sampler1D sampler, float P, int offset); -ivec4 textureOffset(isampler1D sampler, float P, int offset); -uvec4 textureOffset(usampler1D sampler, float P, int offset); - - vec4 textureOffset( sampler2D sampler, vec2 P, ivec2 offset); -ivec4 textureOffset(isampler2D sampler, vec2 P, ivec2 offset); -uvec4 textureOffset(usampler2D sampler, vec2 P, ivec2 offset); - - vec4 textureOffset( sampler3D sampler, vec3 P, ivec3 offset); -ivec4 textureOffset(isampler3D sampler, vec3 P, ivec3 offset); -uvec4 textureOffset(usampler3D sampler, vec3 P, ivec3 offset); - - vec4 textureOffset( sampler2DRect sampler, vec2 P, ivec2 offset); -ivec4 textureOffset(isampler2DRect sampler, vec2 P, ivec2 offset); -uvec4 textureOffset(usampler2DRect sampler, vec2 P, ivec2 offset); - -float textureOffset(sampler2DRectShadow sampler, vec3 P, ivec2 offset); - -float textureOffset(sampler1DShadow sampler, vec3 P, int offset); -float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset); - - vec4 textureOffset( sampler1DArray sampler, vec2 P, int offset); -ivec4 textureOffset(isampler1DArray sampler, vec2 P, int offset); -uvec4 textureOffset(usampler1DArray sampler, vec2 P, int offset); - - vec4 textureOffset( sampler2DArray sampler, vec3 P, ivec2 offset); -ivec4 textureOffset(isampler2DArray sampler, vec3 P, ivec2 offset); -uvec4 textureOffset(usampler2DArray sampler, vec3 P, ivec2 offset); - -float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset); - -/* texelFetch */ - vec4 texelFetch( sampler1D sampler, int P, int lod); -ivec4 texelFetch(isampler1D sampler, int P, int lod); -uvec4 texelFetch(usampler1D sampler, int P, int lod); - - vec4 texelFetch( sampler2D sampler, ivec2 P, int lod); -ivec4 texelFetch(isampler2D sampler, ivec2 P, int lod); -uvec4 texelFetch(usampler2D sampler, ivec2 P, int lod); - - vec4 texelFetch( sampler3D sampler, ivec3 P, int lod); -ivec4 texelFetch(isampler3D sampler, ivec3 P, int lod); -uvec4 texelFetch(usampler3D sampler, ivec3 P, int lod); - - vec4 texelFetch( sampler2DRect sampler, ivec2 P); -ivec4 texelFetch(isampler2DRect sampler, ivec2 P); -uvec4 texelFetch(usampler2DRect sampler, ivec2 P); - - vec4 texelFetch( sampler1DArray sampler, ivec2 P, int lod); -ivec4 texelFetch(isampler1DArray sampler, ivec2 P, int lod); -uvec4 texelFetch(usampler1DArray sampler, ivec2 P, int lod); - - vec4 texelFetch( sampler2DArray sampler, ivec3 P, int lod); -ivec4 texelFetch(isampler2DArray sampler, ivec3 P, int lod); -uvec4 texelFetch(usampler2DArray sampler, ivec3 P, int lod); - - vec4 texelFetch( samplerBuffer sampler, int P); -ivec4 texelFetch(isamplerBuffer sampler, int P); -uvec4 texelFetch(usamplerBuffer sampler, int P); - -/* texelFetchOffset */ - vec4 texelFetchOffset( sampler1D sampler, int P, int lod, int offset); -ivec4 texelFetchOffset(isampler1D sampler, int P, int lod, int offset); -uvec4 texelFetchOffset(usampler1D sampler, int P, int lod, int offset); - - vec4 texelFetchOffset( sampler2D sampler, ivec2 P, int lod, ivec2 offset); -ivec4 texelFetchOffset(isampler2D sampler, ivec2 P, int lod, ivec2 offset); -uvec4 texelFetchOffset(usampler2D sampler, ivec2 P, int lod, ivec2 offset); - - vec4 texelFetchOffset( sampler3D sampler, ivec3 P, int lod, ivec3 offset); -ivec4 texelFetchOffset(isampler3D sampler, ivec3 P, int lod, ivec3 offset); -uvec4 texelFetchOffset(usampler3D sampler, ivec3 P, int lod, ivec3 offset); - - vec4 texelFetchOffset( sampler2DRect sampler, ivec2 P, ivec2 offset); -ivec4 texelFetchOffset(isampler2DRect sampler, ivec2 P, ivec2 offset); -uvec4 texelFetchOffset(usampler2DRect sampler, ivec2 P, ivec2 offset); - - vec4 texelFetchOffset( sampler1DArray sampler, ivec2 P, int lod, int offset); -ivec4 texelFetchOffset(isampler1DArray sampler, ivec2 P, int lod, int offset); -uvec4 texelFetchOffset(usampler1DArray sampler, ivec2 P, int lod, int offset); - - vec4 texelFetchOffset( sampler2DArray sampler, ivec3 P, int lod, ivec2 offset); -ivec4 texelFetchOffset(isampler2DArray sampler, ivec3 P, int lod, ivec2 offset); -uvec4 texelFetchOffset(usampler2DArray sampler, ivec3 P, int lod, ivec2 offset); - -/* textureProjOffset - no bias */ - vec4 textureProjOffset( sampler1D sampler, vec2 P, int offset); -ivec4 textureProjOffset(isampler1D sampler, vec2 P, int offset); -uvec4 textureProjOffset(usampler1D sampler, vec2 P, int offset); - vec4 textureProjOffset( sampler1D sampler, vec4 P, int offset); -ivec4 textureProjOffset(isampler1D sampler, vec4 P, int offset); -uvec4 textureProjOffset(usampler1D sampler, vec4 P, int offset); - - vec4 textureProjOffset( sampler2D sampler, vec3 P, ivec2 offset); -ivec4 textureProjOffset(isampler2D sampler, vec3 P, ivec2 offset); -uvec4 textureProjOffset(usampler2D sampler, vec3 P, ivec2 offset); - vec4 textureProjOffset( sampler2D sampler, vec4 P, ivec2 offset); -ivec4 textureProjOffset(isampler2D sampler, vec4 P, ivec2 offset); -uvec4 textureProjOffset(usampler2D sampler, vec4 P, ivec2 offset); - - vec4 textureProjOffset( sampler3D sampler, vec4 P, ivec3 offset); -ivec4 textureProjOffset(isampler3D sampler, vec4 P, ivec3 offset); -uvec4 textureProjOffset(usampler3D sampler, vec4 P, ivec3 offset); - - vec4 textureProjOffset( sampler2DRect sampler, vec3 P, ivec2 offset); -ivec4 textureProjOffset(isampler2DRect sampler, vec3 P, ivec2 offset); -uvec4 textureProjOffset(usampler2DRect sampler, vec3 P, ivec2 offset); - vec4 textureProjOffset( sampler2DRect sampler, vec4 P, ivec2 offset); -ivec4 textureProjOffset(isampler2DRect sampler, vec4 P, ivec2 offset); -uvec4 textureProjOffset(usampler2DRect sampler, vec4 P, ivec2 offset); - -float textureProjOffset(sampler2DRectShadow sampler, vec4 P, ivec2 offset); - -float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset); -float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset); - -/* textureLodOffset */ - vec4 textureLodOffset( sampler1D sampler, float P, float lod, int offset); -ivec4 textureLodOffset(isampler1D sampler, float P, float lod, int offset); -uvec4 textureLodOffset(usampler1D sampler, float P, float lod, int offset); - - vec4 textureLodOffset( sampler2D sampler, vec2 P, float lod, ivec2 offset); -ivec4 textureLodOffset(isampler2D sampler, vec2 P, float lod, ivec2 offset); -uvec4 textureLodOffset(usampler2D sampler, vec2 P, float lod, ivec2 offset); - - vec4 textureLodOffset( sampler3D sampler, vec3 P, float lod, ivec3 offset); -ivec4 textureLodOffset(isampler3D sampler, vec3 P, float lod, ivec3 offset); -uvec4 textureLodOffset(usampler3D sampler, vec3 P, float lod, ivec3 offset); - -float textureLodOffset(sampler1DShadow samp, vec3 P, float lod, int offset); -float textureLodOffset(sampler2DShadow samp, vec3 P, float lod, ivec2 offset); - - vec4 textureLodOffset( sampler1DArray sampler, vec2 P, float lod, int offset); -ivec4 textureLodOffset(isampler1DArray sampler, vec2 P, float lod, int offset); -uvec4 textureLodOffset(usampler1DArray sampler, vec2 P, float lod, int offset); - - vec4 textureLodOffset( sampler2DArray samp, vec3 P, float lod, ivec2 offset); -ivec4 textureLodOffset(isampler2DArray samp, vec3 P, float lod, ivec2 offset); -uvec4 textureLodOffset(usampler2DArray samp, vec3 P, float lod, ivec2 offset); - -float textureLodOffset(sampler1DArrayShadow s, vec3 P, float lod, int offset); - -/* textureProjLod */ - vec4 textureProjLod( sampler1D sampler, vec2 P, float lod); -ivec4 textureProjLod(isampler1D sampler, vec2 P, float lod); -uvec4 textureProjLod(usampler1D sampler, vec2 P, float lod); - vec4 textureProjLod( sampler1D sampler, vec4 P, float lod); -ivec4 textureProjLod(isampler1D sampler, vec4 P, float lod); -uvec4 textureProjLod(usampler1D sampler, vec4 P, float lod); - - vec4 textureProjLod( sampler2D sampler, vec3 P, float lod); -ivec4 textureProjLod(isampler2D sampler, vec3 P, float lod); -uvec4 textureProjLod(usampler2D sampler, vec3 P, float lod); - vec4 textureProjLod( sampler2D sampler, vec4 P, float lod); -ivec4 textureProjLod(isampler2D sampler, vec4 P, float lod); -uvec4 textureProjLod(usampler2D sampler, vec4 P, float lod); - - vec4 textureProjLod( sampler3D sampler, vec4 P, float lod); -ivec4 textureProjLod(isampler3D sampler, vec4 P, float lod); -uvec4 textureProjLod(usampler3D sampler, vec4 P, float lod); - -float textureProjLod(sampler1DShadow sampler, vec4 P, float lod); -float textureProjLod(sampler2DShadow sampler, vec4 P, float lod); - -/* textureProjLodOffset */ - vec4 textureProjLodOffset( sampler1D sampler, vec2 P, float lod, int offset); -ivec4 textureProjLodOffset(isampler1D sampler, vec2 P, float lod, int offset); -uvec4 textureProjLodOffset(usampler1D sampler, vec2 P, float lod, int offset); - vec4 textureProjLodOffset( sampler1D sampler, vec4 P, float lod, int offset); -ivec4 textureProjLodOffset(isampler1D sampler, vec4 P, float lod, int offset); -uvec4 textureProjLodOffset(usampler1D sampler, vec4 P, float lod, int offset); - - vec4 textureProjLodOffset( sampler2D sampler, vec3 P, float lod, ivec2 offset); -ivec4 textureProjLodOffset(isampler2D sampler, vec3 P, float lod, ivec2 offset); -uvec4 textureProjLodOffset(usampler2D sampler, vec3 P, float lod, ivec2 offset); - vec4 textureProjLodOffset( sampler2D sampler, vec4 P, float lod, ivec2 offset); -ivec4 textureProjLodOffset(isampler2D sampler, vec4 P, float lod, ivec2 offset); -uvec4 textureProjLodOffset(usampler2D sampler, vec4 P, float lod, ivec2 offset); - - vec4 textureProjLodOffset( sampler3D sampler, vec4 P, float lod, ivec3 offset); -ivec4 textureProjLodOffset(isampler3D sampler, vec4 P, float lod, ivec3 offset); -uvec4 textureProjLodOffset(usampler3D sampler, vec4 P, float lod, ivec3 offset); - -float textureProjLodOffset(sampler1DShadow s, vec4 P, float lod, int offset); -float textureProjLodOffset(sampler2DShadow s, vec4 P, float lod, ivec2 offset); - -/* textureGrad */ - vec4 textureGrad( sampler1D sampler, float P, float dPdx, float dPdy); -ivec4 textureGrad(isampler1D sampler, float P, float dPdx, float dPdy); -uvec4 textureGrad(usampler1D sampler, float P, float dPdx, float dPdy); - - vec4 textureGrad( sampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); -ivec4 textureGrad(isampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); -uvec4 textureGrad(usampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy); - - vec4 textureGrad( sampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); -ivec4 textureGrad(isampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); -uvec4 textureGrad(usampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy); - - vec4 textureGrad( samplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); -ivec4 textureGrad(isamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); -uvec4 textureGrad(usamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy); - - vec4 textureGrad( sampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy); -ivec4 textureGrad(isampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy); -uvec4 textureGrad(usampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy); - -float textureGrad(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); - -float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy); -float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy); -float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy); - - vec4 textureGrad( sampler1DArray sampler, vec2 P, float dPdx, float dPdy); -ivec4 textureGrad(isampler1DArray sampler, vec2 P, float dPdx, float dPdy); -uvec4 textureGrad(usampler1DArray sampler, vec2 P, float dPdx, float dPdy); - - vec4 textureGrad( sampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); -ivec4 textureGrad(isampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); -uvec4 textureGrad(usampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy); - -float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy); -float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); - -/* textureGradOffset */ - vec4 textureGradOffset( sampler1D s, float P, float dx, float dy, int off); -ivec4 textureGradOffset(isampler1D s, float P, float dx, float dy, int offset); -uvec4 textureGradOffset(usampler1D s, float P, float dx, float dy, int offset); - - vec4 textureGradOffset( sampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); -ivec4 textureGradOffset(isampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); -uvec4 textureGradOffset(usampler2D s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); - - vec4 textureGradOffset( sampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); -ivec4 textureGradOffset(isampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); -uvec4 textureGradOffset(usampler3D s, vec3 P, vec3 dx, vec3 dy, ivec3 offset); - - vec4 textureGradOffset( sampler2DRect s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); -ivec4 textureGradOffset(isampler2DRect s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); -uvec4 textureGradOffset(usampler2DRect s, vec2 P, vec2 dx, vec2 dy, ivec2 offset); - -float textureGradOffset(sampler2DRectShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - -float textureGradOffset(sampler1DShadow s, vec3 P, float dx, float dy, int off); -float textureGradOffset(sampler2DShadow s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - - vec4 textureGradOffset( sampler1DArray s, vec2 P, float dx, float dy, int off); -ivec4 textureGradOffset(isampler1DArray s, vec2 P, float dx, float dy, int off); -uvec4 textureGradOffset(usampler1DArray s, vec2 P, float dx, float dy, int off); - - vec4 textureGradOffset( sampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureGradOffset(isampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureGradOffset(usampler2DArray s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - -float textureGradOffset(sampler1DArrayShadow s, vec3 P, float dx, float dy, int o); -float textureGradOffset(sampler2DArrayShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); - -/* textureProjGrad */ - vec4 textureProjGrad( sampler1D sampler, vec2 P, float dPdx, float dPdy); -ivec4 textureProjGrad(isampler1D sampler, vec2 P, float dPdx, float dPdy); -uvec4 textureProjGrad(usampler1D sampler, vec2 P, float dPdx, float dPdy); - vec4 textureProjGrad( sampler1D sampler, vec4 P, float dPdx, float dPdy); -ivec4 textureProjGrad(isampler1D sampler, vec4 P, float dPdx, float dPdy); -uvec4 textureProjGrad(usampler1D sampler, vec4 P, float dPdx, float dPdy); - - vec4 textureProjGrad( sampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); -ivec4 textureProjGrad(isampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); -uvec4 textureProjGrad(usampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy); - vec4 textureProjGrad( sampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); -ivec4 textureProjGrad(isampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); -uvec4 textureProjGrad(usampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy); - - vec4 textureProjGrad( sampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); -ivec4 textureProjGrad(isampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); -uvec4 textureProjGrad(usampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy); - - vec4 textureProjGrad( sampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy); -ivec4 textureProjGrad(isampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy); -uvec4 textureProjGrad(usampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy); - vec4 textureProjGrad( sampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy); -ivec4 textureProjGrad(isampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy); -uvec4 textureProjGrad(usampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy); - -float textureProjGrad(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); - -float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy); -float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy); - -/* textureProjGradOffset */ - vec4 textureProjGradOffset( sampler1D s, vec2 P, float dx, float dy, int off); -ivec4 textureProjGradOffset(isampler1D s, vec2 P, float dx, float dy, int off); -uvec4 textureProjGradOffset(usampler1D s, vec2 P, float dx, float dy, int off); - vec4 textureProjGradOffset( sampler1D s, vec4 P, float dx, float dy, int off); -ivec4 textureProjGradOffset(isampler1D s, vec4 P, float dx, float dy, int off); -uvec4 textureProjGradOffset(usampler1D s, vec4 P, float dx, float dy, int off); - - vec4 textureProjGradOffset( sampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureProjGradOffset(isampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureProjGradOffset(usampler2D s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - vec4 textureProjGradOffset( sampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureProjGradOffset(isampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureProjGradOffset(usampler2D s, vec4 P, vec2 dx, vec2 dy, ivec2 off); - - vec4 textureProjGradOffset( sampler2DRect s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureProjGradOffset(isampler2DRect s, vec3 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureProjGradOffset(usampler2DRect s, vec3 P, vec2 dx, vec2 dy, ivec2 off); - vec4 textureProjGradOffset( sampler2DRect s, vec4 P, vec2 dx, vec2 dy, ivec2 off); -ivec4 textureProjGradOffset(isampler2DRect s, vec4 P, vec2 dx, vec2 dy, ivec2 off); -uvec4 textureProjGradOffset(usampler2DRect s, vec4 P, vec2 dx, vec2 dy, ivec2 off); - -float textureProjGradOffset(sampler2DRectShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); - - vec4 textureProjGradOffset( sampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); -ivec4 textureProjGradOffset(isampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); -uvec4 textureProjGradOffset(usampler3D s, vec4 P, vec3 dx, vec3 dy, ivec3 off); - -float textureProjGradOffset(sampler1DShadow s, vec4 P, float dx, float dy, int o); -float textureProjGradOffset(sampler2DShadow s, vec4 P, vec2 dx, vec2 dy, ivec2 o); - -/* - * The following texture functions are deprecated: - */ -vec4 texture1D (sampler1D sampler, float coord); -vec4 texture1DProj (sampler1D sampler, vec2 coord); -vec4 texture1DProj (sampler1D sampler, vec4 coord); -vec4 texture1DLod (sampler1D sampler, float coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); - -vec4 texture2D (sampler2D sampler, vec2 coord); -vec4 texture2DProj (sampler2D sampler, vec3 coord); -vec4 texture2DProj (sampler2D sampler, vec4 coord); -vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); - -vec4 texture3D (sampler3D sampler, vec3 coord); -vec4 texture3DProj (sampler3D sampler, vec4 coord); -vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); -vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); - -vec4 textureCube (samplerCube sampler, vec3 coord); -vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); - -vec4 shadow1D (sampler1DShadow sampler, vec3 coord); -vec4 shadow2D (sampler2DShadow sampler, vec3 coord); -vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord); -vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord); -vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); -vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); -vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); - -/* - * 8.9 - Noise Functions - */ -float noise1(float x); -float noise1(vec2 x); -float noise1(vec3 x); -float noise1(vec4 x); - -vec2 noise2(float x); -vec2 noise2(vec2 x); -vec2 noise2(vec3 x); -vec2 noise2(vec4 x); - -vec3 noise3(float x); -vec3 noise3(vec2 x); -vec3 noise3(vec3 x); -vec3 noise3(vec4 x); - -vec4 noise4(float x); -vec4 noise4(vec2 x); -vec4 noise4(vec3 x); -vec4 noise4(vec4 x); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_bit_encoding.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_bit_encoding.glsl deleted file mode 100644 index e03459401..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_bit_encoding.glsl +++ /dev/null @@ -1,22 +0,0 @@ -#version 130 -#extension GL_ARB_shader_bit_encoding : enable - -int floatBitsToInt(float value); -ivec2 floatBitsToInt(vec2 value); -ivec3 floatBitsToInt(vec3 value); -ivec4 floatBitsToInt(vec4 value); - -uint floatBitsToUint(float value); -uvec2 floatBitsToUint(vec2 value); -uvec3 floatBitsToUint(vec3 value); -uvec4 floatBitsToUint(vec4 value); - -float intBitsToFloat(int value); -vec2 intBitsToFloat(ivec2 value); -vec3 intBitsToFloat(ivec3 value); -vec4 intBitsToFloat(ivec4 value); - -float uintBitsToFloat(uint value); -vec2 uintBitsToFloat(uvec2 value); -vec3 uintBitsToFloat(uvec3 value); -vec4 uintBitsToFloat(uvec4 value); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag deleted file mode 100644 index 26e84d0f5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_texture_lod.frag +++ /dev/null @@ -1,17 +0,0 @@ -/* - * The existing isotropic vertex texture functions are added to the - * built-in functions for fragment shaders. - */ -vec4 texture1DLod (sampler1D sampler, float coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod); -vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod); -vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod); -vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); -vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod); -vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod); -vec4 shadow1DLod (sampler1DShadow sampler, vec3 coord, float lod); -vec4 shadow2DLod (sampler2DShadow sampler, vec3 coord, float lod); -vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod); -vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_texture_lod.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_texture_lod.glsl deleted file mode 100644 index edfed26fc..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_shader_texture_lod.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/* New anisotropic texture functions, providing explicit derivatives: */ -vec4 texture1DGradARB (sampler1D sampler, - float P, float dPdx, float dPdy); -vec4 texture1DProjGradARB (sampler1D sampler, - vec2 P, float dPdx, float dPdy); -vec4 texture1DProjGradARB (sampler1D sampler, - vec4 P, float dPdx, float dPdy); - -vec4 texture2DGradARB (sampler2D sampler, - vec2 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DProjGradARB (sampler2D sampler, - vec3 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DProjGradARB (sampler2D sampler, - vec4 P, vec2 dPdx, vec2 dPdy); - -vec4 texture3DGradARB (sampler3D sampler, - vec3 P, vec3 dPdx, vec3 dPdy); -vec4 texture3DProjGradARB (sampler3D sampler, - vec4 P, vec3 dPdx, vec3 dPdy); - -vec4 textureCubeGradARB (samplerCube sampler, - vec3 P, vec3 dPdx, vec3 dPdy); - -vec4 shadow1DGradARB (sampler1DShadow sampler, - vec3 P, float dPdx, float dPdy); -vec4 shadow1DProjGradARB (sampler1DShadow sampler, - vec4 P, float dPdx, float dPdy); - -vec4 shadow2DGradARB (sampler2DShadow sampler, - vec3 P, vec2 dPdx, vec2 dPdy); -vec4 shadow2DProjGradARB (sampler2DShadow sampler, - vec4 P, vec2 dPdx, vec2 dPdy); - -#ifdef GL_ARB_texture_rectangle -vec4 texture2DRectGradARB (sampler2DRect sampler, - vec2 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DRectProjGradARB(sampler2DRect sampler, - vec3 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DRectProjGradARB(sampler2DRect sampler, - vec4 P, vec2 dPdx, vec2 dPdy); - -vec4 shadow2DRectGradARB (sampler2DRectShadow sampler, - vec3 P, vec2 dPdx, vec2 dPdy); -vec4 shadow2DRectProjGradARB (sampler2DRectShadow sampler, - vec4 P, vec2 dPdx, vec2 dPdy); -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_texture_rectangle.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_texture_rectangle.glsl deleted file mode 100644 index 8938aa3e9..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/ARB_texture_rectangle.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#extension GL_ARB_texture_rectangle : enable -vec4 texture2DRect(sampler2DRect sampler, vec2 coord); -vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord); -vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord); - -vec4 shadow2DRect(sampler2DRectShadow sampler, vec3 coord); -vec4 shadow2DRectProj(sampler2DRectShadow sampler, vec4 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shader_texture_lod.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shader_texture_lod.frag deleted file mode 100644 index 689d713c3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shader_texture_lod.frag +++ /dev/null @@ -1,19 +0,0 @@ -/* - * The existing isotropic vertex texture functions are added to the - * built-in functions for fragment shaders. - */ -vec4 texture2DLodEXT (sampler2D sampler, vec2 coord, float lod); -vec4 texture2DProjLodEXT(sampler2D sampler, vec3 coord, float lod); -vec4 texture2DProjLodEXT(sampler2D sampler, vec4 coord, float lod); -vec4 textureCubeLodEXT (samplerCube sampler, vec3 coord, float lod); - -/* New anisotropic texture functions, providing explicit derivatives: */ -vec4 texture2DGradEXT (sampler2D sampler, - vec2 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DProjGradEXT (sampler2D sampler, - vec3 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DProjGradEXT (sampler2D sampler, - vec4 P, vec2 dPdx, vec2 dPdy); - -vec4 textureCubeGradEXT (samplerCube sampler, - vec3 P, vec3 dPdx, vec3 dPdy); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shader_texture_lod.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shader_texture_lod.vert deleted file mode 100644 index 5d2d20b29..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shader_texture_lod.vert +++ /dev/null @@ -1,10 +0,0 @@ -/* New anisotropic texture functions, providing explicit derivatives: */ -vec4 texture2DGradEXT (sampler2D sampler, - vec2 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DProjGradEXT (sampler2D sampler, - vec3 P, vec2 dPdx, vec2 dPdy); -vec4 texture2DProjGradEXT (sampler2D sampler, - vec4 P, vec2 dPdx, vec2 dPdy); - -vec4 textureCubeGradEXT (samplerCube sampler, - vec3 P, vec3 dPdx, vec3 dPdy); \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shadow_samplers.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shadow_samplers.frag deleted file mode 100644 index 61ee421d1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shadow_samplers.frag +++ /dev/null @@ -1,2 +0,0 @@ -float shadow2DEXT (sampler2DShadow sampler, vec3 coord); -float shadow2DProjEXT (sampler2DShadow sampler, vec4 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shadow_samplers.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shadow_samplers.vert deleted file mode 100644 index 61ee421d1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_shadow_samplers.vert +++ /dev/null @@ -1,2 +0,0 @@ -float shadow2DEXT (sampler2DShadow sampler, vec3 coord); -float shadow2DProjEXT (sampler2DShadow sampler, vec4 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_texture_array.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_texture_array.frag deleted file mode 100644 index d0ce981dd..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_texture_array.frag +++ /dev/null @@ -1,11 +0,0 @@ -#extension GL_EXT_texture_array : enable -vec4 texture1DArray(sampler1DArray sampler, vec2 coord); -vec4 texture1DArray(sampler1DArray sampler, vec2 coord, float bias); - -vec4 texture2DArray(sampler2DArray sampler, vec3 coord); -vec4 texture2DArray(sampler2DArray sampler, vec3 coord, float bias); - -vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); -vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord, float bias); - -vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_texture_array.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_texture_array.vert deleted file mode 100644 index 6b1b7f2f1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/EXT_texture_array.vert +++ /dev/null @@ -1,11 +0,0 @@ -#extension GL_EXT_texture_array : enable -vec4 texture1DArray(sampler1DArray sampler, vec2 coord); -vec4 texture1DArrayLod(sampler1DArray sampler, vec2 coord, float lod); - -vec4 texture2DArray(sampler2DArray sampler, vec3 coord); -vec4 texture2DArrayLod(sampler2DArray sampler, vec3 coord, float lod); - -vec4 shadow1DArray(sampler1DArrayShadow sampler, vec3 coord); -vec4 shadow1DArrayLod(sampler1DArrayShadow sampler, vec3 coord, float lod); - -vec4 shadow2DArray(sampler2DArrayShadow sampler, vec4 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_EGL_image_external.glsl b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_EGL_image_external.glsl deleted file mode 100644 index 71e6af9d3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_EGL_image_external.glsl +++ /dev/null @@ -1,6 +0,0 @@ -#version 100 -#extension GL_OES_EGL_image_external : enable - -vec4 texture2D(samplerExternalOES sampler, vec2 coord); -vec4 texture2DProj(samplerExternalOES sampler, vec3 coord); -vec4 texture2DProj(samplerExternalOES sampler, vec4 coord); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_standard_derivatives.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_standard_derivatives.frag deleted file mode 100644 index 2c6ea07e9..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_standard_derivatives.frag +++ /dev/null @@ -1,20 +0,0 @@ -#version 100 -#extension GL_OES_standard_derivatives : enable - -/* - * 8.8 - Fragment Processing Functions - */ -float dFdx(float p); -vec2 dFdx(vec2 p); -vec3 dFdx(vec3 p); -vec4 dFdx(vec4 p); - -float dFdy(float p); -vec2 dFdy(vec2 p); -vec3 dFdy(vec3 p); -vec4 dFdy(vec4 p); - -float fwidth(float p); -vec2 fwidth(vec2 p); -vec3 fwidth(vec3 p); -vec4 fwidth(vec4 p); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_texture_3D.frag b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_texture_3D.frag deleted file mode 100644 index b6ebd6a31..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_texture_3D.frag +++ /dev/null @@ -1,7 +0,0 @@ -#version 100 -#extension GL_OES_texture_3D : enable - -vec4 texture3D (sampler3D sampler, vec3 coord); -vec4 texture3DProj (sampler3D sampler, vec4 coord); -vec4 texture3D (sampler3D sampler, vec3 coord, float bias); -vec4 texture3DProj (sampler3D sampler, vec4 coord, float bias); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_texture_3D.vert b/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_texture_3D.vert deleted file mode 100644 index 81d12f51e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/profiles/OES_texture_3D.vert +++ /dev/null @@ -1,7 +0,0 @@ -#version 100 -#extension GL_OES_texture_3D : enable - -vec4 texture3D (sampler3D sampler, vec3 coord); -vec4 texture3DProj (sampler3D sampler, vec4 coord); -vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod); -vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod); diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_builtins.py b/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_builtins.py deleted file mode 100644 index 9dc3279df..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_builtins.py +++ /dev/null @@ -1,294 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -from __future__ import with_statement - -import re -import sys -from glob import glob -from os import path -from subprocess import Popen, PIPE -from sys import argv - -# Local module: generator for texture lookup builtins -from texture_builtins import generate_texture_functions - -builtins_dir = path.join(path.dirname(path.abspath(__file__)), "..") - -# Get the path to the standalone GLSL compiler -if len(argv) != 2: - print "Usage:", argv[0], "" - sys.exit(1) - -compiler = argv[1] - -# Read the files in builtins/ir/*...add them to the supplied dictionary. -def read_ir_files(fs): - for filename in glob(path.join(path.join(builtins_dir, 'ir'), '*.ir')): - function_name = path.basename(filename).split('.')[0] - with open(filename) as f: - fs[function_name] = f.read() - -def read_glsl_files(fs): - for filename in glob(path.join(path.join(builtins_dir, 'glsl'), '*.glsl')): - function_name = path.basename(filename).split('.')[0] - (output, returncode) = run_compiler([filename]) - if (returncode): - sys.stderr.write("Failed to compile builtin: " + filename + "\n") - sys.stderr.write("Result:\n") - sys.stderr.write(output) - else: - fs[function_name] = output; - -# Return a dictionary containing all builtin definitions (even generated) -def get_builtin_definitions(): - fs = {} - generate_texture_functions(fs) - read_ir_files(fs) - read_glsl_files(fs) - return fs - -def stringify(s): - # Work around MSVC's 65535 byte limit by outputting an array of characters - # rather than actual string literals. - if len(s) >= 65535: - #t = "/* Warning: length " + repr(len(s)) + " too large */\n" - t = "" - for c in re.sub('\s\s+', ' ', s): - if c == '\n': - t += '\n' - else: - t += "'" + c + "'," - return '{' + t[:-1] + '}' - - t = s.replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n "') - return ' "' + t + '"\n' - -def write_function_definitions(): - fs = get_builtin_definitions() - for k, v in sorted(fs.iteritems()): - print 'static const char builtin_' + k + '[] =' - print stringify(v), ';' - -def run_compiler(args): - command = [compiler, '--dump-hir'] + args - p = Popen(command, 1, stdout=PIPE, shell=False) - output = p.communicate()[0] - - if (p.returncode): - sys.stderr.write("Failed to compile builtins with command:\n") - for arg in command: - sys.stderr.write(arg + " ") - sys.stderr.write("\n") - sys.stderr.write("Result:\n") - sys.stderr.write(output) - - # Clean up output a bit by killing whitespace before a closing paren. - kill_paren_whitespace = re.compile(r'[ \n]*\)', re.MULTILINE) - output = kill_paren_whitespace.sub(')', output) - - # Also toss any duplicate newlines - output = output.replace('\n\n', '\n') - - # Kill any global variable declarations. We don't want them. - kill_globals = re.compile(r'^\(declare.*\n', re.MULTILINE) - output = kill_globals.sub('', output) - - return (output, p.returncode) - -def write_profile(filename, profile): - (proto_ir, returncode) = run_compiler([filename]) - - if returncode != 0: - print '#error builtins profile', profile, 'failed to compile' - return - - print 'static const char prototypes_for_' + profile + '[] =' - print stringify(proto_ir), ';' - - # Print a table of all the functions (not signatures) referenced. - # This is done so we can avoid bothering with a hash table in the C++ code. - - function_names = set() - for func in re.finditer(r'\(function (.+)\n', proto_ir): - function_names.add(func.group(1)) - - print 'static const char *functions_for_' + profile + ' [] = {' - for func in sorted(function_names): - print ' builtin_' + func + ',' - print '};' - -def write_profiles(): - profiles = get_profile_list() - for (filename, profile) in profiles: - write_profile(filename, profile) - -def get_profile_list(): - profile_files = [] - for extension in ['glsl', 'frag', 'vert']: - path_glob = path.join( - path.join(builtins_dir, 'profiles'), '*.' + extension) - profile_files.extend(glob(path_glob)) - profiles = [] - for pfile in sorted(profile_files): - profiles.append((pfile, path.basename(pfile).replace('.', '_'))) - return profiles - -if __name__ == "__main__": - print """/* DO NOT MODIFY - automatically generated by generate_builtins.py */ -/* - * Copyright © 2010 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include "main/core.h" /* for struct gl_shader */ -#include "glsl_parser_extras.h" -#include "ir_reader.h" -#include "program.h" -#include "ast.h" - -extern "C" struct gl_shader * -_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); - -gl_shader * -read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) -{ - struct gl_context fakeCtx; - fakeCtx.API = API_OPENGL; - fakeCtx.Const.GLSLVersion = 140; - fakeCtx.Extensions.ARB_ES2_compatibility = true; - fakeCtx.Const.ForceGLSLExtensionsWarn = false; - gl_shader *sh = _mesa_new_shader(NULL, 0, target); - struct _mesa_glsl_parse_state *st = - new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh); - - st->language_version = 140; - st->symbols->language_version = 140; - st->ARB_texture_rectangle_enable = true; - st->EXT_texture_array_enable = true; - st->OES_EGL_image_external_enable = true; - st->ARB_shader_bit_encoding_enable = true; - _mesa_glsl_initialize_types(st); - - sh->ir = new(sh) exec_list; - sh->symbols = st->symbols; - - /* Read the IR containing the prototypes */ - _mesa_glsl_read_ir(st, sh->ir, protos, true); - - /* Read ALL the function bodies, telling the IR reader not to scan for - * prototypes (we've already created them). The IR reader will skip any - * signature that does not already exist as a prototype. - */ - for (unsigned i = 0; i < count; i++) { - _mesa_glsl_read_ir(st, sh->ir, functions[i], false); - - if (st->error) { - printf("error reading builtin: %.35s ...\\n", functions[i]); - printf("Info log:\\n%s\\n", st->info_log); - ralloc_free(sh); - return NULL; - } - } - - reparent_ir(sh->ir, sh); - delete st; - - return sh; -} -""" - - write_function_definitions() - write_profiles() - - profiles = get_profile_list() - - print 'static gl_shader *builtin_profiles[%d];' % len(profiles) - - print """ -static void *builtin_mem_ctx = NULL; - -void -_mesa_glsl_release_functions(void) -{ - ralloc_free(builtin_mem_ctx); - builtin_mem_ctx = NULL; - memset(builtin_profiles, 0, sizeof(builtin_profiles)); -} - -static void -_mesa_read_profile(struct _mesa_glsl_parse_state *state, - int profile_index, - const char *prototypes, - const char **functions, - int count) -{ - gl_shader *sh = builtin_profiles[profile_index]; - - if (sh == NULL) { - sh = read_builtins(GL_VERTEX_SHADER, prototypes, functions, count); - ralloc_steal(builtin_mem_ctx, sh); - builtin_profiles[profile_index] = sh; - } - - state->builtins_to_link[state->num_builtins_to_link] = sh; - state->num_builtins_to_link++; -} - -void -_mesa_glsl_initialize_functions(struct _mesa_glsl_parse_state *state) -{ - /* If we've already initialized the built-ins, bail early. */ - if (state->num_builtins_to_link > 0) - return; - - if (builtin_mem_ctx == NULL) { - builtin_mem_ctx = ralloc_context(NULL); // "GLSL built-in functions" - memset(&builtin_profiles, 0, sizeof(builtin_profiles)); - } -""" - - i = 0 - for (filename, profile) in profiles: - if profile.endswith('_vert'): - check = 'state->target == vertex_shader && ' - elif profile.endswith('_frag'): - check = 'state->target == fragment_shader && ' - else: - check = '' - - version = re.sub(r'_(glsl|vert|frag)$', '', profile) - if version.isdigit(): - check += 'state->language_version == ' + version - else: # an extension name - check += 'state->' + version + '_enable' - - print ' if (' + check + ') {' - print ' _mesa_read_profile(state, %d,' % i - print ' prototypes_for_' + profile + ',' - print ' functions_for_' + profile + ',' - print ' Elements(functions_for_' + profile + '));' - print ' }' - print - i = i + 1 - print '}' - diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py b/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py deleted file mode 100644 index 391ad110d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_matrixCompMultGLSL.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python - -def gen_matrix(x, y = 0): - if y == 0: - y = x - type = "mat" + str(x) - if x != y: - type = type + "x" + str(y) - print type + " matrixCompMult(" + type + " x, " + type + " y)\n{" - print " " + type + " z;" - - for i in range(x): - print " z[" + str(i) + "] = x[" + str(i) + "] * y[" + str(i) + "];" - print " return z;\n}" - -print "#version 120" -# 1.10 -gen_matrix(2) -gen_matrix(3) -gen_matrix(4) - -# 1.20 -gen_matrix(2,3) # mat2x3 means 2 columns, 3 rows -gen_matrix(3,2) -gen_matrix(2,4) -gen_matrix(4,2) -gen_matrix(3,4) -gen_matrix(4,3) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_outerProductGLSL.py b/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_outerProductGLSL.py deleted file mode 100644 index c561cc3ba..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_outerProductGLSL.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python - -def gen(x, y): - type = "mat" + str(x) - if x != y: - type = type + "x" + str(y) - print type + " outerProduct(vec" + str(y) + " u, vec" + str(x) + " v)\n{" - print " " + type + " m;" - - for i in range(x): - print " m[" + str(i) + "] = u * v[" + str(i) + "];" - print " return m;\n}" - -print "#version 120" -gen(2,2) -gen(2,3) # mat2x3 means 2 columns, 3 rows -gen(2,4) -gen(3,2) -gen(3,3) -gen(3,4) -gen(4,2) -gen(4,3) -gen(4,4) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_transposeGLSL.py b/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_transposeGLSL.py deleted file mode 100644 index 8f669ce98..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/generate_transposeGLSL.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python - -def gen(x, y): - origtype = "mat" + str(x) - trantype = "mat" + str(y) - if x != y: - origtype = origtype + "x" + str(y) - trantype = trantype + "x" + str(x) - print trantype + " transpose(" + origtype + " m)\n{" - print " " + trantype + " t;" - - # The obvious implementation of transpose - for i in range(x): - for j in range(y): - print " t[" + str(j) + "][" + str(i) + "] =", - print "m[" + str(i) + "][" + str(j) + "];" - print " return t;\n}" - -print "#version 120" -gen(2,2) -gen(2,3) # mat2x3 means 2 columns, 3 rows -gen(2,4) -gen(3,2) -gen(3,3) -gen(3,4) -gen(4,2) -gen(4,3) -gen(4,4) diff --git a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/texture_builtins.py b/3rdparty/glsl-optimizer/src/glsl/builtins/tools/texture_builtins.py deleted file mode 100644 index aa0125b63..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/builtins/tools/texture_builtins.py +++ /dev/null @@ -1,629 +0,0 @@ -#!/usr/bin/python - -import sys -import StringIO - -# Bitfield constants for the 'variant' argument to generate_sigs -Proj = 1 -Offset = 2 -Single = 4 - -def vec_type(g, size): - if size == 1: - if g == "i": - return "int" - elif g == "u": - return "uint" - return "float" - return g + "vec" + str(size) - -# Get the sampler dimension - i.e. sampler3D gives 3 -def get_sampler_dim(sampler_type): - if sampler_type[0].isdigit(): - sampler_dim = int(sampler_type[0]) - elif sampler_type.startswith("Cube"): - sampler_dim = 3 - elif sampler_type == "ExternalOES": - sampler_dim = 2 - elif sampler_type == "Buffer": - sampler_dim = 1 - else: - assert False ("coord_dim: invalid sampler_type: " + sampler_type) - return sampler_dim - -# Get the coordinate dimension for a given sampler type. -# Array samplers also get +1 here since the layer is really an extra coordinate -def get_coord_dim(sampler_type): - coord_dim = get_sampler_dim(sampler_type) - if sampler_type.find("Array") != -1: - coord_dim += 1 - return coord_dim - -# Get the number of extra vector components (i.e. shadow comparitor) -def get_extra_dim(sampler_type, use_proj, unused_fields): - extra_dim = unused_fields - if sampler_type.find("Shadow") != -1: - extra_dim += 1 - if use_proj: - extra_dim += 1 - return extra_dim - -def get_txs_dim(sampler_type): - if sampler_type.startswith("Cube"): - return 2 - return get_coord_dim(sampler_type) - -def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0): - coord_dim = get_coord_dim(sampler_type) - extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields) - sampler_dim = get_sampler_dim(sampler_type) - - if variant & Single: - return_type = "float" - elif tex_inst == "txs": - return_type = vec_type("i", get_txs_dim(sampler_type)) - else: - return_type = g + "vec4" - - # Print parameters - print " (signature", return_type - print " (parameters" - print " (declare (in) " + g + "sampler" + sampler_type + " sampler)", - if tex_inst != "txs": - print "\n (declare (in) " + vec_type("i" if tex_inst == "txf" else "", coord_dim + extra_dim) + " P)", - if tex_inst == "txl": - print "\n (declare (in) float lod)", - elif ((tex_inst == "txf" or tex_inst == "txs") and "Buffer" not in sampler_type and "Rect" not in sampler_type): - print "\n (declare (in) int lod)", - elif tex_inst == "txd": - grad_type = vec_type("", sampler_dim) - print "\n (declare (in) " + grad_type + " dPdx)", - print "\n (declare (in) " + grad_type + " dPdy)", - - if variant & Offset: - print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)", - if tex_inst == "txb": - print "\n (declare (in) float bias)", - - print ")\n ((return (" + tex_inst, return_type, "(var_ref sampler)", - - if tex_inst != "txs": - print "(var_ref P)", - - if variant & Offset: - print "(var_ref offset)", - else: - print "0", - - # Bias/explicit LOD/gradient: - if tex_inst == "txb": - print "(var_ref bias)", - elif tex_inst == "txs" or tex_inst == "txf": - if "Rect" not in sampler_type and "Buffer" not in sampler_type: - print "(var_ref lod)", - else: - print "(constant int (0))" - elif tex_inst == "txl": - print "(var_ref lod)", - elif tex_inst == "txd": - print "((var_ref dPdx) (var_ref dPdy))", - print "))))\n" - -def generate_fiu_sigs(tex_inst, sampler_type, variant = 0, unused_fields = 0): - generate_sigs("", tex_inst, sampler_type, variant, unused_fields) - generate_sigs("i", tex_inst, sampler_type, variant, unused_fields) - generate_sigs("u", tex_inst, sampler_type, variant, unused_fields) - -def start_function(name): - sys.stdout = StringIO.StringIO() - print "((function " + name - -def end_function(fs, name): - print "))" - fs[name] = sys.stdout.getvalue(); - sys.stdout.close() - -# Generate all the functions and store them in the supplied dictionary. -# This is better than writing them to actual files since they should never be -# edited; it'd also be easy to confuse them with the many hand-generated files. -# -# Takes a dictionary as an argument. -def generate_texture_functions(fs): - start_function("textureSize") - generate_fiu_sigs("txs", "1D") - generate_fiu_sigs("txs", "2D") - generate_fiu_sigs("txs", "3D") - generate_fiu_sigs("txs", "Cube") - generate_fiu_sigs("txs", "1DArray") - generate_fiu_sigs("txs", "2DArray") - generate_sigs("", "txs", "1DShadow") - generate_sigs("", "txs", "2DShadow") - generate_sigs("", "txs", "CubeShadow") - generate_sigs("", "txs", "1DArrayShadow") - generate_sigs("", "txs", "2DArrayShadow") - generate_fiu_sigs("txs", "2DRect") - generate_sigs("", "txs", "2DRectShadow") - generate_fiu_sigs("txs", "Buffer") - end_function(fs, "textureSize") - - start_function("texture") - generate_fiu_sigs("tex", "1D") - generate_fiu_sigs("tex", "2D") - generate_fiu_sigs("tex", "3D") - generate_fiu_sigs("tex", "Cube") - generate_fiu_sigs("tex", "1DArray") - generate_fiu_sigs("tex", "2DArray") - generate_sigs("", "tex", "1DShadow", Single, 1); - generate_sigs("", "tex", "2DShadow", Single); - generate_sigs("", "tex", "CubeShadow", Single); - generate_sigs("", "tex", "1DArrayShadow", Single); - generate_sigs("", "tex", "2DArrayShadow", Single); - generate_fiu_sigs("tex", "2DRect") - generate_sigs("", "tex", "2DRectShadow", Single); - - generate_fiu_sigs("txb", "1D") - generate_fiu_sigs("txb", "2D") - generate_fiu_sigs("txb", "3D") - generate_fiu_sigs("txb", "Cube") - generate_fiu_sigs("txb", "1DArray") - generate_fiu_sigs("txb", "2DArray") - generate_sigs("", "txb", "1DShadow", Single, 1); - generate_sigs("", "txb", "2DShadow", Single); - generate_sigs("", "txb", "CubeShadow", Single); - generate_sigs("", "txb", "1DArrayShadow", Single); - generate_sigs("", "txb", "2DArrayShadow", Single); - end_function(fs, "texture") - - start_function("textureProj") - generate_fiu_sigs("tex", "1D", Proj) - generate_fiu_sigs("tex", "1D", Proj, 2) - generate_fiu_sigs("tex", "2D", Proj) - generate_fiu_sigs("tex", "2D", Proj, 1) - generate_fiu_sigs("tex", "3D", Proj) - generate_sigs("", "tex", "1DShadow", Proj | Single, 1); - generate_sigs("", "tex", "2DShadow", Proj | Single); - generate_fiu_sigs("tex", "2DRect", Proj) - generate_fiu_sigs("tex", "2DRect", Proj, 1) - generate_sigs("", "tex", "2DRectShadow", Proj | Single); - - generate_fiu_sigs("txb", "1D", Proj) - generate_fiu_sigs("txb", "1D", Proj, 2) - generate_fiu_sigs("txb", "2D", Proj) - generate_fiu_sigs("txb", "2D", Proj, 1) - generate_fiu_sigs("txb", "3D", Proj) - generate_sigs("", "txb", "1DShadow", Proj | Single, 1); - generate_sigs("", "txb", "2DShadow", Proj | Single); - end_function(fs, "textureProj") - - start_function("textureLod") - generate_fiu_sigs("txl", "1D") - generate_fiu_sigs("txl", "2D") - generate_fiu_sigs("txl", "3D") - generate_fiu_sigs("txl", "Cube") - generate_fiu_sigs("txl", "1DArray") - generate_fiu_sigs("txl", "2DArray") - generate_sigs("", "txl", "1DShadow", Single, 1); - generate_sigs("", "txl", "2DShadow", Single); - generate_sigs("", "txl", "1DArrayShadow", Single); - end_function(fs, "textureLod") - - start_function("textureLodOffset") - generate_fiu_sigs("txl", "1D", Offset) - generate_fiu_sigs("txl", "2D", Offset) - generate_fiu_sigs("txl", "3D", Offset) - generate_fiu_sigs("txl", "1DArray", Offset) - generate_fiu_sigs("txl", "2DArray", Offset) - generate_sigs("", "txl", "1DShadow", Offset | Single, 1); - generate_sigs("", "txl", "2DShadow", Offset | Single); - generate_sigs("", "txl", "1DArrayShadow", Offset | Single); - end_function(fs, "textureLodOffset") - - start_function("textureOffset") - generate_fiu_sigs("tex", "1D", Offset) - generate_fiu_sigs("tex", "2D", Offset) - generate_fiu_sigs("tex", "3D", Offset) - generate_fiu_sigs("tex", "2DRect", Offset) - generate_sigs("", "tex", "2DRectShadow", Offset | Single); - generate_fiu_sigs("tex", "1DArray", Offset) - generate_fiu_sigs("tex", "2DArray", Offset) - generate_sigs("", "tex", "1DShadow", Offset | Single, 1); - generate_sigs("", "tex", "2DShadow", Offset | Single); - generate_sigs("", "tex", "1DArrayShadow", Offset | Single); - - generate_fiu_sigs("txb", "1D", Offset) - generate_fiu_sigs("txb", "2D", Offset) - generate_fiu_sigs("txb", "3D", Offset) - generate_fiu_sigs("txb", "1DArray", Offset) - generate_fiu_sigs("txb", "2DArray", Offset) - generate_sigs("", "txb", "1DShadow", Offset | Single, 1); - generate_sigs("", "txb", "2DShadow", Offset | Single); - generate_sigs("", "txb", "1DArrayShadow", Offset | Single); - end_function(fs, "textureOffset") - - start_function("texelFetch") - generate_fiu_sigs("txf", "1D") - generate_fiu_sigs("txf", "2D") - generate_fiu_sigs("txf", "3D") - generate_fiu_sigs("txf", "2DRect") - generate_fiu_sigs("txf", "1DArray") - generate_fiu_sigs("txf", "2DArray") - generate_fiu_sigs("txf", "Buffer") - end_function(fs, "texelFetch") - - start_function("texelFetchOffset") - generate_fiu_sigs("txf", "1D", Offset) - generate_fiu_sigs("txf", "2D", Offset) - generate_fiu_sigs("txf", "3D", Offset) - generate_fiu_sigs("txf", "2DRect", Offset) - generate_fiu_sigs("txf", "1DArray", Offset) - generate_fiu_sigs("txf", "2DArray", Offset) - end_function(fs, "texelFetchOffset") - - start_function("textureProjOffset") - generate_fiu_sigs("tex", "1D", Proj | Offset) - generate_fiu_sigs("tex", "1D", Proj | Offset, 2) - generate_fiu_sigs("tex", "2D", Proj | Offset) - generate_fiu_sigs("tex", "2D", Proj | Offset, 1) - generate_fiu_sigs("tex", "3D", Proj | Offset) - generate_fiu_sigs("tex", "2DRect", Proj | Offset) - generate_fiu_sigs("tex", "2DRect", Proj | Offset, 1) - generate_sigs("", "tex", "2DRectShadow", Proj | Offset | Single); - generate_sigs("", "tex", "1DShadow", Proj | Offset | Single, 1); - generate_sigs("", "tex", "2DShadow", Proj | Offset | Single); - - generate_fiu_sigs("txb", "1D", Proj | Offset) - generate_fiu_sigs("txb", "1D", Proj | Offset, 2) - generate_fiu_sigs("txb", "2D", Proj | Offset) - generate_fiu_sigs("txb", "2D", Proj | Offset, 1) - generate_fiu_sigs("txb", "3D", Proj | Offset) - generate_sigs("", "txb", "1DShadow", Proj | Offset | Single, 1); - generate_sigs("", "txb", "2DShadow", Proj | Offset | Single); - end_function(fs, "textureProjOffset") - - start_function("textureProjLod") - generate_fiu_sigs("txl", "1D", Proj) - generate_fiu_sigs("txl", "1D", Proj, 2) - generate_fiu_sigs("txl", "2D", Proj) - generate_fiu_sigs("txl", "2D", Proj, 1) - generate_fiu_sigs("txl", "3D", Proj) - generate_sigs("", "txl", "1DShadow", Proj | Single, 1); - generate_sigs("", "txl", "2DShadow", Proj | Single); - end_function(fs, "textureProjLod") - - start_function("textureProjLodOffset") - generate_fiu_sigs("txl", "1D", Proj | Offset) - generate_fiu_sigs("txl", "1D", Proj | Offset, 2) - generate_fiu_sigs("txl", "2D", Proj | Offset) - generate_fiu_sigs("txl", "2D", Proj | Offset, 1) - generate_fiu_sigs("txl", "3D", Proj | Offset) - generate_sigs("", "txl", "1DShadow", Proj | Offset | Single, 1); - generate_sigs("", "txl", "2DShadow", Proj | Offset | Single); - end_function(fs, "textureProjLodOffset") - - start_function("textureGrad") - generate_fiu_sigs("txd", "1D") - generate_fiu_sigs("txd", "2D") - generate_fiu_sigs("txd", "3D") - generate_fiu_sigs("txd", "Cube") - generate_fiu_sigs("txd", "1DArray") - generate_fiu_sigs("txd", "2DArray") - generate_fiu_sigs("txd", "2DRect") - generate_sigs("", "txd", "2DRectShadow", Single); - generate_sigs("", "txd", "1DShadow", Single, 1); - generate_sigs("", "txd", "2DShadow", Single); - generate_sigs("", "txd", "CubeShadow", Single); - generate_sigs("", "txd", "1DArrayShadow", Single); - generate_sigs("", "txd", "2DArrayShadow", Single); - end_function(fs, "textureGrad") - - start_function("textureGradOffset") - generate_fiu_sigs("txd", "1D", Offset) - generate_fiu_sigs("txd", "2D", Offset) - generate_fiu_sigs("txd", "3D", Offset) - generate_fiu_sigs("txd", "2DRect", Offset) - generate_sigs("", "txd", "2DRectShadow", Offset | Single); - generate_fiu_sigs("txd", "1DArray", Offset) - generate_fiu_sigs("txd", "2DArray", Offset) - generate_sigs("", "txd", "1DShadow", Offset | Single, 1); - generate_sigs("", "txd", "2DShadow", Offset | Single); - generate_sigs("", "txd", "1DArrayShadow", Offset | Single); - generate_sigs("", "txd", "2DArrayShadow", Offset | Single); - end_function(fs, "textureGradOffset") - - start_function("textureProjGrad") - generate_fiu_sigs("txd", "1D", Proj) - generate_fiu_sigs("txd", "1D", Proj, 2) - generate_fiu_sigs("txd", "2D", Proj) - generate_fiu_sigs("txd", "2D", Proj, 1) - generate_fiu_sigs("txd", "3D", Proj) - generate_fiu_sigs("txd", "2DRect", Proj) - generate_fiu_sigs("txd", "2DRect", Proj, 1) - generate_sigs("", "txd", "2DRectShadow", Proj | Single); - generate_sigs("", "txd", "1DShadow", Proj | Single, 1); - generate_sigs("", "txd", "2DShadow", Proj | Single); - end_function(fs, "textureProjGrad") - - start_function("textureProjGradOffset") - generate_fiu_sigs("txd", "1D", Proj | Offset) - generate_fiu_sigs("txd", "1D", Proj | Offset, 2) - generate_fiu_sigs("txd", "2D", Proj | Offset) - generate_fiu_sigs("txd", "2D", Proj | Offset, 1) - generate_fiu_sigs("txd", "3D", Proj | Offset) - generate_fiu_sigs("txd", "2DRect", Proj | Offset) - generate_fiu_sigs("txd", "2DRect", Proj | Offset, 1) - generate_sigs("", "txd", "2DRectShadow", Proj | Offset | Single); - generate_sigs("", "txd", "1DShadow", Proj | Offset | Single, 1); - generate_sigs("", "txd", "2DShadow", Proj | Offset | Single); - end_function(fs, "textureProjGradOffset") - - - # ARB_texture_rectangle extension - start_function("texture2DRect") - generate_sigs("", "tex", "2DRect") - end_function(fs, "texture2DRect") - - start_function("texture2DRectProj") - generate_sigs("", "tex", "2DRect", Proj) - generate_sigs("", "tex", "2DRect", Proj, 1) - end_function(fs, "texture2DRectProj") - - start_function("shadow2DRect") - generate_sigs("", "tex", "2DRectShadow") - end_function(fs, "shadow2DRect") - - start_function("shadow2DRectProj") - generate_sigs("", "tex", "2DRectShadow", Proj) - end_function(fs, "shadow2DRectProj") - - # EXT_texture_array extension - start_function("texture1DArray") - generate_sigs("", "tex", "1DArray") - generate_sigs("", "txb", "1DArray") - end_function(fs, "texture1DArray") - - start_function("texture1DArrayLod") - generate_sigs("", "txl", "1DArray") - end_function(fs, "texture1DArrayLod") - - start_function("texture2DArray") - generate_sigs("", "tex", "2DArray") - generate_sigs("", "txb", "2DArray") - end_function(fs, "texture2DArray") - - start_function("texture2DArrayLod") - generate_sigs("", "txl", "2DArray") - end_function(fs, "texture2DArrayLod") - - start_function("shadow1DArray") - generate_sigs("", "tex", "1DArrayShadow") - generate_sigs("", "txb", "1DArrayShadow") - end_function(fs, "shadow1DArray") - - start_function("shadow1DArrayLod") - generate_sigs("", "txl", "1DArrayShadow") - end_function(fs, "shadow1DArrayLod") - - start_function("shadow2DArray") - generate_sigs("", "tex", "2DArrayShadow") - end_function(fs, "shadow2DArray") - - # ARB_shader_texture_lod extension - start_function("texture1DGradARB") - generate_fiu_sigs("txd", "1D") - end_function(fs, "texture1DGradARB") - - start_function("texture2DGradARB") - generate_fiu_sigs("txd", "2D") - end_function(fs, "texture2DGradARB") - - start_function("texture2DGradEXT") - generate_fiu_sigs("txd", "2D") - end_function(fs, "texture2DGradEXT") - - start_function("texture3DGradARB") - generate_fiu_sigs("txd", "3D") - end_function(fs, "texture3DGradARB") - - start_function("textureCubeGradARB") - generate_fiu_sigs("txd", "Cube") - end_function(fs, "textureCubeGradARB") - - start_function("textureCubeGradEXT") - generate_fiu_sigs("txd", "Cube") - end_function(fs, "textureCubeGradEXT") - - start_function("texture1DProjGradARB") - generate_fiu_sigs("txd", "1D", True) - generate_fiu_sigs("txd", "1D", True, 2) - end_function(fs, "texture1DProjGradARB") - - start_function("texture2DProjGradARB") - generate_fiu_sigs("txd", "2D", True) - generate_fiu_sigs("txd", "2D", True, 1) - end_function(fs, "texture2DProjGradARB") - - start_function("texture2DProjGradEXT") - generate_fiu_sigs("txd", "2D", True) - generate_fiu_sigs("txd", "2D", True, 1) - end_function(fs, "texture2DProjGradEXT") - - start_function("texture3DProjGradARB") - generate_fiu_sigs("txd", "3D", True) - end_function(fs, "texture3DProjGradARB") - - start_function("shadow1DGradARB") - generate_sigs("", "txd", "1DShadow", False, 1) - end_function(fs, "shadow1DGradARB") - - start_function("shadow1DProjGradARB") - generate_sigs("", "txd", "1DShadow", True, 1) - end_function(fs, "shadow1DProjGradARB") - - start_function("shadow2DGradARB") - generate_sigs("", "txd", "2DShadow", False) - end_function(fs, "shadow2DGradARB") - - start_function("shadow2DProjGradARB") - generate_sigs("", "txd", "2DShadow", True) - end_function(fs, "shadow2DProjGradARB") - - start_function("texture2DRectGradARB") - generate_sigs("", "txd", "2DRect") - end_function(fs, "texture2DRectGradARB") - - start_function("texture2DRectProjGradARB") - generate_sigs("", "txd", "2DRect", True) - generate_sigs("", "txd", "2DRect", True, 1) - end_function(fs, "texture2DRectProjGradARB") - - start_function("shadow2DRectGradARB") - generate_sigs("", "txd", "2DRectShadow", False) - end_function(fs, "shadow2DRectGradARB") - - start_function("shadow2DRectProjGradARB") - generate_sigs("", "txd", "2DRectShadow", True) - end_function(fs, "shadow2DRectProjGradARB") - - # Deprecated (110/120 style) functions with silly names: - start_function("texture1D") - generate_sigs("", "tex", "1D") - generate_sigs("", "txb", "1D") - end_function(fs, "texture1D") - - start_function("texture1DLod") - generate_sigs("", "txl", "1D") - end_function(fs, "texture1DLod") - - start_function("texture1DProj") - generate_sigs("", "tex", "1D", Proj) - generate_sigs("", "tex", "1D", Proj, 2) - generate_sigs("", "txb", "1D", Proj) - generate_sigs("", "txb", "1D", Proj, 2) - end_function(fs, "texture1DProj") - - start_function("texture1DProjLod") - generate_sigs("", "txl", "1D", Proj) - generate_sigs("", "txl", "1D", Proj, 2) - end_function(fs, "texture1DProjLod") - - start_function("texture2D") - generate_sigs("", "tex", "2D") - generate_sigs("", "txb", "2D") - # OES_EGL_image_external - generate_sigs("", "tex", "ExternalOES") - end_function(fs, "texture2D") - - start_function("texture2DLod") - generate_sigs("", "txl", "2D") - end_function(fs, "texture2DLod") - - start_function("texture2DLodEXT") - generate_sigs("", "txl", "2D") - end_function(fs, "texture2DLodEXT") - - start_function("texture2DProj") - generate_sigs("", "tex", "2D", Proj) - generate_sigs("", "tex", "2D", Proj, 1) - generate_sigs("", "txb", "2D", Proj) - generate_sigs("", "txb", "2D", Proj, 1) - # OES_EGL_image_external - generate_sigs("", "tex", "ExternalOES", Proj) - generate_sigs("", "tex", "ExternalOES", Proj, 1) - end_function(fs, "texture2DProj") - - start_function("texture2DProjLod") - generate_sigs("", "txl", "2D", Proj) - generate_sigs("", "txl", "2D", Proj, 1) - end_function(fs, "texture2DProjLod") - - start_function("texture2DProjLodEXT") - generate_sigs("", "txl", "2D", Proj) - generate_sigs("", "txl", "2D", Proj, 1) - end_function(fs, "texture2DProjLodEXT") - - start_function("texture3D") - generate_sigs("", "tex", "3D") - generate_sigs("", "txb", "3D") - end_function(fs, "texture3D") - - start_function("texture3DLod") - generate_sigs("", "txl", "3D") - end_function(fs, "texture3DLod") - - start_function("texture3DProj") - generate_sigs("", "tex", "3D", Proj) - generate_sigs("", "txb", "3D", Proj) - end_function(fs, "texture3DProj") - - start_function("texture3DProjLod") - generate_sigs("", "txl", "3D", Proj) - end_function(fs, "texture3DProjLod") - - start_function("textureCube") - generate_sigs("", "tex", "Cube") - generate_sigs("", "txb", "Cube") - end_function(fs, "textureCube") - - start_function("textureCubeLod") - generate_sigs("", "txl", "Cube") - end_function(fs, "textureCubeLod") - - start_function("textureCubeLodEXT") - generate_sigs("", "txl", "Cube") - end_function(fs, "textureCubeLodEXT") - - start_function("shadow1D") - generate_sigs("", "tex", "1DShadow", False, 1) - generate_sigs("", "txb", "1DShadow", False, 1) - end_function(fs, "shadow1D") - - start_function("shadow1DLod") - generate_sigs("", "txl", "1DShadow", False, 1) - end_function(fs, "shadow1DLod") - - start_function("shadow1DProj") - generate_sigs("", "tex", "1DShadow", Proj, 1) - generate_sigs("", "txb", "1DShadow", Proj, 1) - end_function(fs, "shadow1DProj") - - start_function("shadow1DProjLod") - generate_sigs("", "txl", "1DShadow", Proj, 1) - end_function(fs, "shadow1DProjLod") - - start_function("shadow2D") - generate_sigs("", "tex", "2DShadow") - generate_sigs("", "txb", "2DShadow") - end_function(fs, "shadow2D") - - start_function("shadow2DLod") - generate_sigs("", "txl", "2DShadow") - end_function(fs, "shadow2DLod") - - start_function("shadow2DProj") - generate_sigs("", "tex", "2DShadow", Proj) - generate_sigs("", "txb", "2DShadow", Proj) - end_function(fs, "shadow2DProj") - - start_function("shadow2DProjLod") - generate_sigs("", "txl", "2DShadow", Proj) - end_function(fs, "shadow2DProjLod") - - # GL_EXT_shadow_samplers - start_function("shadow2DEXT") - generate_sigs("", "tex", "2DShadow", Single) - end_function(fs, "shadow2DEXT") - - start_function("shadow2DProjEXT") - generate_sigs("", "tex", "2DShadow", Proj | Single) - end_function(fs, "shadow2DProjEXT") - - - sys.stdout = sys.__stdout__ - return fs - -# If you actually run this script, it'll print out all the functions. -if __name__ == "__main__": - fs = {} - generate_texture_functions(fs); - for k, v in fs.iteritems(): - print v diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore b/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore index 6041c8a27..1c9b0ddd6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore @@ -10,4 +10,3 @@ glcpp-parse.h *~ tests/*.out -/Makefile diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore b/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore new file mode 100644 index 000000000..e69de29bb diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/README b/3rdparty/glsl-optimizer/src/glsl/glcpp/README index 0b5ef508c..0637935e2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/README +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/README @@ -20,13 +20,11 @@ to encounter and deal with the following preprocessor macros: #pragma #extension -All other macros will be handles according to the GLSL specification +All other macros will be handled according to the GLSL specification and will not appear in the output. Known limitations ----------------- -The __LINE__ and __FILE__ macros are not yet supported. - A file that ends with a function-like macro name as the last non-whitespace token will result in a parse error, (where it should be passed through as is). \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c index d215f7e5b..3844d037b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -54,6 +55,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +86,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -159,15 +159,7 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -179,6 +171,11 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -201,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -223,7 +215,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -302,7 +294,7 @@ static void glcpp__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner YY_BUFFER_STATE glcpp__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE glcpp__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *glcpp_alloc (yy_size_t ,yyscan_t yyscanner ); void *glcpp_realloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -353,13 +345,13 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 42 -#define YY_END_OF_BUFFER 43 +#define YY_NUM_RULES 43 +#define YY_END_OF_BUFFER 44 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,40 +359,25 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[106] = +static yyconst flex_int16_t yy_accept[152] = { 0, - 3, 3, 43, 38, 42, 39, 42, 40, 42, 42, - 37, 42, 42, 37, 42, 37, 42, 37, 42, 24, - 42, 23, 42, 37, 42, 37, 42, 37, 42, 36, - 42, 36, 42, 37, 42, 39, 42, 22, 42, 3, - 42, 4, 42, 5, 42, 41, 42, 17, 42, 17, - 42, 17, 42, 38, 39, 31, 34, 32, 2, 1, - 24, 24, 23, 23, 26, 28, 30, 29, 27, 36, - 36, 33, 39, 22, 22, 3, 4, 5, 6, 5, - 7, 1, 25, 36, 25, 36, 13, 36, 14, 15, - 10, 36, 16, 18, 11, 21, 35, 36, 20, 18, + 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 44, 39, 40, 41, 43, 38, + 43, 38, 38, 38, 25, 24, 38, 38, 38, 37, + 37, 38, 40, 23, 3, 4, 5, 42, 17, 17, + 17, 21, 39, 40, 32, 35, 33, 2, 1, 25, + 25, 0, 24, 24, 27, 29, 31, 30, 28, 37, + 37, 34, 40, 23, 23, 0, 0, 0, 0, 0, + 0, 0, 3, 4, 5, 6, 5, 7, 0, 0, + 0, 0, 20, 21, 1, 26, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 26, 37, 0, - 12,16403, 9, 8, 8211 - } ; - -static yyconst flex_int16_t yy_accept[146] = - { 0, - 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, - 3, 4, 6, 8, 10, 11, 13, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 76, 76, 76, 76, 76, 76, 76, 77, 78, - 79, 80, 81, 82, 82, 82, 82, 82, 83, 84, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 86, 87, 87, 87, 87, 87, 87, 87, 88, - - 88, 88, 88, 88, 88, 88, 89, 89, 90, 91, - 91, 91, 91, 91, 91, 92, 92, 92, 92, 93, - 93, 94, 95, 95, 96, 96, 96, 97, 97, 99, - 100, 101, 101, 102, 102, 102, 103, 103, 104, 105, - 105, 105, 106, 106, 106 + 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, + 0, 0, 37, 0, 0, 15, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 37, 0, 14, 16, 18, + 0, 11, 0, 10, 0, 22, 0, 36, 0, 18, + 0, 12, 0, 0, 19, 0, 9, 0, 0, 8, + 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -437,151 +414,148 @@ static yyconst flex_int32_t yy_ec[256] = static yyconst flex_int32_t yy_meta[40] = { 0, - 1, 2, 3, 1, 1, 1, 1, 1, 4, 5, - 1, 6, 6, 6, 1, 1, 1, 7, 8, 8, - 8, 7, 9, 7, 7, 8, 8, 8, 8, 10, - 8, 8, 8, 8, 8, 8, 8, 8, 1 + 1, 1, 2, 1, 1, 1, 1, 1, 3, 4, + 1, 5, 5, 5, 1, 1, 1, 5, 6, 6, + 6, 5, 7, 5, 5, 6, 6, 6, 6, 8, + 6, 6, 6, 6, 6, 6, 6, 6, 1 } ; -static yyconst flex_int16_t yy_base[159] = +static yyconst flex_int16_t yy_base[166] = { 0, - 0, 38, 0, 0, 38, 39, 301, 300, 299, 44, - 301, 299, 297, 305, 305, 282, 291, 305, 288, 41, - 41, 44, 44, 279, 49, 0, 270, 254, 61, 79, - 289, 305, 65, 305, 305, 67, 68, 290, 288, 305, - 305, 305, 305, 0, 74, 305, 0, 76, 305, 305, - 305, 305, 305, 305, 0, 264, 305, 72, 282, 281, - 262, 71, 260, 257, 250, 252, 257, 277, 305, 110, - 305, 114, 305, 91, 81, 112, 15, 0, 35, 252, - 253, 57, 254, 243, 240, 96, 244, 251, 249, 238, - 305, 240, 242, 243, 243, 239, 234, 235, 305, 229, + 0, 38, 0, 0, 38, 39, 321, 320, 319, 44, + 50, 0, 0, 0, 321, 319, 317, 325, 325, 302, + 311, 325, 308, 80, 80, 83, 83, 299, 88, 0, + 290, 274, 100, 118, 309, 325, 104, 325, 325, 106, + 107, 302, 309, 307, 325, 325, 325, 325, 0, 113, + 325, 0, 115, 325, 325, 325, 325, 325, 325, 0, + 283, 325, 111, 301, 300, 281, 110, 279, 276, 269, + 271, 276, 296, 325, 149, 325, 153, 325, 130, 120, + 151, 15, 325, 289, 0, 74, 270, 271, 96, 272, + 261, 258, 135, 262, 269, 267, 256, 325, 258, 260, - 229, 227, 224, 217, 197, 202, 195, 305, 305, 199, - 184, 177, 164, 114, 305, 108, 110, 107, 110, 108, - 305, 0, 97, 305, 105, 107, 305, 97, 0, 125, - 0, 96, 305, 0, 92, 116, 69, 0, 305, 89, - 52, 305, 63, 305, 139, 149, 159, 169, 174, 184, - 194, 204, 209, 218, 228, 238, 247, 254 + 261, 261, 257, 252, 258, 325, 257, 257, 255, 252, + 253, 242, 245, 231, 0, 325, 228, 219, 216, 213, + 208, 216, 148, 151, 147, 150, 148, 325, 325, 0, + 137, 325, 145, 167, 146, 325, 136, 0, 164, 0, + 135, 325, 0, 131, 155, 108, 0, 135, 91, 109, + 325, 178, 186, 194, 202, 206, 214, 222, 228, 236, + 240, 247, 255, 259, 267 } ; -static yyconst flex_int16_t yy_def[159] = +static yyconst flex_int16_t yy_def[166] = { 0, - 144, 1, 145, 145, 146, 146, 147, 147, 148, 148, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 149, 149, 144, 144, 144, - 150, 144, 151, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 152, 144, 144, 153, 144, 144, 144, - 144, 144, 144, 144, 149, 149, 144, 144, 30, 30, - 144, 144, 144, 144, 144, 144, 144, 150, 144, 151, - 144, 151, 144, 144, 144, 144, 144, 152, 153, 149, - 144, 144, 144, 144, 144, 154, 144, 144, 144, 144, - 144, 149, 144, 144, 144, 144, 144, 144, 144, 144, + 151, 1, 152, 152, 153, 153, 154, 154, 155, 155, + 151, 11, 152, 152, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 156, + 156, 151, 151, 151, 157, 151, 158, 151, 151, 151, + 151, 159, 151, 151, 151, 151, 151, 151, 160, 151, + 151, 161, 151, 151, 151, 151, 151, 151, 151, 156, + 156, 151, 151, 34, 34, 151, 151, 151, 151, 151, + 151, 151, 157, 151, 158, 151, 158, 151, 151, 151, + 151, 151, 151, 159, 160, 161, 156, 151, 151, 151, + 151, 151, 162, 151, 151, 151, 151, 151, 156, 151, - 144, 144, 144, 144, 144, 149, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 149, 144, - 144, 155, 144, 144, 144, 144, 144, 144, 149, 144, - 155, 144, 144, 156, 144, 157, 144, 156, 144, 158, - 144, 144, 158, 0, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144 + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 156, 151, 163, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 156, 151, 151, 151, 164, + 151, 151, 151, 151, 151, 151, 151, 156, 151, 164, + 151, 151, 165, 151, 151, 151, 165, 151, 151, 151, + 0, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151 } ; -static yyconst flex_int16_t yy_nxt[345] = +static yyconst flex_int16_t yy_nxt[365] = { 0, - 12, 13, 14, 15, 16, 17, 18, 19, 18, 18, - 20, 21, 22, 22, 23, 24, 25, 26, 26, 26, - 26, 26, 27, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 28, 29, - 32, 32, 82, 30, 83, 36, 14, 33, 33, 37, - 43, 44, 45, 45, 91, 48, 48, 48, 50, 51, - 46, 47, 58, 49, 53, 54, 59, 71, 74, 76, - 91, 142, 75, 58, 72, 73, 46, 59, 47, 49, - 60, 134, 76, 94, 41, 45, 45, 48, 48, 48, - 95, 77, 74, 46, 63, 49, 75, 142, 82, 141, + 16, 17, 18, 19, 20, 21, 22, 23, 22, 22, + 24, 25, 26, 26, 27, 28, 29, 30, 30, 30, + 30, 30, 31, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 32, 33, + 36, 36, 89, 34, 90, 40, 18, 37, 37, 41, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 19, 48, + 49, 50, 50, 98, 53, 53, 53, 55, 56, 51, - 83, 61, 62, 84, 77, 63, 64, 63, 85, 46, - 65, 49, 71, 76, 66, 67, 71, 136, 100, 144, - 144, 139, 137, 72, 73, 101, 136, 135, 134, 133, - 132, 130, 129, 128, 127, 77, 126, 125, 63, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 55, - 55, 55, 55, 55, 68, 68, 68, 68, 124, 68, - 68, 68, 68, 68, 70, 70, 70, 70, 70, 70, + 52, 63, 54, 58, 59, 64, 76, 79, 81, 98, + 150, 80, 63, 77, 78, 51, 64, 52, 54, 65, + 143, 81, 101, 46, 50, 50, 53, 53, 53, 102, + 82, 79, 51, 68, 54, 80, 150, 89, 149, 90, + 66, 67, 91, 82, 68, 69, 68, 92, 51, 70, + 54, 76, 81, 71, 72, 76, 145, 107, 151, 151, + 148, 146, 77, 78, 108, 145, 144, 143, 134, 142, + 141, 139, 138, 137, 82, 136, 135, 68, 19, 19, + 19, 19, 19, 19, 19, 19, 35, 35, 35, 35, + 35, 35, 35, 35, 38, 38, 38, 38, 38, 38, - 70, 70, 70, 70, 78, 78, 123, 78, 78, 78, - 78, 78, 78, 78, 79, 79, 122, 79, 99, 99, - 99, 99, 99, 121, 120, 119, 99, 99, 131, 131, - 118, 131, 131, 131, 131, 131, 131, 131, 138, 138, - 117, 138, 138, 138, 138, 138, 138, 138, 140, 116, - 115, 114, 113, 140, 140, 140, 140, 143, 112, 143, - 143, 143, 143, 143, 111, 110, 109, 108, 107, 106, - 105, 104, 103, 102, 98, 97, 96, 93, 92, 69, - 90, 89, 88, 87, 86, 81, 144, 144, 80, 39, - 38, 69, 57, 56, 52, 42, 41, 40, 39, 38, + 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, + 60, 60, 60, 60, 73, 73, 73, 134, 73, 73, + 73, 73, 75, 75, 75, 75, 75, 75, 75, 75, + 84, 133, 84, 84, 84, 84, 85, 132, 85, 85, + 85, 85, 85, 85, 86, 131, 86, 106, 106, 106, + 106, 130, 129, 106, 106, 128, 128, 128, 128, 140, + 127, 140, 140, 140, 140, 140, 140, 147, 126, 147, + 147, 147, 147, 147, 147, 125, 124, 123, 122, 121, + 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, + 110, 109, 105, 104, 103, 100, 99, 83, 74, 97, - 144, 14, 15, 15, 11, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144 + 96, 95, 94, 93, 88, 151, 151, 87, 44, 43, + 83, 74, 62, 61, 57, 47, 46, 45, 44, 43, + 151, 18, 19, 19, 15, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151 } ; -static yyconst flex_int16_t yy_chk[345] = +static yyconst flex_int16_t yy_chk[365] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 5, 6, 77, 2, 77, 10, 10, 5, 6, 10, - 20, 20, 21, 21, 79, 22, 22, 22, 23, 23, - 21, 21, 29, 22, 25, 25, 29, 33, 36, 37, - 79, 143, 36, 58, 33, 33, 21, 58, 21, 22, - 30, 141, 75, 82, 30, 45, 45, 48, 48, 48, - 82, 37, 74, 45, 37, 48, 74, 140, 62, 137, + 5, 6, 82, 2, 82, 10, 10, 5, 6, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 24, + 24, 25, 25, 86, 26, 26, 26, 27, 27, 25, - 62, 30, 30, 62, 75, 30, 30, 75, 62, 45, - 30, 48, 70, 76, 30, 30, 72, 136, 86, 70, - 70, 135, 132, 72, 72, 86, 130, 128, 126, 125, - 123, 120, 119, 118, 117, 76, 116, 114, 76, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, - 149, 149, 149, 149, 150, 150, 150, 150, 113, 150, - 150, 150, 150, 150, 151, 151, 151, 151, 151, 151, + 25, 33, 26, 29, 29, 33, 37, 40, 41, 86, + 150, 40, 63, 37, 37, 25, 63, 25, 26, 34, + 149, 80, 89, 34, 50, 50, 53, 53, 53, 89, + 41, 79, 50, 41, 53, 79, 148, 67, 146, 67, + 34, 34, 67, 80, 34, 34, 80, 67, 50, 34, + 53, 75, 81, 34, 34, 77, 145, 93, 75, 75, + 144, 141, 77, 77, 93, 139, 137, 135, 134, 133, + 131, 127, 126, 125, 81, 124, 123, 81, 152, 152, + 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, + 153, 153, 153, 153, 154, 154, 154, 154, 154, 154, - 151, 151, 151, 151, 152, 152, 112, 152, 152, 152, - 152, 152, 152, 152, 153, 153, 111, 153, 154, 154, - 154, 154, 154, 110, 107, 106, 154, 154, 155, 155, - 105, 155, 155, 155, 155, 155, 155, 155, 156, 156, - 104, 156, 156, 156, 156, 156, 156, 156, 157, 103, - 102, 101, 100, 157, 157, 157, 157, 158, 98, 158, - 158, 158, 158, 158, 97, 96, 95, 94, 93, 92, - 90, 89, 88, 87, 85, 84, 83, 81, 80, 68, - 67, 66, 65, 64, 63, 61, 60, 59, 56, 39, - 38, 31, 28, 27, 24, 19, 17, 16, 13, 12, + 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, + 156, 156, 156, 156, 157, 157, 157, 122, 157, 157, + 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, + 159, 121, 159, 159, 159, 159, 160, 120, 160, 160, + 160, 160, 160, 160, 161, 119, 161, 162, 162, 162, + 162, 118, 117, 162, 162, 163, 163, 163, 163, 164, + 114, 164, 164, 164, 164, 164, 164, 165, 113, 165, + 165, 165, 165, 165, 165, 112, 111, 110, 109, 108, + 107, 105, 104, 103, 102, 101, 100, 99, 97, 96, + 95, 94, 92, 91, 90, 88, 87, 84, 73, 72, - 11, 9, 8, 7, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144 + 71, 70, 69, 68, 66, 65, 64, 61, 44, 43, + 42, 35, 32, 31, 28, 23, 21, 20, 17, 16, + 15, 9, 8, 7, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151 } ; -#define YY_TRAILING_MASK 0x2000 -#define YY_TRAILING_HEAD_MASK 0x4000 -#define REJECT \ -{ \ -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \ -yyg->yy_lp = yyg->yy_full_lp; /* restore orig. accepting pos. */ \ -yyg->yy_state_ptr = yyg->yy_full_state; /* restore orig. state */ \ -yy_current_state = *yyg->yy_state_ptr; /* restore curr. state */ \ -++yyg->yy_lp; \ -goto find_rule; \ -} - +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET @@ -655,13 +629,15 @@ match longer strings take priority over those matching shorter strings, we have to be careful to avoid OTHER matching and hiding something that CPP does care about. So we simply exclude all characters that appear in any other expressions. */ -#line 659 "src/glsl/glcpp/glcpp-lex.c" +#line 633 "src/glsl/glcpp/glcpp-lex.c" #define INITIAL 0 #define DONE 1 #define COMMENT 2 #define UNREACHABLE 3 #define SKIP 4 +#define DEFINE 5 +#define NEWLINE_CATCHUP 6 #define YY_EXTRA_TYPE glcpp_parser_t * @@ -678,8 +654,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -693,17 +669,6 @@ struct yyguts_t int yylineno_r; int yy_flex_debug_r; - yy_state_type *yy_state_buf; - yy_state_type *yy_state_ptr; - char *yy_full_match; - int yy_lp; - - /* These are only needed for trailing context rules, - * but there's no conditional variable for that yet. */ - int yy_looking_for_trail_begin; - int yy_full_lp; - int *yy_full_state; - char *yytext_r; int yy_more_flag; int yy_more_len; @@ -747,7 +712,7 @@ FILE *glcpp_get_out (yyscan_t yyscanner ); void glcpp_set_out (FILE * out_str ,yyscan_t yyscanner ); -int glcpp_get_leng (yyscan_t yyscanner ); +yy_size_t glcpp_get_leng (yyscan_t yyscanner ); char *glcpp_get_text (yyscan_t yyscanner ); @@ -803,12 +768,7 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -816,7 +776,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -827,7 +787,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -917,20 +877,69 @@ YY_DECL #line 95 "src/glsl/glcpp/glcpp-lex.l" - /* Implicitly switch between SKIP and INITIAL (non-skipping); - * don't switch if some other state was explicitly set. - */ + glcpp_parser_t *parser = yyextra; - if (YY_START == 0 || YY_START == SKIP) { - if (parser->lexing_if || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { - BEGIN 0; + + /* When we lex a multi-line comment, we replace it (as + * specified) with a single space. But if the comment spanned + * multiple lines, then subsequent parsing stages will not + * count correct line numbers. To avoid this problem we keep + * track of all newlines that were commented out by a + * multi-line comment, and we emit a NEWLINE token for each at + * the next legal opportunity, (which is when the lexer would + * be emitting a NEWLINE token anyway). + */ + if (YY_START == NEWLINE_CATCHUP) { + if (parser->commented_newlines) + parser->commented_newlines--; + if (parser->commented_newlines == 0) + BEGIN INITIAL; + return NEWLINE; + } + + /* The handling of the SKIP vs INITIAL start states requires + * some special handling. Typically, a lexer would change + * start states with statements like "BEGIN SKIP" within the + * lexer rules. We can't get away with that here, since we + * need the parser to actually evaluate expressions for + * directives like "#if". + * + * So, here, in code that will be executed on every call to + * the lexer,and before any rules, we examine the skip_stack + * as set by the parser to know whether to change from INITIAL + * to SKIP or from SKIP back to INITIAL. + * + * Three cases cause us to switch out of the SKIP state and + * back to the INITIAL state: + * + * 1. The top of the skip_stack is of type SKIP_NO_SKIP + * This means we're still evaluating some #if + * hierarchy, but we're on a branch of it where + * content should not be skipped (such as "#if 1" or + * "#else" or so). + * + * 2. The skip_stack is NULL meaning that we've reached + * the last #endif. + * + * 3. The lexing_if bit is set. This indicates that we + * are lexing the expression following an "#if" of + * "#elif". Even inside an "#if 0" we need to lex this + * expression so the parser can correctly update the + * skip_stack state. + */ + if (YY_START == INITIAL || YY_START == SKIP) { + if (parser->lexing_if || + parser->skip_stack == NULL || + parser->skip_stack->type == SKIP_NO_SKIP) + { + BEGIN INITIAL; } else { BEGIN SKIP; } } /* Single-line comments */ -#line 934 "src/glsl/glcpp/glcpp-lex.c" +#line 943 "src/glsl/glcpp/glcpp-lex.c" yylval = yylval_param; @@ -944,12 +953,6 @@ YY_DECL YY_USER_INIT; #endif - /* Create the reject buffer large enough to save one state per allowed character. */ - if ( ! yyg->yy_state_buf ) - yyg->yy_state_buf = (yy_state_type *)glcpp_alloc(YY_STATE_BUF_SIZE ,yyscanner); - if ( ! yyg->yy_state_buf ) - YY_FATAL_ERROR( "out of dynamic memory in glcpp_lex()" ); - if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ @@ -982,64 +985,30 @@ YY_DECL yy_current_state = yyg->yy_start; yy_current_state += YY_AT_BOL(); - - yyg->yy_state_ptr = yyg->yy_state_buf; - *yyg->yy_state_ptr++ = yy_current_state; - yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 145 ) + if ( yy_current_state >= 152 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yyg->yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 144 ); + while ( yy_current_state != 151 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; yy_find_action: - yy_current_state = *--yyg->yy_state_ptr; - yyg->yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yyg->yy_lp]; - if ( yy_act & YY_TRAILING_HEAD_MASK || - yyg->yy_looking_for_trail_begin ) - { - if ( yy_act == yyg->yy_looking_for_trail_begin ) - { - yyg->yy_looking_for_trail_begin = 0; - yy_act &= ~YY_TRAILING_HEAD_MASK; - break; - } - } - else if ( yy_act & YY_TRAILING_MASK ) - { - yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; - yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; - } - else - { - yyg->yy_full_match = yy_cp; - yyg->yy_full_state = yyg->yy_state_ptr; - yyg->yy_full_lp = yyg->yy_lp; - break; - } - ++yyg->yy_lp; - goto find_rule; - } - --yy_cp; - yy_current_state = *--yyg->yy_state_ptr; - yyg->yy_lp = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; @@ -1047,43 +1016,52 @@ do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + case 1: YY_RULE_SETUP -#line 109 "src/glsl/glcpp/glcpp-lex.l" +#line 158 "src/glsl/glcpp/glcpp-lex.l" { + if (parser->commented_newlines) + BEGIN NEWLINE_CATCHUP; } YY_BREAK /* Multi-line comments */ case 2: YY_RULE_SETUP -#line 113 "src/glsl/glcpp/glcpp-lex.l" +#line 164 "src/glsl/glcpp/glcpp-lex.l" { yy_push_state(COMMENT, yyscanner); } YY_BREAK case 3: YY_RULE_SETUP -#line 114 "src/glsl/glcpp/glcpp-lex.l" +#line 165 "src/glsl/glcpp/glcpp-lex.l" YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 115 "src/glsl/glcpp/glcpp-lex.l" -{ yylineno++; yycolumn = 0; return NEWLINE; } +#line 166 "src/glsl/glcpp/glcpp-lex.l" +{ yylineno++; yycolumn = 0; parser->commented_newlines++; } YY_BREAK case 5: YY_RULE_SETUP -#line 116 "src/glsl/glcpp/glcpp-lex.l" +#line 167 "src/glsl/glcpp/glcpp-lex.l" YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 117 "src/glsl/glcpp/glcpp-lex.l" -{ yylineno++; yycolumn = 0; return NEWLINE; } +#line 168 "src/glsl/glcpp/glcpp-lex.l" +{ yylineno++; yycolumn = 0; parser->commented_newlines++; } YY_BREAK case 7: YY_RULE_SETUP -#line 118 "src/glsl/glcpp/glcpp-lex.l" +#line 169 "src/glsl/glcpp/glcpp-lex.l" { yy_pop_state(yyscanner); if (yyextra->space_tokens) @@ -1092,7 +1070,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 124 "src/glsl/glcpp/glcpp-lex.l" +#line 175 "src/glsl/glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); yyextra->space_tokens = 0; @@ -1103,8 +1081,10 @@ YY_RULE_SETUP * Simply pass them through to the main compiler's lexer/parser. */ case 9: YY_RULE_SETUP -#line 132 "src/glsl/glcpp/glcpp-lex.l" +#line 183 "src/glsl/glcpp/glcpp-lex.l" { + if (parser->commented_newlines) + BEGIN NEWLINE_CATCHUP; yylval->str = ralloc_strdup (yyextra, yytext); yylineno++; yycolumn = 0; @@ -1113,7 +1093,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 139 "src/glsl/glcpp/glcpp-lex.l" +#line 192 "src/glsl/glcpp/glcpp-lex.l" { return HASH_LINE; } @@ -1121,7 +1101,7 @@ YY_RULE_SETUP case 11: YY_RULE_SETUP -#line 144 "src/glsl/glcpp/glcpp-lex.l" +#line 197 "src/glsl/glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; @@ -1130,7 +1110,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 150 "src/glsl/glcpp/glcpp-lex.l" +#line 203 "src/glsl/glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; @@ -1143,7 +1123,7 @@ case 13: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 156 "src/glsl/glcpp/glcpp-lex.l" +#line 209 "src/glsl/glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; @@ -1151,8 +1131,12 @@ YY_RULE_SETUP } YY_BREAK case 14: +/* rule 14 can match eol */ +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 162 "src/glsl/glcpp/glcpp-lex.l" +#line 215 "src/glsl/glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; @@ -1161,7 +1145,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 168 "src/glsl/glcpp/glcpp-lex.l" +#line 221 "src/glsl/glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH_ELSE; @@ -1169,7 +1153,7 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 173 "src/glsl/glcpp/glcpp-lex.l" +#line 226 "src/glsl/glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH_ENDIF; @@ -1178,12 +1162,15 @@ YY_RULE_SETUP case 17: YY_RULE_SETUP -#line 179 "src/glsl/glcpp/glcpp-lex.l" -; +#line 232 "src/glsl/glcpp/glcpp-lex.l" +{ + if (parser->commented_newlines) + BEGIN NEWLINE_CATCHUP; +} YY_BREAK case 18: YY_RULE_SETUP -#line 181 "src/glsl/glcpp/glcpp-lex.l" +#line 237 "src/glsl/glcpp/glcpp-lex.l" { char *p; for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */ @@ -1193,47 +1180,53 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 188 "src/glsl/glcpp/glcpp-lex.l" +#line 244 "src/glsl/glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; - return HASH_DEFINE_FUNC; + yy_push_state(DEFINE, yyscanner); + return HASH_DEFINE; } YY_BREAK case 20: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 193 "src/glsl/glcpp/glcpp-lex.l" +#line 250 "src/glsl/glcpp/glcpp-lex.l" { - yyextra->space_tokens = 0; - return HASH_DEFINE_OBJ; + yy_pop_state(yyscanner); + yylval->str = ralloc_strdup (yyextra, yytext); + return FUNC_IDENTIFIER; } YY_BREAK case 21: YY_RULE_SETUP -#line 198 "src/glsl/glcpp/glcpp-lex.l" +#line 256 "src/glsl/glcpp/glcpp-lex.l" +{ + yy_pop_state(yyscanner); + yylval->str = ralloc_strdup (yyextra, yytext); + return OBJ_IDENTIFIER; +} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 262 "src/glsl/glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH_UNDEF; } YY_BREAK -case 22: +case 23: YY_RULE_SETUP -#line 203 "src/glsl/glcpp/glcpp-lex.l" +#line 267 "src/glsl/glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH; } YY_BREAK -case 23: -YY_RULE_SETUP -#line 208 "src/glsl/glcpp/glcpp-lex.l" -{ - yylval->str = ralloc_strdup (yyextra, yytext); - return INTEGER_STRING; -} - YY_BREAK case 24: YY_RULE_SETUP -#line 213 "src/glsl/glcpp/glcpp-lex.l" +#line 272 "src/glsl/glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return INTEGER_STRING; @@ -1241,7 +1234,7 @@ YY_RULE_SETUP YY_BREAK case 25: YY_RULE_SETUP -#line 218 "src/glsl/glcpp/glcpp-lex.l" +#line 277 "src/glsl/glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return INTEGER_STRING; @@ -1249,111 +1242,124 @@ YY_RULE_SETUP YY_BREAK case 26: YY_RULE_SETUP -#line 223 "src/glsl/glcpp/glcpp-lex.l" +#line 282 "src/glsl/glcpp/glcpp-lex.l" { - return LEFT_SHIFT; + yylval->str = ralloc_strdup (yyextra, yytext); + return INTEGER_STRING; } YY_BREAK case 27: YY_RULE_SETUP -#line 227 "src/glsl/glcpp/glcpp-lex.l" +#line 287 "src/glsl/glcpp/glcpp-lex.l" { - return RIGHT_SHIFT; + return LEFT_SHIFT; } YY_BREAK case 28: YY_RULE_SETUP -#line 231 "src/glsl/glcpp/glcpp-lex.l" +#line 291 "src/glsl/glcpp/glcpp-lex.l" { - return LESS_OR_EQUAL; + return RIGHT_SHIFT; } YY_BREAK case 29: YY_RULE_SETUP -#line 235 "src/glsl/glcpp/glcpp-lex.l" +#line 295 "src/glsl/glcpp/glcpp-lex.l" { - return GREATER_OR_EQUAL; + return LESS_OR_EQUAL; } YY_BREAK case 30: YY_RULE_SETUP -#line 239 "src/glsl/glcpp/glcpp-lex.l" +#line 299 "src/glsl/glcpp/glcpp-lex.l" { - return EQUAL; + return GREATER_OR_EQUAL; } YY_BREAK case 31: YY_RULE_SETUP -#line 243 "src/glsl/glcpp/glcpp-lex.l" +#line 303 "src/glsl/glcpp/glcpp-lex.l" { - return NOT_EQUAL; + return EQUAL; } YY_BREAK case 32: YY_RULE_SETUP -#line 247 "src/glsl/glcpp/glcpp-lex.l" +#line 307 "src/glsl/glcpp/glcpp-lex.l" { - return AND; + return NOT_EQUAL; } YY_BREAK case 33: YY_RULE_SETUP -#line 251 "src/glsl/glcpp/glcpp-lex.l" +#line 311 "src/glsl/glcpp/glcpp-lex.l" { - return OR; + return AND; } YY_BREAK case 34: YY_RULE_SETUP -#line 255 "src/glsl/glcpp/glcpp-lex.l" +#line 315 "src/glsl/glcpp/glcpp-lex.l" { - return PASTE; + return OR; } YY_BREAK case 35: YY_RULE_SETUP -#line 259 "src/glsl/glcpp/glcpp-lex.l" +#line 319 "src/glsl/glcpp/glcpp-lex.l" { - return DEFINED; + if (parser->is_gles) + glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); + return PASTE; } YY_BREAK case 36: YY_RULE_SETUP -#line 263 "src/glsl/glcpp/glcpp-lex.l" +#line 325 "src/glsl/glcpp/glcpp-lex.l" +{ + return DEFINED; +} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 329 "src/glsl/glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return IDENTIFIER; } YY_BREAK -case 37: +case 38: YY_RULE_SETUP -#line 268 "src/glsl/glcpp/glcpp-lex.l" +#line 334 "src/glsl/glcpp/glcpp-lex.l" { return yytext[0]; } YY_BREAK -case 38: +case 39: YY_RULE_SETUP -#line 272 "src/glsl/glcpp/glcpp-lex.l" +#line 338 "src/glsl/glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return OTHER; } YY_BREAK -case 39: +case 40: YY_RULE_SETUP -#line 277 "src/glsl/glcpp/glcpp-lex.l" +#line 343 "src/glsl/glcpp/glcpp-lex.l" { if (yyextra->space_tokens) { return SPACE; } } YY_BREAK -case 40: -/* rule 40 can match eol */ +case 41: +/* rule 41 can match eol */ YY_RULE_SETUP -#line 283 "src/glsl/glcpp/glcpp-lex.l" +#line 349 "src/glsl/glcpp/glcpp-lex.l" { + if (parser->commented_newlines) { + BEGIN NEWLINE_CATCHUP; + } yyextra->lexing_if = 0; yylineno++; yycolumn = 0; @@ -1362,7 +1368,7 @@ YY_RULE_SETUP YY_BREAK /* Handle missing newline at EOF. */ case YY_STATE_EOF(INITIAL): -#line 291 "src/glsl/glcpp/glcpp-lex.l" +#line 360 "src/glsl/glcpp/glcpp-lex.l" { BEGIN DONE; /* Don't keep matching this rule forever. */ yyextra->lexing_if = 0; @@ -1373,25 +1379,27 @@ case YY_STATE_EOF(INITIAL): only have this action here so that we can pretend to call some generated functions, (to avoid "defined but not used" warnings. */ -case 41: +case 42: YY_RULE_SETUP -#line 301 "src/glsl/glcpp/glcpp-lex.l" +#line 370 "src/glsl/glcpp/glcpp-lex.l" { unput('.'); yy_top_state(yyextra); } YY_BREAK -case 42: +case 43: YY_RULE_SETUP -#line 306 "src/glsl/glcpp/glcpp-lex.l" +#line 375 "src/glsl/glcpp/glcpp-lex.l" ECHO; YY_BREAK -#line 1390 "src/glsl/glcpp/glcpp-lex.c" - case YY_STATE_EOF(DONE): - case YY_STATE_EOF(COMMENT): - case YY_STATE_EOF(UNREACHABLE): - case YY_STATE_EOF(SKIP): - yyterminate(); +#line 1396 "src/glsl/glcpp/glcpp-lex.c" +case YY_STATE_EOF(DONE): +case YY_STATE_EOF(COMMENT): +case YY_STATE_EOF(UNREACHABLE): +case YY_STATE_EOF(SKIP): +case YY_STATE_EOF(DEFINE): +case YY_STATE_EOF(NEWLINE_CATCHUP): + yyterminate(); case YY_END_OF_BUFFER: { @@ -1456,7 +1464,8 @@ ECHO; else { - yy_cp = yyg->yy_c_buf_p; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; } } @@ -1576,14 +1585,43 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + glcpp_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1592,7 +1630,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1644,20 +1682,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yyg->yy_start; yy_current_state += YY_AT_BOL(); - yyg->yy_state_ptr = yyg->yy_state_buf; - *yyg->yy_state_ptr++ = yy_current_state; - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 145 ) + if ( yy_current_state >= 152 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yyg->yy_state_ptr++ = yy_current_state; } return yy_current_state; @@ -1672,18 +1711,22 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + register char *yy_cp = yyg->yy_c_buf_p; register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 145 ) + if ( yy_current_state >= 152 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 144); - if ( ! yy_is_jam ) - *yyg->yy_state_ptr++ = yy_current_state; + yy_is_jam = (yy_current_state == 151); return yy_is_jam ? 0 : yy_current_state; } @@ -1701,7 +1744,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yyg->yy_n_chars + 2; + register yy_size_t number_to_move = yyg->yy_n_chars + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1751,7 +1794,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -1775,7 +1818,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) case EOB_ACT_END_OF_FILE: { if ( glcpp_wrap(yyscanner ) ) - return EOF; + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -2033,7 +2076,7 @@ void glcpp_pop_buffer_state (yyscan_t yyscanner) */ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -2126,17 +2169,16 @@ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to glcpp_lex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2286,7 +2328,7 @@ FILE *glcpp_get_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int glcpp_get_leng (yyscan_t yyscanner) +yy_size_t glcpp_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2480,11 +2522,6 @@ static int yy_init_globals (yyscan_t yyscanner) yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; - yyg->yy_state_buf = 0; - yyg->yy_state_ptr = 0; - yyg->yy_full_match = 0; - yyg->yy_lp = 0; - /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; @@ -2520,9 +2557,6 @@ int glcpp_lex_destroy (yyscan_t yyscanner) glcpp_free(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; - glcpp_free ( yyg->yy_state_buf , yyscanner); - yyg->yy_state_buf = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time * glcpp_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); @@ -2581,7 +2615,7 @@ void glcpp_free (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 306 "src/glsl/glcpp/glcpp-lex.l" +#line 375 "src/glsl/glcpp/glcpp-lex.l" diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l index 7f5f7b1d4..fcbf80342 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l @@ -68,7 +68,7 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); %option stack %option never-interactive -%x DONE COMMENT UNREACHABLE SKIP +%x DONE COMMENT UNREACHABLE SKIP DEFINE NEWLINE_CATCHUP SPACE [[:space:]] NONSPACE [^[:space:]] @@ -93,13 +93,62 @@ OCTAL_INTEGER 0[0-7]*[uU]? HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? %% - /* Implicitly switch between SKIP and INITIAL (non-skipping); - * don't switch if some other state was explicitly set. - */ + glcpp_parser_t *parser = yyextra; - if (YY_START == 0 || YY_START == SKIP) { - if (parser->lexing_if || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { - BEGIN 0; + + /* When we lex a multi-line comment, we replace it (as + * specified) with a single space. But if the comment spanned + * multiple lines, then subsequent parsing stages will not + * count correct line numbers. To avoid this problem we keep + * track of all newlines that were commented out by a + * multi-line comment, and we emit a NEWLINE token for each at + * the next legal opportunity, (which is when the lexer would + * be emitting a NEWLINE token anyway). + */ + if (YY_START == NEWLINE_CATCHUP) { + if (parser->commented_newlines) + parser->commented_newlines--; + if (parser->commented_newlines == 0) + BEGIN INITIAL; + return NEWLINE; + } + + /* The handling of the SKIP vs INITIAL start states requires + * some special handling. Typically, a lexer would change + * start states with statements like "BEGIN SKIP" within the + * lexer rules. We can't get away with that here, since we + * need the parser to actually evaluate expressions for + * directives like "#if". + * + * So, here, in code that will be executed on every call to + * the lexer,and before any rules, we examine the skip_stack + * as set by the parser to know whether to change from INITIAL + * to SKIP or from SKIP back to INITIAL. + * + * Three cases cause us to switch out of the SKIP state and + * back to the INITIAL state: + * + * 1. The top of the skip_stack is of type SKIP_NO_SKIP + * This means we're still evaluating some #if + * hierarchy, but we're on a branch of it where + * content should not be skipped (such as "#if 1" or + * "#else" or so). + * + * 2. The skip_stack is NULL meaning that we've reached + * the last #endif. + * + * 3. The lexing_if bit is set. This indicates that we + * are lexing the expression following an "#if" of + * "#elif". Even inside an "#if 0" we need to lex this + * expression so the parser can correctly update the + * skip_stack state. + */ + if (YY_START == INITIAL || YY_START == SKIP) { + if (parser->lexing_if || + parser->skip_stack == NULL || + parser->skip_stack->type == SKIP_NO_SKIP) + { + BEGIN INITIAL; } else { BEGIN SKIP; } @@ -107,21 +156,23 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* Single-line comments */ "//"[^\n]* { + if (parser->commented_newlines) + BEGIN NEWLINE_CATCHUP; } /* Multi-line comments */ "/*" { yy_push_state(COMMENT, yyscanner); } [^*\n]* -[^*\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; } +[^*\n]*\n { yylineno++; yycolumn = 0; parser->commented_newlines++; } "*"+[^*/\n]* -"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; } +"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; parser->commented_newlines++; } "*"+"/" { yy_pop_state(yyscanner); if (yyextra->space_tokens) return SPACE; } -{HASH}version { +{HASH}version{HSPACE}+ { yylval->str = ralloc_strdup (yyextra, yytext); yyextra->space_tokens = 0; return HASH_VERSION; @@ -130,13 +181,15 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? /* glcpp doesn't handle #extension, #version, or #pragma directives. * Simply pass them through to the main compiler's lexer/parser. */ {HASH}(extension|pragma)[^\n]+ { + if (parser->commented_newlines) + BEGIN NEWLINE_CATCHUP; yylval->str = ralloc_strdup (yyextra, yytext); yylineno++; yycolumn = 0; return OTHER; } -{HASH}line { +{HASH}line{HSPACE}+ { return HASH_LINE; } @@ -159,7 +212,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return HASH_IF; } -{HASH}elif { +{HASH}elif/[^_a-zA-Z0-9] { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_ELIF; @@ -176,7 +229,10 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } } -[^\n] ; +[^\n] { + if (parser->commented_newlines) + BEGIN NEWLINE_CATCHUP; +} {HASH}error.* { char *p; @@ -185,14 +241,22 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? glcpp_error(yylloc, yyextra, "#error%s", p); } -{HASH}define{HSPACE}+/{IDENTIFIER}"(" { +{HASH}define{HSPACE}+ { yyextra->space_tokens = 0; - return HASH_DEFINE_FUNC; + yy_push_state(DEFINE, yyscanner); + return HASH_DEFINE; } -{HASH}define { - yyextra->space_tokens = 0; - return HASH_DEFINE_OBJ; +{IDENTIFIER}/"(" { + yy_pop_state(yyscanner); + yylval->str = ralloc_strdup (yyextra, yytext); + return FUNC_IDENTIFIER; +} + +{IDENTIFIER} { + yy_pop_state(yyscanner); + yylval->str = ralloc_strdup (yyextra, yytext); + return OBJ_IDENTIFIER; } {HASH}undef { @@ -253,6 +317,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } "##" { + if (parser->is_gles) + glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); return PASTE; } @@ -281,6 +347,9 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? } \n { + if (parser->commented_newlines) { + BEGIN NEWLINE_CATCHUP; + } yyextra->lexing_if = 0; yylineno++; yycolumn = 0; diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c index 6eab14bed..b402a4c25 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -52,28 +55,103 @@ /* Pure parsers. */ #define YYPURE 1 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 1 /* Substitute the variable and function names. */ -#define yyparse glcpp_parser_parse -#define yylex glcpp_parser_lex -#define yyerror glcpp_parser_error -#define yylval glcpp_parser_lval -#define yychar glcpp_parser_char -#define yydebug glcpp_parser_debug -#define yynerrs glcpp_parser_nerrs -#define yylloc glcpp_parser_lloc +#define yyparse glcpp_parser_parse +#define yylex glcpp_parser_lex +#define yyerror glcpp_parser_error +#define yylval glcpp_parser_lval +#define yychar glcpp_parser_char +#define yydebug glcpp_parser_debug +#define yynerrs glcpp_parser_nerrs +#define yylloc glcpp_parser_lloc + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + COMMA_FINAL = 258, + DEFINED = 259, + ELIF_EXPANDED = 260, + HASH = 261, + HASH_DEFINE = 262, + FUNC_IDENTIFIER = 263, + OBJ_IDENTIFIER = 264, + HASH_ELIF = 265, + HASH_ELSE = 266, + HASH_ENDIF = 267, + HASH_IF = 268, + HASH_IFDEF = 269, + HASH_IFNDEF = 270, + HASH_LINE = 271, + HASH_UNDEF = 272, + HASH_VERSION = 273, + IDENTIFIER = 274, + IF_EXPANDED = 275, + INTEGER = 276, + INTEGER_STRING = 277, + LINE_EXPANDED = 278, + NEWLINE = 279, + OTHER = 280, + PLACEHOLDER = 281, + SPACE = 282, + PASTE = 283, + OR = 284, + AND = 285, + NOT_EQUAL = 286, + EQUAL = 287, + GREATER_OR_EQUAL = 288, + LESS_OR_EQUAL = 289, + RIGHT_SHIFT = 290, + LEFT_SHIFT = 291, + UNARY = 292 + }; +#endif +/* Tokens. */ +#define COMMA_FINAL 258 +#define DEFINED 259 +#define ELIF_EXPANDED 260 +#define HASH 261 +#define HASH_DEFINE 262 +#define FUNC_IDENTIFIER 263 +#define OBJ_IDENTIFIER 264 +#define HASH_ELIF 265 +#define HASH_ELSE 266 +#define HASH_ENDIF 267 +#define HASH_IF 268 +#define HASH_IFDEF 269 +#define HASH_IFNDEF 270 +#define HASH_LINE 271 +#define HASH_UNDEF 272 +#define HASH_VERSION 273 +#define IDENTIFIER 274 +#define IF_EXPANDED 275 +#define INTEGER 276 +#define INTEGER_STRING 277 +#define LINE_EXPANDED 278 +#define NEWLINE 279 +#define OTHER 280 +#define PLACEHOLDER 281 +#define SPACE 282 +#define PASTE 283 +#define OR 284 +#define AND 285 +#define NOT_EQUAL 286 +#define EQUAL 287 +#define GREATER_OR_EQUAL 288 +#define LESS_OR_EQUAL 289 +#define RIGHT_SHIFT 290 +#define LEFT_SHIFT 291 +#define UNARY 292 + + + /* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ #line 1 "src/glsl/glcpp/glcpp-parse.y" /* @@ -210,6 +288,10 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc, static void _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc); +static void +_glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t version, + const char *ident, bool explicitly_set); + static int glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser); @@ -221,9 +303,6 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); -/* Line 268 of yacc.c */ -#line 226 "src/glsl/glcpp/glcpp-parse.c" - /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -242,56 +321,11 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); # define YYTOKEN_TABLE 0 #endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - COMMA_FINAL = 258, - DEFINED = 259, - ELIF_EXPANDED = 260, - HASH = 261, - HASH_DEFINE_FUNC = 262, - HASH_DEFINE_OBJ = 263, - HASH_ELIF = 264, - HASH_ELSE = 265, - HASH_ENDIF = 266, - HASH_IF = 267, - HASH_IFDEF = 268, - HASH_IFNDEF = 269, - HASH_LINE = 270, - HASH_UNDEF = 271, - HASH_VERSION = 272, - IDENTIFIER = 273, - IF_EXPANDED = 274, - INTEGER = 275, - INTEGER_STRING = 276, - LINE_EXPANDED = 277, - NEWLINE = 278, - OTHER = 279, - PLACEHOLDER = 280, - SPACE = 281, - PASTE = 282, - OR = 283, - AND = 284, - NOT_EQUAL = 285, - EQUAL = 286, - GREATER_OR_EQUAL = 287, - LESS_OR_EQUAL = 288, - RIGHT_SHIFT = 289, - LEFT_SHIFT = 290, - UNARY = 291 - }; -#endif - - - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - +typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED @@ -311,8 +345,8 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 316 "src/glsl/glcpp/glcpp-parse.c" +/* Line 216 of yacc.c. */ +#line 350 "src/glsl/glcpp/glcpp-parse.c" #ifdef short # undef short @@ -387,14 +421,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -415,11 +449,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -442,24 +476,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -476,9 +510,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; + yytype_int16 yyss; + YYSTYPE yyvs; + YYLTYPE yyls; }; /* The size of the maximum gap between one aligned stack and the next. */ @@ -490,27 +524,6 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY @@ -528,25 +541,42 @@ union yyalloc while (YYID (0)) # endif # endif -#endif /* !YYCOPY_NEEDED */ + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 667 +#define YYLAST 695 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 59 +#define YYNTOKENS 60 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 17 +#define YYNNTS 26 /* YYNRULES -- Number of rules. */ -#define YYNRULES 105 +#define YYNRULES 115 /* YYNRULES -- Number of states. */ -#define YYNSTATES 171 +#define YYNSTATES 181 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 291 +#define YYMAXUTOK 292 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -557,16 +587,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 49, 2, 2, 2, 45, 32, 2, - 47, 48, 43, 41, 51, 42, 56, 44, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 57, - 35, 58, 36, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 50, 2, 2, 2, 46, 33, 2, + 48, 49, 44, 42, 52, 43, 57, 45, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 58, + 36, 59, 37, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 52, 2, 53, 31, 2, 2, 2, 2, 2, + 2, 53, 2, 54, 32, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 54, 30, 55, 50, 2, 2, 2, + 2, 2, 2, 55, 31, 56, 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -582,8 +612,8 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 33, 34, 37, 38, 39, - 40, 46 + 25, 26, 27, 28, 29, 30, 34, 35, 38, 39, + 40, 41, 47 }; #if YYDEBUG @@ -591,69 +621,73 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 4, 7, 9, 11, 13, 16, 20, - 24, 28, 33, 38, 45, 53, 57, 61, 65, 68, - 73, 78, 82, 85, 88, 91, 95, 98, 100, 102, - 104, 106, 110, 114, 118, 122, 126, 130, 134, 138, - 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, - 181, 184, 187, 190, 194, 196, 200, 202, 205, 208, - 209, 211, 212, 214, 217, 222, 224, 226, 229, 231, - 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, - 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, - 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, - 294, 296, 298, 300, 302, 304 + 0, 0, 3, 4, 7, 9, 10, 15, 17, 19, + 22, 26, 30, 34, 39, 43, 49, 56, 57, 61, + 62, 67, 68, 73, 76, 77, 83, 84, 90, 94, + 97, 98, 102, 103, 107, 111, 116, 119, 121, 123, + 125, 127, 131, 135, 139, 143, 147, 151, 155, 159, + 163, 167, 171, 175, 179, 183, 187, 191, 195, 199, + 202, 205, 208, 211, 215, 217, 221, 223, 226, 229, + 230, 232, 233, 235, 238, 243, 245, 247, 250, 252, + 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, + 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, + 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, + 315, 317, 319, 321, 323, 325 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 60, 0, -1, -1, 60, 61, -1, 63, -1, 67, - -1, 62, -1, 6, 68, -1, 19, 65, 23, -1, - 5, 65, 23, -1, 22, 64, 23, -1, 22, 64, - 64, 23, -1, 8, 18, 69, 23, -1, 7, 18, - 47, 48, 69, 23, -1, 7, 18, 47, 66, 48, - 69, 23, -1, 16, 18, 23, -1, 15, 73, 23, - -1, 12, 72, 23, -1, 12, 23, -1, 13, 18, - 70, 23, -1, 14, 18, 70, 23, -1, 9, 72, - 23, -1, 9, 23, -1, 10, 23, -1, 11, 23, - -1, 17, 64, 23, -1, 6, 23, -1, 21, -1, - 20, -1, 64, -1, 18, -1, 65, 28, 65, -1, - 65, 29, 65, -1, 65, 30, 65, -1, 65, 31, - 65, -1, 65, 32, 65, -1, 65, 33, 65, -1, - 65, 34, 65, -1, 65, 37, 65, -1, 65, 38, - 65, -1, 65, 36, 65, -1, 65, 35, 65, -1, - 65, 39, 65, -1, 65, 40, 65, -1, 65, 42, - 65, -1, 65, 41, 65, -1, 65, 45, 65, -1, - 65, 44, 65, -1, 65, 43, 65, -1, 49, 65, - -1, 50, 65, -1, 42, 65, -1, 41, 65, -1, - 47, 65, 48, -1, 18, -1, 66, 51, 18, -1, - 23, -1, 73, 23, -1, 73, 23, -1, -1, 73, - -1, -1, 73, -1, 4, 18, -1, 4, 47, 18, - 48, -1, 74, -1, 71, -1, 72, 71, -1, 74, - -1, 73, 74, -1, 18, -1, 21, -1, 75, -1, - 24, -1, 26, -1, 52, -1, 53, -1, 47, -1, - 48, -1, 54, -1, 55, -1, 56, -1, 32, -1, - 43, -1, 41, -1, 42, -1, 50, -1, 49, -1, - 44, -1, 45, -1, 40, -1, 39, -1, 35, -1, - 36, -1, 38, -1, 37, -1, 34, -1, 33, -1, - 31, -1, 30, -1, 29, -1, 28, -1, 57, -1, - 51, -1, 58, -1, 27, -1 + 61, 0, -1, -1, 61, 62, -1, 66, -1, -1, + 16, 63, 83, 24, -1, 77, -1, 64, -1, 6, + 78, -1, 20, 75, 24, -1, 5, 75, 24, -1, + 23, 74, 24, -1, 23, 74, 74, 24, -1, 9, + 79, 24, -1, 8, 48, 49, 79, 24, -1, 8, + 48, 76, 49, 79, 24, -1, -1, 7, 67, 65, + -1, -1, 17, 68, 19, 24, -1, -1, 13, 69, + 82, 24, -1, 13, 24, -1, -1, 14, 70, 19, + 80, 24, -1, -1, 15, 71, 19, 80, 24, -1, + 10, 82, 24, -1, 10, 24, -1, -1, 11, 72, + 24, -1, -1, 12, 73, 24, -1, 18, 74, 24, + -1, 18, 74, 19, 24, -1, 6, 24, -1, 22, + -1, 21, -1, 74, -1, 19, -1, 75, 29, 75, + -1, 75, 30, 75, -1, 75, 31, 75, -1, 75, + 32, 75, -1, 75, 33, 75, -1, 75, 34, 75, + -1, 75, 35, 75, -1, 75, 38, 75, -1, 75, + 39, 75, -1, 75, 37, 75, -1, 75, 36, 75, + -1, 75, 40, 75, -1, 75, 41, 75, -1, 75, + 43, 75, -1, 75, 42, 75, -1, 75, 46, 75, + -1, 75, 45, 75, -1, 75, 44, 75, -1, 50, + 75, -1, 51, 75, -1, 43, 75, -1, 42, 75, + -1, 48, 75, 49, -1, 19, -1, 76, 52, 19, + -1, 24, -1, 83, 24, -1, 83, 24, -1, -1, + 83, -1, -1, 83, -1, 4, 19, -1, 4, 48, + 19, 49, -1, 84, -1, 81, -1, 82, 81, -1, + 84, -1, 83, 84, -1, 19, -1, 22, -1, 85, + -1, 25, -1, 27, -1, 53, -1, 54, -1, 48, + -1, 49, -1, 55, -1, 56, -1, 57, -1, 33, + -1, 44, -1, 42, -1, 43, -1, 51, -1, 50, + -1, 45, -1, 46, -1, 41, -1, 40, -1, 36, + -1, 37, -1, 39, -1, 38, -1, 35, -1, 34, + -1, 32, -1, 31, -1, 30, -1, 29, -1, 58, + -1, 52, -1, 59, -1, 28, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 184, 184, 186, 190, 193, 198, 199, 203, 206, - 209, 217, 230, 233, 236, 239, 247, 255, 275, 285, - 290, 295, 315, 330, 333, 336, 357, 361, 370, 375, - 376, 379, 382, 385, 388, 391, 394, 397, 400, 403, - 406, 409, 412, 415, 418, 421, 424, 432, 440, 443, - 446, 449, 452, 455, 461, 466, 474, 475, 479, 485, - 486, 489, 491, 498, 502, 506, 511, 515, 522, 527, - 534, 538, 542, 546, 550, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, - 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587 + 0, 188, 188, 190, 194, 197, 197, 208, 213, 214, + 218, 221, 224, 232, 245, 248, 251, 257, 257, 260, + 260, 270, 270, 292, 302, 302, 309, 309, 316, 341, + 361, 361, 374, 374, 377, 380, 383, 389, 398, 403, + 404, 409, 412, 415, 418, 421, 424, 427, 430, 433, + 436, 439, 442, 445, 448, 451, 454, 462, 470, 473, + 476, 479, 482, 485, 491, 496, 504, 505, 509, 515, + 516, 519, 521, 528, 532, 536, 541, 545, 552, 557, + 564, 568, 572, 576, 580, 587, 588, 589, 590, 591, + 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, + 612, 613, 614, 615, 616, 617 }; #endif @@ -663,18 +697,19 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "COMMA_FINAL", "DEFINED", - "ELIF_EXPANDED", "HASH", "HASH_DEFINE_FUNC", "HASH_DEFINE_OBJ", - "HASH_ELIF", "HASH_ELSE", "HASH_ENDIF", "HASH_IF", "HASH_IFDEF", - "HASH_IFNDEF", "HASH_LINE", "HASH_UNDEF", "HASH_VERSION", "IDENTIFIER", - "IF_EXPANDED", "INTEGER", "INTEGER_STRING", "LINE_EXPANDED", "NEWLINE", - "OTHER", "PLACEHOLDER", "SPACE", "PASTE", "OR", "AND", "'|'", "'^'", - "'&'", "NOT_EQUAL", "EQUAL", "'<'", "'>'", "GREATER_OR_EQUAL", - "LESS_OR_EQUAL", "RIGHT_SHIFT", "LEFT_SHIFT", "'+'", "'-'", "'*'", "'/'", - "'%'", "UNARY", "'('", "')'", "'!'", "'~'", "','", "'['", "']'", "'{'", - "'}'", "'.'", "';'", "'='", "$accept", "input", "line", "expanded_line", - "control_line", "integer_constant", "expression", "identifier_list", - "text_line", "non_directive", "replacement_list", "junk", - "conditional_token", "conditional_tokens", "pp_tokens", + "ELIF_EXPANDED", "HASH", "HASH_DEFINE", "FUNC_IDENTIFIER", + "OBJ_IDENTIFIER", "HASH_ELIF", "HASH_ELSE", "HASH_ENDIF", "HASH_IF", + "HASH_IFDEF", "HASH_IFNDEF", "HASH_LINE", "HASH_UNDEF", "HASH_VERSION", + "IDENTIFIER", "IF_EXPANDED", "INTEGER", "INTEGER_STRING", + "LINE_EXPANDED", "NEWLINE", "OTHER", "PLACEHOLDER", "SPACE", "PASTE", + "OR", "AND", "'|'", "'^'", "'&'", "NOT_EQUAL", "EQUAL", "'<'", "'>'", + "GREATER_OR_EQUAL", "LESS_OR_EQUAL", "RIGHT_SHIFT", "LEFT_SHIFT", "'+'", + "'-'", "'*'", "'/'", "'%'", "UNARY", "'('", "')'", "'!'", "'~'", "','", + "'['", "']'", "'{'", "'}'", "'.'", "';'", "'='", "$accept", "input", + "line", "@1", "expanded_line", "define", "control_line", "@2", "@3", + "@4", "@5", "@6", "@7", "@8", "integer_constant", "expression", + "identifier_list", "text_line", "non_directive", "replacement_list", + "junk", "conditional_token", "conditional_tokens", "pp_tokens", "preprocessing_token", "operator", 0 }; #endif @@ -687,34 +722,36 @@ static const yytype_uint16 yytoknum[] = 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 124, 94, 38, 285, 286, 60, 62, 287, 288, 289, - 290, 43, 45, 42, 47, 37, 291, 40, 41, 33, - 126, 44, 91, 93, 123, 125, 46, 59, 61 + 285, 124, 94, 38, 286, 287, 60, 62, 288, 289, + 290, 291, 43, 45, 42, 47, 37, 292, 40, 41, + 33, 126, 44, 91, 93, 123, 125, 46, 59, 61 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 59, 60, 60, 61, 61, 61, 61, 62, 62, - 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 64, 64, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 66, 66, 67, 67, 68, 69, - 69, 70, 70, 71, 71, 71, 72, 72, 73, 73, - 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, + 0, 60, 61, 61, 62, 63, 62, 62, 62, 62, + 64, 64, 64, 64, 65, 65, 65, 67, 66, 68, + 66, 69, 66, 66, 70, 66, 71, 66, 66, 66, + 72, 66, 73, 66, 66, 66, 66, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75 + 75, 75, 75, 75, 76, 76, 77, 77, 78, 79, + 79, 80, 80, 81, 81, 81, 82, 82, 83, 83, + 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 0, 2, 1, 1, 1, 2, 3, 3, - 3, 4, 4, 6, 7, 3, 3, 3, 2, 4, - 4, 3, 2, 2, 2, 3, 2, 1, 1, 1, + 0, 2, 0, 2, 1, 0, 4, 1, 1, 2, + 3, 3, 3, 4, 3, 5, 6, 0, 3, 0, + 4, 0, 4, 2, 0, 5, 0, 5, 3, 2, + 0, 3, 0, 3, 3, 4, 2, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 1, 3, 1, 2, 2, 0, @@ -725,244 +762,250 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 70, 0, 71, 0, - 56, 73, 74, 105, 101, 100, 99, 98, 82, 97, - 96, 92, 93, 95, 94, 91, 90, 84, 85, 83, - 88, 89, 77, 78, 87, 86, 103, 75, 76, 79, - 80, 81, 102, 104, 3, 6, 4, 5, 0, 68, - 72, 30, 28, 27, 0, 0, 0, 0, 0, 29, - 0, 26, 7, 0, 0, 59, 0, 22, 66, 0, - 65, 23, 24, 18, 0, 61, 61, 0, 0, 0, - 0, 0, 57, 69, 52, 51, 0, 49, 50, 9, + 2, 0, 1, 0, 0, 17, 0, 30, 32, 21, + 24, 26, 5, 19, 0, 80, 0, 81, 0, 66, + 83, 84, 115, 111, 110, 109, 108, 92, 107, 106, + 102, 103, 105, 104, 101, 100, 94, 95, 93, 98, + 99, 87, 88, 97, 96, 113, 85, 86, 89, 90, + 91, 112, 114, 3, 8, 4, 7, 0, 78, 82, + 40, 38, 37, 0, 0, 0, 0, 0, 39, 0, + 36, 9, 0, 0, 0, 29, 76, 0, 75, 0, + 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, + 67, 79, 62, 61, 0, 59, 60, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, - 0, 60, 63, 0, 21, 67, 17, 0, 62, 0, - 16, 15, 25, 8, 10, 0, 53, 31, 32, 33, - 34, 35, 36, 37, 41, 40, 38, 39, 42, 43, - 45, 44, 48, 47, 46, 54, 59, 0, 12, 0, - 19, 20, 11, 0, 59, 0, 64, 13, 0, 55, - 14 + 0, 0, 0, 0, 0, 0, 68, 0, 69, 18, + 73, 0, 28, 77, 31, 33, 0, 71, 71, 0, + 0, 0, 34, 10, 12, 0, 63, 41, 42, 43, + 44, 45, 46, 47, 51, 50, 48, 49, 52, 53, + 55, 54, 58, 57, 56, 0, 0, 70, 0, 22, + 0, 72, 0, 6, 20, 35, 13, 64, 69, 0, + 14, 74, 25, 27, 0, 69, 0, 15, 0, 65, + 16 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 54, 55, 56, 69, 70, 157, 57, 72, - 120, 127, 78, 79, 121, 59, 60 + -1, 1, 53, 85, 54, 119, 55, 73, 86, 82, + 83, 84, 79, 80, 68, 69, 169, 56, 71, 156, + 160, 76, 77, 157, 58, 59 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -149 +#define YYPACT_NINF -166 static const yytype_int16 yypact[] = { - -149, 117, -149, 490, -9, 55, 57, 159, 42, 53, - 201, 66, 69, 449, 93, -10, -149, 490, -149, -10, - -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, - -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, - -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, - -149, -149, -149, -149, -149, -149, -149, -149, 326, -149, - -149, -149, -149, -149, 490, 490, 490, 490, 490, -149, - 513, -149, -149, 367, 68, 449, 32, -149, -149, 243, - -149, -149, -149, -149, 285, 449, 449, 408, 89, 90, - 536, 47, -149, -149, -149, -149, 485, -149, -149, -149, - 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, - 490, 490, 490, 490, 490, 490, 490, 490, -149, -11, - 95, 449, -149, 98, -149, -149, -149, 96, 449, 97, - -149, -149, -149, -149, -149, 114, -149, 553, 569, 584, - 598, 611, 622, 622, 18, 18, 18, 18, 65, 65, - 38, 38, -149, -149, -149, -149, 449, 23, -149, 94, - -149, -149, -149, 153, 449, 160, -149, -149, 156, -149, - -149 + -166, 147, -166, 87, -10, -166, 190, -166, -166, -17, + -166, -166, -166, -166, 52, -166, 87, -166, 52, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -166, -166, -166, 360, -166, -166, + -166, -166, -166, 87, 87, 87, 87, 87, -166, 519, + -166, -166, 401, 105, 31, -166, -166, 233, -166, 34, + 44, -166, 319, 67, 86, 483, 88, -8, 542, 48, + -166, -166, -166, -166, 560, -166, -166, -166, 87, 87, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 87, 87, -166, -35, 483, -166, + -166, 96, -166, -166, -166, -166, 276, 483, 483, 442, + 92, 93, -166, -166, -166, 94, -166, 580, 596, 611, + 625, 638, 649, 649, 19, 19, 19, 19, 38, 38, + 66, 66, -166, -166, -166, 18, 95, 483, 72, -166, + 98, 483, 100, -166, -166, -166, -166, -166, 483, 26, + -166, -166, -166, -166, 101, 483, 107, -166, 108, -166, + -166 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -149, -149, -149, -149, -149, -13, -12, -149, -149, -149, - -148, 132, -15, 171, 0, -7, -149 + -166, -166, -166, -166, -166, -166, -166, -166, -166, -166, + -166, -166, -166, -166, -12, -11, -166, -166, -166, -165, + 3, -69, 51, 0, -6, -166 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 80, 58, 89, 80, 73, 90, 91, 155, 163, 16, - 62, 63, 18, 87, 71, 21, 168, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 156, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 122, 93, 94, 95, 96, 97, 98, 111, 112, 113, - 114, 115, 116, 117, 125, 81, 93, 62, 63, 125, - 134, 164, 80, 74, 165, 75, 82, 80, 135, 123, - 93, 115, 116, 117, 85, 128, 128, 86, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 113, 114, 115, 116, - 117, 88, 131, 132, 93, 119, 159, 2, 158, 160, - 161, 93, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 162, 18, 19, - 20, 21, 166, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 76, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 167, 16, 169, 170, - 18, 84, 77, 21, 0, 22, 23, 24, 25, 26, + 78, 57, 87, 174, 72, 88, 89, 81, 123, 15, + 178, 131, 17, 155, 70, 20, 132, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 167, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 120, 91, 92, 93, 94, 95, 96, 123, 124, 109, + 110, 111, 112, 113, 114, 115, 91, 168, 125, 61, + 62, 78, 134, 61, 62, 175, 78, 135, 176, 121, + 111, 112, 113, 114, 115, 129, 127, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 128, 60, 130, 61, 62, + 113, 114, 115, 117, 118, 158, 164, 165, 166, 170, + 78, 171, 172, 91, 173, 177, 179, 161, 161, 63, + 64, 162, 180, 126, 0, 65, 0, 66, 67, 0, + 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, + 0, 91, 3, 4, 5, 91, 0, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 0, 17, + 18, 19, 20, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 76, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 129, 16, - 0, 0, 18, 0, 83, 21, 0, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 76, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 0, 16, 0, 0, 18, 0, 124, 21, 0, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 76, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 0, 16, 0, 0, 18, 0, 126, 21, - 0, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 37, 38, 39, 40, 74, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 0, 0, 15, + 0, 0, 17, 0, 75, 20, 0, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 74, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 0, 0, 15, 0, 0, 17, 0, 122, 20, 0, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 0, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 16, 0, 0, 18, 0, 92, - 21, 0, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 0, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 16, 0, 0, 18, 0, - 118, 21, 0, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 0, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 16, 0, 0, 18, - 0, 130, 21, 0, 22, 23, 24, 25, 26, 27, + 74, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 0, 0, 15, 0, 0, 17, 0, + 159, 20, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 0, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 16, 0, 0, - 18, 0, 0, 21, 0, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 0, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 61, 0, - 62, 63, 0, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 64, 65, 136, 0, 0, 99, 66, 0, 67, - 68, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 133, - 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 102, + 38, 39, 40, 74, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 0, 0, 15, 0, + 0, 17, 0, 0, 20, 0, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 0, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 15, + 0, 0, 17, 0, 90, 20, 0, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 0, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 15, 0, 0, 17, 0, 116, 20, 0, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 0, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 15, 0, 0, 17, 0, 163, 20, 0, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 0, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 15, 0, 0, 17, 0, 0, 20, 0, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 0, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 97, 0, 0, 0, 0, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 133, 0, 0, 0, + 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 0, 0, 136, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 113, 114, 115, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117 + 114, 115, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-149)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { - 7, 1, 15, 10, 4, 17, 19, 18, 156, 18, - 20, 21, 21, 13, 23, 24, 164, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 48, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 18, 58, 64, 65, 66, 67, 68, 39, 40, 41, - 42, 43, 44, 45, 79, 23, 73, 20, 21, 84, - 23, 48, 79, 18, 51, 18, 23, 84, 91, 47, - 87, 43, 44, 45, 18, 85, 86, 18, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 41, 42, 43, 44, - 45, 18, 23, 23, 121, 47, 18, 0, 23, 23, - 23, 128, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 23, 21, 22, - 23, 24, 48, 26, 27, 28, 29, 30, 31, 32, + 6, 1, 14, 168, 4, 16, 18, 24, 77, 19, + 175, 19, 22, 48, 24, 25, 24, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 19, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 19, 57, 63, 64, 65, 66, 67, 126, 24, 40, + 41, 42, 43, 44, 45, 46, 72, 49, 24, 21, + 22, 77, 24, 21, 22, 49, 82, 89, 52, 48, + 42, 43, 44, 45, 46, 85, 19, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 19, 19, 19, 21, 22, + 44, 45, 46, 8, 9, 19, 24, 24, 24, 24, + 126, 49, 24, 129, 24, 24, 19, 127, 128, 42, + 43, 128, 24, 82, -1, 48, -1, 50, 51, -1, + -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, + -1, 157, 5, 6, 7, 161, -1, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, -1, 22, + 23, 24, 25, -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 4, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 23, 18, 18, 23, - 21, 10, 23, 24, -1, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 4, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 86, 18, - -1, -1, 21, -1, 23, 24, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 4, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - -1, 18, -1, -1, 21, -1, 23, 24, -1, 26, + 43, 44, 45, 46, 4, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, -1, -1, 19, + -1, -1, 22, -1, 24, 25, -1, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 4, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, 19, -1, -1, 22, -1, 24, 25, -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 4, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, -1, 18, -1, -1, 21, -1, 23, 24, - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, -1, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 18, -1, -1, 21, -1, 23, - 24, -1, 26, 27, 28, 29, 30, 31, 32, 33, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 4, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, -1, -1, 19, -1, -1, 22, -1, + 24, 25, -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, -1, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 18, -1, -1, 21, -1, - 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, -1, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 18, -1, -1, 21, - -1, 23, 24, -1, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, -1, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 18, -1, -1, - 21, -1, -1, 24, -1, 26, 27, 28, 29, 30, + 44, 45, 46, 4, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, -1, -1, 19, -1, + -1, 22, -1, -1, 25, -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, -1, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 18, -1, - 20, 21, -1, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 41, 42, 48, -1, -1, 23, 47, -1, 49, - 50, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 23, - -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, + 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 19, + -1, -1, 22, -1, 24, 25, -1, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 19, -1, -1, 22, -1, 24, 25, -1, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, -1, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 19, -1, -1, 22, -1, 24, 25, -1, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 19, -1, -1, 22, -1, -1, 25, -1, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 24, -1, -1, -1, -1, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 24, -1, -1, -1, + -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, -1, -1, 49, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45 + 44, 45, 46, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 60, 0, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, - 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 61, 62, 63, 67, 73, 74, - 75, 18, 20, 21, 41, 42, 47, 49, 50, 64, - 65, 23, 68, 73, 18, 18, 4, 23, 71, 72, - 74, 23, 23, 23, 72, 18, 18, 73, 18, 64, - 65, 64, 23, 74, 65, 65, 65, 65, 65, 23, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 23, 47, - 69, 73, 18, 47, 23, 71, 23, 70, 73, 70, - 23, 23, 23, 23, 23, 64, 48, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 18, 48, 66, 23, 18, - 23, 23, 23, 69, 48, 51, 48, 23, 69, 18, - 23 + 0, 61, 0, 5, 6, 7, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, + 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 62, 64, 66, 77, 83, 84, 85, + 19, 21, 22, 42, 43, 48, 50, 51, 74, 75, + 24, 78, 83, 67, 4, 24, 81, 82, 84, 72, + 73, 24, 69, 70, 71, 63, 68, 74, 75, 74, + 24, 84, 75, 75, 75, 75, 75, 24, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 24, 8, 9, 65, + 19, 48, 24, 81, 24, 24, 82, 19, 19, 83, + 19, 19, 24, 24, 24, 74, 49, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 48, 79, 83, 19, 24, + 80, 83, 80, 24, 24, 24, 24, 19, 49, 76, + 24, 49, 24, 24, 79, 49, 52, 24, 79, 19, + 24 }; #define yyerrok (yyerrstatus = 0) @@ -977,18 +1020,9 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -998,6 +1032,7 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -1163,20 +1198,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, parser) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1212,11 +1244,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, parser) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , parser); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1253,6 +1285,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1355,142 +1388,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + int yyn = yypact[yystate]; - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1526,9 +1532,10 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, parser) break; } } - + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1544,6 +1551,10 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ + + + + /*----------. | yyparse. | `----------*/ @@ -1570,59 +1581,24 @@ yyparse (parser) #endif #endif { -/* The lookahead symbol. */ + /* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; -/* Location data for the lookahead symbol. */ +/* Number of syntax errors so far. */ +int yynerrs; +/* Location data for the look-ahead symbol. */ YYLTYPE yylloc; - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; - - YYSIZE_T yystacksize; - + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1630,43 +1606,68 @@ YYLTYPE yylloc; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[2]; + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yyls = yylsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; yylsp = yyls; - #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 1; + yylloc.first_column = yylloc.last_column = 0; #endif -/* User initialization code. */ -/* Line 1590 of yacc.c */ -#line 151 "src/glsl/glcpp/glcpp-parse.y" + /* User initialization code. */ +#line 155 "src/glsl/glcpp/glcpp-parse.y" { yylloc.first_line = 1; yylloc.first_column = 1; @@ -1674,11 +1675,9 @@ YYLTYPE yylloc; yylloc.last_column = 1; yylloc.source = 0; } - -/* Line 1590 of yacc.c */ +/* Line 1078 of yacc.c. */ #line 1680 "src/glsl/glcpp/glcpp-parse.c" yylsp[0] = yylloc; - goto yysetstate; /*------------------------------------------------------------. @@ -1715,7 +1714,6 @@ YYLTYPE yylloc; &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); - yyls = yyls1; yyss = yyss1; yyvs = yyvs1; @@ -1737,9 +1735,9 @@ YYLTYPE yylloc; (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + YYSTACK_RELOCATE (yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1760,9 +1758,6 @@ YYLTYPE yylloc; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -1771,16 +1766,16 @@ YYLTYPE yylloc; yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1806,22 +1801,26 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1862,47 +1861,57 @@ yyreduce: switch (yyn) { case 4: - -/* Line 1806 of yacc.c */ -#line 190 "src/glsl/glcpp/glcpp-parse.y" +#line 194 "src/glsl/glcpp/glcpp-parse.y" { ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); - } + ;} break; case 5: +#line 197 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_parser_resolve_implicit_version(parser); + ;} + break; -/* Line 1806 of yacc.c */ -#line 193 "src/glsl/glcpp/glcpp-parse.y" + case 6: +#line 199 "src/glsl/glcpp/glcpp-parse.y" + { + + if (parser->skip_stack == NULL || + parser->skip_stack->type == SKIP_NO_SKIP) + { + _glcpp_parser_expand_and_lex_from (parser, + LINE_EXPANDED, (yyvsp[(3) - (4)].token_list)); + } + ;} + break; + + case 7: +#line 208 "src/glsl/glcpp/glcpp-parse.y" { _glcpp_parser_print_expanded_token_list (parser, (yyvsp[(1) - (1)].token_list)); ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); ralloc_free ((yyvsp[(1) - (1)].token_list)); - } - break; - - case 8: - -/* Line 1806 of yacc.c */ -#line 203 "src/glsl/glcpp/glcpp-parse.y" - { - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), (yyvsp[(2) - (3)].ival)); - } - break; - - case 9: - -/* Line 1806 of yacc.c */ -#line 206 "src/glsl/glcpp/glcpp-parse.y" - { - _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (3)]), "elif", (yyvsp[(2) - (3)].ival)); - } + ;} break; case 10: +#line 218 "src/glsl/glcpp/glcpp-parse.y" + { + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), (yyvsp[(2) - (3)].ival)); + ;} + break; -/* Line 1806 of yacc.c */ -#line 209 "src/glsl/glcpp/glcpp-parse.y" + case 11: +#line 221 "src/glsl/glcpp/glcpp-parse.y" + { + _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (3)]), "elif", (yyvsp[(2) - (3)].ival)); + ;} + break; + + case 12: +#line 224 "src/glsl/glcpp/glcpp-parse.y" { parser->has_new_line_number = 1; parser->new_line_number = (yyvsp[(2) - (3)].ival); @@ -1910,13 +1919,11 @@ yyreduce: &parser->output_length, "#line %" PRIiMAX "\n", (yyvsp[(2) - (3)].ival)); - } + ;} break; - case 11: - -/* Line 1806 of yacc.c */ -#line 217 "src/glsl/glcpp/glcpp-parse.y" + case 13: +#line 232 "src/glsl/glcpp/glcpp-parse.y" { parser->has_new_line_number = 1; parser->new_line_number = (yyvsp[(2) - (4)].ival); @@ -1926,68 +1933,65 @@ yyreduce: &parser->output_length, "#line %" PRIiMAX " %" PRIiMAX "\n", (yyvsp[(2) - (4)].ival), (yyvsp[(3) - (4)].ival)); - } - break; - - case 12: - -/* Line 1806 of yacc.c */ -#line 230 "src/glsl/glcpp/glcpp-parse.y" - { - _define_object_macro (parser, & (yylsp[(2) - (4)]), (yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].token_list)); - } - break; - - case 13: - -/* Line 1806 of yacc.c */ -#line 233 "src/glsl/glcpp/glcpp-parse.y" - { - _define_function_macro (parser, & (yylsp[(2) - (6)]), (yyvsp[(2) - (6)].str), NULL, (yyvsp[(5) - (6)].token_list)); - } + ;} break; case 14: - -/* Line 1806 of yacc.c */ -#line 236 "src/glsl/glcpp/glcpp-parse.y" +#line 245 "src/glsl/glcpp/glcpp-parse.y" { - _define_function_macro (parser, & (yylsp[(2) - (7)]), (yyvsp[(2) - (7)].str), (yyvsp[(4) - (7)].string_list), (yyvsp[(6) - (7)].token_list)); - } + _define_object_macro (parser, & (yylsp[(1) - (3)]), (yyvsp[(1) - (3)].str), (yyvsp[(2) - (3)].token_list)); + ;} break; case 15: - -/* Line 1806 of yacc.c */ -#line 239 "src/glsl/glcpp/glcpp-parse.y" +#line 248 "src/glsl/glcpp/glcpp-parse.y" { - macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (3)].str)); - if (macro) { - hash_table_remove (parser->defines, (yyvsp[(2) - (3)].str)); - ralloc_free (macro); - } - ralloc_free ((yyvsp[(2) - (3)].str)); - } + _define_function_macro (parser, & (yylsp[(1) - (5)]), (yyvsp[(1) - (5)].str), NULL, (yyvsp[(4) - (5)].token_list)); + ;} break; case 16: - -/* Line 1806 of yacc.c */ -#line 247 "src/glsl/glcpp/glcpp-parse.y" +#line 251 "src/glsl/glcpp/glcpp-parse.y" { - if (parser->skip_stack == NULL || - parser->skip_stack->type == SKIP_NO_SKIP) - { - _glcpp_parser_expand_and_lex_from (parser, - LINE_EXPANDED, (yyvsp[(2) - (3)].token_list)); - } - } + _define_function_macro (parser, & (yylsp[(1) - (6)]), (yyvsp[(1) - (6)].str), (yyvsp[(3) - (6)].string_list), (yyvsp[(5) - (6)].token_list)); + ;} break; case 17: +#line 257 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_parser_resolve_implicit_version(parser); + ;} + break; -/* Line 1806 of yacc.c */ -#line 255 "src/glsl/glcpp/glcpp-parse.y" + case 19: +#line 260 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_parser_resolve_implicit_version(parser); + ;} + break; + + case 20: +#line 262 "src/glsl/glcpp/glcpp-parse.y" + { + macro_t *macro = hash_table_find (parser->defines, (yyvsp[(3) - (4)].str)); + if (macro) { + hash_table_remove (parser->defines, (yyvsp[(3) - (4)].str)); + ralloc_free (macro); + } + ralloc_free ((yyvsp[(3) - (4)].str)); + ;} + break; + + case 21: +#line 270 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_parser_resolve_implicit_version(parser); + ;} + break; + + case 22: +#line 272 "src/glsl/glcpp/glcpp-parse.y" { /* Be careful to only evaluate the 'if' expression if * we are not skipping. When we are skipping, we @@ -2000,20 +2004,18 @@ yyreduce: parser->skip_stack->type == SKIP_NO_SKIP) { _glcpp_parser_expand_and_lex_from (parser, - IF_EXPANDED, (yyvsp[(2) - (3)].token_list)); + IF_EXPANDED, (yyvsp[(3) - (4)].token_list)); } else { - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), 0); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (4)]), 0); parser->skip_stack->type = SKIP_TO_ENDIF; } - } + ;} break; - case 18: - -/* Line 1806 of yacc.c */ -#line 275 "src/glsl/glcpp/glcpp-parse.y" + case 23: +#line 292 "src/glsl/glcpp/glcpp-parse.y" { /* #if without an expression is only an error if we * are not skipping */ @@ -2023,35 +2025,43 @@ yyreduce: glcpp_error(& (yylsp[(1) - (2)]), parser, "#if with no expression"); } _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (2)]), 0); - } + ;} break; - case 19: - -/* Line 1806 of yacc.c */ -#line 285 "src/glsl/glcpp/glcpp-parse.y" + case 24: +#line 302 "src/glsl/glcpp/glcpp-parse.y" { - macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str)); - ralloc_free ((yyvsp[(2) - (4)].str)); - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (4)]), macro != NULL); - } + glcpp_parser_resolve_implicit_version(parser); + ;} break; - case 20: - -/* Line 1806 of yacc.c */ -#line 290 "src/glsl/glcpp/glcpp-parse.y" + case 25: +#line 304 "src/glsl/glcpp/glcpp-parse.y" { - macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str)); - ralloc_free ((yyvsp[(2) - (4)].str)); - _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (4)]), macro == NULL); - } + macro_t *macro = hash_table_find (parser->defines, (yyvsp[(3) - (5)].str)); + ralloc_free ((yyvsp[(3) - (5)].str)); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (5)]), macro != NULL); + ;} break; - case 21: + case 26: +#line 309 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_parser_resolve_implicit_version(parser); + ;} + break; -/* Line 1806 of yacc.c */ -#line 295 "src/glsl/glcpp/glcpp-parse.y" + case 27: +#line 311 "src/glsl/glcpp/glcpp-parse.y" + { + macro_t *macro = hash_table_find (parser->defines, (yyvsp[(3) - (5)].str)); + ralloc_free ((yyvsp[(3) - (5)].str)); + _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(2) - (5)]), macro == NULL); + ;} + break; + + case 28: +#line 316 "src/glsl/glcpp/glcpp-parse.y" { /* Be careful to only evaluate the 'elif' expression * if we are not skipping. When we are skipping, we @@ -2066,18 +2076,21 @@ yyreduce: _glcpp_parser_expand_and_lex_from (parser, ELIF_EXPANDED, (yyvsp[(2) - (3)].token_list)); } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& (yylsp[(1) - (3)]), parser, "#elif after #else"); + } else { _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (3)]), "elif", 0); } - } + ;} break; - case 22: - -/* Line 1806 of yacc.c */ -#line 315 "src/glsl/glcpp/glcpp-parse.y" + case 29: +#line 341 "src/glsl/glcpp/glcpp-parse.y" { /* #elif without an expression is an error unless we * are skipping. */ @@ -2086,64 +2099,67 @@ yyreduce: { glcpp_error(& (yylsp[(1) - (2)]), parser, "#elif with no expression"); } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& (yylsp[(1) - (2)]), parser, "#elif after #else"); + } else { _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (2)]), "elif", 0); glcpp_warning(& (yylsp[(1) - (2)]), parser, "ignoring illegal #elif without expression"); } - } + ;} break; - case 23: - -/* Line 1806 of yacc.c */ -#line 330 "src/glsl/glcpp/glcpp-parse.y" - { - _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (2)]), "else", 1); - } - break; - - case 24: - -/* Line 1806 of yacc.c */ -#line 333 "src/glsl/glcpp/glcpp-parse.y" - { - _glcpp_parser_skip_stack_pop (parser, & (yylsp[(1) - (2)])); - } - break; - - case 25: - -/* Line 1806 of yacc.c */ -#line 336 "src/glsl/glcpp/glcpp-parse.y" - { - macro_t *macro = hash_table_find (parser->defines, "__VERSION__"); - if (macro) { - hash_table_remove (parser->defines, "__VERSION__"); - ralloc_free (macro); - } - add_builtin_define (parser, "__VERSION__", (yyvsp[(2) - (3)].ival)); - - if ((yyvsp[(2) - (3)].ival) == 100) - add_builtin_define (parser, "GL_ES", 1); - - /* Currently, all ES2 implementations support highp in the - * fragment shader, so we always define this macro in ES2. - * If we ever get a driver that doesn't support highp, we'll - * need to add a flag to the gl_context and check that here. - */ - if ((yyvsp[(2) - (3)].ival) >= 130 || (yyvsp[(2) - (3)].ival) == 100) - add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1); - - ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#version %" PRIiMAX, (yyvsp[(2) - (3)].ival)); - } - break; - - case 27: - -/* Line 1806 of yacc.c */ + case 30: #line 361 "src/glsl/glcpp/glcpp-parse.y" + { + if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& (yylsp[(1) - (1)]), parser, "multiple #else"); + } + else + { + _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (1)]), "else", 1); + if (parser->skip_stack) + parser->skip_stack->has_else = true; + } + ;} + break; + + case 32: +#line 374 "src/glsl/glcpp/glcpp-parse.y" + { + _glcpp_parser_skip_stack_pop (parser, & (yylsp[(1) - (1)])); + ;} + break; + + case 34: +#line 377 "src/glsl/glcpp/glcpp-parse.y" + { + _glcpp_parser_handle_version_declaration(parser, (yyvsp[(2) - (3)].ival), NULL, true); + ;} + break; + + case 35: +#line 380 "src/glsl/glcpp/glcpp-parse.y" + { + _glcpp_parser_handle_version_declaration(parser, (yyvsp[(2) - (4)].ival), (yyvsp[(3) - (4)].str), true); + ;} + break; + + case 36: +#line 383 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_parser_resolve_implicit_version(parser); + ;} + break; + + case 37: +#line 389 "src/glsl/glcpp/glcpp-parse.y" { if (strlen ((yyvsp[(1) - (1)].str)) >= 3 && strncmp ((yyvsp[(1) - (1)].str), "0x", 2) == 0) { (yyval.ival) = (int)strtoll ((yyvsp[(1) - (1)].str) + 2, NULL, 16); @@ -2152,166 +2168,132 @@ yyreduce: } else { (yyval.ival) = (int)strtoll ((yyvsp[(1) - (1)].str), NULL, 10); } - } - break; - - case 28: - -/* Line 1806 of yacc.c */ -#line 370 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (1)].ival); - } - break; - - case 30: - -/* Line 1806 of yacc.c */ -#line 376 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = 0; - } - break; - - case 31: - -/* Line 1806 of yacc.c */ -#line 379 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) || (yyvsp[(3) - (3)].ival); - } - break; - - case 32: - -/* Line 1806 of yacc.c */ -#line 382 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) && (yyvsp[(3) - (3)].ival); - } - break; - - case 33: - -/* Line 1806 of yacc.c */ -#line 385 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival); - } - break; - - case 34: - -/* Line 1806 of yacc.c */ -#line 388 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) ^ (yyvsp[(3) - (3)].ival); - } - break; - - case 35: - -/* Line 1806 of yacc.c */ -#line 391 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) & (yyvsp[(3) - (3)].ival); - } - break; - - case 36: - -/* Line 1806 of yacc.c */ -#line 394 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) != (yyvsp[(3) - (3)].ival); - } - break; - - case 37: - -/* Line 1806 of yacc.c */ -#line 397 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) == (yyvsp[(3) - (3)].ival); - } + ;} break; case 38: - -/* Line 1806 of yacc.c */ -#line 400 "src/glsl/glcpp/glcpp-parse.y" +#line 398 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) >= (yyvsp[(3) - (3)].ival); - } - break; - - case 39: - -/* Line 1806 of yacc.c */ -#line 403 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.ival) = (yyvsp[(1) - (3)].ival) <= (yyvsp[(3) - (3)].ival); - } + (yyval.ival) = (yyvsp[(1) - (1)].ival); + ;} break; case 40: - -/* Line 1806 of yacc.c */ -#line 406 "src/glsl/glcpp/glcpp-parse.y" +#line 404 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) > (yyvsp[(3) - (3)].ival); - } + if (parser->is_gles) + glcpp_error(& (yylsp[(1) - (1)]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[(1) - (1)].str)); + (yyval.ival) = 0; + ;} break; case 41: - -/* Line 1806 of yacc.c */ #line 409 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) < (yyvsp[(3) - (3)].ival); - } + (yyval.ival) = (yyvsp[(1) - (3)].ival) || (yyvsp[(3) - (3)].ival); + ;} break; case 42: - -/* Line 1806 of yacc.c */ #line 412 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) >> (yyvsp[(3) - (3)].ival); - } + (yyval.ival) = (yyvsp[(1) - (3)].ival) && (yyvsp[(3) - (3)].ival); + ;} break; case 43: - -/* Line 1806 of yacc.c */ #line 415 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) << (yyvsp[(3) - (3)].ival); - } + (yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival); + ;} break; case 44: - -/* Line 1806 of yacc.c */ #line 418 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) - (yyvsp[(3) - (3)].ival); - } + (yyval.ival) = (yyvsp[(1) - (3)].ival) ^ (yyvsp[(3) - (3)].ival); + ;} break; case 45: - -/* Line 1806 of yacc.c */ #line 421 "src/glsl/glcpp/glcpp-parse.y" { - (yyval.ival) = (yyvsp[(1) - (3)].ival) + (yyvsp[(3) - (3)].ival); - } + (yyval.ival) = (yyvsp[(1) - (3)].ival) & (yyvsp[(3) - (3)].ival); + ;} break; case 46: - -/* Line 1806 of yacc.c */ #line 424 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) != (yyvsp[(3) - (3)].ival); + ;} + break; + + case 47: +#line 427 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) == (yyvsp[(3) - (3)].ival); + ;} + break; + + case 48: +#line 430 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) >= (yyvsp[(3) - (3)].ival); + ;} + break; + + case 49: +#line 433 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) <= (yyvsp[(3) - (3)].ival); + ;} + break; + + case 50: +#line 436 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) > (yyvsp[(3) - (3)].ival); + ;} + break; + + case 51: +#line 439 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) < (yyvsp[(3) - (3)].ival); + ;} + break; + + case 52: +#line 442 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) >> (yyvsp[(3) - (3)].ival); + ;} + break; + + case 53: +#line 445 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) << (yyvsp[(3) - (3)].ival); + ;} + break; + + case 54: +#line 448 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) - (yyvsp[(3) - (3)].ival); + ;} + break; + + case 55: +#line 451 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.ival) = (yyvsp[(1) - (3)].ival) + (yyvsp[(3) - (3)].ival); + ;} + break; + + case 56: +#line 454 "src/glsl/glcpp/glcpp-parse.y" { if ((yyvsp[(3) - (3)].ival) == 0) { yyerror (& (yylsp[(1) - (3)]), parser, @@ -2319,13 +2301,11 @@ yyreduce: } else { (yyval.ival) = (yyvsp[(1) - (3)].ival) % (yyvsp[(3) - (3)].ival); } - } + ;} break; - case 47: - -/* Line 1806 of yacc.c */ -#line 432 "src/glsl/glcpp/glcpp-parse.y" + case 57: +#line 462 "src/glsl/glcpp/glcpp-parse.y" { if ((yyvsp[(3) - (3)].ival) == 0) { yyerror (& (yylsp[(1) - (3)]), parser, @@ -2333,462 +2313,342 @@ yyreduce: } else { (yyval.ival) = (yyvsp[(1) - (3)].ival) / (yyvsp[(3) - (3)].ival); } - } + ;} break; - case 48: - -/* Line 1806 of yacc.c */ -#line 440 "src/glsl/glcpp/glcpp-parse.y" + case 58: +#line 470 "src/glsl/glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) * (yyvsp[(3) - (3)].ival); - } + ;} break; - case 49: - -/* Line 1806 of yacc.c */ -#line 443 "src/glsl/glcpp/glcpp-parse.y" + case 59: +#line 473 "src/glsl/glcpp/glcpp-parse.y" { (yyval.ival) = ! (yyvsp[(2) - (2)].ival); - } + ;} break; - case 50: - -/* Line 1806 of yacc.c */ -#line 446 "src/glsl/glcpp/glcpp-parse.y" + case 60: +#line 476 "src/glsl/glcpp/glcpp-parse.y" { (yyval.ival) = ~ (yyvsp[(2) - (2)].ival); - } + ;} break; - case 51: - -/* Line 1806 of yacc.c */ -#line 449 "src/glsl/glcpp/glcpp-parse.y" + case 61: +#line 479 "src/glsl/glcpp/glcpp-parse.y" { (yyval.ival) = - (yyvsp[(2) - (2)].ival); - } + ;} break; - case 52: - -/* Line 1806 of yacc.c */ -#line 452 "src/glsl/glcpp/glcpp-parse.y" + case 62: +#line 482 "src/glsl/glcpp/glcpp-parse.y" { (yyval.ival) = + (yyvsp[(2) - (2)].ival); - } + ;} break; - case 53: - -/* Line 1806 of yacc.c */ -#line 455 "src/glsl/glcpp/glcpp-parse.y" + case 63: +#line 485 "src/glsl/glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(2) - (3)].ival); - } + ;} break; - case 54: - -/* Line 1806 of yacc.c */ -#line 461 "src/glsl/glcpp/glcpp-parse.y" + case 64: +#line 491 "src/glsl/glcpp/glcpp-parse.y" { (yyval.string_list) = _string_list_create (parser); _string_list_append_item ((yyval.string_list), (yyvsp[(1) - (1)].str)); ralloc_steal ((yyval.string_list), (yyvsp[(1) - (1)].str)); - } + ;} break; - case 55: - -/* Line 1806 of yacc.c */ -#line 466 "src/glsl/glcpp/glcpp-parse.y" + case 65: +#line 496 "src/glsl/glcpp/glcpp-parse.y" { (yyval.string_list) = (yyvsp[(1) - (3)].string_list); _string_list_append_item ((yyval.string_list), (yyvsp[(3) - (3)].str)); ralloc_steal ((yyval.string_list), (yyvsp[(3) - (3)].str)); - } - break; - - case 56: - -/* Line 1806 of yacc.c */ -#line 474 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.token_list) = NULL; } - break; - - case 58: - -/* Line 1806 of yacc.c */ -#line 479 "src/glsl/glcpp/glcpp-parse.y" - { - yyerror (& (yylsp[(1) - (2)]), parser, "Invalid tokens after #"); - } - break; - - case 59: - -/* Line 1806 of yacc.c */ -#line 485 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.token_list) = NULL; } - break; - - case 62: - -/* Line 1806 of yacc.c */ -#line 491 "src/glsl/glcpp/glcpp-parse.y" - { - glcpp_warning(&(yylsp[(1) - (1)]), parser, "extra tokens at end of directive"); - } - break; - - case 63: - -/* Line 1806 of yacc.c */ -#line 498 "src/glsl/glcpp/glcpp-parse.y" - { - int v = hash_table_find (parser->defines, (yyvsp[(2) - (2)].str)) ? 1 : 0; - (yyval.token) = _token_create_ival (parser, INTEGER, v); - } - break; - - case 64: - -/* Line 1806 of yacc.c */ -#line 502 "src/glsl/glcpp/glcpp-parse.y" - { - int v = hash_table_find (parser->defines, (yyvsp[(3) - (4)].str)) ? 1 : 0; - (yyval.token) = _token_create_ival (parser, INTEGER, v); - } + ;} break; case 66: - -/* Line 1806 of yacc.c */ -#line 511 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token_list) = _token_list_create (parser); - _token_list_append ((yyval.token_list), (yyvsp[(1) - (1)].token)); - } - break; - - case 67: - -/* Line 1806 of yacc.c */ -#line 515 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token_list) = (yyvsp[(1) - (2)].token_list); - _token_list_append ((yyval.token_list), (yyvsp[(2) - (2)].token)); - } +#line 504 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.token_list) = NULL; ;} break; case 68: +#line 509 "src/glsl/glcpp/glcpp-parse.y" + { + yyerror (& (yylsp[(1) - (2)]), parser, "Invalid tokens after #"); + ;} + break; -/* Line 1806 of yacc.c */ -#line 522 "src/glsl/glcpp/glcpp-parse.y" + case 69: +#line 515 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.token_list) = NULL; ;} + break; + + case 72: +#line 521 "src/glsl/glcpp/glcpp-parse.y" + { + glcpp_warning(&(yylsp[(1) - (1)]), parser, "extra tokens at end of directive"); + ;} + break; + + case 73: +#line 528 "src/glsl/glcpp/glcpp-parse.y" + { + int v = hash_table_find (parser->defines, (yyvsp[(2) - (2)].str)) ? 1 : 0; + (yyval.token) = _token_create_ival (parser, INTEGER, v); + ;} + break; + + case 74: +#line 532 "src/glsl/glcpp/glcpp-parse.y" + { + int v = hash_table_find (parser->defines, (yyvsp[(3) - (4)].str)) ? 1 : 0; + (yyval.token) = _token_create_ival (parser, INTEGER, v); + ;} + break; + + case 76: +#line 541 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token_list) = _token_list_create (parser); + _token_list_append ((yyval.token_list), (yyvsp[(1) - (1)].token)); + ;} + break; + + case 77: +#line 545 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token_list) = (yyvsp[(1) - (2)].token_list); + _token_list_append ((yyval.token_list), (yyvsp[(2) - (2)].token)); + ;} + break; + + case 78: +#line 552 "src/glsl/glcpp/glcpp-parse.y" { parser->space_tokens = 1; (yyval.token_list) = _token_list_create (parser); _token_list_append ((yyval.token_list), (yyvsp[(1) - (1)].token)); - } - break; - - case 69: - -/* Line 1806 of yacc.c */ -#line 527 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token_list) = (yyvsp[(1) - (2)].token_list); - _token_list_append ((yyval.token_list), (yyvsp[(2) - (2)].token)); - } - break; - - case 70: - -/* Line 1806 of yacc.c */ -#line 534 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[(1) - (1)].str)); - (yyval.token)->location = yylloc; - } - break; - - case 71: - -/* Line 1806 of yacc.c */ -#line 538 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[(1) - (1)].str)); - (yyval.token)->location = yylloc; - } - break; - - case 72: - -/* Line 1806 of yacc.c */ -#line 542 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token) = _token_create_ival (parser, (yyvsp[(1) - (1)].ival), (yyvsp[(1) - (1)].ival)); - (yyval.token)->location = yylloc; - } - break; - - case 73: - -/* Line 1806 of yacc.c */ -#line 546 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token) = _token_create_str (parser, OTHER, (yyvsp[(1) - (1)].str)); - (yyval.token)->location = yylloc; - } - break; - - case 74: - -/* Line 1806 of yacc.c */ -#line 550 "src/glsl/glcpp/glcpp-parse.y" - { - (yyval.token) = _token_create_ival (parser, SPACE, SPACE); - (yyval.token)->location = yylloc; - } - break; - - case 75: - -/* Line 1806 of yacc.c */ -#line 557 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '['; } - break; - - case 76: - -/* Line 1806 of yacc.c */ -#line 558 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = ']'; } - break; - - case 77: - -/* Line 1806 of yacc.c */ -#line 559 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '('; } - break; - - case 78: - -/* Line 1806 of yacc.c */ -#line 560 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = ')'; } + ;} break; case 79: - -/* Line 1806 of yacc.c */ -#line 561 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '{'; } +#line 557 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token_list) = (yyvsp[(1) - (2)].token_list); + _token_list_append ((yyval.token_list), (yyvsp[(2) - (2)].token)); + ;} break; case 80: - -/* Line 1806 of yacc.c */ -#line 562 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '}'; } +#line 564 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[(1) - (1)].str)); + (yyval.token)->location = yylloc; + ;} break; case 81: - -/* Line 1806 of yacc.c */ -#line 563 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '.'; } +#line 568 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[(1) - (1)].str)); + (yyval.token)->location = yylloc; + ;} break; case 82: - -/* Line 1806 of yacc.c */ -#line 564 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '&'; } +#line 572 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token) = _token_create_ival (parser, (yyvsp[(1) - (1)].ival), (yyvsp[(1) - (1)].ival)); + (yyval.token)->location = yylloc; + ;} break; case 83: - -/* Line 1806 of yacc.c */ -#line 565 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '*'; } +#line 576 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token) = _token_create_str (parser, OTHER, (yyvsp[(1) - (1)].str)); + (yyval.token)->location = yylloc; + ;} break; case 84: - -/* Line 1806 of yacc.c */ -#line 566 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '+'; } +#line 580 "src/glsl/glcpp/glcpp-parse.y" + { + (yyval.token) = _token_create_ival (parser, SPACE, SPACE); + (yyval.token)->location = yylloc; + ;} break; case 85: - -/* Line 1806 of yacc.c */ -#line 567 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '-'; } +#line 587 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '['; ;} break; case 86: - -/* Line 1806 of yacc.c */ -#line 568 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '~'; } +#line 588 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = ']'; ;} break; case 87: - -/* Line 1806 of yacc.c */ -#line 569 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '!'; } +#line 589 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '('; ;} break; case 88: - -/* Line 1806 of yacc.c */ -#line 570 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '/'; } +#line 590 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = ')'; ;} break; case 89: - -/* Line 1806 of yacc.c */ -#line 571 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '%'; } +#line 591 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '{'; ;} break; case 90: - -/* Line 1806 of yacc.c */ -#line 572 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = LEFT_SHIFT; } +#line 592 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '}'; ;} break; case 91: - -/* Line 1806 of yacc.c */ -#line 573 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = RIGHT_SHIFT; } +#line 593 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '.'; ;} break; case 92: - -/* Line 1806 of yacc.c */ -#line 574 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '<'; } +#line 594 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '&'; ;} break; case 93: - -/* Line 1806 of yacc.c */ -#line 575 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '>'; } +#line 595 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '*'; ;} break; case 94: - -/* Line 1806 of yacc.c */ -#line 576 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = LESS_OR_EQUAL; } +#line 596 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '+'; ;} break; case 95: - -/* Line 1806 of yacc.c */ -#line 577 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = GREATER_OR_EQUAL; } +#line 597 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '-'; ;} break; case 96: - -/* Line 1806 of yacc.c */ -#line 578 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = EQUAL; } +#line 598 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '~'; ;} break; case 97: - -/* Line 1806 of yacc.c */ -#line 579 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = NOT_EQUAL; } +#line 599 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '!'; ;} break; case 98: - -/* Line 1806 of yacc.c */ -#line 580 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '^'; } +#line 600 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '/'; ;} break; case 99: - -/* Line 1806 of yacc.c */ -#line 581 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '|'; } +#line 601 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '%'; ;} break; case 100: - -/* Line 1806 of yacc.c */ -#line 582 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = AND; } +#line 602 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = LEFT_SHIFT; ;} break; case 101: - -/* Line 1806 of yacc.c */ -#line 583 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = OR; } +#line 603 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = RIGHT_SHIFT; ;} break; case 102: - -/* Line 1806 of yacc.c */ -#line 584 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = ';'; } +#line 604 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '<'; ;} break; case 103: - -/* Line 1806 of yacc.c */ -#line 585 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = ','; } +#line 605 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '>'; ;} break; case 104: - -/* Line 1806 of yacc.c */ -#line 586 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = '='; } +#line 606 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = LESS_OR_EQUAL; ;} break; case 105: +#line 607 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = GREATER_OR_EQUAL; ;} + break; -/* Line 1806 of yacc.c */ -#line 587 "src/glsl/glcpp/glcpp-parse.y" - { (yyval.ival) = PASTE; } + case 106: +#line 608 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = EQUAL; ;} + break; + + case 107: +#line 609 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = NOT_EQUAL; ;} + break; + + case 108: +#line 610 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '^'; ;} + break; + + case 109: +#line 611 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '|'; ;} + break; + + case 110: +#line 612 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = AND; ;} + break; + + case 111: +#line 613 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = OR; ;} + break; + + case 112: +#line 614 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = ';'; ;} + break; + + case 113: +#line 615 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = ','; ;} + break; + + case 114: +#line 616 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = '='; ;} + break; + + case 115: +#line 617 "src/glsl/glcpp/glcpp-parse.y" + { (yyval.ival) = PASTE; ;} break; - -/* Line 1806 of yacc.c */ -#line 2779 "src/glsl/glcpp/glcpp-parse.c" +/* Line 1267 of yacc.c. */ +#line 2650 "src/glsl/glcpp/glcpp-parse.c" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -2817,10 +2677,6 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -2828,44 +2684,45 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (&yylloc, parser, YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (&yylloc, parser, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (&yylloc, parser, yymsg); + } + else + { + yyerror (&yylloc, parser, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } - yyerror_range[1] = yylloc; + yyerror_range[0] = yylloc; if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -2882,7 +2739,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -2898,7 +2755,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - yyerror_range[1] = yylsp[1-yylen]; + yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -2917,7 +2774,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -2932,7 +2789,7 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - yyerror_range[1] = *yylsp; + yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, parser); YYPOPSTACK (1); @@ -2940,12 +2797,15 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; - yyerror_range[2] = yylloc; + yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + the look-ahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ @@ -2969,7 +2829,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -2980,14 +2840,9 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, parser); - } + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, parser); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -3011,9 +2866,7 @@ yyreturn: } - -/* Line 2067 of yacc.c */ -#line 590 "src/glsl/glcpp/glcpp-parse.y" +#line 620 "src/glsl/glcpp/glcpp-parse.y" string_list_t * @@ -3481,26 +3334,67 @@ _token_paste (glcpp_parser_t *parser, token_t *token, token_t *other) return combined; } - /* Two string-valued tokens can usually just be mashed - * together. + /* Two string-valued (or integer) tokens can usually just be + * mashed together. (We also handle a string followed by an + * integer here as well.) * - * XXX: This isn't actually legitimate. Several things here - * should result in a diagnostic since the result cannot be a - * valid, single pre-processing token. For example, pasting - * "123" and "abc" is not legal, but we don't catch that - * here. */ - if ((token->type == IDENTIFIER || token->type == OTHER || token->type == INTEGER_STRING) && - (other->type == IDENTIFIER || other->type == OTHER || other->type == INTEGER_STRING)) + * There are some exceptions here. Notably, if the first token + * is an integer (or a string representing an integer), then + * the second token must also be an integer or must be a + * string representing an integer that begins with a digit. + */ + if ((token->type == IDENTIFIER || token->type == OTHER || token->type == INTEGER_STRING || token->type == INTEGER) && + (other->type == IDENTIFIER || other->type == OTHER || other->type == INTEGER_STRING || other->type == INTEGER)) { char *str; + int combined_type; - str = ralloc_asprintf (token, "%s%s", token->value.str, - other->value.str); - combined = _token_create_str (token, token->type, str); + /* Check that pasting onto an integer doesn't create a + * non-integer, (that is, only digits can be + * pasted. */ + if (token->type == INTEGER_STRING || token->type == INTEGER) + { + switch (other->type) { + case INTEGER_STRING: + if (other->value.str[0] < '0' || + other->value.str[0] > '9') + goto FAIL; + break; + case INTEGER: + if (other->value.ival < 0) + goto FAIL; + break; + default: + goto FAIL; + } + } + + if (token->type == INTEGER) + str = ralloc_asprintf (token, "%" PRIiMAX, + token->value.ival); + else + str = ralloc_strdup (token, token->value.str); + + + if (other->type == INTEGER) + ralloc_asprintf_append (&str, "%" PRIiMAX, + other->value.ival); + else + ralloc_strcat (&str, other->value.str); + + /* New token is same type as original token, unless we + * started with an integer, in which case we will be + * creating an integer-string. */ + combined_type = token->type; + if (combined_type == INTEGER) + combined_type = INTEGER_STRING; + + combined = _token_create_str (token, combined_type, str); combined->location = token->location; return combined; } + FAIL: glcpp_error (&token->location, parser, ""); ralloc_asprintf_rewrite_tail (&parser->info_log, &parser->info_log_length, "Pasting \""); _token_print (&parser->info_log, &parser->info_log_length, token); @@ -3543,10 +3437,9 @@ static void add_builtin_define(glcpp_parser_t *parser, } glcpp_parser_t * -glcpp_parser_create (const struct gl_extensions *extensions, int api) +glcpp_parser_create (const struct gl_extensions *extensions, gl_api api) { glcpp_parser_t *parser; - int language_version; parser = ralloc (NULL, glcpp_parser_t); @@ -3559,6 +3452,7 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) parser->newline_as_space = 0; parser->in_control_line = 0; parser->paren_count = 0; + parser->commented_newlines = 0; parser->skip_stack = NULL; @@ -3571,54 +3465,15 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) parser->info_log_length = 0; parser->error = 0; + parser->extensions = extensions; + parser->api = api; + parser->version_resolved = false; + parser->has_new_line_number = 0; parser->new_line_number = 1; parser->has_new_source_number = 0; parser->new_source_number = 0; - /* Add pre-defined macros. */ - add_builtin_define(parser, "GL_ARB_draw_buffers", 1); - add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); - - if (api == API_OPENGLES2) - add_builtin_define(parser, "GL_ES", 1); - - if (extensions != NULL) { - if (extensions->EXT_texture_array) { - add_builtin_define(parser, "GL_EXT_texture_array", 1); - } - - if (extensions->ARB_fragment_coord_conventions) - add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", - 1); - - if (extensions->ARB_explicit_attrib_location) - add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1); - - if (extensions->ARB_shader_texture_lod) - add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); - - if (extensions->ARB_draw_instanced) - add_builtin_define(parser, "GL_ARB_draw_instanced", 1); - - if (extensions->ARB_conservative_depth) { - add_builtin_define(parser, "GL_AMD_conservative_depth", 1); - add_builtin_define(parser, "GL_ARB_conservative_depth", 1); - } - - if (extensions->OES_EGL_image_external) - add_builtin_define(parser, "GL_OES_EGL_image_external", 1); - - if (extensions->ARB_shader_bit_encoding) - add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1); - - if (extensions->ARB_uniform_buffer_object) - add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1); - } - - language_version = 110; - add_builtin_define(parser, "__VERSION__", language_version); - return parser; } @@ -3721,18 +3576,30 @@ _arguments_parse (argument_list_t *arguments, } static token_list_t * -_token_list_create_with_one_space (void *ctx) +_token_list_create_with_one_ival (void *ctx, int type, int ival) { token_list_t *list; - token_t *space; + token_t *node; list = _token_list_create (ctx); - space = _token_create_ival (list, SPACE, SPACE); - _token_list_append (list, space); + node = _token_create_ival (list, type, ival); + _token_list_append (list, node); return list; } +static token_list_t * +_token_list_create_with_one_space (void *ctx) +{ + return _token_list_create_with_one_ival (ctx, SPACE, SPACE); +} + +static token_list_t * +_token_list_create_with_one_integer (void *ctx, int ival) +{ + return _token_list_create_with_one_ival (ctx, INTEGER, ival); +} + /* Perform macro expansion on 'list', placing the resulting tokens * into a new list which is initialized with a first token of type * 'head_token_type'. Then begin lexing from the resulting list, @@ -3949,8 +3816,18 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, return NULL; } - /* Look up this identifier in the hash table. */ + *last = node; identifier = token->value.str; + + /* Special handling for __LINE__ and __FILE__, (not through + * the hash table). */ + if (strcmp(identifier, "__LINE__") == 0) + return _token_list_create_with_one_integer (parser, node->token->location.first_line); + + if (strcmp(identifier, "__FILE__") == 0) + return _token_list_create_with_one_integer (parser, node->token->location.source); + + /* Look up this identifier in the hash table. */ macro = hash_table_find (parser->defines, identifier); /* Not a macro, so no expansion needed. */ @@ -3971,14 +3848,12 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, final = _token_create_str (parser, OTHER, str); expansion = _token_list_create (parser); _token_list_append (expansion, final); - *last = node; return expansion; } if (! macro->is_function) { token_list_t *replacement; - *last = node; /* Replace a macro defined as empty with a SPACE token. */ if (macro->replacements == NULL) @@ -4270,7 +4145,7 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser) if (ret == NEWLINE) parser->in_control_line = 0; } - else if (ret == HASH_DEFINE_OBJ || ret == HASH_DEFINE_FUNC || + else if (ret == HASH_DEFINE || ret == HASH_UNDEF || ret == HASH_IF || ret == HASH_IFDEF || ret == HASH_IFNDEF || ret == HASH_ELIF || ret == HASH_ELSE || @@ -4357,6 +4232,7 @@ _glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc, node->type = SKIP_TO_ENDIF; } + node->has_else = false; node->next = parser->skip_stack; parser->skip_stack = node; } @@ -4393,3 +4269,146 @@ _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc) ralloc_free (node); } +static void +_glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t version, + const char *es_identifier, + bool explicitly_set) +{ + const struct gl_extensions *extensions = parser->extensions; + + if (parser->version_resolved) + return; + + parser->version_resolved = true; + + add_builtin_define (parser, "__VERSION__", version); + + parser->is_gles = (version == 100) || + (es_identifier && + (strcmp(es_identifier, "es") == 0)); + + /* Add pre-defined macros. */ + if (parser->is_gles) { + add_builtin_define(parser, "GL_ES", 1); + + if (extensions != NULL) { + if (extensions->OES_EGL_image_external) + add_builtin_define(parser, "GL_OES_EGL_image_external", 1); + } + } else { + add_builtin_define(parser, "GL_ARB_draw_buffers", 1); + add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); + add_builtin_define(parser, "GL_AMD_shader_trinary_minmax", 1); + + + if (extensions != NULL) { + if (extensions->EXT_texture_array) + add_builtin_define(parser, "GL_EXT_texture_array", 1); + + if (extensions->ARB_arrays_of_arrays) + add_builtin_define(parser, "GL_ARB_arrays_of_arrays", 1); + + if (extensions->ARB_fragment_coord_conventions) + add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", + 1); + + if (extensions->ARB_explicit_attrib_location) + add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1); + + if (extensions->ARB_shader_texture_lod) + add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); + + if (extensions->ARB_draw_instanced) + add_builtin_define(parser, "GL_ARB_draw_instanced", 1); + + if (extensions->ARB_conservative_depth) { + add_builtin_define(parser, "GL_AMD_conservative_depth", 1); + add_builtin_define(parser, "GL_ARB_conservative_depth", 1); + } + + if (extensions->ARB_shader_bit_encoding) + add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1); + + if (extensions->ARB_uniform_buffer_object) + add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1); + + if (extensions->ARB_texture_cube_map_array) + add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1); + + if (extensions->ARB_shading_language_packing) + add_builtin_define(parser, "GL_ARB_shading_language_packing", 1); + + if (extensions->ARB_texture_multisample) + add_builtin_define(parser, "GL_ARB_texture_multisample", 1); + + if (extensions->ARB_texture_query_levels) + add_builtin_define(parser, "GL_ARB_texture_query_levels", 1); + + if (extensions->ARB_texture_query_lod) + add_builtin_define(parser, "GL_ARB_texture_query_lod", 1); + + if (extensions->ARB_gpu_shader5) + add_builtin_define(parser, "GL_ARB_gpu_shader5", 1); + + if (extensions->AMD_vertex_shader_layer) + add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1); + + if (extensions->ARB_shading_language_420pack) + add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1); + + if (extensions->ARB_sample_shading) + add_builtin_define(parser, "GL_ARB_sample_shading", 1); + + if (extensions->ARB_texture_gather) + add_builtin_define(parser, "GL_ARB_texture_gather", 1); + + if (extensions->ARB_shader_atomic_counters) + add_builtin_define(parser, "GL_ARB_shader_atomic_counters", 1); + + if (extensions->ARB_viewport_array) + add_builtin_define(parser, "GL_ARB_viewport_array", 1); + } + } + + if (extensions != NULL) { + if (extensions->EXT_shader_integer_mix) + add_builtin_define(parser, "GL_EXT_shader_integer_mix", 1); + } + + if (version >= 150) + add_builtin_define(parser, "GL_core_profile", 1); + + /* Currently, all ES2/ES3 implementations support highp in the + * fragment shader, so we always define this macro in ES2/ES3. + * If we ever get a driver that doesn't support highp, we'll + * need to add a flag to the gl_context and check that here. + */ + if (version >= 130 || parser->is_gles) + add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1); + + if (explicitly_set) { + ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, + "#version %" PRIiMAX "%s%s", version, + es_identifier ? " " : "", + es_identifier ? es_identifier : ""); + } +} + +/* GLSL version if no version is explicitly specified. */ +#define IMPLICIT_GLSL_VERSION 110 +#define IMPLICIT_GLSL_ES_VERSION 100 + +/* GLSL ES version if no version is explicitly specified. */ +#define IMPLICIT_GLSL_ES_VERSION 100 + +void +glcpp_parser_resolve_implicit_version(glcpp_parser_t *parser) +{ + int language_version = parser->api == API_OPENGLES2 ? + IMPLICIT_GLSL_ES_VERSION : + IMPLICIT_GLSL_VERSION; + + _glcpp_parser_handle_version_declaration(parser, language_version, + NULL, false); +} + diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h index 74767e72e..ce952c541 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,11 +29,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -41,45 +43,84 @@ DEFINED = 259, ELIF_EXPANDED = 260, HASH = 261, - HASH_DEFINE_FUNC = 262, - HASH_DEFINE_OBJ = 263, - HASH_ELIF = 264, - HASH_ELSE = 265, - HASH_ENDIF = 266, - HASH_IF = 267, - HASH_IFDEF = 268, - HASH_IFNDEF = 269, - HASH_LINE = 270, - HASH_UNDEF = 271, - HASH_VERSION = 272, - IDENTIFIER = 273, - IF_EXPANDED = 274, - INTEGER = 275, - INTEGER_STRING = 276, - LINE_EXPANDED = 277, - NEWLINE = 278, - OTHER = 279, - PLACEHOLDER = 280, - SPACE = 281, - PASTE = 282, - OR = 283, - AND = 284, - NOT_EQUAL = 285, - EQUAL = 286, - GREATER_OR_EQUAL = 287, - LESS_OR_EQUAL = 288, - RIGHT_SHIFT = 289, - LEFT_SHIFT = 290, - UNARY = 291 + HASH_DEFINE = 262, + FUNC_IDENTIFIER = 263, + OBJ_IDENTIFIER = 264, + HASH_ELIF = 265, + HASH_ELSE = 266, + HASH_ENDIF = 267, + HASH_IF = 268, + HASH_IFDEF = 269, + HASH_IFNDEF = 270, + HASH_LINE = 271, + HASH_UNDEF = 272, + HASH_VERSION = 273, + IDENTIFIER = 274, + IF_EXPANDED = 275, + INTEGER = 276, + INTEGER_STRING = 277, + LINE_EXPANDED = 278, + NEWLINE = 279, + OTHER = 280, + PLACEHOLDER = 281, + SPACE = 282, + PASTE = 283, + OR = 284, + AND = 285, + NOT_EQUAL = 286, + EQUAL = 287, + GREATER_OR_EQUAL = 288, + LESS_OR_EQUAL = 289, + RIGHT_SHIFT = 290, + LEFT_SHIFT = 291, + UNARY = 292 }; #endif +/* Tokens. */ +#define COMMA_FINAL 258 +#define DEFINED 259 +#define ELIF_EXPANDED 260 +#define HASH 261 +#define HASH_DEFINE 262 +#define FUNC_IDENTIFIER 263 +#define OBJ_IDENTIFIER 264 +#define HASH_ELIF 265 +#define HASH_ELSE 266 +#define HASH_ENDIF 267 +#define HASH_IF 268 +#define HASH_IFDEF 269 +#define HASH_IFNDEF 270 +#define HASH_LINE 271 +#define HASH_UNDEF 272 +#define HASH_VERSION 273 +#define IDENTIFIER 274 +#define IF_EXPANDED 275 +#define INTEGER 276 +#define INTEGER_STRING 277 +#define LINE_EXPANDED 278 +#define NEWLINE 279 +#define OTHER 280 +#define PLACEHOLDER 281 +#define SPACE 282 +#define PASTE 283 +#define OR 284 +#define AND 285 +#define NOT_EQUAL 286 +#define EQUAL 287 +#define GREATER_OR_EQUAL 288 +#define LESS_OR_EQUAL 289 +#define RIGHT_SHIFT 290 +#define LEFT_SHIFT 291 +#define UNARY 292 + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - +typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif @@ -98,4 +139,3 @@ typedef struct YYLTYPE #endif - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y index 7300d29e0..d931e5f0c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.y @@ -133,6 +133,10 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc, static void _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc); +static void +_glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t version, + const char *ident, bool explicitly_set); + static int glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser); @@ -160,10 +164,10 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); %lex-param {glcpp_parser_t *parser} %expect 0 -%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE_FUNC HASH_DEFINE_OBJ HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_LINE HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE +%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE FUNC_IDENTIFIER OBJ_IDENTIFIER HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_LINE HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE %token PASTE %type expression INTEGER operator SPACE integer_constant -%type IDENTIFIER INTEGER_STRING OTHER +%type IDENTIFIER FUNC_IDENTIFIER OBJ_IDENTIFIER INTEGER_STRING OTHER %type identifier_list %type preprocessing_token conditional_token %type pp_tokens replacement_list text_line conditional_tokens @@ -190,6 +194,17 @@ line: control_line { ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); } +| HASH_LINE { + glcpp_parser_resolve_implicit_version(parser); + } pp_tokens NEWLINE { + + if (parser->skip_stack == NULL || + parser->skip_stack->type == SKIP_NO_SKIP) + { + _glcpp_parser_expand_and_lex_from (parser, + LINE_EXPANDED, $3); + } + } | text_line { _glcpp_parser_print_expanded_token_list (parser, $1); ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n"); @@ -226,33 +241,35 @@ expanded_line: } ; +define: + OBJ_IDENTIFIER replacement_list NEWLINE { + _define_object_macro (parser, & @1, $1, $2); + } +| FUNC_IDENTIFIER '(' ')' replacement_list NEWLINE { + _define_function_macro (parser, & @1, $1, NULL, $4); + } +| FUNC_IDENTIFIER '(' identifier_list ')' replacement_list NEWLINE { + _define_function_macro (parser, & @1, $1, $3, $5); + } +; + control_line: - HASH_DEFINE_OBJ IDENTIFIER replacement_list NEWLINE { - _define_object_macro (parser, & @2, $2, $3); - } -| HASH_DEFINE_FUNC IDENTIFIER '(' ')' replacement_list NEWLINE { - _define_function_macro (parser, & @2, $2, NULL, $5); - } -| HASH_DEFINE_FUNC IDENTIFIER '(' identifier_list ')' replacement_list NEWLINE { - _define_function_macro (parser, & @2, $2, $4, $6); - } -| HASH_UNDEF IDENTIFIER NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $2); + HASH_DEFINE { + glcpp_parser_resolve_implicit_version(parser); + } define +| HASH_UNDEF { + glcpp_parser_resolve_implicit_version(parser); + } IDENTIFIER NEWLINE { + macro_t *macro = hash_table_find (parser->defines, $3); if (macro) { - hash_table_remove (parser->defines, $2); + hash_table_remove (parser->defines, $3); ralloc_free (macro); } - ralloc_free ($2); + ralloc_free ($3); } -| HASH_LINE pp_tokens NEWLINE { - if (parser->skip_stack == NULL || - parser->skip_stack->type == SKIP_NO_SKIP) - { - _glcpp_parser_expand_and_lex_from (parser, - LINE_EXPANDED, $2); - } - } -| HASH_IF conditional_tokens NEWLINE { +| HASH_IF { + glcpp_parser_resolve_implicit_version(parser); + } conditional_tokens NEWLINE { /* Be careful to only evaluate the 'if' expression if * we are not skipping. When we are skipping, we * simply push a new 0-valued 'if' onto the skip @@ -264,7 +281,7 @@ control_line: parser->skip_stack->type == SKIP_NO_SKIP) { _glcpp_parser_expand_and_lex_from (parser, - IF_EXPANDED, $2); + IF_EXPANDED, $3); } else { @@ -282,15 +299,19 @@ control_line: } _glcpp_parser_skip_stack_push_if (parser, & @1, 0); } -| HASH_IFDEF IDENTIFIER junk NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $2); - ralloc_free ($2); +| HASH_IFDEF { + glcpp_parser_resolve_implicit_version(parser); + } IDENTIFIER junk NEWLINE { + macro_t *macro = hash_table_find (parser->defines, $3); + ralloc_free ($3); _glcpp_parser_skip_stack_push_if (parser, & @1, macro != NULL); } -| HASH_IFNDEF IDENTIFIER junk NEWLINE { - macro_t *macro = hash_table_find (parser->defines, $2); - ralloc_free ($2); - _glcpp_parser_skip_stack_push_if (parser, & @1, macro == NULL); +| HASH_IFNDEF { + glcpp_parser_resolve_implicit_version(parser); + } IDENTIFIER junk NEWLINE { + macro_t *macro = hash_table_find (parser->defines, $3); + ralloc_free ($3); + _glcpp_parser_skip_stack_push_if (parser, & @2, macro == NULL); } | HASH_ELIF conditional_tokens NEWLINE { /* Be careful to only evaluate the 'elif' expression @@ -306,6 +327,11 @@ control_line: _glcpp_parser_expand_and_lex_from (parser, ELIF_EXPANDED, $2); } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& @1, parser, "#elif after #else"); + } else { _glcpp_parser_skip_stack_change_if (parser, & @1, @@ -320,6 +346,11 @@ control_line: { glcpp_error(& @1, parser, "#elif with no expression"); } + else if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& @1, parser, "#elif after #else"); + } else { _glcpp_parser_skip_stack_change_if (parser, & @1, @@ -327,34 +358,31 @@ control_line: glcpp_warning(& @1, parser, "ignoring illegal #elif without expression"); } } -| HASH_ELSE NEWLINE { - _glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1); - } -| HASH_ENDIF NEWLINE { - _glcpp_parser_skip_stack_pop (parser, & @1); - } -| HASH_VERSION integer_constant NEWLINE { - macro_t *macro = hash_table_find (parser->defines, "__VERSION__"); - if (macro) { - hash_table_remove (parser->defines, "__VERSION__"); - ralloc_free (macro); +| HASH_ELSE { + if (parser->skip_stack && + parser->skip_stack->has_else) + { + glcpp_error(& @1, parser, "multiple #else"); } - add_builtin_define (parser, "__VERSION__", $2); - - if ($2 == 100) - add_builtin_define (parser, "GL_ES", 1); - - /* Currently, all ES2 implementations support highp in the - * fragment shader, so we always define this macro in ES2. - * If we ever get a driver that doesn't support highp, we'll - * need to add a flag to the gl_context and check that here. - */ - if ($2 >= 130 || $2 == 100) - add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1); - - ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#version %" PRIiMAX, $2); + else + { + _glcpp_parser_skip_stack_change_if (parser, & @1, "else", 1); + if (parser->skip_stack) + parser->skip_stack->has_else = true; + } + } NEWLINE +| HASH_ENDIF { + _glcpp_parser_skip_stack_pop (parser, & @1); + } NEWLINE +| HASH_VERSION integer_constant NEWLINE { + _glcpp_parser_handle_version_declaration(parser, $2, NULL, true); + } +| HASH_VERSION integer_constant IDENTIFIER NEWLINE { + _glcpp_parser_handle_version_declaration(parser, $2, $3, true); + } +| HASH NEWLINE { + glcpp_parser_resolve_implicit_version(parser); } -| HASH NEWLINE ; integer_constant: @@ -374,6 +402,8 @@ integer_constant: expression: integer_constant | IDENTIFIER { + if (parser->is_gles) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1); $$ = 0; } | expression OR expression { @@ -1054,26 +1084,67 @@ _token_paste (glcpp_parser_t *parser, token_t *token, token_t *other) return combined; } - /* Two string-valued tokens can usually just be mashed - * together. + /* Two string-valued (or integer) tokens can usually just be + * mashed together. (We also handle a string followed by an + * integer here as well.) * - * XXX: This isn't actually legitimate. Several things here - * should result in a diagnostic since the result cannot be a - * valid, single pre-processing token. For example, pasting - * "123" and "abc" is not legal, but we don't catch that - * here. */ - if ((token->type == IDENTIFIER || token->type == OTHER || token->type == INTEGER_STRING) && - (other->type == IDENTIFIER || other->type == OTHER || other->type == INTEGER_STRING)) + * There are some exceptions here. Notably, if the first token + * is an integer (or a string representing an integer), then + * the second token must also be an integer or must be a + * string representing an integer that begins with a digit. + */ + if ((token->type == IDENTIFIER || token->type == OTHER || token->type == INTEGER_STRING || token->type == INTEGER) && + (other->type == IDENTIFIER || other->type == OTHER || other->type == INTEGER_STRING || other->type == INTEGER)) { char *str; + int combined_type; - str = ralloc_asprintf (token, "%s%s", token->value.str, - other->value.str); - combined = _token_create_str (token, token->type, str); + /* Check that pasting onto an integer doesn't create a + * non-integer, (that is, only digits can be + * pasted. */ + if (token->type == INTEGER_STRING || token->type == INTEGER) + { + switch (other->type) { + case INTEGER_STRING: + if (other->value.str[0] < '0' || + other->value.str[0] > '9') + goto FAIL; + break; + case INTEGER: + if (other->value.ival < 0) + goto FAIL; + break; + default: + goto FAIL; + } + } + + if (token->type == INTEGER) + str = ralloc_asprintf (token, "%" PRIiMAX, + token->value.ival); + else + str = ralloc_strdup (token, token->value.str); + + + if (other->type == INTEGER) + ralloc_asprintf_append (&str, "%" PRIiMAX, + other->value.ival); + else + ralloc_strcat (&str, other->value.str); + + /* New token is same type as original token, unless we + * started with an integer, in which case we will be + * creating an integer-string. */ + combined_type = token->type; + if (combined_type == INTEGER) + combined_type = INTEGER_STRING; + + combined = _token_create_str (token, combined_type, str); combined->location = token->location; return combined; } + FAIL: glcpp_error (&token->location, parser, ""); ralloc_asprintf_rewrite_tail (&parser->info_log, &parser->info_log_length, "Pasting \""); _token_print (&parser->info_log, &parser->info_log_length, token); @@ -1116,10 +1187,9 @@ static void add_builtin_define(glcpp_parser_t *parser, } glcpp_parser_t * -glcpp_parser_create (const struct gl_extensions *extensions, int api) +glcpp_parser_create (const struct gl_extensions *extensions, gl_api api) { glcpp_parser_t *parser; - int language_version; parser = ralloc (NULL, glcpp_parser_t); @@ -1132,6 +1202,7 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) parser->newline_as_space = 0; parser->in_control_line = 0; parser->paren_count = 0; + parser->commented_newlines = 0; parser->skip_stack = NULL; @@ -1144,54 +1215,15 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) parser->info_log_length = 0; parser->error = 0; + parser->extensions = extensions; + parser->api = api; + parser->version_resolved = false; + parser->has_new_line_number = 0; parser->new_line_number = 1; parser->has_new_source_number = 0; parser->new_source_number = 0; - /* Add pre-defined macros. */ - add_builtin_define(parser, "GL_ARB_draw_buffers", 1); - add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); - - if (api == API_OPENGLES2) - add_builtin_define(parser, "GL_ES", 1); - - if (extensions != NULL) { - if (extensions->EXT_texture_array) { - add_builtin_define(parser, "GL_EXT_texture_array", 1); - } - - if (extensions->ARB_fragment_coord_conventions) - add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", - 1); - - if (extensions->ARB_explicit_attrib_location) - add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1); - - if (extensions->ARB_shader_texture_lod) - add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); - - if (extensions->ARB_draw_instanced) - add_builtin_define(parser, "GL_ARB_draw_instanced", 1); - - if (extensions->ARB_conservative_depth) { - add_builtin_define(parser, "GL_AMD_conservative_depth", 1); - add_builtin_define(parser, "GL_ARB_conservative_depth", 1); - } - - if (extensions->OES_EGL_image_external) - add_builtin_define(parser, "GL_OES_EGL_image_external", 1); - - if (extensions->ARB_shader_bit_encoding) - add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1); - - if (extensions->ARB_uniform_buffer_object) - add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1); - } - - language_version = 110; - add_builtin_define(parser, "__VERSION__", language_version); - return parser; } @@ -1294,18 +1326,30 @@ _arguments_parse (argument_list_t *arguments, } static token_list_t * -_token_list_create_with_one_space (void *ctx) +_token_list_create_with_one_ival (void *ctx, int type, int ival) { token_list_t *list; - token_t *space; + token_t *node; list = _token_list_create (ctx); - space = _token_create_ival (list, SPACE, SPACE); - _token_list_append (list, space); + node = _token_create_ival (list, type, ival); + _token_list_append (list, node); return list; } +static token_list_t * +_token_list_create_with_one_space (void *ctx) +{ + return _token_list_create_with_one_ival (ctx, SPACE, SPACE); +} + +static token_list_t * +_token_list_create_with_one_integer (void *ctx, int ival) +{ + return _token_list_create_with_one_ival (ctx, INTEGER, ival); +} + /* Perform macro expansion on 'list', placing the resulting tokens * into a new list which is initialized with a first token of type * 'head_token_type'. Then begin lexing from the resulting list, @@ -1522,8 +1566,18 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, return NULL; } - /* Look up this identifier in the hash table. */ + *last = node; identifier = token->value.str; + + /* Special handling for __LINE__ and __FILE__, (not through + * the hash table). */ + if (strcmp(identifier, "__LINE__") == 0) + return _token_list_create_with_one_integer (parser, node->token->location.first_line); + + if (strcmp(identifier, "__FILE__") == 0) + return _token_list_create_with_one_integer (parser, node->token->location.source); + + /* Look up this identifier in the hash table. */ macro = hash_table_find (parser->defines, identifier); /* Not a macro, so no expansion needed. */ @@ -1544,14 +1598,12 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, final = _token_create_str (parser, OTHER, str); expansion = _token_list_create (parser); _token_list_append (expansion, final); - *last = node; return expansion; } if (! macro->is_function) { token_list_t *replacement; - *last = node; /* Replace a macro defined as empty with a SPACE token. */ if (macro->replacements == NULL) @@ -1843,7 +1895,7 @@ glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser) if (ret == NEWLINE) parser->in_control_line = 0; } - else if (ret == HASH_DEFINE_OBJ || ret == HASH_DEFINE_FUNC || + else if (ret == HASH_DEFINE || ret == HASH_UNDEF || ret == HASH_IF || ret == HASH_IFDEF || ret == HASH_IFNDEF || ret == HASH_ELIF || ret == HASH_ELSE || @@ -1930,6 +1982,7 @@ _glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc, node->type = SKIP_TO_ENDIF; } + node->has_else = false; node->next = parser->skip_stack; parser->skip_stack = node; } @@ -1965,3 +2018,146 @@ _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc) parser->skip_stack = node->next; ralloc_free (node); } + +static void +_glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t version, + const char *es_identifier, + bool explicitly_set) +{ + const struct gl_extensions *extensions = parser->extensions; + + if (parser->version_resolved) + return; + + parser->version_resolved = true; + + add_builtin_define (parser, "__VERSION__", version); + + parser->is_gles = (version == 100) || + (es_identifier && + (strcmp(es_identifier, "es") == 0)); + + /* Add pre-defined macros. */ + if (parser->is_gles) { + add_builtin_define(parser, "GL_ES", 1); + + if (extensions != NULL) { + if (extensions->OES_EGL_image_external) + add_builtin_define(parser, "GL_OES_EGL_image_external", 1); + } + } else { + add_builtin_define(parser, "GL_ARB_draw_buffers", 1); + add_builtin_define(parser, "GL_ARB_texture_rectangle", 1); + add_builtin_define(parser, "GL_AMD_shader_trinary_minmax", 1); + + + if (extensions != NULL) { + if (extensions->EXT_texture_array) + add_builtin_define(parser, "GL_EXT_texture_array", 1); + + if (extensions->ARB_arrays_of_arrays) + add_builtin_define(parser, "GL_ARB_arrays_of_arrays", 1); + + if (extensions->ARB_fragment_coord_conventions) + add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", + 1); + + if (extensions->ARB_explicit_attrib_location) + add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1); + + if (extensions->ARB_shader_texture_lod) + add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); + + if (extensions->ARB_draw_instanced) + add_builtin_define(parser, "GL_ARB_draw_instanced", 1); + + if (extensions->ARB_conservative_depth) { + add_builtin_define(parser, "GL_AMD_conservative_depth", 1); + add_builtin_define(parser, "GL_ARB_conservative_depth", 1); + } + + if (extensions->ARB_shader_bit_encoding) + add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1); + + if (extensions->ARB_uniform_buffer_object) + add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1); + + if (extensions->ARB_texture_cube_map_array) + add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1); + + if (extensions->ARB_shading_language_packing) + add_builtin_define(parser, "GL_ARB_shading_language_packing", 1); + + if (extensions->ARB_texture_multisample) + add_builtin_define(parser, "GL_ARB_texture_multisample", 1); + + if (extensions->ARB_texture_query_levels) + add_builtin_define(parser, "GL_ARB_texture_query_levels", 1); + + if (extensions->ARB_texture_query_lod) + add_builtin_define(parser, "GL_ARB_texture_query_lod", 1); + + if (extensions->ARB_gpu_shader5) + add_builtin_define(parser, "GL_ARB_gpu_shader5", 1); + + if (extensions->AMD_vertex_shader_layer) + add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1); + + if (extensions->ARB_shading_language_420pack) + add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1); + + if (extensions->ARB_sample_shading) + add_builtin_define(parser, "GL_ARB_sample_shading", 1); + + if (extensions->ARB_texture_gather) + add_builtin_define(parser, "GL_ARB_texture_gather", 1); + + if (extensions->ARB_shader_atomic_counters) + add_builtin_define(parser, "GL_ARB_shader_atomic_counters", 1); + + if (extensions->ARB_viewport_array) + add_builtin_define(parser, "GL_ARB_viewport_array", 1); + } + } + + if (extensions != NULL) { + if (extensions->EXT_shader_integer_mix) + add_builtin_define(parser, "GL_EXT_shader_integer_mix", 1); + } + + if (version >= 150) + add_builtin_define(parser, "GL_core_profile", 1); + + /* Currently, all ES2/ES3 implementations support highp in the + * fragment shader, so we always define this macro in ES2/ES3. + * If we ever get a driver that doesn't support highp, we'll + * need to add a flag to the gl_context and check that here. + */ + if (version >= 130 || parser->is_gles) + add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1); + + if (explicitly_set) { + ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, + "#version %" PRIiMAX "%s%s", version, + es_identifier ? " " : "", + es_identifier ? es_identifier : ""); + } +} + +/* GLSL version if no version is explicitly specified. */ +#define IMPLICIT_GLSL_VERSION 110 +#define IMPLICIT_GLSL_ES_VERSION 100 + +/* GLSL ES version if no version is explicitly specified. */ +#define IMPLICIT_GLSL_ES_VERSION 100 + +void +glcpp_parser_resolve_implicit_version(glcpp_parser_t *parser) +{ + int language_version = parser->api == API_OPENGLES2 ? + IMPLICIT_GLSL_ES_VERSION : + IMPLICIT_GLSL_VERSION; + + _glcpp_parser_handle_version_declaration(parser, language_version, + NULL, false); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h index 9326177ca..3be4240da 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp.h @@ -27,6 +27,8 @@ #include #include +#include "main/mtypes.h" + #include "../ralloc.h" #include "program/hash_table.h" @@ -52,7 +54,7 @@ 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; + intmax_t ival; char *str; string_list_t *string_list; token_t *token; @@ -153,6 +155,7 @@ typedef enum skip_type { typedef struct skip_node { skip_type_t type; + bool has_else; YYLTYPE loc; /* location of the initial #if/#elif/... */ struct skip_node *next; } skip_node_t; @@ -172,6 +175,7 @@ struct glcpp_parser { int newline_as_space; int in_control_line; int paren_count; + int commented_newlines; skip_node_t *skip_stack; token_list_t *lex_from_list; token_node_t *lex_from_node; @@ -180,16 +184,20 @@ struct glcpp_parser { size_t output_length; size_t info_log_length; int error; + const struct gl_extensions *extensions; + gl_api api; + bool version_resolved; bool has_new_line_number; int new_line_number; bool has_new_source_number; int new_source_number; + bool is_gles; }; struct gl_extensions; glcpp_parser_t * -glcpp_parser_create (const struct gl_extensions *extensions, int api); +glcpp_parser_create (const struct gl_extensions *extensions, gl_api api); int glcpp_parser_parse (glcpp_parser_t *parser); @@ -197,9 +205,12 @@ glcpp_parser_parse (glcpp_parser_t *parser); void glcpp_parser_destroy (glcpp_parser_t *parser); +void +glcpp_parser_resolve_implicit_version(glcpp_parser_t *parser); + int glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, - const struct gl_extensions *extensions, int api); + const struct gl_extensions *extensions, struct gl_context *g_ctx); /* Functions for writing to the info log */ diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c index 7e5b99649..4a623f81e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c @@ -70,92 +70,79 @@ glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...) &parser->info_log_length, "\n"); } -/* Searches backwards for '^ *#' from a given starting point. */ -static int -in_directive(const char *shader, const char *ptr) -{ - assert(ptr >= shader); - - /* Search backwards for '#'. If we find a \n first, it doesn't count */ - for (; ptr >= shader && *ptr != '#'; ptr--) { - if (*ptr == '\n') - return 0; - } - if (ptr >= shader) { - /* Found '#'...look for spaces preceded by a newline */ - for (ptr--; ptr >= shader && isblank(*ptr); ptr--); - // FIXME: I don't think the '\n' case can happen - if (ptr < shader || *ptr == '\n') - return 1; - } - return 0; -} - -/* Remove any line continuation characters in preprocessing directives. - * However, ignore any in GLSL code, as "There is no line continuation - * character" (1.30 page 9) in GLSL. +/* Remove any line continuation characters in the shader, (whether in + * preprocessing directives or in GLSL code). */ static char * remove_line_continuations(glcpp_parser_t *ctx, const char *shader) { - int in_continued_line = 0; - int extra_newlines = 0; char *clean = ralloc_strdup(ctx, ""); - const char *search_start = shader; - const char *newline; - while ((newline = strchr(search_start, '\n')) != NULL) { - const char *backslash = NULL; + const char *backslash, *newline, *search_start; + int collapsed_newlines = 0; - /* # of characters preceding the newline. */ - size_t n = newline - shader; + search_start = shader; - /* Find the preceding '\', if it exists */ - if (n >= 1 && newline[-1] == '\\') - backslash = newline - 1; - else if (n >= 2 && newline[-1] == '\r' && newline[-2] == '\\') - backslash = newline - 2; + while (true) { + backslash = strchr(search_start, '\\'); - /* Double backslashes don't count (the backslash is escaped) */ - if (backslash != NULL && backslash[-1] == '\\') { - backslash = NULL; - } - - if (backslash != NULL) { - /* We found a line continuation, but do we care? */ - if (!in_continued_line) { - if (in_directive(shader, backslash)) { - in_continued_line = 1; - extra_newlines = 0; + /* If we have previously collapsed any line-continuations, + * then we want to insert additional newlines at the next + * occurrence of a newline character to avoid changing any + * line numbers. + */ + if (collapsed_newlines) { + newline = strchr(search_start, '\n'); + if (newline && + (backslash == NULL || newline < backslash)) + { + ralloc_strncat(&clean, shader, + newline - shader + 1); + while (collapsed_newlines) { + ralloc_strcat(&clean, "\n"); + collapsed_newlines--; } - } - if (in_continued_line) { - /* Copy everything before the \ */ - ralloc_strncat(&clean, shader, backslash - shader); shader = newline + 1; - extra_newlines++; + search_start = shader; } - } else if (in_continued_line) { - /* Copy everything up to and including the \n */ - ralloc_strncat(&clean, shader, newline - shader + 1); - shader = newline + 1; - /* Output extra newlines to make line numbers match */ - for (; extra_newlines > 0; extra_newlines--) - ralloc_strcat(&clean, "\n"); - in_continued_line = 0; } - search_start = newline + 1; + + search_start = backslash + 1; + + if (backslash == NULL) + break; + + /* At each line continuation, (backslash followed by a + * newline), copy all preceding text to the output, then + * advance the shader pointer to the character after the + * newline. + */ + if (backslash[1] == '\n' || + (backslash[1] == '\r' && backslash[2] == '\n')) + { + collapsed_newlines++; + ralloc_strncat(&clean, shader, backslash - shader); + if (backslash[1] == '\n') + shader = backslash + 2; + else + shader = backslash + 3; + search_start = shader; + } } + ralloc_strcat(&clean, shader); + return clean; } int glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, - const struct gl_extensions *extensions, int api) + const struct gl_extensions *extensions, struct gl_context *gl_ctx) { int errors; - glcpp_parser_t *parser = glcpp_parser_create (extensions, api); - *shader = remove_line_continuations(parser, *shader); + glcpp_parser_t *parser = glcpp_parser_create (extensions, gl_ctx->API); + + if (! gl_ctx->Const.DisableGLSLLineContinuations) + *shader = remove_line_continuations(parser, *shader); glcpp_lex_set_source_string (parser, *shader); @@ -164,6 +151,8 @@ glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, if (parser->skip_stack) glcpp_error (&parser->skip_stack->loc, parser, "Unterminated #if\n"); + glcpp_parser_resolve_implicit_version(parser); + ralloc_strcat(info_log, parser->info_log); ralloc_steal(ralloc_ctx, parser->output); diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/000-content-with-spaces.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/000-content-with-spaces.c deleted file mode 100644 index 696cb3a74..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/000-content-with-spaces.c +++ /dev/null @@ -1 +0,0 @@ -this is four tokens diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/000-content-with-spaces.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/000-content-with-spaces.c.expected deleted file mode 100644 index 83f7834d5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/000-content-with-spaces.c.expected +++ /dev/null @@ -1,2 +0,0 @@ -this is four tokens - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/001-define.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/001-define.c deleted file mode 100644 index cbf2fee0e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/001-define.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo 1 -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/001-define.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/001-define.c.expected deleted file mode 100644 index 878fd15d6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/001-define.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/002-define-chain.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/002-define-chain.c deleted file mode 100644 index 87d75c687..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/002-define-chain.c +++ /dev/null @@ -1,3 +0,0 @@ -#define foo 1 -#define bar foo -bar diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/002-define-chain.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/002-define-chain.c.expected deleted file mode 100644 index 43d484d71..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/002-define-chain.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/003-define-chain-reverse.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/003-define-chain-reverse.c deleted file mode 100644 index a18b724ec..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/003-define-chain-reverse.c +++ /dev/null @@ -1,3 +0,0 @@ -#define bar foo -#define foo 1 -bar diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected deleted file mode 100644 index 43d484d71..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/003-define-chain-reverse.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/004-define-recursive.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/004-define-recursive.c deleted file mode 100644 index 2ac56ea3d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/004-define-recursive.c +++ /dev/null @@ -1,6 +0,0 @@ -#define foo bar -#define bar baz -#define baz foo -foo -bar -baz diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/004-define-recursive.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/004-define-recursive.c.expected deleted file mode 100644 index 4d2698b7a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/004-define-recursive.c.expected +++ /dev/null @@ -1,7 +0,0 @@ - - - -foo -bar -baz - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/005-define-composite-chain.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/005-define-composite-chain.c deleted file mode 100644 index f5521df96..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/005-define-composite-chain.c +++ /dev/null @@ -1,3 +0,0 @@ -#define foo 1 -#define bar a foo -bar diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/005-define-composite-chain.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/005-define-composite-chain.c.expected deleted file mode 100644 index c67358f4f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/005-define-composite-chain.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -a 1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c deleted file mode 100644 index 4bb91a122..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c +++ /dev/null @@ -1,3 +0,0 @@ -#define bar a foo -#define foo 1 -bar diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected deleted file mode 100644 index c67358f4f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/006-define-composite-chain-reverse.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -a 1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/007-define-composite-recursive.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/007-define-composite-recursive.c deleted file mode 100644 index 5784565bd..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/007-define-composite-recursive.c +++ /dev/null @@ -1,6 +0,0 @@ -#define foo a bar -#define bar b baz -#define baz c foo -foo -bar -baz diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected deleted file mode 100644 index 30fe4dc1f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/007-define-composite-recursive.c.expected +++ /dev/null @@ -1,7 +0,0 @@ - - - -a b c foo -b c a bar -c a b baz - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/008-define-empty.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/008-define-empty.c deleted file mode 100644 index b1bd17ec2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/008-define-empty.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/008-define-empty.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/008-define-empty.c.expected deleted file mode 100644 index c0f53d75c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/008-define-empty.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/009-undef.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/009-undef.c deleted file mode 100644 index 3fc1fb442..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/009-undef.c +++ /dev/null @@ -1,4 +0,0 @@ -#define foo 1 -foo -#undef foo -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/009-undef.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/009-undef.c.expected deleted file mode 100644 index 03a7061af..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/009-undef.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - -1 - -foo - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/010-undef-re-define.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/010-undef-re-define.c deleted file mode 100644 index 32ff73798..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/010-undef-re-define.c +++ /dev/null @@ -1,6 +0,0 @@ -#define foo 1 -foo -#undef foo -foo -#define foo 2 -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/010-undef-re-define.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/010-undef-re-define.c.expected deleted file mode 100644 index f4f7efdc2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/010-undef-re-define.c.expected +++ /dev/null @@ -1,7 +0,0 @@ - -1 - -foo - -2 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/011-define-func-empty.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/011-define-func-empty.c deleted file mode 100644 index d9ce13c22..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/011-define-func-empty.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo() -foo() diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/011-define-func-empty.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/011-define-func-empty.c.expected deleted file mode 100644 index c0f53d75c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/011-define-func-empty.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/012-define-func-no-args.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/012-define-func-no-args.c deleted file mode 100644 index c2bb730b1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/012-define-func-no-args.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo() bar -foo() diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/012-define-func-no-args.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/012-define-func-no-args.c.expected deleted file mode 100644 index 035376729..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/012-define-func-no-args.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -bar - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c deleted file mode 100644 index f78fb8b11..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x) 1 -foo(bar) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected deleted file mode 100644 index 878fd15d6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/013-define-func-1-arg-unused.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c deleted file mode 100644 index 11feb2624..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x,y) 1 -foo(bar,baz) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected deleted file mode 100644 index 878fd15d6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/014-define-func-2-arg-unused.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/015-define-object-with-parens.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/015-define-object-with-parens.c deleted file mode 100644 index 558da9c61..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/015-define-object-with-parens.c +++ /dev/null @@ -1,4 +0,0 @@ -#define foo ()1 -foo() -#define bar ()2 -bar() diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected deleted file mode 100644 index d6f8cb9dc..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/015-define-object-with-parens.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - -()1() - -()2() - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/016-define-func-1-arg.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/016-define-func-1-arg.c deleted file mode 100644 index a2e2404c7..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/016-define-func-1-arg.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x) ((x)+1) -foo(bar) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected deleted file mode 100644 index 7f1828a3c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/016-define-func-1-arg.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -((bar)+1) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/017-define-func-2-args.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/017-define-func-2-args.c deleted file mode 100644 index c72538352..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/017-define-func-2-args.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x,y) ((x)*(y)) -foo(bar,baz) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/017-define-func-2-args.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/017-define-func-2-args.c.expected deleted file mode 100644 index 9f341dac0..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/017-define-func-2-args.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -((bar)*(baz)) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c deleted file mode 100644 index 668130b8f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c +++ /dev/null @@ -1,3 +0,0 @@ -#define x 0 -#define foo(x) x -foo(1) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected deleted file mode 100644 index 43d484d71..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/018-define-func-macro-as-parameter.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c deleted file mode 100644 index c4e62b255..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x) (x) -foo(this is more than one word) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected deleted file mode 100644 index 4314fc88d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/019-define-func-1-arg-multi.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -(this is more than one word) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c deleted file mode 100644 index 3049ad154..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x,y) x,two fish,red fish,y -foo(one fish, blue fish) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected deleted file mode 100644 index 5648e4fb9..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/020-define-func-2-arg-multi.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -one fish,two fish,red fish,blue fish - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/021-define-func-compose.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/021-define-func-compose.c deleted file mode 100644 index 21ddd0e65..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/021-define-func-compose.c +++ /dev/null @@ -1,3 +0,0 @@ -#define bar(x) (1+(x)) -#define foo(y) (2*(y)) -foo(bar(3)) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/021-define-func-compose.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/021-define-func-compose.c.expected deleted file mode 100644 index 1d62105de..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/021-define-func-compose.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -(2*((1+(3)))) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c deleted file mode 100644 index c20d73a4a..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x) (x) -foo(argument(including parens)for the win) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected deleted file mode 100644 index 66c165817..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/022-define-func-arg-with-parens.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -(argument(including parens)for the win) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/023-define-extra-whitespace.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/023-define-extra-whitespace.c deleted file mode 100644 index 7ebfed651..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/023-define-extra-whitespace.c +++ /dev/null @@ -1,8 +0,0 @@ -#define noargs() 1 -# define onearg(foo) foo - # define twoargs( x , y ) x y - # define threeargs( a , b , c ) a b c -noargs ( ) -onearg ( 2 ) -twoargs ( 3 , 4 ) -threeargs ( 5 , 6 , 7 ) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected deleted file mode 100644 index 573829c2d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/023-define-extra-whitespace.c.expected +++ /dev/null @@ -1,9 +0,0 @@ - - - - -1 -2 -3 4 -5 6 7 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c deleted file mode 100644 index e788adce3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c +++ /dev/null @@ -1,3 +0,0 @@ -#define foo foo -#define bar foo -bar diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected deleted file mode 100644 index ad955fce6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/024-define-chain-to-self-recursion.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -foo - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c deleted file mode 100644 index b433671d1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(bar) bar -foo bar diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected deleted file mode 100644 index 960f44511..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/025-func-macro-as-non-macro.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -foo bar - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/026-define-func-extra-newlines.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/026-define-func-extra-newlines.c deleted file mode 100644 index 0d8374053..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/026-define-func-extra-newlines.c +++ /dev/null @@ -1,6 +0,0 @@ -#define foo(a) bar - -foo -( -1 -) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected deleted file mode 100644 index f0888f21b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/026-define-func-extra-newlines.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -bar - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c deleted file mode 100644 index 5ccb52cab..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c +++ /dev/null @@ -1,3 +0,0 @@ -#define failure() success -#define foo failure() -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected deleted file mode 100644 index aef762e1e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/027-define-chain-obj-to-func.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c deleted file mode 100644 index 44962a718..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c +++ /dev/null @@ -1,3 +0,0 @@ -#define success() failure -#define foo success -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected deleted file mode 100644 index aef762e1e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/028-define-chain-obj-to-non-func.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c deleted file mode 100644 index 261f7d28f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c +++ /dev/null @@ -1,3 +0,0 @@ -#define bar(failure) failure -#define foo bar(success) -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected deleted file mode 100644 index aef762e1e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/029-define-chain-obj-to-func-with-args.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c deleted file mode 100644 index e56fbefd6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c +++ /dev/null @@ -1,4 +0,0 @@ -#define baz(failure) failure -#define bar(failure) failure -#define foo bar(baz(success)) -foo diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected deleted file mode 100644 index 729bdd15f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/030-define-chain-obj-to-func-compose.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c deleted file mode 100644 index 3f4c8744d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c +++ /dev/null @@ -1,4 +0,0 @@ -#define baz(failure) failure -#define bar(failure) failure -#define foo() bar(baz(success)) -foo() diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected deleted file mode 100644 index 729bdd15f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/031-define-chain-func-to-func-compose.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/032-define-func-self-recurse.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/032-define-func-self-recurse.c deleted file mode 100644 index b3ac70f49..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/032-define-func-self-recurse.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(a) foo(2*(a)) -foo(3) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected deleted file mode 100644 index 541d44db7..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/032-define-func-self-recurse.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -foo(2*(3)) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/033-define-func-self-compose.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/033-define-func-self-compose.c deleted file mode 100644 index f65e48286..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/033-define-func-self-compose.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(a) foo(2*(a)) -foo(foo(3)) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected deleted file mode 100644 index 6ea6905d8..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/033-define-func-self-compose.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -foo(2*(foo(2*(3)))) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c deleted file mode 100644 index 209a5f7e0..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(bar) bar -foo(foo) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected deleted file mode 100644 index 24823b1b6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/034-define-func-self-compose-non-func.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -foo - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c deleted file mode 100644 index c307fbe83..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(bar) bar -foo(1+foo) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected deleted file mode 100644 index 137a9ea2d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/035-define-func-self-compose-non-func-multi-token-argument.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -1+foo - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c deleted file mode 100644 index b21ff3367..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c +++ /dev/null @@ -1,3 +0,0 @@ -#define bar success -#define foo(x) x -foo(more bar) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected deleted file mode 100644 index ff6360bfe..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/036-define-func-non-macro-multi-token-argument.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -more success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c deleted file mode 100644 index b3a2f37f1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c +++ /dev/null @@ -1,3 +0,0 @@ -#define expand(x) expand(x once) -#define foo(x) x -foo(expand(just)) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected deleted file mode 100644 index cbadee848..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/037-finalize-unexpanded-macro.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -expand(just once) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/038-func-arg-with-commas.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/038-func-arg-with-commas.c deleted file mode 100644 index 1407c7d6e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/038-func-arg-with-commas.c +++ /dev/null @@ -1,2 +0,0 @@ -#define foo(x) success -foo(argument (with,embedded , commas) -- tricky) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected deleted file mode 100644 index 5a28fb3b6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/038-func-arg-with-commas.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c deleted file mode 100644 index 0f7fe632b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c +++ /dev/null @@ -1,3 +0,0 @@ -#define foo(a) (a) -#define bar two,words -foo(bar) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected deleted file mode 100644 index b73869d02..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -(two,words) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/040-token-pasting.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/040-token-pasting.c deleted file mode 100644 index caab3ba73..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/040-token-pasting.c +++ /dev/null @@ -1,2 +0,0 @@ -#define paste(a,b) a ## b -paste(one , token) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/040-token-pasting.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/040-token-pasting.c.expected deleted file mode 100644 index 36f669925..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/040-token-pasting.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -onetoken - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/041-if-0.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/041-if-0.c deleted file mode 100644 index 2cab677d3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/041-if-0.c +++ /dev/null @@ -1,5 +0,0 @@ -success_1 -#if 0 -failure -#endif -success_2 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/041-if-0.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/041-if-0.c.expected deleted file mode 100644 index 3800024c6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/041-if-0.c.expected +++ /dev/null @@ -1,6 +0,0 @@ -success_1 - - - -success_2 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/042-if-1.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/042-if-1.c deleted file mode 100644 index 874a25cf4..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/042-if-1.c +++ /dev/null @@ -1,5 +0,0 @@ -success_1 -#if 1 -success_2 -#endif -success_3 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/042-if-1.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/042-if-1.c.expected deleted file mode 100644 index e591044ad..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/042-if-1.c.expected +++ /dev/null @@ -1,6 +0,0 @@ -success_1 - -success_2 - -success_3 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/043-if-0-else.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/043-if-0-else.c deleted file mode 100644 index 323351f9d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/043-if-0-else.c +++ /dev/null @@ -1,7 +0,0 @@ -success_1 -#if 0 -failure -#else -success_2 -#endif -success_3 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/043-if-0-else.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/043-if-0-else.c.expected deleted file mode 100644 index ee9e67709..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/043-if-0-else.c.expected +++ /dev/null @@ -1,8 +0,0 @@ -success_1 - - - -success_2 - -success_3 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/044-if-1-else.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/044-if-1-else.c deleted file mode 100644 index 28dfc25c6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/044-if-1-else.c +++ /dev/null @@ -1,7 +0,0 @@ -success_1 -#if 1 -success_2 -#else -failure -#endif -success_3 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/044-if-1-else.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/044-if-1-else.c.expected deleted file mode 100644 index 129f5c854..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/044-if-1-else.c.expected +++ /dev/null @@ -1,8 +0,0 @@ -success_1 - -success_2 - - - -success_3 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/045-if-0-elif.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/045-if-0-elif.c deleted file mode 100644 index e50f686d4..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/045-if-0-elif.c +++ /dev/null @@ -1,11 +0,0 @@ -success_1 -#if 0 -failure_1 -#elif 0 -failure_2 -#elif 1 -success_3 -#elif 1 -failure_3 -#endif -success_4 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/045-if-0-elif.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/045-if-0-elif.c.expected deleted file mode 100644 index 97a11b447..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/045-if-0-elif.c.expected +++ /dev/null @@ -1,12 +0,0 @@ -success_1 - - - - - -success_3 - - - -success_4 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/046-if-1-elsif.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/046-if-1-elsif.c deleted file mode 100644 index 130515a01..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/046-if-1-elsif.c +++ /dev/null @@ -1,11 +0,0 @@ -success_1 -#if 1 -success_2 -#elif 0 -failure_1 -#elif 1 -failure_2 -#elif 0 -failure_3 -#endif -success_3 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/046-if-1-elsif.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/046-if-1-elsif.c.expected deleted file mode 100644 index b928b917e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/046-if-1-elsif.c.expected +++ /dev/null @@ -1,12 +0,0 @@ -success_1 - -success_2 - - - - - - - -success_3 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/047-if-elif-else.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/047-if-elif-else.c deleted file mode 100644 index e8f0838a9..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/047-if-elif-else.c +++ /dev/null @@ -1,11 +0,0 @@ -success_1 -#if 0 -failure_1 -#elif 0 -failure_2 -#elif 0 -failure_3 -#else -success_2 -#endif -success_3 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/047-if-elif-else.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/047-if-elif-else.c.expected deleted file mode 100644 index e5b53a3fa..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/047-if-elif-else.c.expected +++ /dev/null @@ -1,12 +0,0 @@ -success_1 - - - - - - - -success_2 - -success_3 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/048-if-nested.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/048-if-nested.c deleted file mode 100644 index fc4679c3b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/048-if-nested.c +++ /dev/null @@ -1,11 +0,0 @@ -success_1 -#if 0 -failure_1 -#if 1 -failure_2 -#else -failure_3 -#endif -failure_4 -#endif -success_2 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/048-if-nested.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/048-if-nested.c.expected deleted file mode 100644 index c61fd0b31..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/048-if-nested.c.expected +++ /dev/null @@ -1,12 +0,0 @@ -success_1 - - - - - - - - - -success_2 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/049-if-expression-precedence.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/049-if-expression-precedence.c deleted file mode 100644 index 833ea0388..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/049-if-expression-precedence.c +++ /dev/null @@ -1,5 +0,0 @@ -#if 1 + 2 * 3 + - (25 % 17 - + 1) -failure with operator precedence -#else -success -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected deleted file mode 100644 index 569debb0b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/049-if-expression-precedence.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - - - -success - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/050-if-defined.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/050-if-defined.c deleted file mode 100644 index 34f0f9514..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/050-if-defined.c +++ /dev/null @@ -1,17 +0,0 @@ -#if defined foo -failure_1 -#else -success_1 -#endif -#define foo -#if defined foo -success_2 -#else -failure_2 -#endif -#undef foo -#if defined foo -failure_3 -#else -success_3 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/050-if-defined.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/050-if-defined.c.expected deleted file mode 100644 index 3f01955ee..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/050-if-defined.c.expected +++ /dev/null @@ -1,18 +0,0 @@ - - - -success_1 - - - -success_2 - - - - - - - -success_3 - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/051-if-relational.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/051-if-relational.c deleted file mode 100644 index c3db488e0..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/051-if-relational.c +++ /dev/null @@ -1,35 +0,0 @@ -#if 3 < 2 -failure_1 -#else -success_1 -#endif - -#if 3 >= 2 -success_2 -#else -failure_2 -#endif - -#if 2 + 3 <= 5 -success_3 -#else -failure_3 -#endif - -#if 3 - 2 == 1 -success_3 -#else -failure_3 -#endif - -#if 1 > 3 -failure_4 -#else -success_4 -#endif - -#if 1 != 5 -success_5 -#else -failure_5 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/051-if-relational.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/051-if-relational.c.expected deleted file mode 100644 index d2b76f145..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/051-if-relational.c.expected +++ /dev/null @@ -1,36 +0,0 @@ - - - -success_1 - - - -success_2 - - - - - -success_3 - - - - - -success_3 - - - - - - - -success_4 - - - -success_5 - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/052-if-bitwise.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/052-if-bitwise.c deleted file mode 100644 index 2d8e45eb6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/052-if-bitwise.c +++ /dev/null @@ -1,20 +0,0 @@ -#if (0xaaaaaaaa | 0x55555555) != 4294967295 -failure_1 -#else -success_1 -#endif -#if (0x12345678 ^ 0xfdecba98) == 4023971040 -success_2 -#else -failure_2 -#endif -#if (~ 0xdeadbeef) != -3735928560 -failure_3 -#else -success_3 -#endif -#if (0667 & 0733) == 403 -success_4 -#else -failure_4 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/052-if-bitwise.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/052-if-bitwise.c.expected deleted file mode 100644 index bb5d92e8d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/052-if-bitwise.c.expected +++ /dev/null @@ -1,21 +0,0 @@ - - - -success_1 - - -success_2 - - - - - - -success_3 - - -success_4 - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/053-if-divide-and-shift.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/053-if-divide-and-shift.c deleted file mode 100644 index d24c54a88..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/053-if-divide-and-shift.c +++ /dev/null @@ -1,15 +0,0 @@ -#if (15 / 2) != 7 -failure_1 -#else -success_1 -#endif -#if (1 << 12) == 4096 -success_2 -#else -failure_2 -#endif -#if (31762 >> 8) != 124 -failure_3 -#else -success_3 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected deleted file mode 100644 index f97e93673..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/053-if-divide-and-shift.c.expected +++ /dev/null @@ -1,16 +0,0 @@ - - - -success_1 - - -success_2 - - - - - - -success_3 - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/054-if-with-macros.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/054-if-with-macros.c deleted file mode 100644 index 3da79a0d9..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/054-if-with-macros.c +++ /dev/null @@ -1,34 +0,0 @@ -#define one 1 -#define two 2 -#define three 3 -#define five 5 -#if five < two -failure_1 -#else -success_1 -#endif -#if three >= two -success_2 -#else -failure_2 -#endif -#if two + three <= five -success_3 -#else -failure_3 -#endif -#if five - two == three -success_4 -#else -failure_4 -#endif -#if one > three -failure_5 -#else -success_5 -#endif -#if one != five -success_6 -#else -failure_6 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/054-if-with-macros.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/054-if-with-macros.c.expected deleted file mode 100644 index 27ea49696..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/054-if-with-macros.c.expected +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - -success_1 - - -success_2 - - - - -success_3 - - - - -success_4 - - - - - - -success_5 - - -success_6 - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c deleted file mode 100644 index 00f2c2346..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c +++ /dev/null @@ -1,3 +0,0 @@ -#define failure() success -#define foo failure -foo() diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected deleted file mode 100644 index aef762e1e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/055-define-chain-obj-to-func-parens-in-text.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/056-macro-argument-with-comma.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/056-macro-argument-with-comma.c deleted file mode 100644 index 58701d1f2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/056-macro-argument-with-comma.c +++ /dev/null @@ -1,4 +0,0 @@ -#define bar with,embedded,commas -#define function(x) success -#define foo function -foo(bar) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected deleted file mode 100644 index 729bdd15f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/056-macro-argument-with-comma.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/057-empty-arguments.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/057-empty-arguments.c deleted file mode 100644 index 614023286..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/057-empty-arguments.c +++ /dev/null @@ -1,6 +0,0 @@ -#define zero() success -zero() -#define one(x) success -one() -#define two(x,y) success -two(,) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/057-empty-arguments.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/057-empty-arguments.c.expected deleted file mode 100644 index 4e3aad521..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/057-empty-arguments.c.expected +++ /dev/null @@ -1,7 +0,0 @@ - -success - -success - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c deleted file mode 100644 index 8ac260c76..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c +++ /dev/null @@ -1,5 +0,0 @@ -#define paste(x,y) x ## y -paste(a,b) -paste(a,) -paste(,b) -paste(,) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected deleted file mode 100644 index a1c34e5c1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/058-token-pasting-empty-arguments.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - -ab -a -b - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/059-token-pasting-integer.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/059-token-pasting-integer.c deleted file mode 100644 index 37b895a42..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/059-token-pasting-integer.c +++ /dev/null @@ -1,4 +0,0 @@ -#define paste(x,y) x ## y -paste(1,2) -paste(1,000) -paste(identifier,2) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected deleted file mode 100644 index f1a2cd21c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/059-token-pasting-integer.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - -12 -1000 -identifier2 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c deleted file mode 100644 index ed80ea879..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c +++ /dev/null @@ -1,3 +0,0 @@ -#define double(a) a*2 -#define foo double( -foo 5) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected deleted file mode 100644 index c1f0d24a1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/060-left-paren-in-macro-right-paren-in-text.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - -5*2 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c deleted file mode 100644 index 6dbfd1f62..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c +++ /dev/null @@ -1,5 +0,0 @@ -#define foo(x) success -#define bar foo -#define baz bar -#define joe baz -joe (failure) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected deleted file mode 100644 index 111f7d106..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/061-define-chain-obj-to-func-multi.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - - - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/062-if-0-skips-garbage.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/062-if-0-skips-garbage.c deleted file mode 100644 index d9e439bb8..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/062-if-0-skips-garbage.c +++ /dev/null @@ -1,5 +0,0 @@ -#define foo(a,b) -#if 0 -foo(bar) -foo( -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected deleted file mode 100644 index 6fb66a5e2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/062-if-0-skips-garbage.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/063-comments.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/063-comments.c deleted file mode 100644 index e641d2f0f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/063-comments.c +++ /dev/null @@ -1,20 +0,0 @@ -/* this is a comment */ -// so is this -// */ -f = g/**//h; -/*//*/l(); -m = n//**/o -+ p; -/* this -comment spans -multiple lines and -contains *** stars -and slashes / *** / -and other stuff. -****/ -more code here -/* Test that /* nested - comments */ -are not treated like comments. -/*/ this is a comment */ -/*/*/ diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/063-comments.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/063-comments.c.expected deleted file mode 100644 index 73ca7071f..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/063-comments.c.expected +++ /dev/null @@ -1,21 +0,0 @@ - - - -f = g /h; - l(); -m = n -+ p; - - - - - - - -more code here - - -are not treated like comments. - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/064-version.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/064-version.c deleted file mode 100644 index 21326481b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/064-version.c +++ /dev/null @@ -1,2 +0,0 @@ -#version 130 -#define FOO diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/064-version.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/064-version.c.expected deleted file mode 100644 index 3af71113c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/064-version.c.expected +++ /dev/null @@ -1,3 +0,0 @@ -#version 130 - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/065-if-defined-parens.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/065-if-defined-parens.c deleted file mode 100644 index 48aa0f8c3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/065-if-defined-parens.c +++ /dev/null @@ -1,17 +0,0 @@ -#if defined(foo) -failure_1 -#else -success_1 -#endif -#define foo -#if defined ( foo ) -success_2 -#else -failure_2 -#endif -#undef foo -#if defined (foo) -failure_3 -#else -success_3 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/065-if-defined-parens.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/065-if-defined-parens.c.expected deleted file mode 100644 index 3f01955ee..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/065-if-defined-parens.c.expected +++ /dev/null @@ -1,18 +0,0 @@ - - - -success_1 - - - -success_2 - - - - - - - -success_3 - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/066-if-nospace-expression.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/066-if-nospace-expression.c deleted file mode 100644 index 3b0b47349..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/066-if-nospace-expression.c +++ /dev/null @@ -1,3 +0,0 @@ -#if(1) -success -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected deleted file mode 100644 index 0e84a7cda..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/066-if-nospace-expression.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - -success - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c deleted file mode 100644 index f46cce4e6..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c +++ /dev/null @@ -1,40 +0,0 @@ -#define D1 -#define D2 - -#define result success - -#ifdef U1 -#ifdef U2 -#undef result -#define result failure -#endif -#endif -result - -#ifndef D1 -#ifndef D2 -#undef result -#define result failure -#endif -#endif -result - -#undef result -#define result failure -#ifdef D1 -#ifdef D2 -#undef result -#define result success -#endif -#endif -result - -#undef result -#define result failure -#ifndef U1 -#ifndef U2 -#undef result -#define result success -#endif -#endif -result diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected deleted file mode 100644 index 3340daaa1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/067-nested-ifdef-ifndef.c.expected +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - -success - - - - - - - -success - - - - - - - - - -success - - - - - - - - - -success - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/068-accidental-pasting.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/068-accidental-pasting.c deleted file mode 100644 index 699ac5144..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/068-accidental-pasting.c +++ /dev/null @@ -1,11 +0,0 @@ -#define empty -empty> ->empty= -=empty= -!empty= -&empty& -|empty| -+empty+ --empty- diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/068-accidental-pasting.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/068-accidental-pasting.c.expected deleted file mode 100644 index ce41cd6e5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/068-accidental-pasting.c.expected +++ /dev/null @@ -1,12 +0,0 @@ - -< < -< = -> > -> = -= = -! = -& & -| | -+ + -- - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/069-repeated-argument.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/069-repeated-argument.c deleted file mode 100644 index 2b46ead29..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/069-repeated-argument.c +++ /dev/null @@ -1,2 +0,0 @@ -#define double(x) x x -double(1) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/069-repeated-argument.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/069-repeated-argument.c.expected deleted file mode 100644 index 755c4d4b5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/069-repeated-argument.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -1 1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/071-punctuator.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/071-punctuator.c deleted file mode 100644 index 959d68259..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/071-punctuator.c +++ /dev/null @@ -1 +0,0 @@ -a = b diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/071-punctuator.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/071-punctuator.c.expected deleted file mode 100644 index fee253b74..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/071-punctuator.c.expected +++ /dev/null @@ -1,2 +0,0 @@ -a = b - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/072-token-pasting-same-line.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/072-token-pasting-same-line.c deleted file mode 100644 index e421e9d5e..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/072-token-pasting-same-line.c +++ /dev/null @@ -1,2 +0,0 @@ -#define paste(x) success_ ## x -paste(1) paste(2) paste(3) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected deleted file mode 100644 index c780b43d7..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/072-token-pasting-same-line.c.expected +++ /dev/null @@ -1,3 +0,0 @@ - -success_1 success_2 success_3 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/073-if-in-ifdef.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/073-if-in-ifdef.c deleted file mode 100644 index 61a48097c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/073-if-in-ifdef.c +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef UNDEF -#if UNDEF > 1 -#endif -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected deleted file mode 100644 index 3f2ff2d6c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/073-if-in-ifdef.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/074-elif-undef.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/074-elif-undef.c deleted file mode 100644 index 67aac8977..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/074-elif-undef.c +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef UNDEF -#elif UNDEF < 0 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/074-elif-undef.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/074-elif-undef.c.expected deleted file mode 100644 index fd40910d9..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/074-elif-undef.c.expected +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/075-elif-elif-undef.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/075-elif-elif-undef.c deleted file mode 100644 index 264bc4f10..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/075-elif-elif-undef.c +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef UNDEF -#elif UNDEF < 0 -#elif UNDEF == 3 -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected deleted file mode 100644 index 3f2ff2d6c..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/076-elif-undef-nested.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/076-elif-undef-nested.c deleted file mode 100644 index ebd550ed0..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/076-elif-undef-nested.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef UNDEF -#if UNDEF == 4 -#elif UNDEF == 5 -#endif -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected deleted file mode 100644 index 6fb66a5e2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/077-else-without-if.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/077-else-without-if.c deleted file mode 100644 index 81f00bfe2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/077-else-without-if.c +++ /dev/null @@ -1 +0,0 @@ -#else diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/077-else-without-if.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/077-else-without-if.c.expected deleted file mode 100644 index d289b3635..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/077-else-without-if.c.expected +++ /dev/null @@ -1,4 +0,0 @@ -0:1(2): preprocessor error: else without #if - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/078-elif-without-if.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/078-elif-without-if.c deleted file mode 100644 index 60466b389..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/078-elif-without-if.c +++ /dev/null @@ -1 +0,0 @@ -#elif defined FOO diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/078-elif-without-if.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/078-elif-without-if.c.expected deleted file mode 100644 index 7d41f0ac7..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/078-elif-without-if.c.expected +++ /dev/null @@ -1,4 +0,0 @@ -0:1(2): preprocessor error: elif without #if - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/079-endif-without-if.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/079-endif-without-if.c deleted file mode 100644 index 69331c3ca..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/079-endif-without-if.c +++ /dev/null @@ -1 +0,0 @@ -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/079-endif-without-if.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/079-endif-without-if.c.expected deleted file mode 100644 index 08dd33546..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/079-endif-without-if.c.expected +++ /dev/null @@ -1,4 +0,0 @@ -0:1(2): preprocessor error: #endif without #if - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/080-if-without-expression.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/080-if-without-expression.c deleted file mode 100644 index a27ba36a3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/080-if-without-expression.c +++ /dev/null @@ -1,4 +0,0 @@ -/* Error message for unskipped #if with no expression. */ -#if -#endif - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/080-if-without-expression.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/080-if-without-expression.c.expected deleted file mode 100644 index 768ba0f47..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/080-if-without-expression.c.expected +++ /dev/null @@ -1,6 +0,0 @@ -0:2(1): preprocessor error: #if with no expression - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/081-elif-without-expression.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/081-elif-without-expression.c deleted file mode 100644 index 79c78663d..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/081-elif-without-expression.c +++ /dev/null @@ -1,3 +0,0 @@ -#if 0 -#elif -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/081-elif-without-expression.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/081-elif-without-expression.c.expected deleted file mode 100644 index 974f0f550..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/081-elif-without-expression.c.expected +++ /dev/null @@ -1,5 +0,0 @@ -0:2(1): preprocessor error: #elif with no expression - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/082-invalid-paste.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/082-invalid-paste.c deleted file mode 100644 index 40bf64411..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/082-invalid-paste.c +++ /dev/null @@ -1,2 +0,0 @@ -#define PASTE(x,y) x ## y -PASTE(<,>) diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/082-invalid-paste.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/082-invalid-paste.c.expected deleted file mode 100644 index 2c924406b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/082-invalid-paste.c.expected +++ /dev/null @@ -1,5 +0,0 @@ -0:2(7): preprocessor error: -Pasting "<" and ">" does not give a valid preprocessing token. - -< - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/083-unterminated-if.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/083-unterminated-if.c deleted file mode 100644 index 918063509..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/083-unterminated-if.c +++ /dev/null @@ -1,2 +0,0 @@ -#if 1 - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/083-unterminated-if.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/083-unterminated-if.c.expected deleted file mode 100644 index a69f8bab5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/083-unterminated-if.c.expected +++ /dev/null @@ -1,5 +0,0 @@ -0:1(7): preprocessor error: Unterminated #if - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/084-unbalanced-parentheses.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/084-unbalanced-parentheses.c deleted file mode 100644 index 0789ba5e5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/084-unbalanced-parentheses.c +++ /dev/null @@ -1,2 +0,0 @@ -#define FUNC(x) (2*(x)) -FUNC(23 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/085-incorrect-argument-count.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/085-incorrect-argument-count.c deleted file mode 100644 index 91bea6006..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/085-incorrect-argument-count.c +++ /dev/null @@ -1,5 +0,0 @@ -#define MULT(x,y) ((x)*(y)) -MULT() -MULT(1) -MULT(1,2,3) - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected deleted file mode 100644 index 1df30cbb5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/085-incorrect-argument-count.c.expected +++ /dev/null @@ -1,12 +0,0 @@ -0:2(1): preprocessor error: Error: macro MULT invoked with 1 arguments (expected 2) - -0:3(1): preprocessor error: Error: macro MULT invoked with 1 arguments (expected 2) - -0:4(1): preprocessor error: Error: macro MULT invoked with 3 arguments (expected 2) - - -MULT() -MULT(1) -MULT(1,2,3) - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/087-if-comments.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/087-if-comments.c deleted file mode 100644 index ce8dc4305..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/087-if-comments.c +++ /dev/null @@ -1,5 +0,0 @@ -#if (1 == 0) // dangerous comment -fail -#else -win -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/087-if-comments.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/087-if-comments.c.expected deleted file mode 100644 index 827e548fe..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/087-if-comments.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - - - -win - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c deleted file mode 100644 index 0e0666b8b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c +++ /dev/null @@ -1,5 +0,0 @@ -#define abc 123 -#define abc 123 - -#define foo(x) (x)+23 -#define foo(x) ( x ) + 23 diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected deleted file mode 100644 index 6fb66a5e2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/088-redefine-macro-legitimate.c.expected +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/089-redefine-macro-error.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/089-redefine-macro-error.c deleted file mode 100644 index b3d1391e1..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/089-redefine-macro-error.c +++ /dev/null @@ -1,17 +0,0 @@ -#define x y -#define x z - -#define abc 123 -#define abc() 123 - -#define foo() bar -#define foo(x) bar - -#define bar() baz -#define bar baz - -#define biff(a,b) a+b -#define biff(a,b,c) a+b - -#define oper(a,b) a+b -#define oper(a,b) a*b diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected deleted file mode 100644 index 6209ead55..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/089-redefine-macro-error.c.expected +++ /dev/null @@ -1,30 +0,0 @@ -0:2(9): preprocessor error: Redefinition of macro x - -0:5(9): preprocessor error: Redefinition of macro abc - -0:8(9): preprocessor error: Redefinition of macro foo - -0:11(9): preprocessor error: Redefinition of macro bar - -0:14(9): preprocessor error: Redefinition of macro biff - -0:17(9): preprocessor error: Redefinition of macro oper - - - - - - - - - - - - - - - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/090-hash-error.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/090-hash-error.c deleted file mode 100644 index d19bb7fae..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/090-hash-error.c +++ /dev/null @@ -1 +0,0 @@ -#error human error diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/090-hash-error.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/090-hash-error.c.expected deleted file mode 100644 index f2f1fbeaf..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/090-hash-error.c.expected +++ /dev/null @@ -1,3 +0,0 @@ -0:1(2): preprocessor error: #error human error - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/092-redefine-macro-error-2.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/092-redefine-macro-error-2.c deleted file mode 100644 index 3c161a5c5..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/092-redefine-macro-error-2.c +++ /dev/null @@ -1,5 +0,0 @@ -#define A -#define A 1 - -#define B 1 -#define B diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected deleted file mode 100644 index 0026f91f3..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/092-redefine-macro-error-2.c.expected +++ /dev/null @@ -1,10 +0,0 @@ -0:2(9): preprocessor error: Redefinition of macro A - -0:5(9): preprocessor error: Redefinition of macro B - - - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/093-divide-by-zero.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/093-divide-by-zero.c deleted file mode 100644 index bf65d4f52..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/093-divide-by-zero.c +++ /dev/null @@ -1,2 +0,0 @@ -#if (1 / 0) -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c deleted file mode 100644 index 04497b179..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/094-divide-by-zero-short-circuit.c +++ /dev/null @@ -1,13 +0,0 @@ -/* glcpp is generating a division-by-zero error for this case. It's - * easy to argue that it should be short-circuiting the evaluation and - * not generating the diagnostic (which happens to be what gcc does). - * But it doesn't seem like we should force this behavior on our - * pre-processor, (and, as always, the GLSL specification of the - * pre-processor is too vague on this point). - * - * If a short-circuit evaluation optimization does get added to the - * pre-processor then it would legitimate to update the expected file - * for this test. -*/ -#if 1 || (1 / 0) -#endif diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/095-recursive-define.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/095-recursive-define.c deleted file mode 100644 index 801d90ce2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/095-recursive-define.c +++ /dev/null @@ -1,3 +0,0 @@ -#define A(a, b) B(a, b) -#define C A(0, C) -C diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/099-c99-example.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/099-c99-example.c deleted file mode 100644 index d1976b1f2..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/099-c99-example.c +++ /dev/null @@ -1,17 +0,0 @@ -#define x 3 -#define f(a) f(x * (a)) -#undef x -#define x 2 -#define g f -#define z z[0] -#define h g(~ -#define m(a) a(w) -#define w 0,1 -#define t(a) a -#define p() int -#define q(x) x -#define r(x,y) x ## y -f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); -g(x +(3,4)-w) | h 5) & m - (f)^m(m); -p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,)}; diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/099-c99-example.c.expected b/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/099-c99-example.c.expected deleted file mode 100644 index 19be75055..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/tests/099-c99-example.c.expected +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - -f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); -f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); -int i[] = { 1, 23, 4, 5, }; - diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp index cc43a7772..7935663f5 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -54,6 +55,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +86,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -153,21 +153,13 @@ typedef void* yyscan_t; #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE _mesa_glsl_restart(yyin ,yyscanner ) +#define YY_NEW_FILE _mesa_glsl_lexer_restart(yyin ,yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -179,6 +171,11 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -201,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -223,7 +215,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -263,7 +255,7 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via _mesa_glsl_restart()), so that the user can continue scanning by + * (via _mesa_glsl_lexer_restart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -286,36 +278,36 @@ struct yy_buffer_state */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] -void _mesa_glsl_restart (FILE *input_file ,yyscan_t yyscanner ); -void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner ); +void _mesa_glsl_lexer_restart (FILE *input_file ,yyscan_t yyscanner ); +void _mesa_glsl_lexer__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE _mesa_glsl_lexer__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void _mesa_glsl_lexer__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void _mesa_glsl_lexer__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner ); -static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner ); -static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner ); -static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); +static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner ); +static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner ); +static void _mesa_glsl_lexer__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); -#define YY_FLUSH_BUFFER _mesa_glsl__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) +#define YY_FLUSH_BUFFER _mesa_glsl_lexer__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) -YY_BUFFER_STATE _mesa_glsl__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE _mesa_glsl_lexer__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); -void *_mesa_glsl_alloc (yy_size_t ,yyscan_t yyscanner ); -void *_mesa_glsl_realloc (void *,yy_size_t ,yyscan_t yyscanner ); -void _mesa_glsl_free (void * ,yyscan_t yyscanner ); +void *_mesa_glsl_lexer_alloc (yy_size_t ,yyscan_t yyscanner ); +void *_mesa_glsl_lexer_realloc (void *,yy_size_t ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_free (void * ,yyscan_t yyscanner ); -#define yy_new_buffer _mesa_glsl__create_buffer +#define yy_new_buffer _mesa_glsl_lexer__create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - _mesa_glsl_ensure_buffer_stack (yyscanner); \ + _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } @@ -323,9 +315,9 @@ void _mesa_glsl_free (void * ,yyscan_t yyscanner ); #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - _mesa_glsl_ensure_buffer_stack (yyscanner); \ + _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } @@ -334,7 +326,7 @@ void _mesa_glsl_free (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define _mesa_glsl_wrap(n) 1 +#define _mesa_glsl_lexer_wrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -353,13 +345,13 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 215 -#define YY_END_OF_BUFFER 216 +#define YY_NUM_RULES 234 +#define YY_END_OF_BUFFER 235 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,103 +359,113 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[867] = +static yyconst flex_int16_t yy_accept[960] = { 0, - 0, 0, 16, 16, 0, 0, 216, 214, 1, 21, - 214, 214, 214, 214, 214, 214, 214, 214, 121, 119, - 214, 214, 214, 213, 214, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 214, 1, 214, 215, 16, - 20, 215, 19, 17, 18, 14, 13, 1, 103, 112, - 104, 115, 109, 98, 111, 99, 118, 123, 110, 124, - 121, 0, 0, 126, 121, 0, 119, 119, 107, 100, - 102, 101, 108, 213, 116, 106, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 30, 213, + 0, 0, 16, 16, 0, 0, 235, 233, 1, 21, + 233, 233, 233, 233, 233, 233, 233, 233, 132, 130, + 233, 233, 233, 232, 233, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 233, 1, 233, 234, 16, + 20, 234, 19, 17, 18, 14, 13, 1, 114, 123, + 115, 126, 120, 109, 122, 110, 129, 134, 121, 135, + 132, 0, 0, 137, 132, 0, 130, 130, 118, 111, + 113, 112, 119, 232, 127, 117, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 30, 232, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 34, 213, 213, 61, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 117, - 105, 1, 0, 0, 2, 0, 0, 0, 0, 16, - 15, 19, 18, 0, 123, 122, 0, 124, 0, 125, - 120, 113, 114, 213, 129, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 33, 213, 213, 213, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 34, 232, 232, 61, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 128, 116, 1, 0, 0, 2, 0, 0, 0, 0, + 16, 15, 19, 18, 0, 134, 133, 0, 135, 0, + 136, 131, 124, 125, 232, 140, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 33, - 213, 213, 213, 213, 213, 213, 213, 26, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 62, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 0, 0, 0, 0, 15, 0, 123, 0, 122, 0, - 124, 125, 120, 213, 213, 24, 213, 213, 176, 169, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 32, - 132, 213, 213, 213, 213, 68, 213, 213, 137, 151, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 26, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 62, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 0, 0, + 0, 0, 15, 0, 134, 0, 133, 0, 135, 136, + 131, 232, 232, 232, 24, 232, 232, 187, 180, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 32, + 143, 232, 232, 232, 232, 68, 232, 232, 148, 162, - 213, 213, 148, 172, 49, 50, 51, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 135, 127, 213, - 213, 27, 213, 213, 213, 213, 213, 213, 213, 46, - 47, 48, 96, 213, 213, 0, 0, 0, 0, 0, - 122, 213, 213, 28, 37, 38, 39, 213, 130, 213, - 23, 213, 213, 213, 213, 159, 160, 161, 213, 128, - 213, 152, 25, 162, 163, 164, 174, 156, 157, 158, - 213, 213, 213, 63, 154, 213, 213, 213, 40, 41, - 42, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 159, 183, 49, 50, 51, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 146, 138, 232, 232, 27, 232, 232, 232, + 232, 232, 232, 232, 46, 47, 48, 107, 232, 232, + 232, 0, 0, 0, 0, 0, 133, 232, 232, 232, + 28, 37, 38, 39, 232, 141, 232, 232, 23, 232, + 232, 232, 232, 170, 171, 172, 232, 139, 232, 163, + 25, 173, 174, 175, 185, 167, 168, 169, 232, 232, - 213, 213, 213, 213, 213, 213, 213, 149, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 131, 213, - 213, 171, 43, 44, 45, 213, 213, 31, 0, 0, - 0, 0, 179, 213, 213, 177, 213, 213, 213, 150, - 145, 182, 213, 213, 213, 213, 213, 213, 140, 213, - 213, 213, 97, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 213, 213, 213, 213, 155, 136, 213, 213, - 143, 36, 213, 213, 168, 69, 144, 95, 180, 138, - 213, 213, 213, 213, 213, 213, 213, 213, 0, 0, - 0, 0, 213, 213, 213, 139, 35, 213, 213, 213, + 232, 63, 165, 232, 232, 232, 40, 41, 42, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 229, 232, 232, 232, 232, 232, 232, 232, 232, 160, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 142, 232, 232, 182, 43, 44, 45, 232, 232, + 31, 232, 0, 0, 0, 0, 190, 232, 232, 232, + 232, 188, 232, 232, 232, 161, 156, 193, 232, 232, + 232, 232, 232, 232, 151, 232, 232, 232, 108, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 232, 232, + 232, 232, 166, 147, 232, 232, 154, 232, 232, 232, - 213, 213, 213, 183, 184, 185, 213, 213, 213, 213, - 213, 173, 213, 213, 213, 213, 213, 213, 213, 213, - 133, 213, 213, 213, 213, 213, 64, 213, 213, 65, - 213, 0, 0, 0, 0, 0, 213, 66, 29, 146, - 187, 188, 189, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 141, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 134, 191, 192, 193, - 213, 213, 153, 213, 142, 0, 0, 6, 0, 0, - 0, 12, 3, 22, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 186, 147, 67, 213, 213, 213, 213, + 36, 232, 230, 179, 69, 155, 106, 232, 191, 149, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 0, + 0, 0, 0, 232, 232, 232, 232, 232, 150, 35, + 232, 232, 232, 232, 232, 232, 194, 195, 196, 232, + 232, 232, 232, 232, 184, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 144, 232, 232, + 232, 232, 232, 64, 232, 232, 65, 232, 232, 0, + 0, 0, 0, 0, 232, 232, 66, 224, 29, 157, + 198, 199, 200, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 152, 232, 232, 232, 226, - 213, 170, 213, 178, 175, 208, 71, 72, 73, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 0, 0, 0, 0, 0, 0, 0, 213, 213, - 213, 190, 213, 213, 213, 213, 213, 82, 83, 84, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 194, 88, 89, 90, 213, - 213, 4, 0, 5, 0, 0, 0, 0, 0, 0, - 213, 213, 213, 213, 213, 213, 213, 205, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 74, 213, 213, 213, 213, 213, 213, 213, 213, + 228, 225, 232, 232, 232, 232, 232, 232, 232, 232, + 145, 202, 203, 204, 232, 232, 164, 232, 153, 232, + 0, 0, 6, 0, 0, 0, 12, 3, 232, 22, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 197, + 158, 67, 232, 232, 232, 232, 232, 181, 232, 189, + 186, 219, 71, 72, 73, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 227, 0, + 0, 0, 0, 0, 0, 0, 232, 232, 232, 232, + 201, 232, 232, 232, 232, 232, 82, 83, 84, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 213, 0, 0, 0, 0, 213, 213, 206, 195, 213, - 196, 213, 213, 213, 213, 213, 85, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 207, - 213, 213, 213, 213, 91, 0, 0, 0, 197, 198, - 213, 201, 213, 202, 213, 213, 213, 213, 70, 213, - 213, 213, 165, 213, 166, 181, 213, 213, 199, 200, - 213, 213, 213, 213, 0, 0, 0, 213, 213, 213, - 213, 209, 211, 75, 213, 76, 213, 213, 213, 213, - 213, 213, 210, 212, 0, 0, 0, 0, 213, 213, - 86, 87, 213, 77, 213, 213, 78, 213, 213, 92, + 232, 232, 231, 232, 232, 232, 205, 88, 89, 90, + 232, 232, 4, 0, 5, 0, 0, 0, 0, 0, + 0, 105, 232, 232, 232, 232, 232, 232, 232, 216, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 94, 232, 232, 232, 232, 74, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 0, 0, 0, 0, + 232, 232, 217, 206, 232, 207, 232, 232, 232, 95, + 232, 232, 85, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 218, 232, 232, + 96, 232, 232, 91, 0, 0, 0, 208, 209, 232, - 93, 0, 0, 0, 0, 213, 213, 213, 213, 213, - 213, 213, 0, 0, 0, 0, 213, 213, 213, 213, - 213, 79, 213, 0, 0, 0, 7, 0, 0, 203, - 204, 213, 213, 213, 94, 0, 0, 8, 0, 0, - 213, 213, 167, 0, 0, 0, 80, 81, 0, 0, - 0, 9, 0, 0, 10, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 11, 0 + 212, 232, 213, 232, 232, 232, 232, 232, 232, 70, + 232, 232, 232, 232, 176, 232, 177, 192, 232, 232, + 232, 210, 211, 232, 232, 232, 232, 232, 232, 0, + 0, 0, 232, 232, 232, 232, 232, 220, 222, 232, + 75, 232, 76, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 221, 223, 232, 0, 0, 0, 0, 232, + 232, 86, 87, 232, 232, 232, 77, 232, 232, 232, + 78, 232, 232, 232, 92, 93, 232, 232, 0, 0, + 0, 0, 232, 232, 232, 232, 232, 232, 97, 232, + 100, 232, 232, 232, 232, 0, 0, 0, 0, 232, + + 232, 98, 101, 232, 232, 232, 232, 79, 232, 99, + 102, 0, 0, 0, 7, 0, 0, 214, 215, 232, + 232, 232, 232, 104, 0, 0, 8, 0, 0, 232, + 232, 178, 232, 0, 0, 0, 80, 81, 232, 0, + 0, 0, 9, 232, 0, 0, 10, 103, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 11, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -475,13 +477,13 @@ static yyconst flex_int32_t yy_ec[256] = 10, 11, 12, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 22, 22, 23, 1, 24, 25, 26, 1, 1, 27, 28, 29, 30, 31, 32, - 33, 34, 34, 34, 34, 35, 34, 34, 36, 34, - 34, 37, 38, 39, 40, 34, 34, 41, 34, 34, - 1, 1, 1, 42, 43, 1, 44, 45, 46, 47, + 33, 34, 34, 34, 34, 35, 36, 34, 37, 34, + 34, 38, 39, 40, 41, 34, 34, 42, 34, 34, + 1, 1, 1, 43, 44, 1, 45, 46, 47, 48, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 34, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 1, 69, 1, 1, 1, 1, 1, 1, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 34, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 1, 70, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -498,367 +500,397 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[70] = +static yyconst flex_int32_t yy_meta[71] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 4, 4, 4, 4, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 1, 5, 4, 4, 4, 4, 3, 3, 5, + 5, 5, 1, 5, 4, 4, 4, 4, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 1 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[876] = +static yyconst flex_int16_t yy_base[970] = { 0, - 0, 68, 74, 0, 1243, 1242, 1244, 1247, 69, 1247, - 1218, 1217, 136, 1216, 133, 134, 132, 1215, 148, 201, - 131, 1214, 146, 0, 121, 114, 123, 146, 134, 136, - 172, 1180, 161, 182, 141, 129, 151, 1174, 140, 187, - 196, 203, 205, 223, 1185, 187, 204, 270, 1247, 224, - 1247, 1220, 258, 1247, 0, 1247, 1247, 240, 1247, 1247, - 1247, 1247, 1247, 1247, 1247, 1247, 1247, 251, 1247, 253, - 224, 321, 275, 1247, 1247, 0, 0, 1247, 1209, 1247, - 1247, 1247, 1208, 0, 1247, 1247, 1170, 1175, 1168, 1171, - 1180, 1179, 1165, 1168, 1180, 247, 1174, 1161, 1158, 1172, + 0, 69, 75, 145, 1329, 1328, 1330, 1333, 70, 1333, + 1304, 1303, 94, 1302, 91, 92, 90, 1301, 202, 256, + 89, 1300, 95, 0, 79, 68, 64, 79, 124, 76, + 131, 1265, 127, 141, 81, 88, 82, 1259, 136, 126, + 183, 177, 149, 168, 134, 180, 206, 251, 1333, 140, + 1333, 1307, 239, 1333, 0, 1333, 1333, 228, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 231, 1333, 233, + 137, 307, 273, 1333, 1333, 0, 0, 1333, 1296, 1333, + 1333, 1333, 1295, 0, 1333, 1333, 1256, 1261, 115, 1258, + 1267, 1266, 1252, 1255, 1267, 244, 1261, 1248, 1245, 1259, - 1158, 1155, 1155, 1161, 243, 261, 1155, 1166, 1151, 1157, - 1161, 1162, 0, 1153, 1164, 252, 1163, 1158, 1138, 172, - 1142, 1156, 1146, 201, 1139, 260, 1152, 1154, 1136, 1132, - 1140, 1137, 1126, 1135, 264, 1133, 1139, 1134, 1137, 1125, - 1128, 256, 265, 271, 1138, 1125, 1138, 234, 1131, 1247, - 1247, 326, 319, 342, 1247, 1116, 1129, 1120, 1131, 329, - 0, 338, 0, 391, 1247, 315, 402, 1247, 409, 416, - 287, 1247, 1247, 1126, 0, 1117, 1121, 1131, 1128, 300, - 1111, 1111, 1115, 304, 1126, 1123, 1123, 1121, 1118, 1109, - 1116, 1102, 1100, 1113, 1098, 1115, 0, 1112, 1099, 1107, + 1245, 1242, 1242, 1248, 126, 180, 1242, 1253, 1238, 1244, + 1248, 1249, 0, 1240, 1251, 254, 1250, 1245, 1225, 143, + 1229, 1243, 1233, 188, 1226, 271, 1239, 1241, 285, 1220, + 1228, 1225, 1214, 1223, 223, 252, 1228, 1223, 1226, 1214, + 1217, 246, 246, 226, 1227, 1214, 1227, 83, 1220, 1219, + 1333, 1333, 329, 334, 340, 1333, 1204, 1217, 1208, 1219, + 342, 0, 333, 0, 346, 1333, 329, 390, 1333, 353, + 397, 281, 1333, 1333, 1214, 0, 1209, 1204, 1208, 1218, + 1215, 328, 1198, 1198, 1210, 1201, 278, 1212, 1209, 1209, + 1207, 1204, 1195, 1202, 1188, 1186, 1199, 1184, 1201, 0, - 1104, 1108, 1109, 1102, 1099, 1087, 1086, 1100, 1103, 1090, - 1099, 1086, 1093, 1083, 353, 1089, 1092, 1082, 1090, 1078, - 1082, 1073, 1088, 1078, 1069, 1088, 1071, 1069, 1080, 1069, - 1064, 1062, 1076, 1061, 1063, 1060, 1072, 1071, 1074, 1055, - 319, 1064, 1059, 1057, 1067, 1045, 361, 1064, 1066, 1054, - 1046, 1050, 1062, 1045, 0, 423, 434, 451, 1247, 458, - 468, 1247, 1247, 1040, 1051, 0, 1048, 366, 0, 0, - 1041, 1039, 1041, 1036, 1045, 1033, 1051, 1039, 369, 0, - 0, 1033, 1044, 1043, 1043, 0, 1027, 373, 0, 0, - 1029, 376, 1037, 1038, 1028, 1022, 1021, 1022, 1021, 1021, + 1198, 1185, 1193, 1190, 1194, 1195, 1188, 1185, 1173, 1172, + 1186, 1189, 1176, 1185, 1172, 1179, 1169, 362, 1175, 1178, + 1168, 1176, 1164, 1168, 1159, 1174, 1173, 1163, 1170, 325, + 1153, 1172, 1155, 1153, 1164, 1153, 1148, 1146, 1148, 1159, + 1144, 1146, 1143, 1155, 1154, 1157, 1138, 326, 1147, 1142, + 1140, 1150, 1128, 402, 1147, 1149, 1137, 1129, 1128, 1132, + 1144, 1127, 0, 414, 421, 438, 1333, 445, 456, 1333, + 1333, 1122, 1133, 1132, 0, 1129, 405, 0, 0, 1122, + 1120, 1120, 1121, 1116, 1125, 1113, 1131, 1119, 408, 0, + 0, 1113, 1124, 1123, 1123, 0, 1107, 426, 0, 0, - 380, 1016, 0, 0, 1012, 1011, 1010, 1012, 1013, 1018, - 1012, 1008, 1022, 1017, 1016, 1015, 1006, 1009, 1009, 1001, - 1004, 999, 1008, 1013, 998, 1011, 1001, 0, 0, 1008, - 1004, 0, 995, 995, 1001, 991, 999, 439, 996, 0, - 0, 0, 0, 985, 998, 997, 996, 993, 981, 475, - 486, 993, 995, 0, 0, 0, 0, 981, 0, 981, - 0, 980, 981, 975, 986, 0, 0, 0, 976, 0, - 972, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 983, 492, 982, 0, 0, 980, 976, 972, 0, 0, - 0, 964, 442, 494, 504, 969, 965, 971, 961, 959, + 1109, 450, 1117, 1118, 1108, 1102, 1101, 1102, 1101, 1101, + 461, 1096, 0, 0, 1092, 1091, 1090, 1092, 1093, 1098, + 1092, 1088, 1102, 1097, 1097, 1095, 1094, 1087, 1081, 1083, + 1082, 1085, 1085, 1077, 1080, 1075, 1084, 1089, 1076, 1073, + 1086, 1076, 0, 0, 1083, 1079, 0, 1070, 1070, 1076, + 1066, 1074, 464, 1071, 0, 0, 0, 0, 1060, 1073, + 1072, 1071, 1070, 1067, 1055, 473, 480, 1067, 1068, 1068, + 0, 0, 0, 0, 1054, 0, 1063, 1053, 0, 1052, + 1053, 1047, 1058, 0, 0, 0, 1048, 0, 1044, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1055, 486, - 973, 957, 957, 971, 959, 971, 966, 0, 964, 961, - 965, 948, 950, 957, 963, 958, 957, 944, 0, 946, - 947, 0, 0, 0, 0, 944, 948, 0, 942, 996, - 941, 944, 0, 932, 942, 0, 930, 930, 944, 0, - 946, 0, 508, 959, 958, 957, 923, 922, 0, 940, - 939, 934, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 922, 936, 922, 919, 0, 0, 925, 924, - 0, 0, 922, 914, 0, 0, 0, 0, 0, 0, - 911, 923, 511, 915, 922, 921, 918, 912, 905, 529, - 921, 906, 901, 915, 913, 0, 0, 905, 929, 928, + 1054, 0, 0, 1052, 1048, 1044, 0, 0, 0, 1036, + 467, 489, 498, 1041, 1037, 1043, 1033, 1031, 1045, 1029, + 0, 1029, 1043, 1031, 1027, 1034, 1028, 1040, 1035, 0, + 1033, 1030, 1034, 1017, 1015, 1018, 1025, 1031, 1026, 1025, + 1012, 0, 1014, 1015, 0, 0, 0, 0, 1012, 1016, + 0, 1009, 1009, 1064, 1008, 1011, 0, 1019, 998, 1008, + 1002, 0, 995, 995, 1009, 0, 1011, 0, 503, 1025, + 1024, 1023, 988, 987, 0, 1005, 1004, 999, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 987, 1001, + 987, 984, 0, 0, 990, 989, 0, 985, 993, 992, - 927, 893, 892, 378, 505, 0, 905, 908, 906, 894, - 890, 0, 903, 900, 899, 888, 887, 886, 535, 895, - 0, 912, 911, 910, 876, 875, 0, 890, 876, 0, - 887, 882, 539, 565, 931, 875, 883, 0, 0, 0, - 903, 902, 0, 879, 882, 866, 874, 864, 872, 873, - 873, 872, 857, 560, 870, 0, 871, 859, 858, 854, - 883, 882, 881, 847, 846, 842, 0, 880, 879, 0, - 856, 859, 0, 573, 0, 845, 591, 1247, 601, 0, - 612, 597, 1247, 0, 842, 841, 851, 851, 838, 853, - 836, 851, 846, 0, 0, 0, 863, 862, 861, 827, + 0, 984, 976, 0, 0, 0, 0, 973, 0, 0, + 972, 984, 506, 976, 983, 982, 979, 973, 970, 965, + 524, 981, 966, 960, 960, 974, 958, 971, 0, 0, + 963, 988, 987, 986, 951, 950, 359, 365, 0, 963, + 966, 964, 952, 948, 0, 961, 958, 957, 946, 945, + 935, 953, 938, 941, 519, 946, 949, 0, 967, 966, + 965, 930, 929, 0, 944, 930, 0, 941, 933, 935, + 549, 555, 985, 928, 932, 935, 0, 0, 0, 0, + 956, 955, 0, 931, 934, 918, 926, 916, 924, 925, + 925, 924, 909, 561, 922, 0, 923, 911, 910, 0, - 826, 0, 826, 0, 0, 0, 506, 534, 850, 837, - 840, 822, 823, 822, 832, 832, 849, 848, 847, 813, - 812, 817, 621, 647, 373, 834, 824, 812, 810, 809, - 820, 0, 823, 819, 821, 817, 803, 835, 324, 0, - 812, 815, 807, 798, 806, 796, 807, 803, 805, 803, - 803, 802, 789, 788, 799, 0, 819, 538, 0, 796, - 799, 1247, 444, 1247, 654, 0, 674, 813, 797, 779, - 796, 795, 778, 770, 778, 768, 776, 0, 773, 772, - 783, 781, 781, 764, 767, 782, 765, 778, 779, 776, - 773, 782, 759, 774, 773, 756, 755, 754, 765, 763, + 0, 0, 906, 936, 935, 934, 899, 898, 894, 902, + 0, 932, 931, 0, 907, 910, 0, 564, 0, 887, + 895, 582, 1333, 592, 0, 603, 594, 1333, 895, 0, + 891, 890, 900, 900, 887, 902, 885, 900, 895, 0, + 0, 0, 913, 912, 911, 876, 875, 0, 875, 0, + 0, 0, 500, 590, 899, 886, 889, 871, 884, 871, + 870, 880, 880, 898, 897, 896, 861, 860, 0, 865, + 628, 638, 446, 882, 872, 860, 856, 857, 856, 867, + 0, 870, 866, 868, 864, 850, 883, 526, 0, 859, + 862, 854, 845, 853, 843, 864, 853, 849, 851, 849, - 763, 479, 777, 746, 756, 740, 739, 0, 767, 739, - 765, 737, 741, 740, 753, 750, 0, 749, 752, 748, - 750, 731, 745, 729, 730, 738, 731, 720, 719, 0, - 725, 724, 737, 734, 0, 746, 730, 723, 0, 0, - 720, 0, 704, 0, 710, 709, 689, 690, 0, 682, - 690, 680, 708, 687, 0, 0, 700, 699, 0, 0, - 698, 697, 678, 679, 736, 560, 685, 692, 691, 667, - 666, 0, 0, 694, 666, 692, 678, 663, 678, 669, - 656, 5, 0, 0, 155, 634, 568, 106, 131, 208, - 0, 0, 217, 0, 285, 305, 0, 324, 366, 0, + 849, 848, 0, 835, 834, 845, 0, 866, 600, 0, + 842, 845, 1333, 508, 1333, 648, 0, 659, 860, 843, + 825, 0, 842, 841, 824, 816, 824, 814, 822, 0, + 819, 818, 839, 828, 826, 826, 809, 812, 827, 810, + 843, 822, 823, 820, 817, 522, 804, 819, 818, 794, + 772, 771, 792, 781, 779, 779, 526, 794, 762, 772, + 755, 754, 0, 782, 754, 780, 752, 756, 755, 788, + 767, 764, 784, 761, 764, 760, 760, 743, 740, 754, + 10, 170, 176, 190, 209, 241, 247, 0, 326, 332, + 368, 350, 352, 425, 478, 468, 476, 0, 0, 502, - 0, 360, 593, 549, 401, 440, 441, 457, 471, 469, - 454, 503, 474, 524, 643, 645, 509, 511, 549, 550, - 542, 0, 578, 581, 650, 676, 1247, 679, 625, 0, - 0, 588, 590, 593, 0, 599, 687, 1247, 659, 649, - 614, 615, 0, 630, 635, 697, 0, 0, 641, 698, - 699, 1247, 645, 701, 1247, 642, 703, 711, 708, 712, - 660, 661, 716, 717, 1247, 1247, 756, 759, 762, 718, - 719, 765, 769, 772, 774 + 0, 503, 0, 511, 514, 499, 500, 525, 526, 0, + 520, 538, 539, 553, 576, 559, 0, 0, 571, 589, + 590, 0, 0, 592, 594, 582, 589, 602, 610, 670, + 680, 620, 629, 638, 616, 617, 625, 0, 0, 626, + 649, 624, 652, 647, 641, 628, 651, 649, 642, 631, + 632, 640, 0, 0, 641, 701, 702, 703, 637, 659, + 660, 0, 0, 664, 665, 660, 0, 661, 646, 670, + 0, 648, 658, 681, 0, 0, 674, 675, 663, 720, + 673, 675, 666, 667, 659, 660, 684, 685, 0, 684, + 694, 668, 704, 668, 669, 673, 689, 738, 740, 675, + + 677, 0, 0, 696, 697, 687, 695, 0, 711, 0, + 0, 706, 750, 751, 1333, 754, 753, 0, 0, 698, + 699, 693, 719, 0, 704, 764, 1333, 765, 718, 703, + 704, 0, 723, 719, 723, 773, 0, 0, 718, 733, + 778, 779, 1333, 716, 726, 783, 1333, 0, 723, 785, + 788, 789, 790, 739, 740, 796, 797, 1333, 1333, 835, + 840, 843, 846, 797, 798, 849, 853, 856, 858 } ; -static yyconst flex_int16_t yy_def[876] = +static yyconst flex_int16_t yy_def[970] = { 0, - 866, 1, 866, 3, 867, 867, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 868, 866, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 869, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 870, 866, 871, - 19, 866, 866, 866, 866, 872, 20, 866, 866, 866, - 866, 866, 866, 868, 866, 866, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 959, 1, 960, 960, 961, 961, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 962, 959, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 963, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 964, 959, 965, + 19, 959, 959, 959, 959, 966, 20, 959, 959, 959, + 959, 959, 959, 962, 959, 959, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 873, 866, 869, 866, 866, 871, 866, 866, 866, 866, - 872, 866, 866, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 967, 959, 963, 959, 959, 965, 959, 959, 959, + 959, 966, 959, 959, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 866, 866, 866, 866, 873, 866, 866, 866, 866, 866, - 866, 866, 866, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 959, 959, + 959, 959, 967, 959, 959, 959, 959, 959, 959, 959, + 959, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 866, 866, 866, 866, 866, - 866, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 959, 959, 959, 959, 959, 959, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 866, 866, - 866, 866, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 866, 866, - 866, 866, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 959, 959, 959, 959, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 866, 866, 866, 866, 866, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 866, 866, 866, 866, 874, - 866, 866, 866, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 959, + 959, 959, 959, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 959, + 959, 959, 959, 959, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 866, 866, 866, 874, 866, 866, 866, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 866, 866, 866, 866, 875, 866, 866, 866, 866, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 959, 959, 959, 959, 968, 959, 959, 959, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 959, + 959, 959, 968, 959, 959, 959, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, - 868, 875, 866, 866, 866, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 866, 866, 866, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 866, 866, 866, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 866, 866, 866, 866, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, 868, 868, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 959, 959, 959, 959, 969, 959, 959, 959, + 959, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 969, 959, 959, 959, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 959, 959, 959, 962, 962, 962, - 868, 866, 866, 866, 866, 868, 868, 868, 868, 868, - 868, 868, 866, 866, 866, 866, 868, 868, 868, 868, - 868, 868, 868, 866, 866, 866, 866, 866, 866, 868, - 868, 868, 868, 868, 868, 866, 866, 866, 866, 866, - 868, 868, 868, 866, 866, 866, 868, 868, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 0, 866, 866, 866, 866, - 866, 866, 866, 866, 866 + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 959, + 959, 959, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 959, 959, 959, 959, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 962, 962, 962, 959, 959, + 959, 959, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 962, 962, 962, 962, 959, 959, 959, 959, 962, + + 962, 962, 962, 962, 962, 962, 962, 962, 962, 962, + 962, 959, 959, 959, 959, 959, 959, 962, 962, 962, + 962, 962, 962, 962, 959, 959, 959, 959, 959, 962, + 962, 962, 962, 959, 959, 959, 962, 962, 962, 959, + 959, 959, 959, 962, 959, 959, 959, 962, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 0, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959 } ; -static yyconst flex_int16_t yy_nxt[1317] = +static yyconst flex_int16_t yy_nxt[1404] = { 0, 8, 9, 10, 9, 11, 8, 12, 13, 8, 8, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 8, 21, 22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 25, 24, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 24, 24, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 24, 24, 24, 46, 47, - 58, 801, 58, 48, 49, 50, 51, 50, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 52, 49, - 53, 53, 53, 53, 53, 53, 54, 49, 49, 49, + 24, 24, 25, 24, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 24, 24, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 24, 24, 24, 46, + 47, 58, 817, 58, 48, 49, 50, 51, 50, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 52, + 49, 53, 53, 53, 53, 53, 53, 54, 49, 49, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 49, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 49, 61, 64, 85, 66, 68, 68, 68, - 68, 68, 68, 68, 79, 80, 785, 65, 67, 87, - 62, 70, 86, 71, 71, 71, 71, 71, 71, 72, - 82, 83, 121, 805, 88, 89, 122, 806, 73, 74, - 90, 97, 91, 126, 119, 98, 92, 75, 76, 93, - 101, 99, 102, 94, 123, 73, 74, 100, 120, 127, + 49, 61, 64, 85, 66, 68, 68, 68, 68, 68, + 68, 68, 79, 80, 87, 65, 67, 49, 62, 82, + 83, 86, 90, 93, 91, 119, 123, 94, 92, 88, + 89, 101, 121, 102, 95, 255, 122, 96, 256, 120, + 124, 161, 103, 161, 49, 49, 50, 51, 50, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 52, + 49, 53, 53, 53, 53, 53, 53, 54, 49, 49, + 49, 110, 97, 177, 129, 104, 98, 178, 959, 111, + 126, 196, 99, 105, 130, 149, 106, 49, 100, 107, + 113, 112, 197, 114, 150, 108, 127, 115, 116, 128, - 95, 103, 128, 96, 110, 152, 802, 58, 124, 153, - 75, 150, 111, 76, 70, 104, 77, 77, 77, 77, - 77, 77, 77, 105, 112, 160, 106, 160, 213, 107, - 113, 73, 74, 114, 129, 108, 214, 115, 116, 131, - 78, 58, 117, 58, 130, 118, 132, 133, 73, 74, - 138, 134, 218, 139, 807, 151, 142, 135, 136, 219, - 137, 143, 140, 78, 866, 144, 146, 808, 145, 141, - 147, 154, 155, 162, 162, 162, 162, 162, 162, 162, - 148, 164, 165, 167, 168, 248, 169, 169, 249, 866, - 170, 170, 170, 170, 170, 170, 170, 193, 164, 165, + 216, 142, 117, 959, 151, 118, 143, 153, 217, 58, + 144, 154, 146, 145, 49, 70, 147, 71, 71, 71, + 71, 71, 71, 72, 198, 138, 148, 131, 139, 58, + 818, 58, 73, 74, 132, 133, 819, 140, 199, 134, + 221, 820, 75, 76, 141, 135, 136, 222, 137, 152, + 73, 74, 155, 156, 163, 163, 163, 163, 163, 163, + 163, 165, 166, 168, 169, 75, 821, 237, 76, 70, + 250, 77, 77, 77, 77, 77, 77, 77, 251, 165, + 166, 168, 169, 238, 170, 170, 73, 74, 171, 171, + 171, 171, 171, 171, 171, 185, 78, 239, 248, 157, - 167, 168, 183, 184, 195, 221, 205, 231, 194, 206, - 207, 239, 240, 208, 243, 209, 241, 156, 196, 222, - 154, 155, 244, 232, 157, 242, 263, 152, 158, 58, - 160, 153, 160, 159, 70, 809, 72, 72, 72, 72, - 72, 72, 72, 154, 155, 258, 259, 269, 810, 263, - 680, 73, 74, 162, 162, 162, 162, 162, 162, 162, - 681, 270, 258, 259, 274, 275, 156, 333, 73, 74, - 305, 306, 307, 157, 577, 578, 334, 158, 340, 341, - 342, 811, 159, 355, 356, 357, 366, 367, 368, 156, - 374, 375, 376, 378, 379, 380, 157, 389, 390, 391, + 186, 187, 246, 247, 73, 74, 158, 249, 822, 208, + 159, 240, 209, 210, 823, 160, 211, 224, 212, 78, + 70, 271, 72, 72, 72, 72, 72, 72, 72, 229, + 153, 225, 58, 226, 154, 155, 156, 73, 74, 284, + 285, 155, 156, 161, 271, 161, 230, 231, 163, 163, + 163, 163, 163, 163, 163, 73, 74, 264, 264, 266, + 267, 265, 265, 265, 265, 265, 265, 265, 171, 171, + 171, 171, 171, 171, 171, 348, 278, 266, 267, 315, + 316, 317, 157, 329, 349, 586, 824, 330, 157, 158, + 279, 588, 825, 159, 826, 158, 827, 587, 160, 159, - 158, 812, 256, 256, 546, 159, 257, 257, 257, 257, - 257, 257, 257, 260, 260, 547, 813, 261, 261, 261, - 261, 261, 261, 261, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 257, 257, - 257, 257, 257, 257, 257, 663, 664, 262, 816, 257, - 257, 257, 257, 257, 257, 257, 423, 424, 425, 454, - 455, 456, 350, 350, 262, 165, 351, 351, 351, 351, - 351, 351, 351, 261, 261, 261, 261, 261, 261, 261, - 663, 664, 165, 261, 261, 261, 261, 261, 261, 261, - 351, 351, 351, 351, 351, 351, 351, 817, 818, 168, + 828, 268, 268, 589, 160, 269, 269, 269, 269, 269, + 269, 269, 171, 171, 171, 171, 171, 171, 171, 355, + 356, 357, 372, 373, 374, 384, 385, 386, 270, 265, + 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, + 265, 265, 265, 392, 393, 394, 270, 622, 623, 366, + 366, 829, 166, 367, 367, 367, 367, 367, 367, 367, + 269, 269, 269, 269, 269, 269, 269, 396, 397, 398, + 166, 269, 269, 269, 269, 269, 269, 269, 407, 408, + 409, 446, 447, 448, 480, 481, 482, 169, 367, 367, + 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, - 819, 351, 351, 351, 351, 351, 351, 351, 444, 445, - 446, 457, 458, 459, 820, 821, 168, 259, 822, 447, - 448, 460, 461, 462, 499, 500, 501, 522, 523, 524, - 490, 548, 644, 823, 259, 502, 503, 824, 525, 526, - 577, 578, 549, 645, 533, 534, 534, 534, 534, 534, - 534, 561, 562, 563, 579, 579, 579, 579, 579, 579, - 646, 786, 564, 565, 698, 566, 577, 578, 787, 803, - 647, 648, 825, 830, 699, 831, 597, 598, 599, 580, - 581, 581, 581, 581, 581, 581, 581, 600, 601, 617, - 618, 619, 577, 578, 803, 832, 833, 814, 582, 834, + 367, 367, 470, 471, 472, 169, 483, 484, 485, 714, + 715, 267, 830, 473, 474, 486, 487, 488, 831, 532, + 533, 534, 559, 560, 561, 521, 693, 714, 715, 267, + 535, 536, 832, 562, 563, 604, 605, 606, 694, 571, + 572, 572, 572, 572, 572, 572, 607, 608, 783, 609, + 622, 623, 732, 833, 834, 835, 622, 623, 836, 837, + 784, 733, 838, 734, 624, 624, 624, 624, 624, 624, + 626, 626, 626, 626, 626, 626, 626, 643, 644, 645, + 664, 665, 666, 622, 623, 839, 840, 841, 646, 647, + 625, 667, 668, 622, 623, 627, 842, 671, 672, 672, - 620, 621, 577, 578, 580, 815, 623, 624, 624, 624, - 624, 624, 624, 577, 578, 835, 579, 579, 579, 579, - 579, 579, 663, 664, 836, 804, 839, 581, 581, 581, - 581, 581, 581, 581, 626, 786, 665, 665, 665, 665, - 665, 665, 787, 627, 826, 841, 828, 842, 663, 664, - 804, 837, 827, 829, 628, 663, 664, 843, 844, 838, - 839, 666, 667, 667, 667, 667, 667, 667, 667, 665, - 665, 665, 665, 665, 665, 663, 664, 826, 847, 848, - 828, 849, 840, 850, 853, 827, 666, 829, 837, 667, - 667, 667, 667, 667, 667, 667, 838, 845, 851, 854, + 672, 672, 672, 672, 622, 623, 843, 624, 624, 624, + 624, 624, 624, 844, 845, 625, 695, 846, 626, 626, + 626, 626, 626, 626, 626, 696, 752, 697, 698, 714, + 715, 847, 674, 848, 849, 753, 850, 754, 851, 714, + 715, 675, 852, 716, 716, 716, 716, 716, 716, 714, + 715, 853, 676, 718, 718, 718, 718, 718, 718, 718, + 714, 715, 854, 716, 716, 716, 716, 716, 716, 717, + 855, 856, 859, 860, 718, 718, 718, 718, 718, 718, + 718, 857, 861, 862, 863, 864, 865, 866, 858, 867, + 868, 869, 870, 871, 717, 872, 873, 874, 875, 876, - 851, 856, 854, 857, 858, 846, 852, 855, 852, 860, - 855, 859, 858, 860, 862, 863, 840, 864, 864, 859, - 68, 166, 800, 799, 798, 865, 865, 797, 796, 795, - 794, 793, 792, 791, 790, 789, 788, 785, 784, 783, - 782, 781, 780, 779, 778, 777, 776, 775, 774, 773, - 772, 861, 771, 770, 769, 861, 56, 56, 56, 56, - 56, 84, 84, 84, 163, 163, 163, 171, 171, 255, - 768, 255, 255, 255, 625, 625, 702, 702, 767, 766, - 765, 764, 763, 762, 761, 760, 759, 758, 757, 756, - 755, 754, 753, 752, 751, 750, 749, 748, 747, 746, + 877, 878, 856, 857, 880, 882, 883, 884, 885, 886, + 858, 887, 888, 889, 890, 891, 892, 893, 894, 895, + 896, 880, 897, 899, 900, 901, 902, 903, 904, 905, + 898, 906, 907, 908, 909, 910, 911, 912, 913, 914, + 918, 916, 919, 920, 921, 922, 923, 915, 917, 924, + 925, 926, 914, 879, 928, 916, 930, 931, 932, 927, + 915, 881, 917, 933, 934, 926, 928, 935, 937, 938, + 939, 940, 941, 927, 942, 936, 944, 945, 881, 946, + 942, 948, 943, 949, 946, 950, 951, 947, 943, 951, + 953, 953, 947, 952, 955, 956, 952, 957, 957, 68, - 745, 744, 743, 742, 741, 740, 739, 738, 737, 736, - 735, 734, 733, 732, 731, 730, 729, 728, 727, 726, - 725, 724, 723, 722, 721, 720, 719, 718, 717, 716, - 715, 714, 713, 712, 711, 710, 709, 708, 707, 706, - 705, 704, 703, 701, 700, 697, 696, 695, 694, 693, - 692, 691, 690, 689, 688, 687, 686, 685, 684, 683, - 682, 679, 678, 677, 676, 675, 674, 673, 672, 671, - 670, 669, 668, 662, 661, 660, 659, 658, 657, 656, - 655, 654, 653, 652, 651, 650, 649, 643, 642, 641, - 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, + 167, 816, 815, 814, 813, 958, 958, 812, 811, 810, + 809, 929, 808, 807, 806, 805, 804, 803, 802, 801, + 800, 799, 798, 929, 797, 796, 795, 794, 793, 792, + 791, 790, 789, 954, 954, 55, 55, 55, 55, 55, + 56, 56, 56, 56, 56, 84, 84, 84, 164, 164, + 164, 172, 172, 263, 788, 263, 263, 263, 673, 673, + 757, 757, 787, 786, 785, 782, 781, 780, 779, 778, + 777, 776, 775, 774, 773, 772, 771, 770, 769, 768, + 767, 766, 765, 764, 763, 762, 761, 760, 759, 758, + 756, 755, 751, 750, 749, 748, 747, 746, 745, 744, - 630, 629, 622, 616, 615, 614, 613, 612, 611, 610, - 609, 608, 607, 606, 605, 604, 603, 602, 596, 595, - 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, - 584, 583, 582, 576, 575, 574, 573, 572, 571, 570, - 569, 568, 567, 560, 559, 558, 557, 556, 555, 554, - 553, 552, 551, 550, 545, 544, 543, 542, 541, 540, - 539, 538, 537, 536, 535, 532, 531, 530, 529, 528, - 527, 521, 520, 519, 518, 517, 516, 515, 514, 513, - 512, 511, 510, 509, 508, 507, 506, 505, 504, 498, - 497, 496, 495, 494, 493, 492, 491, 490, 489, 488, + 743, 742, 741, 740, 739, 738, 737, 736, 735, 731, + 730, 729, 728, 727, 726, 725, 724, 723, 722, 721, + 720, 719, 713, 712, 711, 710, 709, 708, 707, 706, + 705, 704, 703, 702, 701, 700, 699, 692, 691, 690, + 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, + 679, 678, 677, 670, 669, 663, 662, 661, 660, 659, + 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, + 648, 642, 641, 640, 639, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 621, 620, 619, + 618, 617, 616, 615, 614, 613, 612, 611, 610, 603, - 487, 486, 485, 484, 483, 482, 481, 480, 479, 478, - 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, - 467, 466, 465, 464, 463, 453, 452, 451, 450, 449, - 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, - 433, 432, 431, 430, 429, 428, 427, 426, 422, 421, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 388, - 387, 386, 385, 384, 383, 382, 381, 377, 373, 372, - 371, 370, 369, 365, 364, 363, 362, 361, 360, 359, + 602, 601, 600, 599, 598, 597, 596, 595, 594, 593, + 592, 591, 590, 585, 584, 583, 582, 581, 580, 579, + 578, 577, 576, 575, 574, 573, 570, 569, 568, 567, + 566, 565, 564, 558, 557, 556, 555, 554, 553, 552, + 551, 550, 549, 548, 547, 546, 545, 544, 543, 542, + 541, 540, 539, 538, 537, 531, 530, 529, 528, 527, + 526, 525, 524, 523, 522, 521, 520, 519, 518, 517, + 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, + 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, + 496, 495, 494, 493, 492, 491, 490, 489, 479, 478, - 358, 354, 353, 352, 349, 348, 347, 346, 345, 344, - 343, 339, 338, 337, 336, 335, 332, 331, 330, 329, - 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, - 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, - 308, 304, 303, 302, 301, 300, 299, 298, 297, 296, - 295, 294, 293, 292, 291, 290, 289, 288, 287, 286, - 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, - 273, 272, 271, 268, 267, 266, 265, 264, 254, 253, - 252, 251, 250, 247, 246, 245, 238, 237, 236, 235, - 234, 233, 230, 229, 228, 227, 226, 225, 224, 223, + 477, 476, 475, 469, 468, 467, 466, 465, 464, 463, + 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, + 452, 451, 450, 449, 445, 444, 443, 442, 441, 440, + 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, + 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, + 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, + 406, 405, 404, 403, 402, 401, 400, 399, 395, 391, + 390, 389, 388, 387, 383, 382, 381, 380, 379, 378, + 377, 376, 375, 371, 370, 369, 368, 365, 364, 363, + 362, 361, 360, 359, 358, 354, 353, 352, 351, 350, - 220, 217, 216, 215, 212, 211, 210, 204, 203, 202, - 201, 200, 199, 198, 197, 192, 191, 190, 189, 188, - 187, 186, 185, 182, 181, 180, 179, 178, 177, 176, - 175, 174, 173, 172, 161, 149, 125, 109, 81, 69, - 63, 60, 59, 866, 57, 57, 7, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, + 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, + 337, 336, 335, 334, 333, 332, 331, 328, 327, 326, + 325, 324, 323, 322, 321, 320, 319, 318, 314, 313, + 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, + 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, + 292, 291, 290, 289, 288, 287, 286, 283, 282, 281, + 280, 277, 276, 275, 274, 273, 272, 262, 261, 260, + 259, 258, 257, 254, 253, 252, 245, 244, 243, 242, + 241, 236, 235, 234, 233, 232, 228, 227, 223, 220, + 219, 218, 215, 214, 213, 207, 206, 205, 204, 203, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866 + 202, 201, 200, 195, 194, 193, 192, 191, 190, 189, + 188, 184, 183, 182, 181, 180, 179, 176, 175, 174, + 173, 162, 125, 109, 81, 69, 63, 60, 59, 959, + 57, 57, 7, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + + 959, 959, 959 } ; -static yyconst flex_int16_t yy_chk[1317] = +static yyconst flex_int16_t yy_chk[1404] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -866,145 +898,155 @@ static yyconst flex_int16_t yy_chk[1317] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 9, 782, 9, 2, 3, 3, 3, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 9, 781, 9, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 13, 15, 25, 16, 17, 17, 17, - 17, 17, 17, 17, 21, 21, 785, 15, 16, 26, - 13, 19, 25, 19, 19, 19, 19, 19, 19, 19, - 23, 23, 36, 788, 26, 26, 36, 789, 19, 19, - 27, 29, 27, 39, 35, 29, 27, 19, 19, 28, - 30, 29, 30, 28, 37, 19, 19, 29, 35, 39, + 3, 13, 15, 25, 16, 17, 17, 17, 17, 17, + 17, 17, 21, 21, 26, 15, 16, 3, 13, 23, + 23, 25, 27, 28, 27, 35, 37, 28, 27, 26, + 26, 30, 36, 30, 28, 148, 36, 28, 148, 35, + 37, 50, 30, 50, 3, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 33, 29, 89, 40, 31, 29, 89, 71, 33, + 39, 105, 29, 31, 40, 45, 31, 4, 29, 31, + 34, 33, 105, 34, 45, 31, 39, 34, 34, 39, - 28, 30, 39, 28, 33, 47, 785, 47, 37, 47, - 19, 46, 33, 19, 20, 31, 20, 20, 20, 20, - 20, 20, 20, 31, 33, 50, 31, 50, 120, 31, - 34, 20, 20, 34, 40, 31, 120, 34, 34, 41, - 20, 58, 34, 58, 40, 34, 41, 41, 20, 20, - 42, 41, 124, 42, 790, 46, 43, 41, 41, 124, - 41, 43, 42, 20, 71, 43, 44, 793, 43, 42, - 44, 48, 48, 53, 53, 53, 53, 53, 53, 53, - 44, 68, 68, 70, 70, 148, 73, 73, 148, 71, - 73, 73, 73, 73, 73, 73, 73, 105, 68, 68, + 120, 43, 34, 71, 46, 34, 43, 47, 120, 47, + 43, 47, 44, 43, 4, 19, 44, 19, 19, 19, + 19, 19, 19, 19, 106, 42, 44, 41, 42, 58, + 782, 58, 19, 19, 41, 41, 783, 42, 106, 41, + 124, 784, 19, 19, 42, 41, 41, 124, 41, 46, + 19, 19, 48, 48, 53, 53, 53, 53, 53, 53, + 53, 68, 68, 70, 70, 19, 785, 135, 19, 20, + 144, 20, 20, 20, 20, 20, 20, 20, 144, 68, + 68, 70, 70, 135, 73, 73, 20, 20, 73, 73, + 73, 73, 73, 73, 73, 96, 20, 136, 143, 48, - 70, 70, 96, 96, 106, 126, 116, 135, 105, 116, - 116, 142, 142, 116, 144, 116, 143, 48, 106, 126, - 153, 153, 144, 135, 48, 143, 171, 152, 48, 152, - 160, 152, 160, 48, 72, 795, 72, 72, 72, 72, - 72, 72, 72, 154, 154, 166, 166, 180, 796, 171, - 639, 72, 72, 162, 162, 162, 162, 162, 162, 162, - 639, 180, 166, 166, 184, 184, 153, 241, 72, 72, - 215, 215, 215, 153, 625, 625, 241, 153, 247, 247, - 247, 798, 153, 268, 268, 268, 279, 279, 279, 154, - 288, 288, 288, 292, 292, 292, 154, 301, 301, 301, + 96, 96, 142, 142, 20, 20, 48, 143, 786, 116, + 48, 136, 116, 116, 787, 48, 116, 126, 116, 20, + 72, 172, 72, 72, 72, 72, 72, 72, 72, 129, + 153, 126, 153, 126, 153, 154, 154, 72, 72, 187, + 187, 155, 155, 161, 172, 161, 129, 129, 163, 163, + 163, 163, 163, 163, 163, 72, 72, 165, 165, 167, + 167, 165, 165, 165, 165, 165, 165, 165, 170, 170, + 170, 170, 170, 170, 170, 248, 182, 167, 167, 218, + 218, 218, 154, 230, 248, 537, 789, 230, 155, 154, + 182, 538, 790, 154, 791, 155, 792, 537, 154, 155, - 154, 799, 164, 164, 504, 154, 164, 164, 164, 164, - 164, 164, 164, 167, 167, 504, 802, 167, 167, 167, - 167, 167, 167, 167, 169, 169, 169, 169, 169, 169, - 169, 170, 170, 170, 170, 170, 170, 170, 256, 256, - 256, 256, 256, 256, 256, 663, 663, 170, 805, 257, - 257, 257, 257, 257, 257, 257, 338, 338, 338, 393, - 393, 393, 258, 258, 170, 257, 258, 258, 258, 258, - 258, 258, 258, 260, 260, 260, 260, 260, 260, 260, - 702, 702, 257, 261, 261, 261, 261, 261, 261, 261, - 350, 350, 350, 350, 350, 350, 350, 806, 807, 261, + 793, 168, 168, 538, 155, 168, 168, 168, 168, 168, + 168, 168, 171, 171, 171, 171, 171, 171, 171, 254, + 254, 254, 277, 277, 277, 289, 289, 289, 171, 264, + 264, 264, 264, 264, 264, 264, 265, 265, 265, 265, + 265, 265, 265, 298, 298, 298, 171, 673, 673, 266, + 266, 794, 265, 266, 266, 266, 266, 266, 266, 266, + 268, 268, 268, 268, 268, 268, 268, 302, 302, 302, + 265, 269, 269, 269, 269, 269, 269, 269, 311, 311, + 311, 353, 353, 353, 411, 411, 411, 269, 366, 366, + 366, 366, 366, 366, 366, 367, 367, 367, 367, 367, - 808, 351, 351, 351, 351, 351, 351, 351, 382, 382, - 382, 394, 394, 394, 809, 810, 261, 351, 811, 382, - 382, 395, 395, 395, 443, 443, 443, 483, 483, 483, - 490, 505, 607, 812, 351, 443, 443, 813, 483, 483, - 533, 533, 505, 607, 490, 490, 490, 490, 490, 490, - 490, 519, 519, 519, 533, 533, 533, 533, 533, 533, - 608, 766, 519, 519, 658, 519, 534, 534, 766, 787, - 608, 608, 814, 817, 658, 818, 554, 554, 554, 533, - 534, 534, 534, 534, 534, 534, 534, 554, 554, 574, - 574, 574, 577, 577, 803, 819, 820, 804, 582, 821, + 367, 367, 400, 400, 400, 269, 412, 412, 412, 714, + 714, 367, 795, 400, 400, 413, 413, 413, 796, 469, + 469, 469, 513, 513, 513, 521, 653, 757, 757, 367, + 469, 469, 797, 513, 513, 555, 555, 555, 653, 521, + 521, 521, 521, 521, 521, 521, 555, 555, 746, 555, + 571, 571, 688, 800, 802, 804, 572, 572, 805, 806, + 746, 688, 807, 688, 571, 571, 571, 571, 571, 571, + 572, 572, 572, 572, 572, 572, 572, 594, 594, 594, + 618, 618, 618, 622, 622, 808, 809, 811, 594, 594, + 571, 618, 618, 624, 624, 627, 812, 622, 622, 622, - 574, 574, 579, 579, 533, 804, 577, 577, 577, 577, - 577, 577, 577, 581, 581, 823, 579, 579, 579, 579, - 579, 579, 623, 623, 824, 787, 829, 581, 581, 581, - 581, 581, 581, 581, 582, 786, 623, 623, 623, 623, - 623, 623, 786, 582, 815, 832, 816, 833, 624, 624, - 803, 825, 815, 816, 582, 665, 665, 834, 836, 825, - 839, 623, 624, 624, 624, 624, 624, 624, 624, 665, - 665, 665, 665, 665, 665, 667, 667, 826, 841, 842, - 828, 844, 829, 845, 849, 826, 623, 828, 837, 667, - 667, 667, 667, 667, 667, 667, 837, 840, 846, 850, + 622, 622, 622, 622, 626, 626, 813, 624, 624, 624, + 624, 624, 624, 814, 815, 571, 654, 816, 626, 626, + 626, 626, 626, 626, 626, 654, 709, 654, 654, 671, + 671, 819, 627, 820, 821, 709, 824, 709, 825, 672, + 672, 627, 826, 671, 671, 671, 671, 671, 671, 716, + 716, 827, 627, 672, 672, 672, 672, 672, 672, 672, + 718, 718, 828, 716, 716, 716, 716, 716, 716, 671, + 829, 830, 832, 833, 718, 718, 718, 718, 718, 718, + 718, 831, 834, 835, 836, 837, 840, 841, 831, 842, + 843, 844, 845, 846, 671, 847, 848, 849, 850, 851, - 851, 853, 854, 856, 857, 840, 846, 850, 851, 859, - 854, 857, 858, 860, 861, 862, 839, 863, 864, 858, - 870, 871, 781, 780, 779, 863, 864, 778, 777, 776, - 775, 774, 771, 770, 769, 768, 767, 765, 764, 763, - 762, 761, 758, 757, 754, 753, 752, 751, 750, 748, - 747, 859, 746, 745, 743, 860, 867, 867, 867, 867, - 867, 868, 868, 868, 869, 869, 869, 872, 872, 873, - 741, 873, 873, 873, 874, 874, 875, 875, 738, 737, - 736, 734, 733, 732, 731, 729, 728, 727, 726, 725, - 724, 723, 722, 721, 720, 719, 718, 716, 715, 714, + 852, 855, 856, 857, 858, 859, 860, 861, 864, 865, + 857, 866, 868, 869, 870, 872, 873, 874, 877, 878, + 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, + 881, 890, 891, 892, 893, 894, 895, 896, 897, 898, + 900, 899, 901, 904, 905, 906, 907, 898, 899, 909, + 912, 913, 914, 856, 917, 916, 920, 921, 922, 913, + 914, 858, 916, 923, 925, 926, 928, 929, 930, 931, + 933, 934, 935, 926, 936, 929, 939, 940, 880, 941, + 942, 944, 936, 945, 946, 949, 950, 941, 942, 951, + 952, 953, 946, 950, 954, 955, 951, 956, 957, 964, - 713, 712, 711, 710, 709, 707, 706, 705, 704, 703, - 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, - 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, - 681, 680, 679, 677, 676, 675, 674, 673, 672, 671, - 670, 669, 668, 661, 660, 657, 655, 654, 653, 652, - 651, 650, 649, 648, 647, 646, 645, 644, 643, 642, - 641, 638, 637, 636, 635, 634, 633, 631, 630, 629, - 628, 627, 626, 622, 621, 620, 619, 618, 617, 616, - 615, 614, 613, 612, 611, 610, 609, 603, 601, 600, - 599, 598, 597, 593, 592, 591, 590, 589, 588, 587, + 965, 780, 779, 778, 777, 956, 957, 776, 775, 774, + 773, 917, 772, 771, 770, 769, 768, 767, 766, 765, + 764, 762, 761, 928, 760, 759, 758, 756, 755, 754, + 753, 752, 751, 952, 953, 960, 960, 960, 960, 960, + 961, 961, 961, 961, 961, 962, 962, 962, 963, 963, + 963, 966, 966, 967, 750, 967, 967, 967, 968, 968, + 969, 969, 749, 748, 747, 745, 744, 743, 742, 741, + 740, 739, 738, 737, 736, 735, 734, 733, 732, 731, + 729, 728, 727, 726, 725, 724, 723, 721, 720, 719, + 712, 711, 708, 706, 705, 704, 702, 701, 700, 699, - 586, 585, 576, 572, 571, 569, 568, 566, 565, 564, - 563, 562, 561, 560, 559, 558, 557, 555, 553, 552, - 551, 550, 549, 548, 547, 546, 545, 544, 542, 541, - 537, 536, 535, 532, 531, 529, 528, 526, 525, 524, - 523, 522, 520, 518, 517, 516, 515, 514, 513, 511, - 510, 509, 508, 507, 503, 502, 501, 500, 499, 498, - 495, 494, 493, 492, 491, 489, 488, 487, 486, 485, - 484, 482, 481, 474, 473, 470, 469, 466, 465, 464, - 463, 452, 451, 450, 448, 447, 446, 445, 444, 441, - 439, 438, 437, 435, 434, 432, 431, 430, 429, 427, + 698, 697, 696, 695, 694, 693, 692, 691, 690, 687, + 686, 685, 684, 683, 682, 680, 679, 678, 677, 676, + 675, 674, 670, 668, 667, 666, 665, 664, 663, 662, + 661, 660, 659, 658, 657, 656, 655, 649, 647, 646, + 645, 644, 643, 639, 638, 637, 636, 635, 634, 633, + 632, 631, 629, 621, 620, 616, 615, 613, 612, 610, + 609, 608, 607, 606, 605, 604, 603, 599, 598, 597, + 595, 593, 592, 591, 590, 589, 588, 587, 586, 585, + 584, 582, 581, 576, 575, 574, 573, 570, 569, 568, + 566, 565, 563, 562, 561, 560, 559, 557, 556, 554, - 426, 421, 420, 418, 417, 416, 415, 414, 413, 412, - 411, 410, 409, 407, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 392, 388, 387, 386, 383, - 381, 371, 369, 365, 364, 363, 362, 360, 358, 353, - 352, 349, 348, 347, 346, 345, 344, 339, 337, 336, - 335, 334, 333, 331, 330, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 305, 302, 300, - 299, 298, 297, 296, 295, 294, 293, 291, 287, 285, - 284, 283, 282, 278, 277, 276, 275, 274, 273, 272, + 553, 552, 551, 550, 549, 548, 547, 546, 544, 543, + 542, 541, 540, 536, 535, 534, 533, 532, 531, 528, + 527, 526, 525, 524, 523, 522, 520, 519, 518, 517, + 516, 515, 514, 512, 511, 508, 503, 502, 500, 499, + 498, 496, 495, 492, 491, 490, 489, 478, 477, 476, + 474, 473, 472, 471, 470, 467, 465, 464, 463, 461, + 460, 459, 458, 456, 455, 454, 453, 452, 450, 449, + 444, 443, 441, 440, 439, 438, 437, 436, 435, 434, + 433, 432, 431, 429, 428, 427, 426, 425, 424, 423, + 422, 420, 419, 418, 417, 416, 415, 414, 410, 406, - 271, 267, 265, 264, 254, 253, 252, 251, 250, 249, - 248, 246, 245, 244, 243, 242, 240, 239, 238, 237, - 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, - 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, - 216, 214, 213, 212, 211, 210, 209, 208, 207, 206, - 205, 204, 203, 202, 201, 200, 199, 198, 196, 195, - 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, - 183, 182, 181, 179, 178, 177, 176, 174, 159, 158, - 157, 156, 149, 147, 146, 145, 141, 140, 139, 138, - 137, 136, 134, 133, 132, 131, 130, 129, 128, 127, + 405, 404, 401, 399, 389, 387, 383, 382, 381, 380, + 378, 377, 375, 370, 369, 368, 365, 364, 363, 362, + 361, 360, 359, 354, 352, 351, 350, 349, 348, 346, + 345, 342, 341, 340, 339, 338, 337, 336, 335, 334, + 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, + 323, 322, 321, 320, 319, 318, 317, 316, 315, 312, + 310, 309, 308, 307, 306, 305, 304, 303, 301, 297, + 295, 294, 293, 292, 288, 287, 286, 285, 284, 283, + 282, 281, 280, 276, 274, 273, 272, 262, 261, 260, + 259, 258, 257, 256, 255, 253, 252, 251, 250, 249, - 125, 123, 122, 121, 119, 118, 117, 115, 114, 112, - 111, 110, 109, 108, 107, 104, 103, 102, 101, 100, - 99, 98, 97, 95, 94, 93, 92, 91, 90, 89, - 88, 87, 83, 79, 52, 45, 38, 32, 22, 18, - 14, 12, 11, 7, 6, 5, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, + 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, + 237, 236, 235, 234, 233, 232, 231, 229, 228, 227, + 226, 225, 224, 223, 222, 221, 220, 219, 217, 216, + 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, + 205, 204, 203, 202, 201, 199, 198, 197, 196, 195, + 194, 193, 192, 191, 190, 189, 188, 186, 185, 184, + 183, 181, 180, 179, 178, 177, 175, 160, 159, 158, + 157, 150, 149, 147, 146, 145, 141, 140, 139, 138, + 137, 134, 133, 132, 131, 130, 128, 127, 125, 123, + 122, 121, 119, 118, 117, 115, 114, 112, 111, 110, - 866, 866, 866, 866, 866, 866, 866, 866, 866, 866, - 866, 866, 866, 866, 866, 866 + 109, 108, 107, 104, 103, 102, 101, 100, 99, 98, + 97, 95, 94, 93, 92, 91, 90, 88, 87, 83, + 79, 52, 38, 32, 22, 18, 14, 12, 11, 7, + 6, 5, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + + 959, 959, 959 } ; /* The intent behind this definition is that it'll catch @@ -1071,22 +1113,36 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); * * Certain words start out as identifiers, become reserved words in * later language revisions, and finally become language keywords. + * This may happen at different times in desktop GLSL and GLSL ES. * * For example, consider the following lexer rule: - * samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER) + * samplerBuffer KEYWORD(130, 0, 140, 0, SAMPLERBUFFER) * * This means that "samplerBuffer" will be treated as: * - a keyword (SAMPLERBUFFER token) ...in GLSL >= 1.40 * - a reserved word - error ...in GLSL >= 1.30 - * - an identifier ...in GLSL < 1.30 + * - an identifier ...in GLSL < 1.30 or GLSL ES */ -#define KEYWORD(reserved_version, allowed_version, token) \ +#define KEYWORD(reserved_glsl, reserved_glsl_es, \ + allowed_glsl, allowed_glsl_es, token) \ + KEYWORD_WITH_ALT(reserved_glsl, reserved_glsl_es, \ + allowed_glsl, allowed_glsl_es, false, token) + +/** + * Like the KEYWORD macro, but the word is also treated as a keyword + * if the given boolean expression is true. + */ +#define KEYWORD_WITH_ALT(reserved_glsl, reserved_glsl_es, \ + allowed_glsl, allowed_glsl_es, \ + alt_expr, token) \ do { \ - if (yyextra->language_version >= allowed_version) { \ + if (yyextra->is_version(allowed_glsl, allowed_glsl_es) \ + || (alt_expr)) { \ return token; \ - } else if (yyextra->language_version >= reserved_version) { \ + } else if (yyextra->is_version(reserved_glsl, \ + reserved_glsl_es)) { \ _mesa_glsl_error(yylloc, yyextra, \ - "Illegal use of reserved word `%s'", yytext); \ + "illegal use of reserved word `%s'", yytext); \ return ERROR_TOK; \ } else { \ yylval->identifier = strdup(yytext); \ @@ -1094,15 +1150,20 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); } \ } while (0) -/* The ES macro can be used in KEYWORD checks: - * - * word KEYWORD(110 || ES, 400, TOKEN) - * ...means the word is reserved in GLSL ES 1.00, while - * - * word KEYWORD(110, 130 || ES, TOKEN) - * ...means the word is a legal keyword in GLSL ES 1.00. +/** + * A macro for handling keywords that have been present in GLSL since + * its origin, but were changed into reserved words in GLSL 3.00 ES. */ -#define ES yyextra->es_shader +#define DEPRECATED_ES_KEYWORD(token) \ + do { \ + if (yyextra->is_version(0, 300)) { \ + _mesa_glsl_error(yylloc, yyextra, \ + "illegal use of reserved word `%s'", yytext); \ + return ERROR_TOK; \ + } else { \ + return token; \ + } \ + } while (0) static int literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, @@ -1126,12 +1187,12 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, if (value > UINT_MAX) { /* Note that signed 0xffffffff is valid, not out of range! */ - if (state->language_version >= 130) { + if (state->is_version(130, 300)) { _mesa_glsl_error(lloc, state, - "Literal value `%s' out of range", text); + "literal value `%s' out of range", text); } else { _mesa_glsl_warning(lloc, state, - "Literal value `%s' out of range", text); + "literal value `%s' out of range", text); } } else if (base == 10 && !is_uint && (unsigned)value > (unsigned)INT_MAX + 1) { /* Tries to catch unintentionally providing a negative value. @@ -1139,7 +1200,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, * want to warn for INT_MAX. */ _mesa_glsl_warning(lloc, state, - "Signed literal value `%s' is interpreted as %d", + "signed literal value `%s' is interpreted as %d", text, lval->n); } return is_uint ? UINTCONSTANT : INTCONSTANT; @@ -1149,7 +1210,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, literal_integer(yytext, yyleng, yyextra, yylval, yylloc, base) -#line 1153 "src/glsl/glsl_lexer.cpp" +#line 1214 "src/glsl/glsl_lexer.cpp" #define INITIAL 0 #define PP 1 @@ -1170,8 +1231,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -1203,46 +1264,46 @@ static int yy_init_globals (yyscan_t yyscanner ); # define yylloc yyg->yylloc_r -int _mesa_glsl_lex_init (yyscan_t* scanner); +int _mesa_glsl_lexer_lex_init (yyscan_t* scanner); -int _mesa_glsl_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int _mesa_glsl_lexer_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int _mesa_glsl_lex_destroy (yyscan_t yyscanner ); +int _mesa_glsl_lexer_lex_destroy (yyscan_t yyscanner ); -int _mesa_glsl_get_debug (yyscan_t yyscanner ); +int _mesa_glsl_lexer_get_debug (yyscan_t yyscanner ); -void _mesa_glsl_set_debug (int debug_flag ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_set_debug (int debug_flag ,yyscan_t yyscanner ); -YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner ); +YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra (yyscan_t yyscanner ); -void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); -FILE *_mesa_glsl_get_in (yyscan_t yyscanner ); +FILE *_mesa_glsl_lexer_get_in (yyscan_t yyscanner ); -void _mesa_glsl_set_in (FILE * in_str ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_set_in (FILE * in_str ,yyscan_t yyscanner ); -FILE *_mesa_glsl_get_out (yyscan_t yyscanner ); +FILE *_mesa_glsl_lexer_get_out (yyscan_t yyscanner ); -void _mesa_glsl_set_out (FILE * out_str ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_set_out (FILE * out_str ,yyscan_t yyscanner ); -int _mesa_glsl_get_leng (yyscan_t yyscanner ); +yy_size_t _mesa_glsl_lexer_get_leng (yyscan_t yyscanner ); -char *_mesa_glsl_get_text (yyscan_t yyscanner ); +char *_mesa_glsl_lexer_get_text (yyscan_t yyscanner ); -int _mesa_glsl_get_lineno (yyscan_t yyscanner ); +int _mesa_glsl_lexer_get_lineno (yyscan_t yyscanner ); -void _mesa_glsl_set_lineno (int line_number ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_set_lineno (int line_number ,yyscan_t yyscanner ); -YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner ); +YYSTYPE * _mesa_glsl_lexer_get_lval (yyscan_t yyscanner ); -void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); +void _mesa_glsl_lexer_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner ); + YYLTYPE *_mesa_glsl_lexer_get_lloc (yyscan_t yyscanner ); - void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + void _mesa_glsl_lexer_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1250,9 +1311,9 @@ void _mesa_glsl_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int _mesa_glsl_wrap (yyscan_t yyscanner ); +extern "C" int _mesa_glsl_lexer_wrap (yyscan_t yyscanner ); #else -extern int _mesa_glsl_wrap (yyscan_t yyscanner ); +extern int _mesa_glsl_lexer_wrap (yyscan_t yyscanner ); #endif #endif @@ -1276,12 +1337,7 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1289,7 +1345,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1300,7 +1356,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1354,10 +1410,10 @@ static int input (yyscan_t yyscanner ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int _mesa_glsl_lex \ +extern int _mesa_glsl_lexer_lex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); -#define YY_DECL int _mesa_glsl_lex \ +#define YY_DECL int _mesa_glsl_lexer_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ @@ -1388,10 +1444,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 151 "src/glsl/glsl_lexer.ll" +#line 170 "src/glsl/glsl_lexer.ll" -#line 1395 "src/glsl/glsl_lexer.cpp" +#line 1451 "src/glsl/glsl_lexer.cpp" yylval = yylval_param; @@ -1415,12 +1471,12 @@ YY_DECL yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - _mesa_glsl_ensure_buffer_stack (yyscanner); + _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } - _mesa_glsl__load_buffer_state(yyscanner ); + _mesa_glsl_lexer__load_buffer_state(yyscanner ); } while ( 1 ) /* loops until end-of-file is reached */ @@ -1449,13 +1505,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 867 ) + if ( yy_current_state >= 960 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 866 ); + while ( yy_current_state != 959 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1477,7 +1533,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 153 "src/glsl/glsl_lexer.ll" +#line 172 "src/glsl/glsl_lexer.ll" ; YY_BREAK /* Preprocessor tokens. */ @@ -1486,17 +1542,17 @@ case 2: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 156 "src/glsl/glsl_lexer.ll" +#line 175 "src/glsl/glsl_lexer.ll" ; YY_BREAK case 3: YY_RULE_SETUP -#line 157 "src/glsl/glsl_lexer.ll" +#line 176 "src/glsl/glsl_lexer.ll" { BEGIN PP; return VERSION_TOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 158 "src/glsl/glsl_lexer.ll" +#line 177 "src/glsl/glsl_lexer.ll" { BEGIN PP; return EXTENSION; } YY_BREAK case 5: @@ -1504,7 +1560,7 @@ case 5: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 159 "src/glsl/glsl_lexer.ll" +#line 178 "src/glsl/glsl_lexer.ll" { /* Eat characters until the first digit is * encountered @@ -1526,7 +1582,7 @@ case 6: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 174 "src/glsl/glsl_lexer.ll" +#line 193 "src/glsl/glsl_lexer.ll" { /* Eat characters until the first digit is * encountered @@ -1544,7 +1600,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 188 "src/glsl/glsl_lexer.ll" +#line 207 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_DEBUG_ON; @@ -1552,7 +1608,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 192 "src/glsl/glsl_lexer.ll" +#line 211 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_DEBUG_OFF; @@ -1560,7 +1616,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 196 "src/glsl/glsl_lexer.ll" +#line 215 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_OPTIMIZE_ON; @@ -1568,7 +1624,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 200 "src/glsl/glsl_lexer.ll" +#line 219 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_OPTIMIZE_OFF; @@ -1576,7 +1632,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 204 "src/glsl/glsl_lexer.ll" +#line 223 "src/glsl/glsl_lexer.ll" { BEGIN PP; return PRAGMA_INVARIANT_ALL; @@ -1584,38 +1640,38 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 208 "src/glsl/glsl_lexer.ll" +#line 227 "src/glsl/glsl_lexer.ll" { BEGIN PRAGMA; } YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP -#line 210 "src/glsl/glsl_lexer.ll" +#line 229 "src/glsl/glsl_lexer.ll" { BEGIN 0; yylineno++; yycolumn = 0; } YY_BREAK case 14: YY_RULE_SETUP -#line 211 "src/glsl/glsl_lexer.ll" +#line 230 "src/glsl/glsl_lexer.ll" { } YY_BREAK case 15: YY_RULE_SETUP -#line 213 "src/glsl/glsl_lexer.ll" +#line 232 "src/glsl/glsl_lexer.ll" { } YY_BREAK case 16: YY_RULE_SETUP -#line 214 "src/glsl/glsl_lexer.ll" +#line 233 "src/glsl/glsl_lexer.ll" { } YY_BREAK case 17: YY_RULE_SETUP -#line 215 "src/glsl/glsl_lexer.ll" +#line 234 "src/glsl/glsl_lexer.ll" return COLON; YY_BREAK case 18: YY_RULE_SETUP -#line 216 "src/glsl/glsl_lexer.ll" +#line 235 "src/glsl/glsl_lexer.ll" { yylval->identifier = strdup(yytext); return IDENTIFIER; @@ -1623,7 +1679,7 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 220 "src/glsl/glsl_lexer.ll" +#line 239 "src/glsl/glsl_lexer.ll" { yylval->n = strtol(yytext, NULL, 10); return INTCONSTANT; @@ -1632,1021 +1688,1121 @@ YY_RULE_SETUP case 20: /* rule 20 can match eol */ YY_RULE_SETUP -#line 224 "src/glsl/glsl_lexer.ll" +#line 243 "src/glsl/glsl_lexer.ll" { BEGIN 0; yylineno++; yycolumn = 0; return EOL; } YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP -#line 226 "src/glsl/glsl_lexer.ll" +#line 245 "src/glsl/glsl_lexer.ll" { yylineno++; yycolumn = 0; } YY_BREAK case 22: YY_RULE_SETUP -#line 228 "src/glsl/glsl_lexer.ll" -return ATTRIBUTE; +#line 247 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(ATTRIBUTE); YY_BREAK case 23: YY_RULE_SETUP -#line 229 "src/glsl/glsl_lexer.ll" +#line 248 "src/glsl/glsl_lexer.ll" return CONST_TOK; YY_BREAK case 24: YY_RULE_SETUP -#line 230 "src/glsl/glsl_lexer.ll" +#line 249 "src/glsl/glsl_lexer.ll" return BOOL_TOK; YY_BREAK case 25: YY_RULE_SETUP -#line 231 "src/glsl/glsl_lexer.ll" +#line 250 "src/glsl/glsl_lexer.ll" return FLOAT_TOK; YY_BREAK case 26: YY_RULE_SETUP -#line 232 "src/glsl/glsl_lexer.ll" +#line 251 "src/glsl/glsl_lexer.ll" return INT_TOK; YY_BREAK case 27: YY_RULE_SETUP -#line 233 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, UINT_TOK); +#line 252 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UINT_TOK); YY_BREAK case 28: YY_RULE_SETUP -#line 235 "src/glsl/glsl_lexer.ll" +#line 254 "src/glsl/glsl_lexer.ll" return BREAK; YY_BREAK case 29: YY_RULE_SETUP -#line 236 "src/glsl/glsl_lexer.ll" +#line 255 "src/glsl/glsl_lexer.ll" return CONTINUE; YY_BREAK case 30: YY_RULE_SETUP -#line 237 "src/glsl/glsl_lexer.ll" +#line 256 "src/glsl/glsl_lexer.ll" return DO; YY_BREAK case 31: YY_RULE_SETUP -#line 238 "src/glsl/glsl_lexer.ll" +#line 257 "src/glsl/glsl_lexer.ll" return WHILE; YY_BREAK case 32: YY_RULE_SETUP -#line 239 "src/glsl/glsl_lexer.ll" +#line 258 "src/glsl/glsl_lexer.ll" return ELSE; YY_BREAK case 33: YY_RULE_SETUP -#line 240 "src/glsl/glsl_lexer.ll" +#line 259 "src/glsl/glsl_lexer.ll" return FOR; YY_BREAK case 34: YY_RULE_SETUP -#line 241 "src/glsl/glsl_lexer.ll" +#line 260 "src/glsl/glsl_lexer.ll" return IF; YY_BREAK case 35: YY_RULE_SETUP -#line 242 "src/glsl/glsl_lexer.ll" +#line 261 "src/glsl/glsl_lexer.ll" return DISCARD; YY_BREAK case 36: YY_RULE_SETUP -#line 243 "src/glsl/glsl_lexer.ll" +#line 262 "src/glsl/glsl_lexer.ll" return RETURN; YY_BREAK case 37: YY_RULE_SETUP -#line 245 "src/glsl/glsl_lexer.ll" +#line 264 "src/glsl/glsl_lexer.ll" return BVEC2; YY_BREAK case 38: YY_RULE_SETUP -#line 246 "src/glsl/glsl_lexer.ll" +#line 265 "src/glsl/glsl_lexer.ll" return BVEC3; YY_BREAK case 39: YY_RULE_SETUP -#line 247 "src/glsl/glsl_lexer.ll" +#line 266 "src/glsl/glsl_lexer.ll" return BVEC4; YY_BREAK case 40: YY_RULE_SETUP -#line 248 "src/glsl/glsl_lexer.ll" +#line 267 "src/glsl/glsl_lexer.ll" return IVEC2; YY_BREAK case 41: YY_RULE_SETUP -#line 249 "src/glsl/glsl_lexer.ll" +#line 268 "src/glsl/glsl_lexer.ll" return IVEC3; YY_BREAK case 42: YY_RULE_SETUP -#line 250 "src/glsl/glsl_lexer.ll" +#line 269 "src/glsl/glsl_lexer.ll" return IVEC4; YY_BREAK case 43: YY_RULE_SETUP -#line 251 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, UVEC2); +#line 270 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UVEC2); YY_BREAK case 44: YY_RULE_SETUP -#line 252 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, UVEC3); +#line 271 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UVEC3); YY_BREAK case 45: YY_RULE_SETUP -#line 253 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, UVEC4); +#line 272 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, UVEC4); YY_BREAK case 46: YY_RULE_SETUP -#line 254 "src/glsl/glsl_lexer.ll" +#line 273 "src/glsl/glsl_lexer.ll" return VEC2; YY_BREAK case 47: YY_RULE_SETUP -#line 255 "src/glsl/glsl_lexer.ll" +#line 274 "src/glsl/glsl_lexer.ll" return VEC3; YY_BREAK case 48: YY_RULE_SETUP -#line 256 "src/glsl/glsl_lexer.ll" +#line 275 "src/glsl/glsl_lexer.ll" return VEC4; YY_BREAK case 49: YY_RULE_SETUP -#line 257 "src/glsl/glsl_lexer.ll" +#line 276 "src/glsl/glsl_lexer.ll" return MAT2X2; YY_BREAK case 50: YY_RULE_SETUP -#line 258 "src/glsl/glsl_lexer.ll" +#line 277 "src/glsl/glsl_lexer.ll" return MAT3X3; YY_BREAK case 51: YY_RULE_SETUP -#line 259 "src/glsl/glsl_lexer.ll" +#line 278 "src/glsl/glsl_lexer.ll" return MAT4X4; YY_BREAK case 52: YY_RULE_SETUP -#line 260 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT2X2); +#line 279 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT2X2); YY_BREAK case 53: YY_RULE_SETUP -#line 261 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT2X3); +#line 280 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT2X3); YY_BREAK case 54: YY_RULE_SETUP -#line 262 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT2X4); +#line 281 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT2X4); YY_BREAK case 55: YY_RULE_SETUP -#line 263 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT3X2); +#line 282 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT3X2); YY_BREAK case 56: YY_RULE_SETUP -#line 264 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT3X3); +#line 283 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT3X3); YY_BREAK case 57: YY_RULE_SETUP -#line 265 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT3X4); +#line 284 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT3X4); YY_BREAK case 58: YY_RULE_SETUP -#line 266 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT4X2); +#line 285 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT4X2); YY_BREAK case 59: YY_RULE_SETUP -#line 267 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT4X3); +#line 286 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT4X3); YY_BREAK case 60: YY_RULE_SETUP -#line 268 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, MAT4X4); +#line 287 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, MAT4X4); YY_BREAK case 61: YY_RULE_SETUP -#line 270 "src/glsl/glsl_lexer.ll" +#line 289 "src/glsl/glsl_lexer.ll" return IN_TOK; YY_BREAK case 62: YY_RULE_SETUP -#line 271 "src/glsl/glsl_lexer.ll" +#line 290 "src/glsl/glsl_lexer.ll" return OUT_TOK; YY_BREAK case 63: YY_RULE_SETUP -#line 272 "src/glsl/glsl_lexer.ll" +#line 291 "src/glsl/glsl_lexer.ll" return INOUT_TOK; YY_BREAK case 64: YY_RULE_SETUP -#line 273 "src/glsl/glsl_lexer.ll" +#line 292 "src/glsl/glsl_lexer.ll" return UNIFORM; YY_BREAK case 65: YY_RULE_SETUP -#line 274 "src/glsl/glsl_lexer.ll" -return VARYING; +#line 293 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(VARYING); YY_BREAK case 66: YY_RULE_SETUP -#line 275 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 120, CENTROID); +#line 294 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 300, 120, 300, CENTROID); YY_BREAK case 67: YY_RULE_SETUP -#line 276 "src/glsl/glsl_lexer.ll" -KEYWORD(120 || ES, 120 || ES, INVARIANT); +#line 295 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 120, 100, INVARIANT); YY_BREAK case 68: YY_RULE_SETUP -#line 277 "src/glsl/glsl_lexer.ll" -KEYWORD(130 || ES, 130, FLAT); +#line 296 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 100, 130, 300, FLAT); YY_BREAK case 69: YY_RULE_SETUP -#line 278 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, SMOOTH); +#line 297 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SMOOTH); YY_BREAK case 70: YY_RULE_SETUP -#line 279 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, NOPERSPECTIVE); +#line 298 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, NOPERSPECTIVE); YY_BREAK case 71: YY_RULE_SETUP -#line 281 "src/glsl/glsl_lexer.ll" -return SAMPLER1D; +#line 300 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER1D); YY_BREAK case 72: YY_RULE_SETUP -#line 282 "src/glsl/glsl_lexer.ll" +#line 301 "src/glsl/glsl_lexer.ll" return SAMPLER2D; YY_BREAK case 73: YY_RULE_SETUP -#line 283 "src/glsl/glsl_lexer.ll" +#line 302 "src/glsl/glsl_lexer.ll" return SAMPLER3D; YY_BREAK case 74: YY_RULE_SETUP -#line 284 "src/glsl/glsl_lexer.ll" +#line 303 "src/glsl/glsl_lexer.ll" return SAMPLERCUBE; YY_BREAK case 75: YY_RULE_SETUP -#line 285 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, SAMPLER1DARRAY); +#line 304 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY); YY_BREAK case 76: YY_RULE_SETUP -#line 286 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, SAMPLER2DARRAY); +#line 305 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY); YY_BREAK case 77: YY_RULE_SETUP -#line 287 "src/glsl/glsl_lexer.ll" -return SAMPLER1DSHADOW; +#line 306 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW); YY_BREAK case 78: YY_RULE_SETUP -#line 288 "src/glsl/glsl_lexer.ll" +#line 307 "src/glsl/glsl_lexer.ll" return SAMPLER2DSHADOW; YY_BREAK case 79: YY_RULE_SETUP -#line 289 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, SAMPLERCUBESHADOW); +#line 308 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW); YY_BREAK case 80: YY_RULE_SETUP -#line 290 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, SAMPLER1DARRAYSHADOW); +#line 309 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW); YY_BREAK case 81: YY_RULE_SETUP -#line 291 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, SAMPLER2DARRAYSHADOW); +#line 310 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW); YY_BREAK case 82: YY_RULE_SETUP -#line 292 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, ISAMPLER1D); +#line 311 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, ISAMPLER1D); YY_BREAK case 83: YY_RULE_SETUP -#line 293 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, ISAMPLER2D); +#line 312 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLER2D); YY_BREAK case 84: YY_RULE_SETUP -#line 294 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, ISAMPLER3D); +#line 313 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLER3D); YY_BREAK case 85: YY_RULE_SETUP -#line 295 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, ISAMPLERCUBE); +#line 314 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLERCUBE); YY_BREAK case 86: YY_RULE_SETUP -#line 296 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, ISAMPLER1DARRAY); +#line 315 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY); YY_BREAK case 87: YY_RULE_SETUP -#line 297 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, ISAMPLER2DARRAY); +#line 316 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY); YY_BREAK case 88: YY_RULE_SETUP -#line 298 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, USAMPLER1D); +#line 317 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, USAMPLER1D); YY_BREAK case 89: YY_RULE_SETUP -#line 299 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, USAMPLER2D); +#line 318 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLER2D); YY_BREAK case 90: YY_RULE_SETUP -#line 300 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, USAMPLER3D); +#line 319 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLER3D); YY_BREAK case 91: YY_RULE_SETUP -#line 301 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, USAMPLERCUBE); +#line 320 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLERCUBE); YY_BREAK case 92: YY_RULE_SETUP -#line 302 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, USAMPLER1DARRAY); +#line 321 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY); YY_BREAK case 93: YY_RULE_SETUP -#line 303 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, USAMPLER2DARRAY); +#line 322 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY); YY_BREAK +/* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */ +/* these are reserved but not defined in GLSL 3.00 */ case 94: YY_RULE_SETUP -#line 305 "src/glsl/glsl_lexer.ll" +#line 326 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS); + YY_BREAK +case 95: +YY_RULE_SETUP +#line 327 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS); + YY_BREAK +case 96: +YY_RULE_SETUP +#line 328 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS); + YY_BREAK +case 97: +YY_RULE_SETUP +#line 329 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY); + YY_BREAK +case 98: +YY_RULE_SETUP +#line 330 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY); + YY_BREAK +case 99: +YY_RULE_SETUP +#line 331 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY); + YY_BREAK +/* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */ +case 100: +YY_RULE_SETUP +#line 334 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY); + YY_BREAK +case 101: +YY_RULE_SETUP +#line 335 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY); + YY_BREAK +case 102: +YY_RULE_SETUP +#line 336 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY); + YY_BREAK +case 103: +YY_RULE_SETUP +#line 337 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW); + YY_BREAK +case 104: +YY_RULE_SETUP +#line 339 "src/glsl/glsl_lexer.ll" { if (yyextra->OES_EGL_image_external_enable) return SAMPLEREXTERNALOES; else return IDENTIFIER; - } + } YY_BREAK -case 95: +case 105: YY_RULE_SETUP -#line 313 "src/glsl/glsl_lexer.ll" +#line 346 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT); + YY_BREAK +case 106: +YY_RULE_SETUP +#line 348 "src/glsl/glsl_lexer.ll" return STRUCT; YY_BREAK -case 96: +case 107: YY_RULE_SETUP -#line 314 "src/glsl/glsl_lexer.ll" +#line 349 "src/glsl/glsl_lexer.ll" return VOID_TOK; YY_BREAK -case 97: +case 108: YY_RULE_SETUP -#line 316 "src/glsl/glsl_lexer.ll" +#line 351 "src/glsl/glsl_lexer.ll" { - if ((yyextra->language_version >= 140) + if ((yyextra->is_version(140, 300)) || yyextra->AMD_conservative_depth_enable || yyextra->ARB_conservative_depth_enable || yyextra->ARB_explicit_attrib_location_enable || yyextra->ARB_uniform_buffer_object_enable - || yyextra->ARB_fragment_coord_conventions_enable) { + || yyextra->ARB_fragment_coord_conventions_enable + || yyextra->ARB_shading_language_420pack_enable) { return LAYOUT_TOK; } else { yylval->identifier = strdup(yytext); - return IDENTIFIER; + return classify_identifier(yyextra, yytext); } } YY_BREAK -case 98: -YY_RULE_SETUP -#line 330 "src/glsl/glsl_lexer.ll" -return INC_OP; - YY_BREAK -case 99: -YY_RULE_SETUP -#line 331 "src/glsl/glsl_lexer.ll" -return DEC_OP; - YY_BREAK -case 100: -YY_RULE_SETUP -#line 332 "src/glsl/glsl_lexer.ll" -return LE_OP; - YY_BREAK -case 101: -YY_RULE_SETUP -#line 333 "src/glsl/glsl_lexer.ll" -return GE_OP; - YY_BREAK -case 102: -YY_RULE_SETUP -#line 334 "src/glsl/glsl_lexer.ll" -return EQ_OP; - YY_BREAK -case 103: -YY_RULE_SETUP -#line 335 "src/glsl/glsl_lexer.ll" -return NE_OP; - YY_BREAK -case 104: -YY_RULE_SETUP -#line 336 "src/glsl/glsl_lexer.ll" -return AND_OP; - YY_BREAK -case 105: -YY_RULE_SETUP -#line 337 "src/glsl/glsl_lexer.ll" -return OR_OP; - YY_BREAK -case 106: -YY_RULE_SETUP -#line 338 "src/glsl/glsl_lexer.ll" -return XOR_OP; - YY_BREAK -case 107: -YY_RULE_SETUP -#line 339 "src/glsl/glsl_lexer.ll" -return LEFT_OP; - YY_BREAK -case 108: -YY_RULE_SETUP -#line 340 "src/glsl/glsl_lexer.ll" -return RIGHT_OP; - YY_BREAK case 109: YY_RULE_SETUP -#line 342 "src/glsl/glsl_lexer.ll" -return MUL_ASSIGN; +#line 366 "src/glsl/glsl_lexer.ll" +return INC_OP; YY_BREAK case 110: YY_RULE_SETUP -#line 343 "src/glsl/glsl_lexer.ll" -return DIV_ASSIGN; +#line 367 "src/glsl/glsl_lexer.ll" +return DEC_OP; YY_BREAK case 111: YY_RULE_SETUP -#line 344 "src/glsl/glsl_lexer.ll" -return ADD_ASSIGN; +#line 368 "src/glsl/glsl_lexer.ll" +return LE_OP; YY_BREAK case 112: YY_RULE_SETUP -#line 345 "src/glsl/glsl_lexer.ll" -return MOD_ASSIGN; +#line 369 "src/glsl/glsl_lexer.ll" +return GE_OP; YY_BREAK case 113: YY_RULE_SETUP -#line 346 "src/glsl/glsl_lexer.ll" -return LEFT_ASSIGN; +#line 370 "src/glsl/glsl_lexer.ll" +return EQ_OP; YY_BREAK case 114: YY_RULE_SETUP -#line 347 "src/glsl/glsl_lexer.ll" -return RIGHT_ASSIGN; +#line 371 "src/glsl/glsl_lexer.ll" +return NE_OP; YY_BREAK case 115: YY_RULE_SETUP -#line 348 "src/glsl/glsl_lexer.ll" -return AND_ASSIGN; +#line 372 "src/glsl/glsl_lexer.ll" +return AND_OP; YY_BREAK case 116: YY_RULE_SETUP -#line 349 "src/glsl/glsl_lexer.ll" -return XOR_ASSIGN; +#line 373 "src/glsl/glsl_lexer.ll" +return OR_OP; YY_BREAK case 117: YY_RULE_SETUP -#line 350 "src/glsl/glsl_lexer.ll" -return OR_ASSIGN; +#line 374 "src/glsl/glsl_lexer.ll" +return XOR_OP; YY_BREAK case 118: YY_RULE_SETUP -#line 351 "src/glsl/glsl_lexer.ll" -return SUB_ASSIGN; +#line 375 "src/glsl/glsl_lexer.ll" +return LEFT_OP; YY_BREAK case 119: YY_RULE_SETUP -#line 353 "src/glsl/glsl_lexer.ll" +#line 376 "src/glsl/glsl_lexer.ll" +return RIGHT_OP; + YY_BREAK +case 120: +YY_RULE_SETUP +#line 378 "src/glsl/glsl_lexer.ll" +return MUL_ASSIGN; + YY_BREAK +case 121: +YY_RULE_SETUP +#line 379 "src/glsl/glsl_lexer.ll" +return DIV_ASSIGN; + YY_BREAK +case 122: +YY_RULE_SETUP +#line 380 "src/glsl/glsl_lexer.ll" +return ADD_ASSIGN; + YY_BREAK +case 123: +YY_RULE_SETUP +#line 381 "src/glsl/glsl_lexer.ll" +return MOD_ASSIGN; + YY_BREAK +case 124: +YY_RULE_SETUP +#line 382 "src/glsl/glsl_lexer.ll" +return LEFT_ASSIGN; + YY_BREAK +case 125: +YY_RULE_SETUP +#line 383 "src/glsl/glsl_lexer.ll" +return RIGHT_ASSIGN; + YY_BREAK +case 126: +YY_RULE_SETUP +#line 384 "src/glsl/glsl_lexer.ll" +return AND_ASSIGN; + YY_BREAK +case 127: +YY_RULE_SETUP +#line 385 "src/glsl/glsl_lexer.ll" +return XOR_ASSIGN; + YY_BREAK +case 128: +YY_RULE_SETUP +#line 386 "src/glsl/glsl_lexer.ll" +return OR_ASSIGN; + YY_BREAK +case 129: +YY_RULE_SETUP +#line 387 "src/glsl/glsl_lexer.ll" +return SUB_ASSIGN; + YY_BREAK +case 130: +YY_RULE_SETUP +#line 389 "src/glsl/glsl_lexer.ll" { return LITERAL_INTEGER(10); } YY_BREAK -case 120: +case 131: YY_RULE_SETUP -#line 356 "src/glsl/glsl_lexer.ll" +#line 392 "src/glsl/glsl_lexer.ll" { return LITERAL_INTEGER(16); } YY_BREAK -case 121: +case 132: YY_RULE_SETUP -#line 359 "src/glsl/glsl_lexer.ll" +#line 395 "src/glsl/glsl_lexer.ll" { return LITERAL_INTEGER(8); } YY_BREAK -case 122: +case 133: YY_RULE_SETUP -#line 363 "src/glsl/glsl_lexer.ll" +#line 399 "src/glsl/glsl_lexer.ll" { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } YY_BREAK -case 123: +case 134: YY_RULE_SETUP -#line 367 "src/glsl/glsl_lexer.ll" +#line 403 "src/glsl/glsl_lexer.ll" { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } YY_BREAK -case 124: +case 135: YY_RULE_SETUP -#line 371 "src/glsl/glsl_lexer.ll" +#line 407 "src/glsl/glsl_lexer.ll" { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } YY_BREAK -case 125: +case 136: YY_RULE_SETUP -#line 375 "src/glsl/glsl_lexer.ll" +#line 411 "src/glsl/glsl_lexer.ll" { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } YY_BREAK -case 126: +case 137: YY_RULE_SETUP -#line 379 "src/glsl/glsl_lexer.ll" +#line 415 "src/glsl/glsl_lexer.ll" { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } YY_BREAK -case 127: +case 138: YY_RULE_SETUP -#line 384 "src/glsl/glsl_lexer.ll" +#line 420 "src/glsl/glsl_lexer.ll" { yylval->n = 1; return BOOLCONSTANT; } YY_BREAK -case 128: +case 139: YY_RULE_SETUP -#line 388 "src/glsl/glsl_lexer.ll" +#line 424 "src/glsl/glsl_lexer.ll" { yylval->n = 0; return BOOLCONSTANT; } YY_BREAK /* Reserved words in GLSL 1.10. */ -case 129: -YY_RULE_SETUP -#line 395 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, ASM); - YY_BREAK -case 130: -YY_RULE_SETUP -#line 396 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, CLASS); - YY_BREAK -case 131: -YY_RULE_SETUP -#line 397 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, UNION); - YY_BREAK -case 132: -YY_RULE_SETUP -#line 398 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, ENUM); - YY_BREAK -case 133: -YY_RULE_SETUP -#line 399 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, TYPEDEF); - YY_BREAK -case 134: -YY_RULE_SETUP -#line 400 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, TEMPLATE); - YY_BREAK -case 135: -YY_RULE_SETUP -#line 401 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, THIS); - YY_BREAK -case 136: -YY_RULE_SETUP -#line 402 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 140 || yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK); - YY_BREAK -case 137: -YY_RULE_SETUP -#line 403 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, GOTO); - YY_BREAK -case 138: -YY_RULE_SETUP -#line 404 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 130, SWITCH); - YY_BREAK -case 139: -YY_RULE_SETUP -#line 405 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 130, DEFAULT); - YY_BREAK case 140: YY_RULE_SETUP -#line 406 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, INLINE_TOK); +#line 431 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, ASM); YY_BREAK case 141: YY_RULE_SETUP -#line 407 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, NOINLINE); +#line 432 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, CLASS); YY_BREAK case 142: YY_RULE_SETUP -#line 408 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, VOLATILE); +#line 433 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, UNION); YY_BREAK case 143: YY_RULE_SETUP -#line 409 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, PUBLIC_TOK); +#line 434 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, ENUM); YY_BREAK case 144: YY_RULE_SETUP -#line 410 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, STATIC); +#line 435 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, TYPEDEF); YY_BREAK case 145: YY_RULE_SETUP -#line 411 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, EXTERN); +#line 436 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, TEMPLATE); YY_BREAK case 146: YY_RULE_SETUP -#line 412 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, EXTERNAL); +#line 437 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, THIS); YY_BREAK case 147: YY_RULE_SETUP -#line 413 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, INTERFACE); +#line 438 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK); YY_BREAK case 148: YY_RULE_SETUP -#line 414 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, LONG_TOK); +#line 439 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, GOTO); YY_BREAK case 149: YY_RULE_SETUP -#line 415 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, SHORT_TOK); +#line 440 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 130, 300, SWITCH); YY_BREAK case 150: YY_RULE_SETUP -#line 416 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 400, DOUBLE_TOK); +#line 441 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 130, 300, DEFAULT); YY_BREAK case 151: YY_RULE_SETUP -#line 417 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, HALF); +#line 442 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, INLINE_TOK); YY_BREAK case 152: YY_RULE_SETUP -#line 418 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, FIXED_TOK); +#line 443 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, NOINLINE); YY_BREAK case 153: YY_RULE_SETUP -#line 419 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, UNSIGNED); +#line 444 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, VOLATILE); YY_BREAK case 154: YY_RULE_SETUP -#line 420 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, INPUT_TOK); +#line 445 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, PUBLIC_TOK); YY_BREAK case 155: YY_RULE_SETUP -#line 421 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, OUTPUT); +#line 446 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, STATIC); YY_BREAK case 156: YY_RULE_SETUP -#line 422 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, HVEC2); +#line 447 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, EXTERN); YY_BREAK case 157: YY_RULE_SETUP -#line 423 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, HVEC3); +#line 448 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, EXTERNAL); YY_BREAK case 158: YY_RULE_SETUP -#line 424 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, HVEC4); +#line 449 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, INTERFACE); YY_BREAK case 159: YY_RULE_SETUP -#line 425 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 400, DVEC2); +#line 450 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, LONG_TOK); YY_BREAK case 160: YY_RULE_SETUP -#line 426 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 400, DVEC3); +#line 451 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, SHORT_TOK); YY_BREAK case 161: YY_RULE_SETUP -#line 427 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 400, DVEC4); +#line 452 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DOUBLE_TOK); YY_BREAK case 162: YY_RULE_SETUP -#line 428 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, FVEC2); +#line 453 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HALF); YY_BREAK case 163: YY_RULE_SETUP -#line 429 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, FVEC3); +#line 454 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FIXED_TOK); YY_BREAK case 164: YY_RULE_SETUP -#line 430 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, FVEC4); +#line 455 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, UNSIGNED); YY_BREAK case 165: YY_RULE_SETUP -#line 431 "src/glsl/glsl_lexer.ll" -return SAMPLER2DRECT; +#line 456 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, INPUT_TOK); YY_BREAK case 166: YY_RULE_SETUP -#line 432 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, SAMPLER3DRECT); +#line 457 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, OUTPUT); YY_BREAK case 167: YY_RULE_SETUP -#line 433 "src/glsl/glsl_lexer.ll" -return SAMPLER2DRECTSHADOW; +#line 458 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HVEC2); YY_BREAK case 168: YY_RULE_SETUP -#line 434 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, SIZEOF); +#line 459 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HVEC3); YY_BREAK case 169: YY_RULE_SETUP -#line 435 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, CAST); +#line 460 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, HVEC4); YY_BREAK case 170: YY_RULE_SETUP -#line 436 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, NAMESPACE); +#line 461 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DVEC2); YY_BREAK case 171: YY_RULE_SETUP -#line 437 "src/glsl/glsl_lexer.ll" -KEYWORD(110 || ES, 999, USING); +#line 462 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DVEC3); YY_BREAK -/* Additional reserved words in GLSL 1.20. */ case 172: YY_RULE_SETUP -#line 440 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 130 || ES, LOWP); +#line 463 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 400, 0, DVEC4); YY_BREAK case 173: YY_RULE_SETUP -#line 441 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 130 || ES, MEDIUMP); +#line 464 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FVEC2); YY_BREAK case 174: YY_RULE_SETUP -#line 442 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 130 || ES, HIGHP); +#line 465 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FVEC3); YY_BREAK case 175: YY_RULE_SETUP -#line 443 "src/glsl/glsl_lexer.ll" -KEYWORD(120, 130 || ES, PRECISION); +#line 466 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, FVEC4); YY_BREAK -/* Additional reserved words in GLSL 1.30. */ case 176: YY_RULE_SETUP -#line 446 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 130, CASE); +#line 467 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER2DRECT); YY_BREAK case 177: YY_RULE_SETUP -#line 447 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, COMMON); +#line 468 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, SAMPLER3DRECT); YY_BREAK case 178: YY_RULE_SETUP -#line 448 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, PARTITION); +#line 469 "src/glsl/glsl_lexer.ll" +DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW); YY_BREAK case 179: YY_RULE_SETUP -#line 449 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, ACTIVE); +#line 470 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, SIZEOF); YY_BREAK case 180: YY_RULE_SETUP -#line 450 "src/glsl/glsl_lexer.ll" -KEYWORD(130 || ES, 999, SUPERP); +#line 471 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, CAST); YY_BREAK case 181: YY_RULE_SETUP -#line 451 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 140, SAMPLERBUFFER); +#line 472 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, NAMESPACE); YY_BREAK case 182: YY_RULE_SETUP -#line 452 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, FILTER); +#line 473 "src/glsl/glsl_lexer.ll" +KEYWORD(110, 100, 0, 0, USING); YY_BREAK +/* Additional reserved words in GLSL 1.20. */ case 183: YY_RULE_SETUP -#line 453 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE1D); +#line 476 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, LOWP); YY_BREAK case 184: YY_RULE_SETUP -#line 454 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE2D); +#line 477 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, MEDIUMP); YY_BREAK case 185: YY_RULE_SETUP -#line 455 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE3D); +#line 478 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, HIGHP); YY_BREAK case 186: YY_RULE_SETUP -#line 456 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGECUBE); +#line 479 "src/glsl/glsl_lexer.ll" +KEYWORD(120, 100, 130, 100, PRECISION); YY_BREAK +/* Additional reserved words in GLSL 1.30. */ case 187: YY_RULE_SETUP -#line 457 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGE1D); +#line 482 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 130, 300, CASE); YY_BREAK case 188: YY_RULE_SETUP -#line 458 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGE2D); +#line 483 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, COMMON); YY_BREAK case 189: YY_RULE_SETUP -#line 459 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGE3D); +#line 484 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, PARTITION); YY_BREAK case 190: YY_RULE_SETUP -#line 460 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGECUBE); +#line 485 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, ACTIVE); YY_BREAK case 191: YY_RULE_SETUP -#line 461 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGE1D); +#line 486 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 100, 0, 0, SUPERP); YY_BREAK case 192: YY_RULE_SETUP -#line 462 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGE2D); +#line 487 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 140, 0, SAMPLERBUFFER); YY_BREAK case 193: YY_RULE_SETUP -#line 463 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGE3D); +#line 488 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, FILTER); YY_BREAK case 194: YY_RULE_SETUP -#line 464 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGECUBE); +#line 489 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE1D); YY_BREAK case 195: YY_RULE_SETUP -#line 465 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE1DARRAY); +#line 490 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE2D); YY_BREAK case 196: YY_RULE_SETUP -#line 466 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE2DARRAY); +#line 491 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE3D); YY_BREAK case 197: YY_RULE_SETUP -#line 467 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGE1DARRAY); +#line 492 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGECUBE); YY_BREAK case 198: YY_RULE_SETUP -#line 468 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGE2DARRAY); +#line 493 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGE1D); YY_BREAK case 199: YY_RULE_SETUP -#line 469 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGE1DARRAY); +#line 494 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGE2D); YY_BREAK case 200: YY_RULE_SETUP -#line 470 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGE2DARRAY); +#line 495 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGE3D); YY_BREAK case 201: YY_RULE_SETUP -#line 471 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE1DSHADOW); +#line 496 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGECUBE); YY_BREAK case 202: YY_RULE_SETUP -#line 472 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE2DSHADOW); +#line 497 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGE1D); YY_BREAK case 203: YY_RULE_SETUP -#line 473 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE1DARRAYSHADOW); +#line 498 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGE2D); YY_BREAK case 204: YY_RULE_SETUP -#line 474 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGE2DARRAYSHADOW); +#line 499 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGE3D); YY_BREAK case 205: YY_RULE_SETUP -#line 475 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IMAGEBUFFER); +#line 500 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGECUBE); YY_BREAK case 206: YY_RULE_SETUP -#line 476 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, IIMAGEBUFFER); +#line 501 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE1DARRAY); YY_BREAK case 207: YY_RULE_SETUP -#line 477 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 999, UIMAGEBUFFER); +#line 502 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE2DARRAY); YY_BREAK case 208: YY_RULE_SETUP -#line 478 "src/glsl/glsl_lexer.ll" -KEYWORD(130, 140 || yyextra->ARB_uniform_buffer_object_enable, ROW_MAJOR); +#line 503 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGE1DARRAY); YY_BREAK -/* Additional reserved words in GLSL 1.40 */ case 209: YY_RULE_SETUP -#line 481 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 140, ISAMPLER2DRECT); +#line 504 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGE2DARRAY); YY_BREAK case 210: YY_RULE_SETUP -#line 482 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 140, USAMPLER2DRECT); +#line 505 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGE1DARRAY); YY_BREAK case 211: YY_RULE_SETUP -#line 483 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 140, ISAMPLERBUFFER); +#line 506 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGE2DARRAY); YY_BREAK case 212: YY_RULE_SETUP -#line 484 "src/glsl/glsl_lexer.ll" -KEYWORD(140, 140, USAMPLERBUFFER); +#line 507 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW); YY_BREAK case 213: YY_RULE_SETUP -#line 486 "src/glsl/glsl_lexer.ll" +#line 508 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW); + YY_BREAK +case 214: +YY_RULE_SETUP +#line 509 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW); + YY_BREAK +case 215: +YY_RULE_SETUP +#line 510 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW); + YY_BREAK +case 216: +YY_RULE_SETUP +#line 511 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IMAGEBUFFER); + YY_BREAK +case 217: +YY_RULE_SETUP +#line 512 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, IIMAGEBUFFER); + YY_BREAK +case 218: +YY_RULE_SETUP +#line 513 "src/glsl/glsl_lexer.ll" +KEYWORD(130, 300, 0, 0, UIMAGEBUFFER); + YY_BREAK +case 219: +YY_RULE_SETUP +#line 514 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR); + YY_BREAK +/* Additional reserved words in GLSL 1.40 */ +case 220: +YY_RULE_SETUP +#line 517 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT); + YY_BREAK +case 221: +YY_RULE_SETUP +#line 518 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, USAMPLER2DRECT); + YY_BREAK +case 222: +YY_RULE_SETUP +#line 519 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER); + YY_BREAK +case 223: +YY_RULE_SETUP +#line 520 "src/glsl/glsl_lexer.ll" +KEYWORD(140, 300, 140, 0, USAMPLERBUFFER); + YY_BREAK +/* Additional reserved words in GLSL ES 3.00 */ +case 224: +YY_RULE_SETUP +#line 523 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, COHERENT); + YY_BREAK +case 225: +YY_RULE_SETUP +#line 524 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, RESTRICT); + YY_BREAK +case 226: +YY_RULE_SETUP +#line 525 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, READONLY); + YY_BREAK +case 227: +YY_RULE_SETUP +#line 526 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, WRITEONLY); + YY_BREAK +case 228: +YY_RULE_SETUP +#line 527 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, RESOURCE); + YY_BREAK +case 229: +YY_RULE_SETUP +#line 528 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, PATCH); + YY_BREAK +case 230: +YY_RULE_SETUP +#line 529 "src/glsl/glsl_lexer.ll" +KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE); + YY_BREAK +case 231: +YY_RULE_SETUP +#line 530 "src/glsl/glsl_lexer.ll" +KEYWORD(0, 300, 0, 0, SUBROUTINE); + YY_BREAK +case 232: +YY_RULE_SETUP +#line 533 "src/glsl/glsl_lexer.ll" { struct _mesa_glsl_parse_state *state = yyextra; void *ctx = state; @@ -2654,17 +2810,17 @@ YY_RULE_SETUP return classify_identifier(state, yytext); } YY_BREAK -case 214: +case 233: YY_RULE_SETUP -#line 493 "src/glsl/glsl_lexer.ll" +#line 540 "src/glsl/glsl_lexer.ll" { return yytext[0]; } YY_BREAK -case 215: +case 234: YY_RULE_SETUP -#line 495 "src/glsl/glsl_lexer.ll" +#line 542 "src/glsl/glsl_lexer.ll" ECHO; YY_BREAK -#line 2668 "src/glsl/glsl_lexer.cpp" +#line 2824 "src/glsl/glsl_lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PP): case YY_STATE_EOF(PRAGMA): @@ -2684,7 +2840,7 @@ case YY_STATE_EOF(PRAGMA): /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called - * _mesa_glsl_lex(). If so, then we have to assure + * _mesa_glsl_lexer_lex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a @@ -2745,7 +2901,7 @@ case YY_STATE_EOF(PRAGMA): { yyg->yy_did_buffer_switch_on_eof = 0; - if ( _mesa_glsl_wrap(yyscanner ) ) + if ( _mesa_glsl_lexer_wrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2798,7 +2954,7 @@ case YY_STATE_EOF(PRAGMA): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of _mesa_glsl_lex */ +} /* end of _mesa_glsl_lexer_lex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -2854,7 +3010,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2868,7 +3024,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2877,7 +3033,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - _mesa_glsl_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + _mesa_glsl_lexer_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); } else /* Can't grow it, we don't own it. */ @@ -2899,7 +3055,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -2909,7 +3065,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - _mesa_glsl_restart(yyin ,yyscanner); + _mesa_glsl_lexer_restart(yyin ,yyscanner); } else @@ -2926,7 +3082,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_lexer_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } @@ -2962,7 +3118,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 867 ) + if ( yy_current_state >= 960 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2991,11 +3147,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 867 ) + if ( yy_current_state >= 960 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 866); + yy_is_jam = (yy_current_state == 959); return yy_is_jam ? 0 : yy_current_state; } @@ -3025,7 +3181,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -3042,14 +3198,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ /* Reset buffer status. */ - _mesa_glsl_restart(yyin ,yyscanner); + _mesa_glsl_lexer_restart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( _mesa_glsl_wrap(yyscanner ) ) - return EOF; + if ( _mesa_glsl_lexer_wrap(yyscanner ) ) + return 0; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -3082,34 +3238,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ - void _mesa_glsl_restart (FILE * input_file , yyscan_t yyscanner) + void _mesa_glsl_lexer_restart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - _mesa_glsl_ensure_buffer_stack (yyscanner); + _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - _mesa_glsl__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } - _mesa_glsl__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - _mesa_glsl__load_buffer_state(yyscanner ); + _mesa_glsl_lexer__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); + _mesa_glsl_lexer__load_buffer_state(yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ - void _mesa_glsl__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + void _mesa_glsl_lexer__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with - * _mesa_glsl_pop_buffer_state(); - * _mesa_glsl_push_buffer_state(new_buffer); + * _mesa_glsl_lexer_pop_buffer_state(); + * _mesa_glsl_lexer_push_buffer_state(new_buffer); */ - _mesa_glsl_ensure_buffer_stack (yyscanner); + _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -3122,17 +3278,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - _mesa_glsl__load_buffer_state(yyscanner ); + _mesa_glsl_lexer__load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during - * EOF (_mesa_glsl_wrap()) processing, but the only time this flag - * is looked at is after _mesa_glsl_wrap() is called, so it's safe + * EOF (_mesa_glsl_lexer_wrap()) processing, but the only time this flag + * is looked at is after _mesa_glsl_lexer_wrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } -static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) +static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; @@ -3147,35 +3303,35 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ - YY_BUFFER_STATE _mesa_glsl__create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE _mesa_glsl_lexer__create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) _mesa_glsl_lexer_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) _mesa_glsl_alloc(b->yy_buf_size + 2 ,yyscanner ); + b->yy_ch_buf = (char *) _mesa_glsl_lexer_alloc(b->yy_buf_size + 2 ,yyscanner ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__create_buffer()" ); b->yy_is_our_buffer = 1; - _mesa_glsl__init_buffer(b,file ,yyscanner); + _mesa_glsl_lexer__init_buffer(b,file ,yyscanner); return b; } /** Destroy the buffer. - * @param b a buffer created with _mesa_glsl__create_buffer() + * @param b a buffer created with _mesa_glsl_lexer__create_buffer() * @param yyscanner The scanner object. */ - void _mesa_glsl__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void _mesa_glsl_lexer__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -3186,28 +3342,28 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - _mesa_glsl_free((void *) b->yy_ch_buf ,yyscanner ); + _mesa_glsl_lexer_free((void *) b->yy_ch_buf ,yyscanner ); - _mesa_glsl_free((void *) b ,yyscanner ); + _mesa_glsl_lexer_free((void *) b ,yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a _mesa_glsl_restart() or at EOF. + * such as during a _mesa_glsl_lexer_restart() or at EOF. */ - static void _mesa_glsl__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + static void _mesa_glsl_lexer__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - _mesa_glsl__flush_buffer(b ,yyscanner); + _mesa_glsl_lexer__flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then _mesa_glsl__init_buffer was _probably_ - * called from _mesa_glsl_restart() or through yy_get_next_buffer. + /* If b is the current buffer, then _mesa_glsl_lexer__init_buffer was _probably_ + * called from _mesa_glsl_lexer_restart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -3224,7 +3380,7 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ - void _mesa_glsl__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void _mesa_glsl_lexer__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) @@ -3245,7 +3401,7 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - _mesa_glsl__load_buffer_state(yyscanner ); + _mesa_glsl_lexer__load_buffer_state(yyscanner ); } /** Pushes the new state onto the stack. The new state becomes @@ -3254,15 +3410,15 @@ static void _mesa_glsl__load_buffer_state (yyscan_t yyscanner) * @param new_buffer The new state. * @param yyscanner The scanner object. */ -void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; - _mesa_glsl_ensure_buffer_stack(yyscanner); + _mesa_glsl_lexer_ensure_buffer_stack(yyscanner); - /* This block is copied from _mesa_glsl__switch_to_buffer. */ + /* This block is copied from _mesa_glsl_lexer__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -3276,8 +3432,8 @@ void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscann yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from _mesa_glsl__switch_to_buffer. */ - _mesa_glsl__load_buffer_state(yyscanner ); + /* copied from _mesa_glsl_lexer__switch_to_buffer. */ + _mesa_glsl_lexer__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } @@ -3285,19 +3441,19 @@ void _mesa_glsl_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscann * The next element becomes the new top. * @param yyscanner The scanner object. */ -void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner) +void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; - _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + _mesa_glsl_lexer__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { - _mesa_glsl__load_buffer_state(yyscanner ); + _mesa_glsl_lexer__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } @@ -3305,9 +3461,9 @@ void _mesa_glsl_pop_buffer_state (yyscan_t yyscanner) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner) +static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -3317,11 +3473,11 @@ static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner) * immediate realloc on the next call. */ num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_alloc + yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_lexer_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer_ensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); @@ -3336,12 +3492,12 @@ static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner) int grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_realloc + yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_lexer_realloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_ensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer_ensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -3355,7 +3511,7 @@ static void _mesa_glsl_ensure_buffer_stack (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; @@ -3365,9 +3521,9 @@ YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_ /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) _mesa_glsl_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + b = (YY_BUFFER_STATE) _mesa_glsl_lexer_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; @@ -3379,53 +3535,52 @@ YY_BUFFER_STATE _mesa_glsl__scan_buffer (char * base, yy_size_t size , yyscan_ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - _mesa_glsl__switch_to_buffer(b ,yyscanner ); + _mesa_glsl_lexer__switch_to_buffer(b ,yyscanner ); return b; } -/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lex() will +/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lexer_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * _mesa_glsl__scan_bytes() instead. + * _mesa_glsl_lexer__scan_bytes() instead. */ -YY_BUFFER_STATE _mesa_glsl__scan_string (yyconst char * yystr , yyscan_t yyscanner) +YY_BUFFER_STATE _mesa_glsl_lexer__scan_string (yyconst char * yystr , yyscan_t yyscanner) { - return _mesa_glsl__scan_bytes(yystr,strlen(yystr) ,yyscanner); + return _mesa_glsl_lexer__scan_bytes(yystr,strlen(yystr) ,yyscanner); } -/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lex() will +/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lexer_lex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE _mesa_glsl__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; - buf = (char *) _mesa_glsl_alloc(n ,yyscanner ); + buf = (char *) _mesa_glsl_lexer_alloc(n ,yyscanner ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl__scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = _mesa_glsl__scan_buffer(buf,n ,yyscanner); + b = _mesa_glsl_lexer__scan_buffer(buf,n ,yyscanner); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in _mesa_glsl__scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in _mesa_glsl_lexer__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -3467,7 +3622,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner) +YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; @@ -3476,7 +3631,7 @@ YY_EXTRA_TYPE _mesa_glsl_get_extra (yyscan_t yyscanner) /** Get the current line number. * @param yyscanner The scanner object. */ -int _mesa_glsl_get_lineno (yyscan_t yyscanner) +int _mesa_glsl_lexer_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -3489,7 +3644,7 @@ int _mesa_glsl_get_lineno (yyscan_t yyscanner) /** Get the current column number. * @param yyscanner The scanner object. */ -int _mesa_glsl_get_column (yyscan_t yyscanner) +int _mesa_glsl_lexer_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; @@ -3502,7 +3657,7 @@ int _mesa_glsl_get_column (yyscan_t yyscanner) /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *_mesa_glsl_get_in (yyscan_t yyscanner) +FILE *_mesa_glsl_lexer_get_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; @@ -3511,7 +3666,7 @@ FILE *_mesa_glsl_get_in (yyscan_t yyscanner) /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *_mesa_glsl_get_out (yyscan_t yyscanner) +FILE *_mesa_glsl_lexer_get_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; @@ -3520,7 +3675,7 @@ FILE *_mesa_glsl_get_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int _mesa_glsl_get_leng (yyscan_t yyscanner) +yy_size_t _mesa_glsl_lexer_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -3530,7 +3685,7 @@ int _mesa_glsl_get_leng (yyscan_t yyscanner) * @param yyscanner The scanner object. */ -char *_mesa_glsl_get_text (yyscan_t yyscanner) +char *_mesa_glsl_lexer_get_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; @@ -3540,7 +3695,7 @@ char *_mesa_glsl_get_text (yyscan_t yyscanner) * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; @@ -3550,13 +3705,13 @@ void _mesa_glsl_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) * @param line_number * @param yyscanner The scanner object. */ -void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_lineno (int line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "_mesa_glsl_set_lineno called with no buffer" , yyscanner); + yy_fatal_error( "_mesa_glsl_lexer_set_lineno called with no buffer" , yyscanner); yylineno = line_number; } @@ -3565,13 +3720,13 @@ void _mesa_glsl_set_lineno (int line_number , yyscan_t yyscanner) * @param line_number * @param yyscanner The scanner object. */ -void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_column (int column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "_mesa_glsl_set_column called with no buffer" , yyscanner); + yy_fatal_error( "_mesa_glsl_lexer_set_column called with no buffer" , yyscanner); yycolumn = column_no; } @@ -3580,27 +3735,27 @@ void _mesa_glsl_set_column (int column_no , yyscan_t yyscanner) * input buffer. * @param in_str A readable stream. * @param yyscanner The scanner object. - * @see _mesa_glsl__switch_to_buffer + * @see _mesa_glsl_lexer__switch_to_buffer */ -void _mesa_glsl_set_in (FILE * in_str , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_in (FILE * in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyin = in_str ; } -void _mesa_glsl_set_out (FILE * out_str , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_out (FILE * out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyout = out_str ; } -int _mesa_glsl_get_debug (yyscan_t yyscanner) +int _mesa_glsl_lexer_get_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_debug (int bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flex_debug = bdebug ; @@ -3608,25 +3763,25 @@ void _mesa_glsl_set_debug (int bdebug , yyscan_t yyscanner) /* Accessor methods for yylval and yylloc */ -YYSTYPE * _mesa_glsl_get_lval (yyscan_t yyscanner) +YYSTYPE * _mesa_glsl_lexer_get_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } -void _mesa_glsl_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } -YYLTYPE *_mesa_glsl_get_lloc (yyscan_t yyscanner) +YYLTYPE *_mesa_glsl_lexer_get_lloc (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } -void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +void _mesa_glsl_lexer_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; @@ -3634,12 +3789,12 @@ void _mesa_glsl_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) /* User-visible API */ -/* _mesa_glsl_lex_init is special because it creates the scanner itself, so it is +/* _mesa_glsl_lexer_lex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ -int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals) +int _mesa_glsl_lexer_lex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ @@ -3647,7 +3802,7 @@ int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals) return 1; } - *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) _mesa_glsl_lexer_alloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -3660,27 +3815,27 @@ int _mesa_glsl_lex_init(yyscan_t* ptr_yy_globals) return yy_init_globals ( *ptr_yy_globals ); } -/* _mesa_glsl_lex_init_extra has the same functionality as _mesa_glsl_lex_init, but follows the +/* _mesa_glsl_lexer_lex_init_extra has the same functionality as _mesa_glsl_lexer_lex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to _mesa_glsl_alloc in + * The user defined value in the first argument will be available to _mesa_glsl_lexer_alloc in * the yyextra field. */ -int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) +int _mesa_glsl_lexer_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; - _mesa_glsl_set_extra (yy_user_defined, &dummy_yyguts); + _mesa_glsl_lexer_set_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t) _mesa_glsl_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + *ptr_yy_globals = (yyscan_t) _mesa_glsl_lexer_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; @@ -3691,7 +3846,7 @@ int _mesa_glsl_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_glo yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - _mesa_glsl_set_extra (yy_user_defined, *ptr_yy_globals); + _mesa_glsl_lexer_set_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } @@ -3700,7 +3855,7 @@ static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. - * This function is called from _mesa_glsl_lex_destroy(), so don't allocate here. + * This function is called from _mesa_glsl_lexer_lex_destroy(), so don't allocate here. */ yyg->yy_buffer_stack = 0; @@ -3724,37 +3879,37 @@ static int yy_init_globals (yyscan_t yyscanner) #endif /* For future reference: Set errno on error, since we are called by - * _mesa_glsl_lex_init() + * _mesa_glsl_lexer_lex_init() */ return 0; } -/* _mesa_glsl_lex_destroy is for both reentrant and non-reentrant scanners. */ -int _mesa_glsl_lex_destroy (yyscan_t yyscanner) +/* _mesa_glsl_lexer_lex_destroy is for both reentrant and non-reentrant scanners. */ +int _mesa_glsl_lexer_lex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - _mesa_glsl__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + _mesa_glsl_lexer__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; - _mesa_glsl_pop_buffer_state(yyscanner); + _mesa_glsl_lexer_pop_buffer_state(yyscanner); } /* Destroy the stack itself. */ - _mesa_glsl_free(yyg->yy_buffer_stack ,yyscanner); + _mesa_glsl_lexer_free(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - _mesa_glsl_free(yyg->yy_start_stack ,yyscanner ); + _mesa_glsl_lexer_free(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * _mesa_glsl_lex() is called, initialization will occur. */ + * _mesa_glsl_lexer_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ - _mesa_glsl_free ( yyscanner , yyscanner ); + _mesa_glsl_lexer_free ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } @@ -3783,12 +3938,12 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) } #endif -void *_mesa_glsl_alloc (yy_size_t size , yyscan_t yyscanner) +void *_mesa_glsl_lexer_alloc (yy_size_t size , yyscan_t yyscanner) { return (void *) malloc( size ); } -void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +void *_mesa_glsl_lexer_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those @@ -3800,14 +3955,14 @@ void *_mesa_glsl_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) return (void *) realloc( (char *) ptr, size ); } -void _mesa_glsl_free (void * ptr , yyscan_t yyscanner) +void _mesa_glsl_lexer_free (void * ptr , yyscan_t yyscanner) { - free( (char *) ptr ); /* see _mesa_glsl_realloc() for (char *) cast */ + free( (char *) ptr ); /* see _mesa_glsl_lexer_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 495 "src/glsl/glsl_lexer.ll" +#line 542 "src/glsl/glsl_lexer.ll" @@ -3825,13 +3980,13 @@ classify_identifier(struct _mesa_glsl_parse_state *state, const char *name) void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string) { - _mesa_glsl_lex_init_extra(state,& state->scanner); - _mesa_glsl__scan_string(string,state->scanner); + _mesa_glsl_lexer_lex_init_extra(state,& state->scanner); + _mesa_glsl_lexer__scan_string(string,state->scanner); } void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state) { - _mesa_glsl_lex_destroy(state->scanner); + _mesa_glsl_lexer_lex_destroy(state->scanner); } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll index 03df4a2d7..885bdd911 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.ll @@ -54,22 +54,36 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); * * Certain words start out as identifiers, become reserved words in * later language revisions, and finally become language keywords. + * This may happen at different times in desktop GLSL and GLSL ES. * * For example, consider the following lexer rule: - * samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER) + * samplerBuffer KEYWORD(130, 0, 140, 0, SAMPLERBUFFER) * * This means that "samplerBuffer" will be treated as: * - a keyword (SAMPLERBUFFER token) ...in GLSL >= 1.40 * - a reserved word - error ...in GLSL >= 1.30 - * - an identifier ...in GLSL < 1.30 + * - an identifier ...in GLSL < 1.30 or GLSL ES */ -#define KEYWORD(reserved_version, allowed_version, token) \ +#define KEYWORD(reserved_glsl, reserved_glsl_es, \ + allowed_glsl, allowed_glsl_es, token) \ + KEYWORD_WITH_ALT(reserved_glsl, reserved_glsl_es, \ + allowed_glsl, allowed_glsl_es, false, token) + +/** + * Like the KEYWORD macro, but the word is also treated as a keyword + * if the given boolean expression is true. + */ +#define KEYWORD_WITH_ALT(reserved_glsl, reserved_glsl_es, \ + allowed_glsl, allowed_glsl_es, \ + alt_expr, token) \ do { \ - if (yyextra->language_version >= allowed_version) { \ + if (yyextra->is_version(allowed_glsl, allowed_glsl_es) \ + || (alt_expr)) { \ return token; \ - } else if (yyextra->language_version >= reserved_version) { \ + } else if (yyextra->is_version(reserved_glsl, \ + reserved_glsl_es)) { \ _mesa_glsl_error(yylloc, yyextra, \ - "Illegal use of reserved word `%s'", yytext); \ + "illegal use of reserved word `%s'", yytext); \ return ERROR_TOK; \ } else { \ yylval->identifier = strdup(yytext); \ @@ -77,15 +91,20 @@ static int classify_identifier(struct _mesa_glsl_parse_state *, const char *); } \ } while (0) -/* The ES macro can be used in KEYWORD checks: - * - * word KEYWORD(110 || ES, 400, TOKEN) - * ...means the word is reserved in GLSL ES 1.00, while - * - * word KEYWORD(110, 130 || ES, TOKEN) - * ...means the word is a legal keyword in GLSL ES 1.00. +/** + * A macro for handling keywords that have been present in GLSL since + * its origin, but were changed into reserved words in GLSL 3.00 ES. */ -#define ES yyextra->es_shader +#define DEPRECATED_ES_KEYWORD(token) \ + do { \ + if (yyextra->is_version(0, 300)) { \ + _mesa_glsl_error(yylloc, yyextra, \ + "illegal use of reserved word `%s'", yytext); \ + return ERROR_TOK; \ + } else { \ + return token; \ + } \ + } while (0) static int literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, @@ -109,12 +128,12 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, if (value > UINT_MAX) { /* Note that signed 0xffffffff is valid, not out of range! */ - if (state->language_version >= 130) { + if (state->is_version(130, 300)) { _mesa_glsl_error(lloc, state, - "Literal value `%s' out of range", text); + "literal value `%s' out of range", text); } else { _mesa_glsl_warning(lloc, state, - "Literal value `%s' out of range", text); + "literal value `%s' out of range", text); } } else if (base == 10 && !is_uint && (unsigned)value > (unsigned)INT_MAX + 1) { /* Tries to catch unintentionally providing a negative value. @@ -122,7 +141,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, * want to warn for INT_MAX. */ _mesa_glsl_warning(lloc, state, - "Signed literal value `%s' is interpreted as %d", + "signed literal value `%s' is interpreted as %d", text, lval->n); } return is_uint ? UINTCONSTANT : INTCONSTANT; @@ -136,7 +155,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state, %option bison-bridge bison-locations reentrant noyywrap %option nounput noyy_top_state %option never-interactive -%option prefix="_mesa_glsl_" +%option prefix="_mesa_glsl_lexer_" %option extra-type="struct _mesa_glsl_parse_state *" %x PP PRAGMA @@ -225,12 +244,12 @@ HASH ^{SPC}#{SPC} \n { yylineno++; yycolumn = 0; } -attribute return ATTRIBUTE; +attribute DEPRECATED_ES_KEYWORD(ATTRIBUTE); const return CONST_TOK; bool return BOOL_TOK; float return FLOAT_TOK; int return INT_TOK; -uint KEYWORD(130, 130, UINT_TOK); +uint KEYWORD(130, 300, 130, 300, UINT_TOK); break return BREAK; continue return CONTINUE; @@ -248,82 +267,99 @@ bvec4 return BVEC4; ivec2 return IVEC2; ivec3 return IVEC3; ivec4 return IVEC4; -uvec2 KEYWORD(130, 130, UVEC2); -uvec3 KEYWORD(130, 130, UVEC3); -uvec4 KEYWORD(130, 130, UVEC4); +uvec2 KEYWORD(130, 300, 130, 300, UVEC2); +uvec3 KEYWORD(130, 300, 130, 300, UVEC3); +uvec4 KEYWORD(130, 300, 130, 300, UVEC4); vec2 return VEC2; vec3 return VEC3; vec4 return VEC4; mat2 return MAT2X2; mat3 return MAT3X3; mat4 return MAT4X4; -mat2x2 KEYWORD(120, 120, MAT2X2); -mat2x3 KEYWORD(120, 120, MAT2X3); -mat2x4 KEYWORD(120, 120, MAT2X4); -mat3x2 KEYWORD(120, 120, MAT3X2); -mat3x3 KEYWORD(120, 120, MAT3X3); -mat3x4 KEYWORD(120, 120, MAT3X4); -mat4x2 KEYWORD(120, 120, MAT4X2); -mat4x3 KEYWORD(120, 120, MAT4X3); -mat4x4 KEYWORD(120, 120, MAT4X4); +mat2x2 KEYWORD(120, 300, 120, 300, MAT2X2); +mat2x3 KEYWORD(120, 300, 120, 300, MAT2X3); +mat2x4 KEYWORD(120, 300, 120, 300, MAT2X4); +mat3x2 KEYWORD(120, 300, 120, 300, MAT3X2); +mat3x3 KEYWORD(120, 300, 120, 300, MAT3X3); +mat3x4 KEYWORD(120, 300, 120, 300, MAT3X4); +mat4x2 KEYWORD(120, 300, 120, 300, MAT4X2); +mat4x3 KEYWORD(120, 300, 120, 300, MAT4X3); +mat4x4 KEYWORD(120, 300, 120, 300, MAT4X4); in return IN_TOK; out return OUT_TOK; inout return INOUT_TOK; uniform return UNIFORM; -varying return VARYING; -centroid KEYWORD(120, 120, CENTROID); -invariant KEYWORD(120 || ES, 120 || ES, INVARIANT); -flat KEYWORD(130 || ES, 130, FLAT); -smooth KEYWORD(130, 130, SMOOTH); -noperspective KEYWORD(130, 130, NOPERSPECTIVE); +varying DEPRECATED_ES_KEYWORD(VARYING); +centroid KEYWORD(120, 300, 120, 300, CENTROID); +invariant KEYWORD(120, 100, 120, 100, INVARIANT); +flat KEYWORD(130, 100, 130, 300, FLAT); +smooth KEYWORD(130, 300, 130, 300, SMOOTH); +noperspective KEYWORD(130, 300, 130, 0, NOPERSPECTIVE); -sampler1D return SAMPLER1D; +sampler1D DEPRECATED_ES_KEYWORD(SAMPLER1D); sampler2D return SAMPLER2D; sampler3D return SAMPLER3D; samplerCube return SAMPLERCUBE; -sampler1DArray KEYWORD(130, 130, SAMPLER1DARRAY); -sampler2DArray KEYWORD(130, 130, SAMPLER2DARRAY); -sampler1DShadow return SAMPLER1DSHADOW; +sampler1DArray KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY); +sampler2DArray KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY); +sampler1DShadow DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW); sampler2DShadow return SAMPLER2DSHADOW; -samplerCubeShadow KEYWORD(130, 130, SAMPLERCUBESHADOW); -sampler1DArrayShadow KEYWORD(130, 130, SAMPLER1DARRAYSHADOW); -sampler2DArrayShadow KEYWORD(130, 130, SAMPLER2DARRAYSHADOW); -isampler1D KEYWORD(130, 130, ISAMPLER1D); -isampler2D KEYWORD(130, 130, ISAMPLER2D); -isampler3D KEYWORD(130, 130, ISAMPLER3D); -isamplerCube KEYWORD(130, 130, ISAMPLERCUBE); -isampler1DArray KEYWORD(130, 130, ISAMPLER1DARRAY); -isampler2DArray KEYWORD(130, 130, ISAMPLER2DARRAY); -usampler1D KEYWORD(130, 130, USAMPLER1D); -usampler2D KEYWORD(130, 130, USAMPLER2D); -usampler3D KEYWORD(130, 130, USAMPLER3D); -usamplerCube KEYWORD(130, 130, USAMPLERCUBE); -usampler1DArray KEYWORD(130, 130, USAMPLER1DARRAY); -usampler2DArray KEYWORD(130, 130, USAMPLER2DARRAY); +samplerCubeShadow KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW); +sampler1DArrayShadow KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW); +sampler2DArrayShadow KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW); +isampler1D KEYWORD(130, 300, 130, 0, ISAMPLER1D); +isampler2D KEYWORD(130, 300, 130, 300, ISAMPLER2D); +isampler3D KEYWORD(130, 300, 130, 300, ISAMPLER3D); +isamplerCube KEYWORD(130, 300, 130, 300, ISAMPLERCUBE); +isampler1DArray KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY); +isampler2DArray KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY); +usampler1D KEYWORD(130, 300, 130, 0, USAMPLER1D); +usampler2D KEYWORD(130, 300, 130, 300, USAMPLER2D); +usampler3D KEYWORD(130, 300, 130, 300, USAMPLER3D); +usamplerCube KEYWORD(130, 300, 130, 300, USAMPLERCUBE); +usampler1DArray KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY); +usampler2DArray KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY); -samplerExternalOES { + /* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */ + /* these are reserved but not defined in GLSL 3.00 */ +sampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS); +isampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS); +usampler2DMS KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS); +sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY); +isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY); +usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY); + + /* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */ +samplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY); +isamplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY); +usamplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY); +samplerCubeArrayShadow KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW); + +samplerExternalOES { if (yyextra->OES_EGL_image_external_enable) return SAMPLEREXTERNALOES; else return IDENTIFIER; - } + } +atomic_uint KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT); struct return STRUCT; void return VOID_TOK; layout { - if ((yyextra->language_version >= 140) + if ((yyextra->is_version(140, 300)) || yyextra->AMD_conservative_depth_enable || yyextra->ARB_conservative_depth_enable || yyextra->ARB_explicit_attrib_location_enable || yyextra->ARB_uniform_buffer_object_enable - || yyextra->ARB_fragment_coord_conventions_enable) { + || yyextra->ARB_fragment_coord_conventions_enable + || yyextra->ARB_shading_language_420pack_enable) { return LAYOUT_TOK; } else { yylval->identifier = strdup(yytext); - return IDENTIFIER; + return classify_identifier(yyextra, yytext); } } @@ -361,23 +397,23 @@ layout { } [0-9]+\.[0-9]+([eE][+-]?[0-9]+)?[fF]? { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } \.[0-9]+([eE][+-]?[0-9]+)?[fF]? { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } [0-9]+\.([eE][+-]?[0-9]+)?[fF]? { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } [0-9]+[eE][+-]?[0-9]+[fF]? { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } [0-9]+[fF] { - yylval->real = glsl_strtod(yytext, NULL); + yylval->real = glsl_strtof(yytext, NULL); return FLOATCONSTANT; } @@ -392,96 +428,107 @@ false { /* Reserved words in GLSL 1.10. */ -asm KEYWORD(110 || ES, 999, ASM); -class KEYWORD(110 || ES, 999, CLASS); -union KEYWORD(110 || ES, 999, UNION); -enum KEYWORD(110 || ES, 999, ENUM); -typedef KEYWORD(110 || ES, 999, TYPEDEF); -template KEYWORD(110 || ES, 999, TEMPLATE); -this KEYWORD(110 || ES, 999, THIS); -packed KEYWORD(110 || ES, 140 || yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK); -goto KEYWORD(110 || ES, 999, GOTO); -switch KEYWORD(110 || ES, 130, SWITCH); -default KEYWORD(110 || ES, 130, DEFAULT); -inline KEYWORD(110 || ES, 999, INLINE_TOK); -noinline KEYWORD(110 || ES, 999, NOINLINE); -volatile KEYWORD(110 || ES, 999, VOLATILE); -public KEYWORD(110 || ES, 999, PUBLIC_TOK); -static KEYWORD(110 || ES, 999, STATIC); -extern KEYWORD(110 || ES, 999, EXTERN); -external KEYWORD(110 || ES, 999, EXTERNAL); -interface KEYWORD(110 || ES, 999, INTERFACE); -long KEYWORD(110 || ES, 999, LONG_TOK); -short KEYWORD(110 || ES, 999, SHORT_TOK); -double KEYWORD(110 || ES, 400, DOUBLE_TOK); -half KEYWORD(110 || ES, 999, HALF); -fixed KEYWORD(110 || ES, 999, FIXED_TOK); -unsigned KEYWORD(110 || ES, 999, UNSIGNED); -input KEYWORD(110 || ES, 999, INPUT_TOK); -output KEYWORD(110 || ES, 999, OUTPUT); -hvec2 KEYWORD(110 || ES, 999, HVEC2); -hvec3 KEYWORD(110 || ES, 999, HVEC3); -hvec4 KEYWORD(110 || ES, 999, HVEC4); -dvec2 KEYWORD(110 || ES, 400, DVEC2); -dvec3 KEYWORD(110 || ES, 400, DVEC3); -dvec4 KEYWORD(110 || ES, 400, DVEC4); -fvec2 KEYWORD(110 || ES, 999, FVEC2); -fvec3 KEYWORD(110 || ES, 999, FVEC3); -fvec4 KEYWORD(110 || ES, 999, FVEC4); -sampler2DRect return SAMPLER2DRECT; -sampler3DRect KEYWORD(110 || ES, 999, SAMPLER3DRECT); -sampler2DRectShadow return SAMPLER2DRECTSHADOW; -sizeof KEYWORD(110 || ES, 999, SIZEOF); -cast KEYWORD(110 || ES, 999, CAST); -namespace KEYWORD(110 || ES, 999, NAMESPACE); -using KEYWORD(110 || ES, 999, USING); +asm KEYWORD(110, 100, 0, 0, ASM); +class KEYWORD(110, 100, 0, 0, CLASS); +union KEYWORD(110, 100, 0, 0, UNION); +enum KEYWORD(110, 100, 0, 0, ENUM); +typedef KEYWORD(110, 100, 0, 0, TYPEDEF); +template KEYWORD(110, 100, 0, 0, TEMPLATE); +this KEYWORD(110, 100, 0, 0, THIS); +packed KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK); +goto KEYWORD(110, 100, 0, 0, GOTO); +switch KEYWORD(110, 100, 130, 300, SWITCH); +default KEYWORD(110, 100, 130, 300, DEFAULT); +inline KEYWORD(110, 100, 0, 0, INLINE_TOK); +noinline KEYWORD(110, 100, 0, 0, NOINLINE); +volatile KEYWORD(110, 100, 0, 0, VOLATILE); +public KEYWORD(110, 100, 0, 0, PUBLIC_TOK); +static KEYWORD(110, 100, 0, 0, STATIC); +extern KEYWORD(110, 100, 0, 0, EXTERN); +external KEYWORD(110, 100, 0, 0, EXTERNAL); +interface KEYWORD(110, 100, 0, 0, INTERFACE); +long KEYWORD(110, 100, 0, 0, LONG_TOK); +short KEYWORD(110, 100, 0, 0, SHORT_TOK); +double KEYWORD(110, 100, 400, 0, DOUBLE_TOK); +half KEYWORD(110, 100, 0, 0, HALF); +fixed KEYWORD(110, 100, 0, 0, FIXED_TOK); +unsigned KEYWORD(110, 100, 0, 0, UNSIGNED); +input KEYWORD(110, 100, 0, 0, INPUT_TOK); +output KEYWORD(110, 100, 0, 0, OUTPUT); +hvec2 KEYWORD(110, 100, 0, 0, HVEC2); +hvec3 KEYWORD(110, 100, 0, 0, HVEC3); +hvec4 KEYWORD(110, 100, 0, 0, HVEC4); +dvec2 KEYWORD(110, 100, 400, 0, DVEC2); +dvec3 KEYWORD(110, 100, 400, 0, DVEC3); +dvec4 KEYWORD(110, 100, 400, 0, DVEC4); +fvec2 KEYWORD(110, 100, 0, 0, FVEC2); +fvec3 KEYWORD(110, 100, 0, 0, FVEC3); +fvec4 KEYWORD(110, 100, 0, 0, FVEC4); +sampler2DRect DEPRECATED_ES_KEYWORD(SAMPLER2DRECT); +sampler3DRect KEYWORD(110, 100, 0, 0, SAMPLER3DRECT); +sampler2DRectShadow DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW); +sizeof KEYWORD(110, 100, 0, 0, SIZEOF); +cast KEYWORD(110, 100, 0, 0, CAST); +namespace KEYWORD(110, 100, 0, 0, NAMESPACE); +using KEYWORD(110, 100, 0, 0, USING); /* Additional reserved words in GLSL 1.20. */ -lowp KEYWORD(120, 130 || ES, LOWP); -mediump KEYWORD(120, 130 || ES, MEDIUMP); -highp KEYWORD(120, 130 || ES, HIGHP); -precision KEYWORD(120, 130 || ES, PRECISION); +lowp KEYWORD(120, 100, 130, 100, LOWP); +mediump KEYWORD(120, 100, 130, 100, MEDIUMP); +highp KEYWORD(120, 100, 130, 100, HIGHP); +precision KEYWORD(120, 100, 130, 100, PRECISION); /* Additional reserved words in GLSL 1.30. */ -case KEYWORD(130, 130, CASE); -common KEYWORD(130, 999, COMMON); -partition KEYWORD(130, 999, PARTITION); -active KEYWORD(130, 999, ACTIVE); -superp KEYWORD(130 || ES, 999, SUPERP); -samplerBuffer KEYWORD(130, 140, SAMPLERBUFFER); -filter KEYWORD(130, 999, FILTER); -image1D KEYWORD(130, 999, IMAGE1D); -image2D KEYWORD(130, 999, IMAGE2D); -image3D KEYWORD(130, 999, IMAGE3D); -imageCube KEYWORD(130, 999, IMAGECUBE); -iimage1D KEYWORD(130, 999, IIMAGE1D); -iimage2D KEYWORD(130, 999, IIMAGE2D); -iimage3D KEYWORD(130, 999, IIMAGE3D); -iimageCube KEYWORD(130, 999, IIMAGECUBE); -uimage1D KEYWORD(130, 999, UIMAGE1D); -uimage2D KEYWORD(130, 999, UIMAGE2D); -uimage3D KEYWORD(130, 999, UIMAGE3D); -uimageCube KEYWORD(130, 999, UIMAGECUBE); -image1DArray KEYWORD(130, 999, IMAGE1DARRAY); -image2DArray KEYWORD(130, 999, IMAGE2DARRAY); -iimage1DArray KEYWORD(130, 999, IIMAGE1DARRAY); -iimage2DArray KEYWORD(130, 999, IIMAGE2DARRAY); -uimage1DArray KEYWORD(130, 999, UIMAGE1DARRAY); -uimage2DArray KEYWORD(130, 999, UIMAGE2DARRAY); -image1DShadow KEYWORD(130, 999, IMAGE1DSHADOW); -image2DShadow KEYWORD(130, 999, IMAGE2DSHADOW); -image1DArrayShadow KEYWORD(130, 999, IMAGE1DARRAYSHADOW); -image2DArrayShadow KEYWORD(130, 999, IMAGE2DARRAYSHADOW); -imageBuffer KEYWORD(130, 999, IMAGEBUFFER); -iimageBuffer KEYWORD(130, 999, IIMAGEBUFFER); -uimageBuffer KEYWORD(130, 999, UIMAGEBUFFER); -row_major KEYWORD(130, 140 || yyextra->ARB_uniform_buffer_object_enable, ROW_MAJOR); +case KEYWORD(130, 300, 130, 300, CASE); +common KEYWORD(130, 300, 0, 0, COMMON); +partition KEYWORD(130, 300, 0, 0, PARTITION); +active KEYWORD(130, 300, 0, 0, ACTIVE); +superp KEYWORD(130, 100, 0, 0, SUPERP); +samplerBuffer KEYWORD(130, 300, 140, 0, SAMPLERBUFFER); +filter KEYWORD(130, 300, 0, 0, FILTER); +image1D KEYWORD(130, 300, 0, 0, IMAGE1D); +image2D KEYWORD(130, 300, 0, 0, IMAGE2D); +image3D KEYWORD(130, 300, 0, 0, IMAGE3D); +imageCube KEYWORD(130, 300, 0, 0, IMAGECUBE); +iimage1D KEYWORD(130, 300, 0, 0, IIMAGE1D); +iimage2D KEYWORD(130, 300, 0, 0, IIMAGE2D); +iimage3D KEYWORD(130, 300, 0, 0, IIMAGE3D); +iimageCube KEYWORD(130, 300, 0, 0, IIMAGECUBE); +uimage1D KEYWORD(130, 300, 0, 0, UIMAGE1D); +uimage2D KEYWORD(130, 300, 0, 0, UIMAGE2D); +uimage3D KEYWORD(130, 300, 0, 0, UIMAGE3D); +uimageCube KEYWORD(130, 300, 0, 0, UIMAGECUBE); +image1DArray KEYWORD(130, 300, 0, 0, IMAGE1DARRAY); +image2DArray KEYWORD(130, 300, 0, 0, IMAGE2DARRAY); +iimage1DArray KEYWORD(130, 300, 0, 0, IIMAGE1DARRAY); +iimage2DArray KEYWORD(130, 300, 0, 0, IIMAGE2DARRAY); +uimage1DArray KEYWORD(130, 300, 0, 0, UIMAGE1DARRAY); +uimage2DArray KEYWORD(130, 300, 0, 0, UIMAGE2DARRAY); +image1DShadow KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW); +image2DShadow KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW); +image1DArrayShadow KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW); +image2DArrayShadow KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW); +imageBuffer KEYWORD(130, 300, 0, 0, IMAGEBUFFER); +iimageBuffer KEYWORD(130, 300, 0, 0, IIMAGEBUFFER); +uimageBuffer KEYWORD(130, 300, 0, 0, UIMAGEBUFFER); +row_major KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR); /* Additional reserved words in GLSL 1.40 */ -isampler2DRect KEYWORD(140, 140, ISAMPLER2DRECT); -usampler2DRect KEYWORD(140, 140, USAMPLER2DRECT); -isamplerBuffer KEYWORD(140, 140, ISAMPLERBUFFER); -usamplerBuffer KEYWORD(140, 140, USAMPLERBUFFER); +isampler2DRect KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT); +usampler2DRect KEYWORD(140, 300, 140, 0, USAMPLER2DRECT); +isamplerBuffer KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER); +usamplerBuffer KEYWORD(140, 300, 140, 0, USAMPLERBUFFER); + + /* Additional reserved words in GLSL ES 3.00 */ +coherent KEYWORD(0, 300, 0, 0, COHERENT); +restrict KEYWORD(0, 300, 0, 0, RESTRICT); +readonly KEYWORD(0, 300, 0, 0, READONLY); +writeonly KEYWORD(0, 300, 0, 0, WRITEONLY); +resource KEYWORD(0, 300, 0, 0, RESOURCE); +patch KEYWORD(0, 300, 0, 0, PATCH); +sample KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE); +subroutine KEYWORD(0, 300, 0, 0, SUBROUTINE); + [_a-zA-Z][_a-zA-Z0-9]* { struct _mesa_glsl_parse_state *state = yyextra; diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp index 90de3bcba..5f92c123c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.cpp @@ -5,63 +5,76 @@ #include "ir_optimization.h" #include "ir_print_glsl_visitor.h" #include "ir_print_visitor.h" +#include "ir_stats.h" #include "loop_analysis.h" #include "program.h" #include "linker.h" +#include "standalone_scaffolding.h" extern "C" struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); +static void DeleteShader(struct gl_context *ctx, struct gl_shader *shader) +{ + ralloc_free(shader); +} + static void -initialize_mesa_context(struct gl_context *ctx, gl_api api) +initialize_mesa_context(struct gl_context *ctx, glslopt_target api) { - memset(ctx, 0, sizeof(*ctx)); + gl_api mesaAPI; + switch(api) + { + default: + case kGlslTargetOpenGL: + mesaAPI = API_OPENGL_COMPAT; + break; + case kGlslTargetOpenGLES20: + mesaAPI = API_OPENGLES2; + break; + case kGlslTargetOpenGLES30: + mesaAPI = API_OPENGL_CORE; + break; + } + initialize_context_to_defaults (ctx, mesaAPI); - ctx->API = api; + switch(api) + { + default: + case kGlslTargetOpenGL: + ctx->Const.GLSLVersion = 140; + break; + case kGlslTargetOpenGLES20: + ctx->Extensions.OES_standard_derivatives = true; + ctx->Extensions.EXT_shadow_samplers = true; + ctx->Extensions.EXT_frag_depth = true; + break; + case kGlslTargetOpenGLES30: + ctx->Extensions.ARB_ES3_compatibility = true; + break; + } + - ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; - ctx->Extensions.EXT_texture_array = GL_TRUE; - ctx->Extensions.NV_texture_rectangle = GL_TRUE; - ctx->Extensions.ARB_shader_texture_lod = GL_TRUE; - - // Enable opengl es extensions we care about here - if (api == API_OPENGLES2) - { - ctx->Extensions.OES_standard_derivatives = GL_TRUE; - ctx->Extensions.EXT_shadow_samplers = GL_TRUE; - ctx->Extensions.EXT_frag_depth = GL_TRUE; - } - - ctx->Const.GLSLVersion = 140; - - /* 1.20 minimums. */ - ctx->Const.MaxLights = 8; - ctx->Const.MaxClipPlanes = 8; - ctx->Const.MaxTextureUnits = 2; - - /* allow high amount */ + // allow high amount of texcoords ctx->Const.MaxTextureCoordUnits = 16; - ctx->Const.VertexProgram.MaxAttribs = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 512; - ctx->Const.MaxVarying = 8; - ctx->Const.MaxVertexTextureImageUnits = 0; - ctx->Const.MaxCombinedTextureImageUnits = 2; - ctx->Const.MaxTextureImageUnits = 2; - ctx->Const.FragmentProgram.MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16; ctx->Const.MaxDrawBuffers = 2; ctx->Driver.NewShader = _mesa_new_shader; + ctx->Driver.DeleteShader = DeleteShader; } struct glslopt_ctx { - glslopt_ctx (bool openglES) { + glslopt_ctx (glslopt_target target) { mem_ctx = ralloc_context (NULL); - initialize_mesa_context (&mesa_ctx, openglES ? API_OPENGLES2 : API_OPENGL); + initialize_mesa_context (&mesa_ctx, target); } ~glslopt_ctx() { ralloc_free (mem_ctx); @@ -70,18 +83,21 @@ struct glslopt_ctx { void* mem_ctx; }; -glslopt_ctx* glslopt_initialize (bool openglES) +glslopt_ctx* glslopt_initialize (glslopt_target target) { - return new glslopt_ctx(openglES); + return new glslopt_ctx(target); } void glslopt_cleanup (glslopt_ctx* ctx) { delete ctx; - _mesa_glsl_release_types(); - _mesa_glsl_release_functions(); + _mesa_destroy_shader_compiler(); } +struct glslopt_shader_input +{ + const char* name; +}; struct glslopt_shader { @@ -101,6 +117,10 @@ struct glslopt_shader : rawOutput(0) , optimizedOutput(0) , status(false) + , inputCount(0) + , statsMath(0) + , statsTex(0) + , statsFlow(0) { infoLog = "Shader not compiled yet"; @@ -114,18 +134,27 @@ struct glslopt_shader shader = rzalloc(whole_program, gl_shader); whole_program->Shaders[whole_program->NumShaders] = shader; whole_program->NumShaders++; + + whole_program->LinkStatus = true; } ~glslopt_shader() { - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) ralloc_free(whole_program->_LinkedShaders[i]); ralloc_free(whole_program); + ralloc_free(rawOutput); + ralloc_free(optimizedOutput); } struct gl_shader_program* whole_program; struct gl_shader* shader; + static const int kMaxShaderInputs = 128; + glslopt_shader_input inputs[kMaxShaderInputs]; + int inputCount; + int statsMath, statsTex, statsFlow; + char* rawOutput; char* optimizedOutput; const char* infoLog; @@ -147,9 +176,9 @@ static void propagate_precision_deref(ir_instruction *ir, void *data) { // variable -> deference ir_dereference_variable* der = ir->as_dereference_variable(); - if (der && der->get_precision() == glsl_precision_undefined && der->var->precision != glsl_precision_undefined) + if (der && der->get_precision() == glsl_precision_undefined && der->var->data.precision != glsl_precision_undefined) { - der->set_precision ((glsl_precision)der->var->precision); + der->set_precision ((glsl_precision)der->var->data.precision); *(bool*)data = true; } // swizzle value -> swizzle @@ -199,7 +228,7 @@ static void propagate_precision_assign(ir_instruction *ir, void *data) if (lp == glsl_precision_undefined) { if (lhs_var) - lhs_var->precision = rp; + lhs_var->data.precision = rp; ass->lhs->set_precision (rp); *(bool*)data = true; } @@ -216,19 +245,16 @@ static void propagate_precision_call(ir_instruction *ir, void *data) if (call->return_deref->get_precision() == glsl_precision_undefined /*&& call->callee->precision == glsl_precision_undefined*/) { glsl_precision prec_params_max = glsl_precision_undefined; - exec_list_iterator iter_sig = call->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter_param, call->actual_parameters) - { - ir_variable* sig_param = (ir_variable*)iter_sig.get(); - ir_rvalue* param = (ir_rvalue*)iter_param.get(); + foreach_two_lists(formal_node, &call->callee->parameters, + actual_node, &call->actual_parameters) { + ir_variable* sig_param = (ir_variable*)formal_node; + ir_rvalue* param = (ir_rvalue*)actual_node; - glsl_precision p = (glsl_precision)sig_param->precision; + glsl_precision p = (glsl_precision)sig_param->data.precision; if (p == glsl_precision_undefined) p = param->get_precision(); prec_params_max = higher_precision (prec_params_max, p); - - iter_sig.next(); } if (call->return_deref->get_precision() != prec_params_max) { @@ -245,8 +271,8 @@ static bool propagate_precision(exec_list* list) bool res; do { res = false; - foreach_iter(exec_list_iterator, iter, *list) { - ir_instruction* ir = (ir_instruction*)iter.get(); + foreach_list(node, list) { + ir_instruction* ir = (ir_instruction*)node; visit_tree (ir, propagate_precision_deref, &res); visit_tree (ir, propagate_precision_assign, &res); visit_tree (ir, propagate_precision_call, &res); @@ -258,45 +284,50 @@ static bool propagate_precision(exec_list* list) } -static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_state* state, glslopt_ctx* ctx) +static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_state* state, void* mem_ctx) { bool progress; do { progress = false; bool progress2; - debug_print_ir ("Initial", ir, state, ctx->mem_ctx); + debug_print_ir ("Initial", ir, state, mem_ctx); if (linked) { - progress2 = do_function_inlining(ir); progress |= progress2; if (progress2) debug_print_ir ("After inlining", ir, state, ctx->mem_ctx); - progress2 = do_dead_functions(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead functions", ir, state, ctx->mem_ctx); - progress2 = do_structure_splitting(ir); progress |= progress2; if (progress2) debug_print_ir ("After struct splitting", ir, state, ctx->mem_ctx); + progress2 = do_function_inlining(ir); progress |= progress2; if (progress2) debug_print_ir ("After inlining", ir, state, mem_ctx); + progress2 = do_dead_functions(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead functions", ir, state, mem_ctx); + progress2 = do_structure_splitting(ir); progress |= progress2; if (progress2) debug_print_ir ("After struct splitting", ir, state, mem_ctx); + } + progress2 = do_if_simplification(ir); progress |= progress2; if (progress2) debug_print_ir ("After if simpl", ir, state, mem_ctx); + progress2 = opt_flatten_nested_if_blocks(ir); progress |= progress2; if (progress2) debug_print_ir ("After if flatten", ir, state, mem_ctx); + progress2 = propagate_precision (ir); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx); + progress2 = do_copy_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation", ir, state, mem_ctx); + progress2 = do_copy_propagation_elements(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation elems", ir, state, mem_ctx); + if (linked) + { + progress2 = do_vectorize(ir); progress |= progress2; if (progress2) debug_print_ir ("After vectorize", ir, state, mem_ctx); } - progress2 = do_if_simplification(ir); progress |= progress2; if (progress2) debug_print_ir ("After if simpl", ir, state, ctx->mem_ctx); - progress2 = propagate_precision (ir); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, ctx->mem_ctx); - progress2 = do_copy_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation", ir, state, ctx->mem_ctx); - progress2 = do_copy_propagation_elements(ir); progress |= progress2; if (progress2) debug_print_ir ("After copy propagation elems", ir, state, ctx->mem_ctx); if (linked) { - progress2 = do_dead_code(ir,false); progress |= progress2; if (progress2) debug_print_ir ("After dead code", ir, state, ctx->mem_ctx); + progress2 = do_dead_code(ir,false); progress |= progress2; if (progress2) debug_print_ir ("After dead code", ir, state, mem_ctx); } else { - progress2 = do_dead_code_unlinked(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead code unlinked", ir, state, ctx->mem_ctx); + progress2 = do_dead_code_unlinked(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead code unlinked", ir, state, mem_ctx); } - progress2 = do_dead_code_local(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead code local", ir, state, ctx->mem_ctx); - progress2 = propagate_precision (ir); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, ctx->mem_ctx); - progress2 = do_tree_grafting(ir); progress |= progress2; if (progress2) debug_print_ir ("After tree grafting", ir, state, ctx->mem_ctx); - progress2 = do_constant_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After const propagation", ir, state, ctx->mem_ctx); + progress2 = do_dead_code_local(ir); progress |= progress2; if (progress2) debug_print_ir ("After dead code local", ir, state, mem_ctx); + progress2 = propagate_precision (ir); progress |= progress2; if (progress2) debug_print_ir ("After prec propagation", ir, state, mem_ctx); + progress2 = do_tree_grafting(ir); progress |= progress2; if (progress2) debug_print_ir ("After tree grafting", ir, state, mem_ctx); + progress2 = do_constant_propagation(ir); progress |= progress2; if (progress2) debug_print_ir ("After const propagation", ir, state, mem_ctx); if (linked) { - progress2 = do_constant_variable(ir); progress |= progress2; if (progress2) debug_print_ir ("After const variable", ir, state, ctx->mem_ctx); + progress2 = do_constant_variable(ir); progress |= progress2; if (progress2) debug_print_ir ("After const variable", ir, state, mem_ctx); } else { - progress2 = do_constant_variable_unlinked(ir); progress |= progress2; if (progress2) debug_print_ir ("After const variable unlinked", ir, state, ctx->mem_ctx); + progress2 = do_constant_variable_unlinked(ir); progress |= progress2; if (progress2) debug_print_ir ("After const variable unlinked", ir, state, mem_ctx); } - progress2 = do_constant_folding(ir); progress |= progress2; if (progress2) debug_print_ir ("After const folding", ir, state, ctx->mem_ctx); - progress2 = do_algebraic(ir); progress |= progress2; if (progress2) debug_print_ir ("After algebraic", ir, state, ctx->mem_ctx); - progress2 = do_lower_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After lower jumps", ir, state, ctx->mem_ctx); - progress2 = do_vec_index_to_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After vec index to swizzle", ir, state, ctx->mem_ctx); - //progress2 = do_vec_index_to_cond_assign(ir); progress |= progress2; if (progress2) debug_print_ir ("After vec index to cond assign", ir, state, ctx->mem_ctx); - progress2 = do_swizzle_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After swizzle swizzle", ir, state, ctx->mem_ctx); - progress2 = do_noop_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After noop swizzle", ir, state, ctx->mem_ctx); - progress2 = optimize_split_arrays(ir, linked); progress |= progress2; if (progress2) debug_print_ir ("After split arrays", ir, state, ctx->mem_ctx); - progress2 = optimize_redundant_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After redundant jumps", ir, state, ctx->mem_ctx); + progress2 = do_constant_folding(ir); progress |= progress2; if (progress2) debug_print_ir ("After const folding", ir, state, mem_ctx); + progress2 = do_cse(ir); progress |= progress2; if (progress2) debug_print_ir ("After CSE", ir, state, mem_ctx); + progress2 = do_algebraic(ir); progress |= progress2; if (progress2) debug_print_ir ("After algebraic", ir, state, mem_ctx); + progress2 = do_lower_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After lower jumps", ir, state, mem_ctx); + progress2 = do_vec_index_to_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After vec index to swizzle", ir, state, mem_ctx); + progress2 = do_swizzle_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After swizzle swizzle", ir, state, mem_ctx); + progress2 = do_noop_swizzle(ir); progress |= progress2; if (progress2) debug_print_ir ("After noop swizzle", ir, state, mem_ctx); + progress2 = optimize_split_arrays(ir, linked); progress |= progress2; if (progress2) debug_print_ir ("After split arrays", ir, state, mem_ctx); + progress2 = optimize_redundant_jumps(ir); progress |= progress2; if (progress2) debug_print_ir ("After redundant jumps", ir, state, mem_ctx); // do loop stuff only when linked; otherwise causes duplicate loop induction variable // problems (ast-in.txt test) @@ -304,8 +335,8 @@ static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_ { loop_state *ls = analyze_loop_variables(ir); if (ls->loop_found) { - progress2 = set_loop_controls(ir, ls); progress |= progress2; if (progress2) debug_print_ir ("After set loop", ir, state, ctx->mem_ctx); - progress2 = unroll_loops(ir, ls, 8); progress |= progress2; if (progress2) debug_print_ir ("After unroll", ir, state, ctx->mem_ctx); + progress2 = set_loop_controls(ir, ls); progress |= progress2; if (progress2) debug_print_ir ("After set loop", ir, state, mem_ctx); + progress2 = unroll_loops(ir, ls, 8); progress |= progress2; if (progress2) debug_print_ir ("After unroll", ir, state, mem_ctx); } delete ls; } @@ -313,28 +344,53 @@ static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_ } +static void find_shader_inputs(glslopt_shader* sh, exec_list* ir) +{ + foreach_list(node, ir) + { + ir_variable* const var = ((ir_instruction *)node)->as_variable(); + if (var == NULL || var->data.mode != ir_var_shader_in) + continue; + + if (sh->inputCount >= glslopt_shader::kMaxShaderInputs) + return; + + sh->inputs[sh->inputCount].name = ralloc_strdup(sh, var->name); + ++sh->inputCount; + } +} + + glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, const char* shaderSource, unsigned options) { glslopt_shader* shader = new (ctx->mem_ctx) glslopt_shader (); PrintGlslMode printMode = kPrintGlslVertex; switch (type) { - case kGlslOptShaderVertex: shader->shader->Type = GL_VERTEX_SHADER; printMode = kPrintGlslVertex; break; - case kGlslOptShaderFragment: shader->shader->Type = GL_FRAGMENT_SHADER; printMode = kPrintGlslFragment; break; + case kGlslOptShaderVertex: + shader->shader->Type = GL_VERTEX_SHADER; + shader->shader->Stage = MESA_SHADER_VERTEX; + printMode = kPrintGlslVertex; + break; + case kGlslOptShaderFragment: + shader->shader->Type = GL_FRAGMENT_SHADER; + shader->shader->Stage = MESA_SHADER_FRAGMENT; + printMode = kPrintGlslFragment; + break; } if (!shader->shader->Type) { - shader->infoLog = ralloc_asprintf (ctx->mem_ctx, "Unknown shader type %d", (int)type); + shader->infoLog = ralloc_asprintf (shader, "Unknown shader type %d", (int)type); shader->status = false; return shader; } - _mesa_glsl_parse_state* state = new (ctx->mem_ctx) _mesa_glsl_parse_state (&ctx->mesa_ctx, shader->shader->Type, ctx->mem_ctx); + _mesa_glsl_parse_state* state = new (shader) _mesa_glsl_parse_state (&ctx->mesa_ctx, shader->shader->Stage, shader); state->error = 0; if (!(options & kGlslOptionSkipPreprocessor)) { - state->error = !!glcpp_preprocess (state, &shaderSource, &state->info_log, state->extensions, ctx->mesa_ctx.API); + state->error = !!glcpp_preprocess (state, &shaderSource, &state->info_log, state->extensions, &ctx->mesa_ctx); if (state->error) { shader->status = !state->error; @@ -347,7 +403,7 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co _mesa_glsl_parse (state); _mesa_glsl_lexer_dtor (state); - exec_list* ir = new (ctx->mem_ctx) exec_list(); + exec_list* ir = new (shader) exec_list(); shader->shader->ir = ir; if (!state->error && !state->translation_unit.is_empty()) @@ -356,19 +412,18 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co // Un-optimized output if (!state->error) { validate_ir_tree(ir); - shader->rawOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(ctx->mem_ctx, ""), printMode); + shader->rawOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(shader, ""), printMode); } // Link built-in functions shader->shader->symbols = state->symbols; - memcpy(shader->shader->builtins_to_link, state->builtins_to_link, sizeof(shader->shader->builtins_to_link[0]) * state->num_builtins_to_link); - shader->shader->num_builtins_to_link = state->num_builtins_to_link; + shader->shader->uses_builtin_functions = state->uses_builtin_functions; - struct gl_shader* linked_shader = 0; + struct gl_shader* linked_shader = NULL; if (!state->error && !ir->is_empty()) { - linked_shader = link_intrastage_shaders(ctx->mem_ctx, + linked_shader = link_intrastage_shaders(shader, &ctx->mesa_ctx, shader->whole_program, shader->whole_program->Shaders, @@ -381,26 +436,30 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co } ir = linked_shader->ir; - debug_print_ir ("==== After link ====", ir, state, ctx->mem_ctx); + debug_print_ir ("==== After link ====", ir, state, shader); } // Do optimization post-link if (!state->error && !ir->is_empty()) { const bool linked = !(options & kGlslOptionNotFullShader); - do_optimization_passes(ir, linked, state, ctx); + do_optimization_passes(ir, linked, state, shader); validate_ir_tree(ir); } // Final optimized output if (!state->error) { - shader->optimizedOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(ctx->mem_ctx, ""), printMode); + shader->optimizedOutput = _mesa_print_ir_glsl(ir, state, ralloc_strdup(shader, ""), printMode); } shader->status = !state->error; shader->infoLog = state->info_log; + find_shader_inputs(shader, ir); + if (!state->error) + calculate_shader_stats (ir, &shader->statsMath, &shader->statsTex, &shader->statsFlow); + ralloc_free (ir); ralloc_free (state); @@ -434,3 +493,20 @@ const char* glslopt_get_log (glslopt_shader* shader) { return shader->infoLog; } + +int glslopt_shader_get_input_count (glslopt_shader* shader) +{ + return shader->inputCount; +} + +const char* glslopt_shader_get_input_name (glslopt_shader* shader, int index) +{ + return shader->inputs[index].name; +} + +void glslopt_shader_get_stats (glslopt_shader* shader, int* approxMath, int* approxTex, int* approxFlow) +{ + *approxMath = shader->statsMath; + *approxTex = shader->statsTex; + *approxFlow = shader->statsFlow; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h index 53e66c62b..a724aed52 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_optimizer.h @@ -35,7 +35,14 @@ enum glslopt_options { kGlslOptionNotFullShader = (1<<1), // Passed shader is not the full shader source. This makes some optimizations weaker. }; -glslopt_ctx* glslopt_initialize (bool openglES); +// Optimizer target language +enum glslopt_target { + kGlslTargetOpenGL = 0, + kGlslTargetOpenGLES20 = 1, + kGlslTargetOpenGLES30 = 2 +}; + +glslopt_ctx* glslopt_initialize (glslopt_target target); void glslopt_cleanup (glslopt_ctx* ctx); glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, const char* shaderSource, unsigned options); @@ -45,5 +52,12 @@ const char* glslopt_get_raw_output (glslopt_shader* shader); const char* glslopt_get_log (glslopt_shader* shader); void glslopt_shader_delete (glslopt_shader* shader); +int glslopt_shader_get_input_count (glslopt_shader* shader); +const char* glslopt_shader_get_input_name (glslopt_shader* shader, int index); + +// Get *very* approximate shader stats: +// Number of math, texture and flow control instructions. +void glslopt_shader_get_stats (glslopt_shader* shader, int* approxMath, int* approxTex, int* approxFlow); + #endif /* GLSL_OPTIMIZER_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp index 1618b38d8..9c32c4755 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -52,98 +55,18 @@ /* Pure parsers. */ #define YYPURE 1 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 1 /* Substitute the variable and function names. */ -#define yyparse _mesa_glsl_parse -#define yylex _mesa_glsl_lex -#define yyerror _mesa_glsl_error -#define yylval _mesa_glsl_lval -#define yychar _mesa_glsl_char -#define yydebug _mesa_glsl_debug -#define yynerrs _mesa_glsl_nerrs -#define yylloc _mesa_glsl_lloc - -/* Copy the first part of user declarations. */ - -/* Line 268 of yacc.c */ -#line 1 "src/glsl/glsl_parser.yy" - -/* - * Copyright © 2008, 2009 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -#include -#include -#include -#include - -#include "ast.h" -#include "glsl_parser_extras.h" -#include "glsl_types.h" -#include "main/context.h" - -#if defined(_MSC_VER) -# pragma warning(disable: 4065) // warning C4065: switch statement contains 'default' but no 'case' labels -# pragma warning(disable: 4244) // warning C4244: '=' : conversion from 'double' to 'float', possible loss of data -#endif // defined(_MSC_VER) - -#define YYLEX_PARAM state->scanner - -#undef yyerror - -static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) -{ - _mesa_glsl_error(loc, st, "%s", msg); -} - - -/* Line 268 of yacc.c */ -#line 128 "src/glsl/glsl_parser.cpp" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - +#define yyparse _mesa_glsl_parse +#define yylex _mesa_glsl_lex +#define yyerror _mesa_glsl_error +#define yylval _mesa_glsl_lval +#define yychar _mesa_glsl_char +#define yydebug _mesa_glsl_debug +#define yynerrs _mesa_glsl_nerrs +#define yylloc _mesa_glsl_lloc /* Tokens. */ #ifndef YYTOKENTYPE @@ -209,158 +132,493 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) SAMPLER2DARRAY = 313, SAMPLER1DARRAYSHADOW = 314, SAMPLER2DARRAYSHADOW = 315, - ISAMPLER1D = 316, - ISAMPLER2D = 317, - ISAMPLER3D = 318, - ISAMPLERCUBE = 319, - ISAMPLER1DARRAY = 320, - ISAMPLER2DARRAY = 321, - USAMPLER1D = 322, - USAMPLER2D = 323, - USAMPLER3D = 324, - USAMPLERCUBE = 325, - USAMPLER1DARRAY = 326, - USAMPLER2DARRAY = 327, - SAMPLER2DRECT = 328, - ISAMPLER2DRECT = 329, - USAMPLER2DRECT = 330, - SAMPLER2DRECTSHADOW = 331, - SAMPLERBUFFER = 332, - ISAMPLERBUFFER = 333, - USAMPLERBUFFER = 334, - SAMPLEREXTERNALOES = 335, - STRUCT = 336, - VOID_TOK = 337, - WHILE = 338, - IDENTIFIER = 339, - TYPE_IDENTIFIER = 340, - NEW_IDENTIFIER = 341, - FLOATCONSTANT = 342, - INTCONSTANT = 343, - UINTCONSTANT = 344, - BOOLCONSTANT = 345, - FIELD_SELECTION = 346, - LEFT_OP = 347, - RIGHT_OP = 348, - INC_OP = 349, - DEC_OP = 350, - LE_OP = 351, - GE_OP = 352, - EQ_OP = 353, - NE_OP = 354, - AND_OP = 355, - OR_OP = 356, - XOR_OP = 357, - MUL_ASSIGN = 358, - DIV_ASSIGN = 359, - ADD_ASSIGN = 360, - MOD_ASSIGN = 361, - LEFT_ASSIGN = 362, - RIGHT_ASSIGN = 363, - AND_ASSIGN = 364, - XOR_ASSIGN = 365, - OR_ASSIGN = 366, - SUB_ASSIGN = 367, - INVARIANT = 368, - LOWP = 369, - MEDIUMP = 370, - HIGHP = 371, - SUPERP = 372, - PRECISION = 373, - VERSION_TOK = 374, - EXTENSION = 375, - LINE = 376, - COLON = 377, - EOL = 378, - INTERFACE = 379, - OUTPUT = 380, - PRAGMA_DEBUG_ON = 381, - PRAGMA_DEBUG_OFF = 382, - PRAGMA_OPTIMIZE_ON = 383, - PRAGMA_OPTIMIZE_OFF = 384, - PRAGMA_INVARIANT_ALL = 385, - LAYOUT_TOK = 386, - ASM = 387, - CLASS = 388, - UNION = 389, - ENUM = 390, - TYPEDEF = 391, - TEMPLATE = 392, - THIS = 393, - PACKED_TOK = 394, - GOTO = 395, - INLINE_TOK = 396, - NOINLINE = 397, - VOLATILE = 398, - PUBLIC_TOK = 399, - STATIC = 400, - EXTERN = 401, - EXTERNAL = 402, - LONG_TOK = 403, - SHORT_TOK = 404, - DOUBLE_TOK = 405, - HALF = 406, - FIXED_TOK = 407, - UNSIGNED = 408, - INPUT_TOK = 409, - OUPTUT = 410, - HVEC2 = 411, - HVEC3 = 412, - HVEC4 = 413, - DVEC2 = 414, - DVEC3 = 415, - DVEC4 = 416, - FVEC2 = 417, - FVEC3 = 418, - FVEC4 = 419, - SAMPLER3DRECT = 420, - SIZEOF = 421, - CAST = 422, - NAMESPACE = 423, - USING = 424, - ERROR_TOK = 425, - COMMON = 426, - PARTITION = 427, - ACTIVE = 428, - FILTER = 429, - IMAGE1D = 430, - IMAGE2D = 431, - IMAGE3D = 432, - IMAGECUBE = 433, - IMAGE1DARRAY = 434, - IMAGE2DARRAY = 435, - IIMAGE1D = 436, - IIMAGE2D = 437, - IIMAGE3D = 438, - IIMAGECUBE = 439, - IIMAGE1DARRAY = 440, - IIMAGE2DARRAY = 441, - UIMAGE1D = 442, - UIMAGE2D = 443, - UIMAGE3D = 444, - UIMAGECUBE = 445, - UIMAGE1DARRAY = 446, - UIMAGE2DARRAY = 447, - IMAGE1DSHADOW = 448, - IMAGE2DSHADOW = 449, - IMAGEBUFFER = 450, - IIMAGEBUFFER = 451, - UIMAGEBUFFER = 452, - IMAGE1DARRAYSHADOW = 453, - IMAGE2DARRAYSHADOW = 454, - ROW_MAJOR = 455 + SAMPLERCUBEARRAY = 316, + SAMPLERCUBEARRAYSHADOW = 317, + ISAMPLER1D = 318, + ISAMPLER2D = 319, + ISAMPLER3D = 320, + ISAMPLERCUBE = 321, + ISAMPLER1DARRAY = 322, + ISAMPLER2DARRAY = 323, + ISAMPLERCUBEARRAY = 324, + USAMPLER1D = 325, + USAMPLER2D = 326, + USAMPLER3D = 327, + USAMPLERCUBE = 328, + USAMPLER1DARRAY = 329, + USAMPLER2DARRAY = 330, + USAMPLERCUBEARRAY = 331, + SAMPLER2DRECT = 332, + ISAMPLER2DRECT = 333, + USAMPLER2DRECT = 334, + SAMPLER2DRECTSHADOW = 335, + SAMPLERBUFFER = 336, + ISAMPLERBUFFER = 337, + USAMPLERBUFFER = 338, + SAMPLER2DMS = 339, + ISAMPLER2DMS = 340, + USAMPLER2DMS = 341, + SAMPLER2DMSARRAY = 342, + ISAMPLER2DMSARRAY = 343, + USAMPLER2DMSARRAY = 344, + SAMPLEREXTERNALOES = 345, + ATOMIC_UINT = 346, + STRUCT = 347, + VOID_TOK = 348, + WHILE = 349, + IDENTIFIER = 350, + TYPE_IDENTIFIER = 351, + NEW_IDENTIFIER = 352, + FLOATCONSTANT = 353, + INTCONSTANT = 354, + UINTCONSTANT = 355, + BOOLCONSTANT = 356, + FIELD_SELECTION = 357, + LEFT_OP = 358, + RIGHT_OP = 359, + INC_OP = 360, + DEC_OP = 361, + LE_OP = 362, + GE_OP = 363, + EQ_OP = 364, + NE_OP = 365, + AND_OP = 366, + OR_OP = 367, + XOR_OP = 368, + MUL_ASSIGN = 369, + DIV_ASSIGN = 370, + ADD_ASSIGN = 371, + MOD_ASSIGN = 372, + LEFT_ASSIGN = 373, + RIGHT_ASSIGN = 374, + AND_ASSIGN = 375, + XOR_ASSIGN = 376, + OR_ASSIGN = 377, + SUB_ASSIGN = 378, + INVARIANT = 379, + LOWP = 380, + MEDIUMP = 381, + HIGHP = 382, + SUPERP = 383, + PRECISION = 384, + VERSION_TOK = 385, + EXTENSION = 386, + LINE = 387, + COLON = 388, + EOL = 389, + INTERFACE = 390, + OUTPUT = 391, + PRAGMA_DEBUG_ON = 392, + PRAGMA_DEBUG_OFF = 393, + PRAGMA_OPTIMIZE_ON = 394, + PRAGMA_OPTIMIZE_OFF = 395, + PRAGMA_INVARIANT_ALL = 396, + LAYOUT_TOK = 397, + ASM = 398, + CLASS = 399, + UNION = 400, + ENUM = 401, + TYPEDEF = 402, + TEMPLATE = 403, + THIS = 404, + PACKED_TOK = 405, + GOTO = 406, + INLINE_TOK = 407, + NOINLINE = 408, + VOLATILE = 409, + PUBLIC_TOK = 410, + STATIC = 411, + EXTERN = 412, + EXTERNAL = 413, + LONG_TOK = 414, + SHORT_TOK = 415, + DOUBLE_TOK = 416, + HALF = 417, + FIXED_TOK = 418, + UNSIGNED = 419, + INPUT_TOK = 420, + OUPTUT = 421, + HVEC2 = 422, + HVEC3 = 423, + HVEC4 = 424, + DVEC2 = 425, + DVEC3 = 426, + DVEC4 = 427, + FVEC2 = 428, + FVEC3 = 429, + FVEC4 = 430, + SAMPLER3DRECT = 431, + SIZEOF = 432, + CAST = 433, + NAMESPACE = 434, + USING = 435, + COHERENT = 436, + RESTRICT = 437, + READONLY = 438, + WRITEONLY = 439, + RESOURCE = 440, + PATCH = 441, + SAMPLE = 442, + SUBROUTINE = 443, + ERROR_TOK = 444, + COMMON = 445, + PARTITION = 446, + ACTIVE = 447, + FILTER = 448, + IMAGE1D = 449, + IMAGE2D = 450, + IMAGE3D = 451, + IMAGECUBE = 452, + IMAGE1DARRAY = 453, + IMAGE2DARRAY = 454, + IIMAGE1D = 455, + IIMAGE2D = 456, + IIMAGE3D = 457, + IIMAGECUBE = 458, + IIMAGE1DARRAY = 459, + IIMAGE2DARRAY = 460, + UIMAGE1D = 461, + UIMAGE2D = 462, + UIMAGE3D = 463, + UIMAGECUBE = 464, + UIMAGE1DARRAY = 465, + UIMAGE2DARRAY = 466, + IMAGE1DSHADOW = 467, + IMAGE2DSHADOW = 468, + IMAGEBUFFER = 469, + IIMAGEBUFFER = 470, + UIMAGEBUFFER = 471, + IMAGE1DARRAYSHADOW = 472, + IMAGE2DARRAYSHADOW = 473, + ROW_MAJOR = 474, + THEN = 475 }; #endif +/* Tokens. */ +#define ATTRIBUTE 258 +#define CONST_TOK 259 +#define BOOL_TOK 260 +#define FLOAT_TOK 261 +#define INT_TOK 262 +#define UINT_TOK 263 +#define BREAK 264 +#define CONTINUE 265 +#define DO 266 +#define ELSE 267 +#define FOR 268 +#define IF 269 +#define DISCARD 270 +#define RETURN 271 +#define SWITCH 272 +#define CASE 273 +#define DEFAULT 274 +#define BVEC2 275 +#define BVEC3 276 +#define BVEC4 277 +#define IVEC2 278 +#define IVEC3 279 +#define IVEC4 280 +#define UVEC2 281 +#define UVEC3 282 +#define UVEC4 283 +#define VEC2 284 +#define VEC3 285 +#define VEC4 286 +#define CENTROID 287 +#define IN_TOK 288 +#define OUT_TOK 289 +#define INOUT_TOK 290 +#define UNIFORM 291 +#define VARYING 292 +#define NOPERSPECTIVE 293 +#define FLAT 294 +#define SMOOTH 295 +#define MAT2X2 296 +#define MAT2X3 297 +#define MAT2X4 298 +#define MAT3X2 299 +#define MAT3X3 300 +#define MAT3X4 301 +#define MAT4X2 302 +#define MAT4X3 303 +#define MAT4X4 304 +#define SAMPLER1D 305 +#define SAMPLER2D 306 +#define SAMPLER3D 307 +#define SAMPLERCUBE 308 +#define SAMPLER1DSHADOW 309 +#define SAMPLER2DSHADOW 310 +#define SAMPLERCUBESHADOW 311 +#define SAMPLER1DARRAY 312 +#define SAMPLER2DARRAY 313 +#define SAMPLER1DARRAYSHADOW 314 +#define SAMPLER2DARRAYSHADOW 315 +#define SAMPLERCUBEARRAY 316 +#define SAMPLERCUBEARRAYSHADOW 317 +#define ISAMPLER1D 318 +#define ISAMPLER2D 319 +#define ISAMPLER3D 320 +#define ISAMPLERCUBE 321 +#define ISAMPLER1DARRAY 322 +#define ISAMPLER2DARRAY 323 +#define ISAMPLERCUBEARRAY 324 +#define USAMPLER1D 325 +#define USAMPLER2D 326 +#define USAMPLER3D 327 +#define USAMPLERCUBE 328 +#define USAMPLER1DARRAY 329 +#define USAMPLER2DARRAY 330 +#define USAMPLERCUBEARRAY 331 +#define SAMPLER2DRECT 332 +#define ISAMPLER2DRECT 333 +#define USAMPLER2DRECT 334 +#define SAMPLER2DRECTSHADOW 335 +#define SAMPLERBUFFER 336 +#define ISAMPLERBUFFER 337 +#define USAMPLERBUFFER 338 +#define SAMPLER2DMS 339 +#define ISAMPLER2DMS 340 +#define USAMPLER2DMS 341 +#define SAMPLER2DMSARRAY 342 +#define ISAMPLER2DMSARRAY 343 +#define USAMPLER2DMSARRAY 344 +#define SAMPLEREXTERNALOES 345 +#define ATOMIC_UINT 346 +#define STRUCT 347 +#define VOID_TOK 348 +#define WHILE 349 +#define IDENTIFIER 350 +#define TYPE_IDENTIFIER 351 +#define NEW_IDENTIFIER 352 +#define FLOATCONSTANT 353 +#define INTCONSTANT 354 +#define UINTCONSTANT 355 +#define BOOLCONSTANT 356 +#define FIELD_SELECTION 357 +#define LEFT_OP 358 +#define RIGHT_OP 359 +#define INC_OP 360 +#define DEC_OP 361 +#define LE_OP 362 +#define GE_OP 363 +#define EQ_OP 364 +#define NE_OP 365 +#define AND_OP 366 +#define OR_OP 367 +#define XOR_OP 368 +#define MUL_ASSIGN 369 +#define DIV_ASSIGN 370 +#define ADD_ASSIGN 371 +#define MOD_ASSIGN 372 +#define LEFT_ASSIGN 373 +#define RIGHT_ASSIGN 374 +#define AND_ASSIGN 375 +#define XOR_ASSIGN 376 +#define OR_ASSIGN 377 +#define SUB_ASSIGN 378 +#define INVARIANT 379 +#define LOWP 380 +#define MEDIUMP 381 +#define HIGHP 382 +#define SUPERP 383 +#define PRECISION 384 +#define VERSION_TOK 385 +#define EXTENSION 386 +#define LINE 387 +#define COLON 388 +#define EOL 389 +#define INTERFACE 390 +#define OUTPUT 391 +#define PRAGMA_DEBUG_ON 392 +#define PRAGMA_DEBUG_OFF 393 +#define PRAGMA_OPTIMIZE_ON 394 +#define PRAGMA_OPTIMIZE_OFF 395 +#define PRAGMA_INVARIANT_ALL 396 +#define LAYOUT_TOK 397 +#define ASM 398 +#define CLASS 399 +#define UNION 400 +#define ENUM 401 +#define TYPEDEF 402 +#define TEMPLATE 403 +#define THIS 404 +#define PACKED_TOK 405 +#define GOTO 406 +#define INLINE_TOK 407 +#define NOINLINE 408 +#define VOLATILE 409 +#define PUBLIC_TOK 410 +#define STATIC 411 +#define EXTERN 412 +#define EXTERNAL 413 +#define LONG_TOK 414 +#define SHORT_TOK 415 +#define DOUBLE_TOK 416 +#define HALF 417 +#define FIXED_TOK 418 +#define UNSIGNED 419 +#define INPUT_TOK 420 +#define OUPTUT 421 +#define HVEC2 422 +#define HVEC3 423 +#define HVEC4 424 +#define DVEC2 425 +#define DVEC3 426 +#define DVEC4 427 +#define FVEC2 428 +#define FVEC3 429 +#define FVEC4 430 +#define SAMPLER3DRECT 431 +#define SIZEOF 432 +#define CAST 433 +#define NAMESPACE 434 +#define USING 435 +#define COHERENT 436 +#define RESTRICT 437 +#define READONLY 438 +#define WRITEONLY 439 +#define RESOURCE 440 +#define PATCH 441 +#define SAMPLE 442 +#define SUBROUTINE 443 +#define ERROR_TOK 444 +#define COMMON 445 +#define PARTITION 446 +#define ACTIVE 447 +#define FILTER 448 +#define IMAGE1D 449 +#define IMAGE2D 450 +#define IMAGE3D 451 +#define IMAGECUBE 452 +#define IMAGE1DARRAY 453 +#define IMAGE2DARRAY 454 +#define IIMAGE1D 455 +#define IIMAGE2D 456 +#define IIMAGE3D 457 +#define IIMAGECUBE 458 +#define IIMAGE1DARRAY 459 +#define IIMAGE2DARRAY 460 +#define UIMAGE1D 461 +#define UIMAGE2D 462 +#define UIMAGE3D 463 +#define UIMAGECUBE 464 +#define UIMAGE1DARRAY 465 +#define UIMAGE2DARRAY 466 +#define IMAGE1DSHADOW 467 +#define IMAGE2DSHADOW 468 +#define IMAGEBUFFER 469 +#define IIMAGEBUFFER 470 +#define UIMAGEBUFFER 471 +#define IMAGE1DARRAYSHADOW 472 +#define IMAGE2DARRAYSHADOW 473 +#define ROW_MAJOR 474 +#define THEN 475 + +/* Copy the first part of user declarations. */ +#line 1 "src/glsl/glsl_parser.yy" + +/* + * Copyright © 2008, 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include +#include +#include +#include + +#include "ast.h" +#include "glsl_parser_extras.h" +#include "glsl_types.h" +#include "main/context.h" + +#if defined(_MSC_VER) +# pragma warning(disable: 4065) // warning C4065: switch statement contains 'default' but no 'case' labels +# pragma warning(disable: 4244) // warning C4244: '=' : conversion from 'double' to 'float', possible loss of data +#endif // defined(_MSC_VER) + +#undef yyerror + +static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) +{ + _mesa_glsl_error(loc, st, "%s", msg); +} + +static int +_mesa_glsl_lex(YYSTYPE *val, YYLTYPE *loc, _mesa_glsl_parse_state *state) +{ + return _mesa_glsl_lexer_lex(val, loc, state->scanner); +} + +static bool match_layout_qualifier(const char *s1, const char *s2, + _mesa_glsl_parse_state *state) +{ + /* From the GLSL 1.50 spec, section 4.3.8 (Layout Qualifiers): + * + * "The tokens in any layout-qualifier-id-list ... are not case + * sensitive, unless explicitly noted otherwise." + * + * The text "unless explicitly noted otherwise" appears to be + * vacuous--no desktop GLSL spec (up through GLSL 4.40) notes + * otherwise. + * + * However, the GLSL ES 3.00 spec says, in section 4.3.8 (Layout + * Qualifiers): + * + * "As for other identifiers, they are case sensitive." + * + * So we need to do a case-sensitive or a case-insensitive match, + * depending on whether we are compiling for GLSL ES. + */ + if (state->es_shader) + return strcmp(s1, s2); + else + return strcasecmp(s1, s2); +} + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE +#line 96 "src/glsl/glsl_parser.yy" { - -/* Line 293 of yacc.c */ -#line 64 "src/glsl/glsl_parser.yy" - int n; float real; const char *identifier; @@ -369,6 +627,7 @@ typedef union YYSTYPE ast_node *node; ast_type_specifier *type_specifier; + ast_array_specifier *array_specifier; ast_fully_specified_type *fully_specified_type; ast_function *function; ast_parameter_declarator *parameter_declarator; @@ -383,6 +642,7 @@ typedef union YYSTYPE ast_case_label_list *case_label_list; ast_case_statement *case_statement; ast_case_statement_list *case_statement_list; + ast_interface_block *interface_block; struct { ast_node *cond; @@ -393,15 +653,13 @@ typedef union YYSTYPE ast_node *then_statement; ast_node *else_statement; } selection_rest_statement; - - - -/* Line 293 of yacc.c */ -#line 401 "src/glsl/glsl_parser.cpp" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 193 of yacc.c. */ +#line 659 "src/glsl/glsl_parser.cpp" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED @@ -421,8 +679,8 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 426 "src/glsl/glsl_parser.cpp" +/* Line 216 of yacc.c. */ +#line 684 "src/glsl/glsl_parser.cpp" #ifdef short # undef short @@ -497,14 +755,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -525,11 +783,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -552,24 +810,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -586,9 +844,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; + yytype_int16 yyss; + YYSTYPE yyvs; + YYLTYPE yyls; }; /* The size of the maximum gap between one aligned stack and the next. */ @@ -600,27 +858,6 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY @@ -638,25 +875,42 @@ union yyalloc while (YYID (0)) # endif # endif -#endif /* !YYCOPY_NEEDED */ + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3101 +#define YYLAST 4108 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 225 +#define YYNTOKENS 245 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 103 +#define YYNNTS 108 /* YYNRULES -- Number of rules. */ -#define YYNRULES 318 +#define YYNRULES 342 /* YYNRULES -- Number of states. */ -#define YYNSTATES 483 +#define YYNSTATES 494 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 455 +#define YYMAXUTOK 475 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -667,16 +921,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 209, 2, 2, 2, 213, 216, 2, - 201, 202, 211, 207, 206, 208, 205, 212, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 220, 222, - 214, 221, 215, 219, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 229, 2, 2, 2, 233, 236, 2, + 221, 222, 231, 227, 226, 228, 225, 232, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 240, 242, + 234, 241, 235, 239, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 203, 2, 204, 217, 2, 2, 2, 2, 2, + 2, 223, 2, 224, 237, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 223, 218, 224, 210, 2, 2, 2, + 2, 2, 2, 243, 238, 244, 230, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -709,7 +963,9 @@ static const yytype_uint8 yytranslate[] = 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200 + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220 }; #if YYDEBUG @@ -717,171 +973,180 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 4, 9, 10, 14, 17, 20, 23, - 26, 29, 30, 33, 35, 37, 39, 45, 47, 50, - 52, 54, 56, 58, 60, 62, 64, 68, 70, 75, - 77, 81, 84, 87, 89, 91, 93, 97, 100, 103, - 106, 108, 111, 115, 118, 120, 122, 124, 127, 130, - 133, 135, 138, 142, 145, 147, 150, 153, 156, 158, - 160, 162, 164, 166, 170, 174, 178, 180, 184, 188, - 190, 194, 198, 200, 204, 208, 212, 216, 218, 222, - 226, 228, 232, 234, 238, 240, 244, 246, 250, 252, - 256, 258, 262, 264, 270, 272, 276, 278, 280, 282, - 284, 286, 288, 290, 292, 294, 296, 298, 300, 304, - 306, 309, 312, 317, 319, 322, 324, 326, 329, 333, - 337, 340, 346, 350, 353, 357, 360, 361, 363, 365, - 367, 369, 371, 375, 381, 388, 396, 405, 411, 413, - 416, 421, 427, 434, 442, 447, 450, 452, 455, 460, - 462, 466, 468, 472, 474, 476, 478, 480, 482, 484, - 486, 488, 490, 493, 495, 498, 501, 505, 507, 509, - 511, 513, 516, 518, 520, 523, 526, 528, 530, 533, - 535, 539, 544, 546, 548, 550, 552, 554, 556, 558, - 560, 562, 564, 566, 568, 570, 572, 574, 576, 578, - 580, 582, 584, 586, 588, 590, 592, 594, 596, 598, - 600, 602, 604, 606, 608, 610, 612, 614, 616, 618, - 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, - 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, - 660, 662, 664, 666, 668, 670, 676, 681, 683, 686, - 690, 692, 696, 698, 703, 705, 707, 709, 711, 713, - 715, 717, 719, 721, 723, 726, 727, 732, 734, 736, - 739, 743, 745, 748, 750, 753, 759, 763, 765, 767, - 772, 778, 781, 785, 789, 792, 794, 797, 800, 803, - 805, 808, 814, 822, 829, 831, 833, 835, 836, 839, - 843, 846, 849, 852, 856, 859, 861, 863, 865, 867, - 870, 877, 885, 887, 890, 891, 893, 899, 904 + 0, 0, 3, 4, 9, 10, 14, 19, 22, 25, + 28, 31, 34, 35, 38, 40, 42, 44, 50, 52, + 55, 57, 59, 61, 63, 65, 67, 69, 73, 75, + 80, 82, 86, 89, 92, 94, 96, 98, 102, 105, + 108, 111, 113, 116, 120, 123, 125, 127, 129, 132, + 135, 138, 140, 143, 147, 150, 152, 155, 158, 161, + 163, 165, 167, 169, 171, 175, 179, 183, 185, 189, + 193, 195, 199, 203, 205, 209, 213, 217, 221, 223, + 227, 231, 233, 237, 239, 243, 245, 249, 251, 255, + 257, 261, 263, 267, 269, 275, 277, 281, 283, 285, + 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, + 309, 311, 314, 317, 322, 324, 327, 329, 331, 334, + 338, 342, 345, 349, 352, 355, 356, 359, 362, 365, + 367, 369, 371, 373, 375, 379, 384, 391, 397, 399, + 402, 406, 412, 417, 420, 422, 425, 430, 432, 436, + 438, 440, 442, 446, 448, 450, 452, 454, 456, 458, + 460, 462, 464, 466, 468, 470, 473, 476, 479, 482, + 485, 488, 490, 492, 494, 496, 498, 500, 502, 504, + 507, 511, 515, 520, 522, 525, 527, 529, 531, 533, + 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, + 555, 557, 559, 561, 563, 565, 567, 569, 571, 573, + 575, 577, 579, 581, 583, 585, 587, 589, 591, 593, + 595, 597, 599, 601, 603, 605, 607, 609, 611, 613, + 615, 617, 619, 621, 623, 625, 627, 629, 631, 633, + 635, 637, 639, 641, 643, 645, 647, 649, 651, 653, + 655, 657, 659, 661, 663, 665, 667, 669, 671, 673, + 679, 684, 686, 689, 693, 695, 699, 701, 704, 706, + 710, 715, 717, 721, 723, 725, 727, 729, 731, 733, + 735, 737, 739, 742, 743, 748, 750, 752, 755, 759, + 761, 764, 766, 769, 775, 779, 781, 783, 788, 794, + 797, 801, 805, 808, 810, 813, 816, 819, 821, 824, + 830, 838, 845, 847, 849, 851, 852, 855, 859, 862, + 865, 868, 872, 875, 877, 879, 881, 883, 886, 888, + 891, 899, 901, 903, 905, 906, 908, 911, 913, 916, + 920, 924, 928 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 226, 0, -1, -1, 228, 230, 227, 233, -1, -1, - 119, 88, 123, -1, 126, 123, -1, 127, 123, -1, - 128, 123, -1, 129, 123, -1, 130, 123, -1, -1, - 230, 232, -1, 84, -1, 85, -1, 86, -1, 120, - 231, 122, 231, 123, -1, 321, -1, 233, 321, -1, - 84, -1, 86, -1, 234, -1, 88, -1, 89, -1, - 87, -1, 90, -1, 201, 265, 202, -1, 235, -1, - 236, 203, 237, 204, -1, 238, -1, 236, 205, 231, - -1, 236, 94, -1, 236, 95, -1, 265, -1, 239, - -1, 240, -1, 236, 205, 245, -1, 242, 202, -1, - 241, 202, -1, 243, 82, -1, 243, -1, 243, 263, - -1, 242, 206, 263, -1, 244, 201, -1, 287, -1, - 234, -1, 91, -1, 247, 202, -1, 246, 202, -1, - 248, 82, -1, 248, -1, 248, 263, -1, 247, 206, - 263, -1, 234, 201, -1, 236, -1, 94, 249, -1, - 95, 249, -1, 250, 249, -1, 207, -1, 208, -1, - 209, -1, 210, -1, 249, -1, 251, 211, 249, -1, - 251, 212, 249, -1, 251, 213, 249, -1, 251, -1, - 252, 207, 251, -1, 252, 208, 251, -1, 252, -1, - 253, 92, 252, -1, 253, 93, 252, -1, 253, -1, - 254, 214, 253, -1, 254, 215, 253, -1, 254, 96, - 253, -1, 254, 97, 253, -1, 254, -1, 255, 98, - 254, -1, 255, 99, 254, -1, 255, -1, 256, 216, - 255, -1, 256, -1, 257, 217, 256, -1, 257, -1, - 258, 218, 257, -1, 258, -1, 259, 100, 258, -1, - 259, -1, 260, 102, 259, -1, 260, -1, 261, 101, - 260, -1, 261, -1, 261, 219, 265, 220, 263, -1, - 262, -1, 249, 264, 263, -1, 221, -1, 103, -1, - 104, -1, 106, -1, 105, -1, 112, -1, 107, -1, - 108, -1, 109, -1, 110, -1, 111, -1, 263, -1, - 265, 206, 263, -1, 262, -1, 268, 222, -1, 276, - 222, -1, 118, 291, 288, 222, -1, 323, -1, 269, - 202, -1, 271, -1, 270, -1, 271, 273, -1, 270, - 206, 273, -1, 278, 234, 201, -1, 287, 231, -1, - 287, 231, 203, 266, 204, -1, 284, 274, 272, -1, - 274, 272, -1, 284, 274, 275, -1, 274, 275, -1, - -1, 33, -1, 34, -1, 35, -1, 287, -1, 277, - -1, 276, 206, 231, -1, 276, 206, 231, 203, 204, - -1, 276, 206, 231, 203, 266, 204, -1, 276, 206, - 231, 203, 204, 221, 297, -1, 276, 206, 231, 203, - 266, 204, 221, 297, -1, 276, 206, 231, 221, 297, - -1, 278, -1, 278, 231, -1, 278, 231, 203, 204, - -1, 278, 231, 203, 266, 204, -1, 278, 231, 203, - 204, 221, 297, -1, 278, 231, 203, 266, 204, 221, - 297, -1, 278, 231, 221, 297, -1, 113, 234, -1, - 287, -1, 285, 287, -1, 131, 201, 280, 202, -1, - 281, -1, 280, 206, 281, -1, 231, -1, 231, 221, - 88, -1, 282, -1, 200, -1, 139, -1, 40, -1, - 39, -1, 38, -1, 4, -1, 286, -1, 279, -1, - 279, 286, -1, 283, -1, 283, 286, -1, 113, 286, - -1, 113, 283, 286, -1, 113, -1, 4, -1, 3, - -1, 37, -1, 32, 37, -1, 33, -1, 34, -1, - 32, 33, -1, 32, 34, -1, 36, -1, 288, -1, - 291, 288, -1, 289, -1, 289, 203, 204, -1, 289, - 203, 266, 204, -1, 290, -1, 292, -1, 85, -1, - 82, -1, 6, -1, 7, -1, 8, -1, 5, -1, - 29, -1, 30, -1, 31, -1, 20, -1, 21, -1, - 22, -1, 23, -1, 24, -1, 25, -1, 26, -1, - 27, -1, 28, -1, 41, -1, 42, -1, 43, -1, - 44, -1, 45, -1, 46, -1, 47, -1, 48, -1, - 49, -1, 50, -1, 51, -1, 73, -1, 52, -1, - 53, -1, 80, -1, 54, -1, 55, -1, 76, -1, - 56, -1, 57, -1, 58, -1, 59, -1, 60, -1, - 77, -1, 61, -1, 62, -1, 74, -1, 63, -1, - 64, -1, 65, -1, 66, -1, 78, -1, 67, -1, - 68, -1, 75, -1, 69, -1, 70, -1, 71, -1, - 72, -1, 79, -1, 116, -1, 115, -1, 114, -1, - 81, 231, 223, 293, 224, -1, 81, 223, 293, 224, - -1, 294, -1, 293, 294, -1, 287, 295, 222, -1, - 296, -1, 295, 206, 296, -1, 231, -1, 231, 203, - 266, 204, -1, 263, -1, 267, -1, 301, -1, 300, - -1, 298, -1, 306, -1, 307, -1, 310, -1, 316, - -1, 320, -1, 223, 224, -1, -1, 223, 302, 305, - 224, -1, 304, -1, 300, -1, 223, 224, -1, 223, - 305, 224, -1, 299, -1, 305, 299, -1, 222, -1, - 265, 222, -1, 14, 201, 265, 202, 308, -1, 299, - 12, 299, -1, 299, -1, 265, -1, 278, 231, 221, - 297, -1, 17, 201, 265, 202, 311, -1, 223, 224, - -1, 223, 315, 224, -1, 18, 265, 220, -1, 19, - 220, -1, 312, -1, 313, 312, -1, 313, 299, -1, - 314, 299, -1, 314, -1, 315, 314, -1, 83, 201, - 309, 202, 303, -1, 11, 299, 83, 201, 265, 202, - 222, -1, 13, 201, 317, 319, 202, 303, -1, 306, - -1, 298, -1, 309, -1, -1, 318, 222, -1, 318, - 222, 265, -1, 10, 222, -1, 9, 222, -1, 16, - 222, -1, 16, 265, 222, -1, 15, 222, -1, 322, - -1, 267, -1, 229, -1, 327, -1, 268, 304, -1, - 36, 86, 223, 324, 224, 222, -1, 279, 36, 86, - 223, 324, 224, 222, -1, 326, -1, 326, 324, -1, - -1, 36, -1, 279, 325, 287, 295, 222, -1, 325, - 287, 295, 222, -1, 279, 36, 222, -1 + 246, 0, -1, -1, 248, 250, 247, 253, -1, -1, + 130, 99, 134, -1, 130, 99, 251, 134, -1, 137, + 134, -1, 138, 134, -1, 139, 134, -1, 140, 134, + -1, 141, 134, -1, -1, 250, 252, -1, 95, -1, + 96, -1, 97, -1, 131, 251, 133, 251, 134, -1, + 344, -1, 253, 344, -1, 95, -1, 97, -1, 254, + -1, 99, -1, 100, -1, 98, -1, 101, -1, 221, + 285, 222, -1, 255, -1, 256, 223, 257, 224, -1, + 258, -1, 256, 225, 251, -1, 256, 105, -1, 256, + 106, -1, 285, -1, 259, -1, 260, -1, 256, 225, + 265, -1, 262, 222, -1, 261, 222, -1, 263, 93, + -1, 263, -1, 263, 283, -1, 262, 226, 283, -1, + 264, 221, -1, 310, -1, 254, -1, 102, -1, 267, + 222, -1, 266, 222, -1, 268, 93, -1, 268, -1, + 268, 283, -1, 267, 226, 283, -1, 254, 221, -1, + 256, -1, 105, 269, -1, 106, 269, -1, 270, 269, + -1, 227, -1, 228, -1, 229, -1, 230, -1, 269, + -1, 271, 231, 269, -1, 271, 232, 269, -1, 271, + 233, 269, -1, 271, -1, 272, 227, 271, -1, 272, + 228, 271, -1, 272, -1, 273, 103, 272, -1, 273, + 104, 272, -1, 273, -1, 274, 234, 273, -1, 274, + 235, 273, -1, 274, 107, 273, -1, 274, 108, 273, + -1, 274, -1, 275, 109, 274, -1, 275, 110, 274, + -1, 275, -1, 276, 236, 275, -1, 276, -1, 277, + 237, 276, -1, 277, -1, 278, 238, 277, -1, 278, + -1, 279, 111, 278, -1, 279, -1, 280, 113, 279, + -1, 280, -1, 281, 112, 280, -1, 281, -1, 281, + 239, 285, 240, 283, -1, 282, -1, 269, 284, 283, + -1, 241, -1, 114, -1, 115, -1, 117, -1, 116, + -1, 123, -1, 118, -1, 119, -1, 120, -1, 121, + -1, 122, -1, 283, -1, 285, 226, 283, -1, 282, + -1, 288, 242, -1, 297, 242, -1, 129, 313, 310, + 242, -1, 346, -1, 289, 222, -1, 291, -1, 290, + -1, 291, 293, -1, 290, 226, 293, -1, 299, 254, + 221, -1, 310, 251, -1, 310, 251, 309, -1, 294, + 292, -1, 294, 296, -1, -1, 4, 294, -1, 295, + 294, -1, 313, 294, -1, 33, -1, 34, -1, 35, + -1, 310, -1, 298, -1, 297, 226, 251, -1, 297, + 226, 251, 309, -1, 297, 226, 251, 309, 241, 319, + -1, 297, 226, 251, 241, 319, -1, 299, -1, 299, + 251, -1, 299, 251, 309, -1, 299, 251, 309, 241, + 319, -1, 299, 251, 241, 319, -1, 124, 254, -1, + 310, -1, 306, 310, -1, 142, 221, 301, 222, -1, + 303, -1, 301, 226, 303, -1, 99, -1, 100, -1, + 251, -1, 251, 241, 302, -1, 304, -1, 219, -1, + 150, -1, 40, -1, 39, -1, 38, -1, 124, -1, + 307, -1, 308, -1, 305, -1, 300, -1, 313, -1, + 124, 306, -1, 305, 306, -1, 300, 306, -1, 307, + 306, -1, 308, 306, -1, 313, 306, -1, 32, -1, + 187, -1, 4, -1, 3, -1, 37, -1, 33, -1, + 34, -1, 36, -1, 223, 224, -1, 223, 286, 224, + -1, 309, 223, 224, -1, 309, 223, 286, 224, -1, + 311, -1, 311, 309, -1, 312, -1, 314, -1, 96, + -1, 93, -1, 6, -1, 7, -1, 8, -1, 5, + -1, 29, -1, 30, -1, 31, -1, 20, -1, 21, + -1, 22, -1, 23, -1, 24, -1, 25, -1, 26, + -1, 27, -1, 28, -1, 41, -1, 42, -1, 43, + -1, 44, -1, 45, -1, 46, -1, 47, -1, 48, + -1, 49, -1, 50, -1, 51, -1, 77, -1, 52, + -1, 53, -1, 90, -1, 54, -1, 55, -1, 80, + -1, 56, -1, 57, -1, 58, -1, 59, -1, 60, + -1, 81, -1, 61, -1, 62, -1, 63, -1, 64, + -1, 78, -1, 65, -1, 66, -1, 67, -1, 68, + -1, 82, -1, 69, -1, 70, -1, 71, -1, 79, + -1, 72, -1, 73, -1, 74, -1, 75, -1, 83, + -1, 76, -1, 84, -1, 85, -1, 86, -1, 87, + -1, 88, -1, 89, -1, 91, -1, 127, -1, 126, + -1, 125, -1, 92, 251, 243, 315, 244, -1, 92, + 243, 315, 244, -1, 316, -1, 315, 316, -1, 299, + 317, 242, -1, 318, -1, 317, 226, 318, -1, 251, + -1, 251, 309, -1, 283, -1, 243, 320, 244, -1, + 243, 320, 226, 244, -1, 319, -1, 320, 226, 319, + -1, 287, -1, 324, -1, 323, -1, 321, -1, 329, + -1, 330, -1, 333, -1, 339, -1, 343, -1, 243, + 244, -1, -1, 243, 325, 328, 244, -1, 327, -1, + 323, -1, 243, 244, -1, 243, 328, 244, -1, 322, + -1, 328, 322, -1, 242, -1, 285, 242, -1, 14, + 221, 285, 222, 331, -1, 322, 12, 322, -1, 322, + -1, 285, -1, 299, 251, 241, 319, -1, 17, 221, + 285, 222, 334, -1, 243, 244, -1, 243, 338, 244, + -1, 18, 285, 240, -1, 19, 240, -1, 335, -1, + 336, 335, -1, 336, 322, -1, 337, 322, -1, 337, + -1, 338, 337, -1, 94, 221, 332, 222, 326, -1, + 11, 322, 94, 221, 285, 222, 242, -1, 13, 221, + 340, 342, 222, 326, -1, 329, -1, 321, -1, 332, + -1, -1, 341, 242, -1, 341, 242, 285, -1, 10, + 242, -1, 9, 242, -1, 16, 242, -1, 16, 285, + 242, -1, 15, 242, -1, 345, -1, 287, -1, 249, + -1, 352, -1, 288, 327, -1, 347, -1, 300, 347, + -1, 348, 97, 243, 350, 244, 349, 242, -1, 33, + -1, 34, -1, 36, -1, -1, 97, -1, 97, 309, + -1, 351, -1, 351, 350, -1, 299, 317, 242, -1, + 300, 36, 242, -1, 300, 33, 242, -1, 300, 34, + 242, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 248, 248, 247, 259, 261, 314, 315, 316, 317, - 318, 330, 332, 336, 337, 338, 342, 351, 359, 370, - 371, 375, 382, 389, 396, 403, 410, 417, 418, 424, - 428, 435, 441, 450, 454, 458, 459, 468, 469, 473, - 474, 478, 484, 496, 500, 506, 513, 523, 524, 528, - 529, 533, 539, 551, 562, 563, 569, 575, 585, 586, - 587, 588, 592, 593, 599, 605, 614, 615, 621, 630, - 631, 637, 646, 647, 653, 659, 665, 674, 675, 681, - 690, 691, 700, 701, 710, 711, 720, 721, 730, 731, - 740, 741, 750, 751, 760, 761, 770, 771, 772, 773, - 774, 775, 776, 777, 778, 779, 780, 784, 788, 804, - 808, 813, 817, 823, 830, 834, 835, 839, 844, 852, - 866, 876, 891, 898, 903, 914, 927, 930, 935, 940, - 949, 953, 954, 964, 974, 984, 994, 1004, 1018, 1025, - 1034, 1043, 1052, 1061, 1070, 1079, 1093, 1100, 1111, 1118, - 1119, 1129, 1197, 1243, 1265, 1270, 1278, 1283, 1288, 1296, - 1304, 1305, 1306, 1311, 1312, 1317, 1322, 1328, 1336, 1341, - 1346, 1351, 1357, 1362, 1367, 1372, 1377, 1385, 1389, 1397, - 1398, 1404, 1413, 1419, 1425, 1434, 1435, 1436, 1437, 1438, - 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, - 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, - 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, - 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, - 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, - 1489, 1490, 1494, 1504, 1514, 1527, 1534, 1543, 1548, 1556, - 1571, 1576, 1584, 1591, 1600, 1604, 1610, 1611, 1615, 1616, - 1617, 1618, 1619, 1620, 1624, 1631, 1630, 1644, 1645, 1649, - 1655, 1664, 1674, 1686, 1692, 1701, 1710, 1715, 1723, 1727, - 1745, 1753, 1758, 1766, 1771, 1779, 1787, 1795, 1803, 1811, - 1819, 1827, 1834, 1841, 1851, 1852, 1856, 1858, 1864, 1869, - 1878, 1884, 1890, 1896, 1902, 1911, 1912, 1913, 1914, 1918, - 1932, 1948, 1971, 1976, 1984, 1986, 1990, 2005, 2022 + 0, 298, 298, 297, 309, 311, 318, 328, 329, 330, + 331, 332, 345, 347, 351, 352, 353, 357, 366, 374, + 385, 386, 390, 397, 404, 411, 418, 425, 432, 433, + 439, 443, 450, 456, 465, 469, 473, 474, 483, 484, + 488, 489, 493, 499, 511, 515, 521, 528, 538, 539, + 543, 544, 548, 554, 566, 577, 578, 584, 590, 600, + 601, 602, 603, 607, 608, 614, 620, 629, 630, 636, + 645, 646, 652, 661, 662, 668, 674, 680, 689, 690, + 696, 705, 706, 715, 716, 725, 726, 735, 736, 745, + 746, 755, 756, 765, 766, 775, 776, 785, 786, 787, + 788, 789, 790, 791, 792, 793, 794, 795, 799, 803, + 819, 823, 828, 832, 837, 844, 848, 849, 853, 858, + 866, 880, 890, 904, 909, 922, 926, 934, 946, 959, + 965, 971, 981, 986, 987, 997, 1007, 1017, 1031, 1038, + 1047, 1056, 1065, 1074, 1088, 1095, 1106, 1113, 1114, 1124, + 1125, 1129, 1249, 1319, 1345, 1351, 1360, 1366, 1372, 1382, + 1388, 1389, 1390, 1391, 1392, 1411, 1424, 1452, 1475, 1490, + 1510, 1524, 1530, 1538, 1544, 1550, 1556, 1562, 1568, 1577, + 1582, 1587, 1601, 1616, 1617, 1625, 1631, 1637, 1646, 1647, + 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, + 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, + 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, + 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, + 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, + 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 1707, + 1708, 1709, 1710, 1711, 1712, 1713, 1717, 1722, 1727, 1735, + 1743, 1752, 1757, 1765, 1784, 1789, 1797, 1803, 1812, 1813, + 1817, 1824, 1831, 1838, 1844, 1845, 1849, 1850, 1851, 1852, + 1853, 1854, 1858, 1865, 1864, 1878, 1879, 1883, 1889, 1898, + 1908, 1920, 1926, 1935, 1944, 1949, 1957, 1961, 1979, 1987, + 1992, 2000, 2005, 2013, 2021, 2029, 2037, 2045, 2053, 2061, + 2068, 2075, 2085, 2086, 2090, 2092, 2098, 2103, 2112, 2118, + 2124, 2130, 2136, 2145, 2146, 2147, 2148, 2152, 2166, 2170, + 2181, 2278, 2284, 2290, 2300, 2304, 2309, 2317, 2322, 2330, + 2354, 2362, 2392 }; #endif @@ -900,39 +1165,44 @@ static const char *const yytname[] = "MAT4X4", "SAMPLER1D", "SAMPLER2D", "SAMPLER3D", "SAMPLERCUBE", "SAMPLER1DSHADOW", "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER1DARRAY", "SAMPLER2DARRAY", "SAMPLER1DARRAYSHADOW", - "SAMPLER2DARRAYSHADOW", "ISAMPLER1D", "ISAMPLER2D", "ISAMPLER3D", - "ISAMPLERCUBE", "ISAMPLER1DARRAY", "ISAMPLER2DARRAY", "USAMPLER1D", + "SAMPLER2DARRAYSHADOW", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", + "ISAMPLER1D", "ISAMPLER2D", "ISAMPLER3D", "ISAMPLERCUBE", + "ISAMPLER1DARRAY", "ISAMPLER2DARRAY", "ISAMPLERCUBEARRAY", "USAMPLER1D", "USAMPLER2D", "USAMPLER3D", "USAMPLERCUBE", "USAMPLER1DARRAY", - "USAMPLER2DARRAY", "SAMPLER2DRECT", "ISAMPLER2DRECT", "USAMPLER2DRECT", - "SAMPLER2DRECTSHADOW", "SAMPLERBUFFER", "ISAMPLERBUFFER", - "USAMPLERBUFFER", "SAMPLEREXTERNALOES", "STRUCT", "VOID_TOK", "WHILE", - "IDENTIFIER", "TYPE_IDENTIFIER", "NEW_IDENTIFIER", "FLOATCONSTANT", - "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", - "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", - "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", - "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", - "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", "LOWP", "MEDIUMP", - "HIGHP", "SUPERP", "PRECISION", "VERSION_TOK", "EXTENSION", "LINE", - "COLON", "EOL", "INTERFACE", "OUTPUT", "PRAGMA_DEBUG_ON", - "PRAGMA_DEBUG_OFF", "PRAGMA_OPTIMIZE_ON", "PRAGMA_OPTIMIZE_OFF", - "PRAGMA_INVARIANT_ALL", "LAYOUT_TOK", "ASM", "CLASS", "UNION", "ENUM", - "TYPEDEF", "TEMPLATE", "THIS", "PACKED_TOK", "GOTO", "INLINE_TOK", - "NOINLINE", "VOLATILE", "PUBLIC_TOK", "STATIC", "EXTERN", "EXTERNAL", - "LONG_TOK", "SHORT_TOK", "DOUBLE_TOK", "HALF", "FIXED_TOK", "UNSIGNED", - "INPUT_TOK", "OUPTUT", "HVEC2", "HVEC3", "HVEC4", "DVEC2", "DVEC3", - "DVEC4", "FVEC2", "FVEC3", "FVEC4", "SAMPLER3DRECT", "SIZEOF", "CAST", - "NAMESPACE", "USING", "ERROR_TOK", "COMMON", "PARTITION", "ACTIVE", - "FILTER", "IMAGE1D", "IMAGE2D", "IMAGE3D", "IMAGECUBE", "IMAGE1DARRAY", + "USAMPLER2DARRAY", "USAMPLERCUBEARRAY", "SAMPLER2DRECT", + "ISAMPLER2DRECT", "USAMPLER2DRECT", "SAMPLER2DRECTSHADOW", + "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", "SAMPLER2DMS", + "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", + "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "ATOMIC_UINT", "STRUCT", + "VOID_TOK", "WHILE", "IDENTIFIER", "TYPE_IDENTIFIER", "NEW_IDENTIFIER", + "FLOATCONSTANT", "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", + "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", + "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", + "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", + "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "INVARIANT", + "LOWP", "MEDIUMP", "HIGHP", "SUPERP", "PRECISION", "VERSION_TOK", + "EXTENSION", "LINE", "COLON", "EOL", "INTERFACE", "OUTPUT", + "PRAGMA_DEBUG_ON", "PRAGMA_DEBUG_OFF", "PRAGMA_OPTIMIZE_ON", + "PRAGMA_OPTIMIZE_OFF", "PRAGMA_INVARIANT_ALL", "LAYOUT_TOK", "ASM", + "CLASS", "UNION", "ENUM", "TYPEDEF", "TEMPLATE", "THIS", "PACKED_TOK", + "GOTO", "INLINE_TOK", "NOINLINE", "VOLATILE", "PUBLIC_TOK", "STATIC", + "EXTERN", "EXTERNAL", "LONG_TOK", "SHORT_TOK", "DOUBLE_TOK", "HALF", + "FIXED_TOK", "UNSIGNED", "INPUT_TOK", "OUPTUT", "HVEC2", "HVEC3", + "HVEC4", "DVEC2", "DVEC3", "DVEC4", "FVEC2", "FVEC3", "FVEC4", + "SAMPLER3DRECT", "SIZEOF", "CAST", "NAMESPACE", "USING", "COHERENT", + "RESTRICT", "READONLY", "WRITEONLY", "RESOURCE", "PATCH", "SAMPLE", + "SUBROUTINE", "ERROR_TOK", "COMMON", "PARTITION", "ACTIVE", "FILTER", + "IMAGE1D", "IMAGE2D", "IMAGE3D", "IMAGECUBE", "IMAGE1DARRAY", "IMAGE2DARRAY", "IIMAGE1D", "IIMAGE2D", "IIMAGE3D", "IIMAGECUBE", "IIMAGE1DARRAY", "IIMAGE2DARRAY", "UIMAGE1D", "UIMAGE2D", "UIMAGE3D", "UIMAGECUBE", "UIMAGE1DARRAY", "UIMAGE2DARRAY", "IMAGE1DSHADOW", "IMAGE2DSHADOW", "IMAGEBUFFER", "IIMAGEBUFFER", "UIMAGEBUFFER", - "IMAGE1DARRAYSHADOW", "IMAGE2DARRAYSHADOW", "ROW_MAJOR", "'('", "')'", - "'['", "']'", "'.'", "','", "'+'", "'-'", "'!'", "'~'", "'*'", "'/'", - "'%'", "'<'", "'>'", "'&'", "'^'", "'|'", "'?'", "':'", "'='", "';'", - "'{'", "'}'", "$accept", "translation_unit", "$@1", "version_statement", - "pragma_statement", "extension_statement_list", "any_identifier", - "extension_statement", "external_declaration_list", + "IMAGE1DARRAYSHADOW", "IMAGE2DARRAYSHADOW", "ROW_MAJOR", "THEN", "'('", + "')'", "'['", "']'", "'.'", "','", "'+'", "'-'", "'!'", "'~'", "'*'", + "'/'", "'%'", "'<'", "'>'", "'&'", "'^'", "'|'", "'?'", "':'", "'='", + "';'", "'{'", "'}'", "$accept", "translation_unit", "@1", + "version_statement", "pragma_statement", "extension_statement_list", + "any_identifier", "extension_statement", "external_declaration_list", "variable_identifier", "primary_expression", "postfix_expression", "integer_expression", "function_call", "function_call_or_method", "function_call_generic", "function_call_header_no_parameters", @@ -949,25 +1219,27 @@ static const char *const yytname[] = "constant_expression", "declaration", "function_prototype", "function_declarator", "function_header_with_parameters", "function_header", "parameter_declarator", "parameter_declaration", - "parameter_qualifier", "parameter_type_specifier", - "init_declarator_list", "single_declaration", "fully_specified_type", - "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id", - "uniform_block_layout_qualifier", "interpolation_qualifier", - "parameter_type_qualifier", "type_qualifier", "storage_qualifier", - "type_specifier", "type_specifier_no_prec", "type_specifier_nonarray", + "parameter_qualifier", "parameter_direction_qualifier", + "parameter_type_specifier", "init_declarator_list", "single_declaration", + "fully_specified_type", "layout_qualifier", "layout_qualifier_id_list", + "integer_constant", "layout_qualifier_id", + "interface_block_layout_qualifier", "interpolation_qualifier", + "type_qualifier", "auxiliary_storage_qualifier", "storage_qualifier", + "array_specifier", "type_specifier", "type_specifier_nonarray", "basic_type_specifier_nonarray", "precision_qualifier", "struct_specifier", "struct_declaration_list", "struct_declaration", "struct_declarator_list", "struct_declarator", "initializer", - "declaration_statement", "statement", "simple_statement", - "compound_statement", "$@2", "statement_no_new_scope", + "initializer_list", "declaration_statement", "statement", + "simple_statement", "compound_statement", "@2", "statement_no_new_scope", "compound_statement_no_new_scope", "statement_list", "expression_statement", "selection_statement", "selection_rest_statement", "condition", "switch_statement", "switch_body", "case_label", "case_label_list", "case_statement", "case_statement_list", "iteration_statement", "for_init_statement", "conditionopt", "for_rest_statement", "jump_statement", - "external_declaration", "function_definition", "uniform_block", - "member_list", "uniformopt", "member_declaration", "layout_defaults", 0 + "external_declaration", "function_definition", "interface_block", + "basic_interface_block", "interface_qualifier", "instance_name_opt", + "member_list", "member_declaration", "layout_defaults", 0 }; #endif @@ -996,7 +1268,9 @@ static const yytype_uint16 yytoknum[] = 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 40, 41, 91, 93, 46, 44, 43, 45, 33, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 40, 41, 91, 93, 46, 44, 43, 45, 33, 126, 42, 47, 37, 60, 62, 38, 94, 124, 63, 58, 61, 59, 123, 125 }; @@ -1005,596 +1279,838 @@ static const yytype_uint16 yytoknum[] = /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 225, 227, 226, 228, 228, 229, 229, 229, 229, - 229, 230, 230, 231, 231, 231, 232, 233, 233, 234, - 234, 235, 235, 235, 235, 235, 235, 236, 236, 236, - 236, 236, 236, 237, 238, 239, 239, 240, 240, 241, - 241, 242, 242, 243, 244, 244, 244, 245, 245, 246, - 246, 247, 247, 248, 249, 249, 249, 249, 250, 250, - 250, 250, 251, 251, 251, 251, 252, 252, 252, 253, - 253, 253, 254, 254, 254, 254, 254, 255, 255, 255, - 256, 256, 257, 257, 258, 258, 259, 259, 260, 260, - 261, 261, 262, 262, 263, 263, 264, 264, 264, 264, - 264, 264, 264, 264, 264, 264, 264, 265, 265, 266, - 267, 267, 267, 267, 268, 269, 269, 270, 270, 271, - 272, 272, 273, 273, 273, 273, 274, 274, 274, 274, - 275, 276, 276, 276, 276, 276, 276, 276, 277, 277, - 277, 277, 277, 277, 277, 277, 278, 278, 279, 280, - 280, 281, 281, 281, 282, 282, 283, 283, 283, 284, - 285, 285, 285, 285, 285, 285, 285, 285, 286, 286, - 286, 286, 286, 286, 286, 286, 286, 287, 287, 288, - 288, 288, 289, 289, 289, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 291, 291, 291, 292, 292, 293, 293, 294, - 295, 295, 296, 296, 297, 298, 299, 299, 300, 300, - 300, 300, 300, 300, 301, 302, 301, 303, 303, 304, - 304, 305, 305, 306, 306, 307, 308, 308, 309, 309, - 310, 311, 311, 312, 312, 313, 313, 314, 314, 315, - 315, 316, 316, 316, 317, 317, 318, 318, 319, 319, - 320, 320, 320, 320, 320, 321, 321, 321, 321, 322, - 323, 323, 324, 324, 325, 325, 326, 326, 327 + 0, 245, 247, 246, 248, 248, 248, 249, 249, 249, + 249, 249, 250, 250, 251, 251, 251, 252, 253, 253, + 254, 254, 255, 255, 255, 255, 255, 255, 256, 256, + 256, 256, 256, 256, 257, 258, 259, 259, 260, 260, + 261, 261, 262, 262, 263, 264, 264, 264, 265, 265, + 266, 266, 267, 267, 268, 269, 269, 269, 269, 270, + 270, 270, 270, 271, 271, 271, 271, 272, 272, 272, + 273, 273, 273, 274, 274, 274, 274, 274, 275, 275, + 275, 276, 276, 277, 277, 278, 278, 279, 279, 280, + 280, 281, 281, 282, 282, 283, 283, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 285, 285, + 286, 287, 287, 287, 287, 288, 289, 289, 290, 290, + 291, 292, 292, 293, 293, 294, 294, 294, 294, 295, + 295, 295, 296, 297, 297, 297, 297, 297, 298, 298, + 298, 298, 298, 298, 299, 299, 300, 301, 301, 302, + 302, 303, 303, 303, 304, 304, 305, 305, 305, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 307, 307, 308, 308, 308, 308, 308, 308, 309, + 309, 309, 309, 310, 310, 311, 311, 311, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + 312, 312, 312, 312, 312, 312, 313, 313, 313, 314, + 314, 315, 315, 316, 317, 317, 318, 318, 319, 319, + 319, 320, 320, 321, 322, 322, 323, 323, 323, 323, + 323, 323, 324, 325, 324, 326, 326, 327, 327, 328, + 328, 329, 329, 330, 331, 331, 332, 332, 333, 334, + 334, 335, 335, 336, 336, 337, 337, 338, 338, 339, + 339, 339, 340, 340, 341, 341, 342, 342, 343, 343, + 343, 343, 343, 344, 344, 344, 344, 345, 346, 346, + 347, 348, 348, 348, 349, 349, 349, 350, 350, 351, + 352, 352, 352 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 0, 4, 0, 3, 2, 2, 2, 2, - 2, 0, 2, 1, 1, 1, 5, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 4, 1, - 3, 2, 2, 1, 1, 1, 3, 2, 2, 2, - 1, 2, 3, 2, 1, 1, 1, 2, 2, 2, - 1, 2, 3, 2, 1, 2, 2, 2, 1, 1, - 1, 1, 1, 3, 3, 3, 1, 3, 3, 1, - 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 5, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 2, 2, 4, 1, 2, 1, 1, 2, 3, 3, - 2, 5, 3, 2, 3, 2, 0, 1, 1, 1, - 1, 1, 3, 5, 6, 7, 8, 5, 1, 2, - 4, 5, 6, 7, 4, 2, 1, 2, 4, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 2, 2, 3, 1, 1, 1, - 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, - 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 2, 0, 4, 0, 3, 4, 2, 2, 2, + 2, 2, 0, 2, 1, 1, 1, 5, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 4, + 1, 3, 2, 2, 1, 1, 1, 3, 2, 2, + 2, 1, 2, 3, 2, 1, 1, 1, 2, 2, + 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, + 1, 1, 1, 1, 3, 3, 3, 1, 3, 3, + 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 5, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 2, 2, 4, 1, 2, 1, 1, 2, 3, + 3, 2, 3, 2, 2, 0, 2, 2, 2, 1, + 1, 1, 1, 1, 3, 4, 6, 5, 1, 2, + 3, 5, 4, 2, 1, 2, 4, 1, 3, 1, + 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 3, 3, 4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 4, 1, 2, 3, - 1, 3, 1, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 0, 4, 1, 1, 2, - 3, 1, 2, 1, 2, 5, 3, 1, 1, 4, - 5, 2, 3, 3, 2, 1, 2, 2, 2, 1, - 2, 5, 7, 6, 1, 1, 1, 0, 2, 3, - 2, 2, 2, 3, 2, 1, 1, 1, 1, 2, - 6, 7, 1, 2, 0, 1, 5, 4, 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, + 4, 1, 2, 3, 1, 3, 1, 2, 1, 3, + 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 0, 4, 1, 1, 2, 3, 1, + 2, 1, 2, 5, 3, 1, 1, 4, 5, 2, + 3, 3, 2, 1, 2, 2, 2, 1, 2, 5, + 7, 6, 1, 1, 1, 0, 2, 3, 2, 2, + 2, 3, 2, 1, 1, 1, 1, 2, 1, 2, + 7, 1, 1, 1, 0, 1, 2, 1, 2, 3, + 3, 3, 3 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { - 4, 0, 0, 11, 0, 1, 2, 5, 0, 0, - 12, 13, 14, 15, 0, 169, 168, 189, 186, 187, - 188, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 190, 191, 192, 0, 172, 173, 176, 170, 158, 157, - 156, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 214, 215, 217, 218, 220, 221, 222, 223, - 224, 226, 227, 229, 230, 231, 232, 234, 235, 237, - 238, 239, 240, 213, 228, 236, 219, 225, 233, 241, - 216, 0, 185, 184, 167, 244, 243, 242, 0, 0, - 0, 0, 0, 0, 0, 307, 3, 306, 0, 0, - 116, 126, 0, 131, 138, 161, 163, 0, 160, 146, - 177, 179, 182, 0, 183, 17, 305, 113, 308, 0, - 174, 175, 171, 0, 0, 0, 176, 19, 20, 145, - 0, 165, 0, 6, 7, 8, 9, 10, 0, 18, - 110, 0, 309, 114, 126, 159, 127, 128, 129, 117, - 0, 126, 0, 111, 13, 15, 139, 0, 176, 162, - 164, 147, 0, 178, 0, 314, 0, 0, 247, 0, - 166, 0, 155, 154, 151, 0, 149, 153, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 24, 22, 23, - 25, 46, 0, 0, 0, 58, 59, 60, 61, 273, - 265, 269, 21, 27, 54, 29, 34, 35, 0, 0, - 40, 0, 62, 0, 66, 69, 72, 77, 80, 82, - 84, 86, 88, 90, 92, 94, 107, 0, 255, 0, - 161, 146, 258, 271, 257, 256, 0, 259, 260, 261, - 262, 263, 118, 123, 125, 130, 0, 132, 0, 0, - 119, 0, 318, 180, 62, 109, 0, 44, 16, 315, - 314, 0, 0, 314, 252, 0, 250, 246, 248, 0, - 112, 0, 148, 0, 301, 300, 0, 0, 0, 304, - 302, 0, 0, 0, 55, 56, 0, 264, 0, 31, - 32, 0, 0, 38, 37, 0, 185, 41, 43, 97, - 98, 100, 99, 102, 103, 104, 105, 106, 101, 96, - 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 12, 0, 1, 2, 14, 15, 16, + 5, 0, 0, 0, 13, 6, 0, 174, 173, 192, + 189, 190, 191, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 193, 194, 195, 171, 176, 177, 178, 175, + 158, 157, 156, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 217, 218, 220, 221, 223, 224, + 225, 226, 227, 229, 230, 231, 232, 234, 235, 236, + 237, 239, 240, 241, 243, 244, 245, 246, 248, 216, + 233, 242, 222, 228, 238, 247, 249, 250, 251, 252, + 253, 254, 219, 255, 0, 188, 187, 159, 258, 257, + 256, 0, 0, 0, 0, 0, 0, 0, 172, 325, + 3, 324, 0, 0, 117, 125, 0, 133, 138, 163, + 162, 0, 160, 161, 144, 183, 185, 164, 186, 18, + 323, 114, 328, 0, 326, 0, 0, 0, 176, 177, + 178, 20, 21, 159, 143, 163, 165, 0, 7, 8, + 9, 10, 11, 0, 19, 111, 0, 327, 115, 125, + 125, 129, 130, 131, 118, 0, 125, 125, 0, 112, + 14, 16, 139, 0, 176, 177, 178, 167, 329, 166, + 145, 168, 169, 0, 184, 170, 0, 0, 0, 0, + 261, 0, 0, 155, 154, 151, 0, 147, 153, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 25, 23, + 24, 26, 47, 0, 0, 0, 59, 60, 61, 62, + 291, 283, 287, 22, 28, 55, 30, 35, 36, 0, + 0, 41, 0, 63, 0, 67, 70, 73, 78, 81, + 83, 85, 87, 89, 91, 93, 95, 108, 0, 273, + 0, 163, 144, 276, 289, 275, 274, 0, 277, 278, + 279, 280, 281, 119, 126, 123, 124, 132, 127, 128, + 134, 0, 140, 120, 341, 342, 340, 179, 63, 110, + 0, 45, 0, 0, 17, 266, 0, 264, 260, 262, + 0, 113, 0, 146, 0, 319, 318, 0, 0, 0, + 322, 320, 0, 0, 0, 56, 57, 0, 282, 0, + 32, 33, 0, 0, 39, 38, 0, 188, 42, 44, + 98, 99, 101, 100, 103, 104, 105, 106, 107, 102, + 97, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 274, 176, 270, 272, 120, 122, 124, - 0, 0, 140, 0, 254, 144, 314, 181, 0, 0, - 0, 313, 0, 0, 249, 245, 152, 150, 0, 295, - 294, 297, 0, 303, 0, 167, 278, 0, 161, 0, - 26, 0, 0, 33, 30, 0, 36, 0, 0, 50, - 42, 95, 63, 64, 65, 67, 68, 70, 71, 75, - 76, 73, 74, 78, 79, 81, 83, 85, 87, 89, - 91, 0, 108, 0, 133, 0, 137, 0, 141, 0, - 0, 310, 0, 0, 251, 0, 296, 0, 0, 0, - 0, 0, 0, 266, 28, 53, 48, 47, 0, 185, - 51, 0, 0, 0, 134, 142, 0, 0, 0, 317, - 253, 0, 298, 0, 277, 275, 0, 280, 0, 268, - 291, 267, 52, 93, 121, 135, 0, 143, 311, 316, - 0, 299, 293, 0, 0, 0, 281, 285, 0, 289, - 0, 279, 136, 292, 276, 0, 284, 287, 286, 288, - 282, 290, 283 + 0, 0, 0, 0, 292, 288, 290, 121, 0, 135, + 0, 268, 142, 0, 180, 181, 0, 0, 0, 337, + 267, 0, 263, 259, 149, 150, 152, 148, 0, 313, + 312, 315, 0, 321, 0, 296, 0, 0, 27, 0, + 0, 34, 31, 0, 37, 0, 0, 51, 43, 96, + 64, 65, 66, 68, 69, 71, 72, 76, 77, 74, + 75, 79, 80, 82, 84, 86, 88, 90, 92, 0, + 109, 122, 137, 0, 271, 0, 141, 182, 0, 334, + 338, 265, 0, 314, 0, 0, 0, 0, 0, 0, + 284, 29, 54, 49, 48, 0, 188, 52, 0, 136, + 0, 269, 339, 335, 0, 0, 316, 0, 295, 293, + 0, 298, 0, 286, 309, 285, 53, 94, 270, 272, + 336, 330, 0, 317, 311, 0, 0, 0, 299, 303, + 0, 307, 0, 297, 310, 294, 0, 302, 305, 304, + 306, 300, 308, 301 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 9, 3, 95, 6, 264, 10, 96, 202, - 203, 204, 372, 205, 206, 207, 208, 209, 210, 211, - 376, 377, 378, 379, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 310, - 227, 256, 228, 229, 99, 100, 101, 243, 149, 150, - 244, 102, 103, 104, 230, 175, 176, 177, 106, 151, - 107, 108, 257, 110, 111, 112, 113, 114, 167, 168, - 265, 266, 345, 232, 233, 234, 235, 288, 450, 451, - 236, 237, 238, 445, 369, 239, 447, 467, 468, 469, - 470, 240, 361, 417, 418, 241, 115, 116, 117, 261, - 262, 263, 118 + -1, 2, 13, 3, 109, 6, 285, 14, 110, 223, + 224, 225, 390, 226, 227, 228, 229, 230, 231, 232, + 394, 395, 396, 397, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 331, + 248, 280, 249, 250, 113, 114, 115, 265, 164, 165, + 166, 266, 116, 117, 118, 145, 196, 376, 197, 198, + 120, 121, 122, 123, 184, 281, 125, 126, 127, 128, + 189, 190, 286, 287, 362, 425, 253, 254, 255, 256, + 309, 464, 465, 257, 258, 259, 459, 387, 260, 461, + 479, 480, 481, 482, 261, 381, 434, 435, 262, 129, + 130, 131, 132, 133, 454, 368, 369, 134 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -373 +#define YYPACT_NINF -374 static const yytype_int16 yypact[] = { - -75, -37, 53, -373, -50, -373, -19, -373, 160, 2970, - -373, -373, -373, -373, -36, -373, -373, -373, -373, -373, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -373, -373, 130, -373, -373, 28, -373, -373, -373, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -58, -373, -373, 43, -373, -373, -373, 147, 0, - 17, 20, 26, 46, -26, -373, 2970, -373, -166, -15, - -8, 2, -128, -373, 196, 173, 198, 1003, -373, -373, - -373, 5, -373, 1225, -373, -373, -373, -373, -373, 160, - -373, -373, -373, -20, 1003, 10, -373, -373, -373, -373, - 198, -373, 1225, -373, -373, -373, -373, -373, -54, -373, - -373, 460, -373, -373, 100, -373, -373, -373, -373, -373, - 1003, 181, 160, -373, 19, 35, -162, 38, -78, -373, - -373, -373, 2180, -373, 95, -3, 160, 559, -373, 1003, - -373, 42, -373, -373, 21, -157, -373, -373, 47, 49, - 1347, 40, 64, 50, 1875, 75, 90, -373, -373, -373, - -373, -373, 2568, 2568, 2568, -373, -373, -373, -373, -373, - 60, -373, 96, -373, -52, -373, -373, -373, 48, -114, - 2759, 98, -42, 2568, 83, -53, 101, -76, 113, 84, - 85, 86, 201, 204, -89, -373, -373, -122, -373, 81, - 222, 106, -373, -373, -373, -373, 682, -373, -373, -373, - -373, -373, -373, -373, -373, 160, 1003, -149, 2280, 2568, - -373, 87, -373, -373, -373, -373, 104, -373, -373, -373, - 273, 91, 1003, -25, 108, -113, -373, -373, -373, 781, - -373, 226, -373, -54, -373, -373, 252, 1776, 2568, -373, - -373, -111, 2568, 2083, -373, -373, -45, -373, 1347, -373, - -373, 2568, 196, -373, -373, 2568, 134, -373, -373, -373, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - 2568, -373, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, - 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, - 2568, 2568, 2568, -373, 251, -373, -373, 135, -373, -373, - 2471, 2568, 129, 149, -373, -373, -3, -373, 1003, 132, - 160, -373, 2568, 160, -373, -373, -373, -373, 150, -373, - -373, 2083, -34, -373, -24, 309, 151, 160, 198, 156, - -373, 904, 155, 151, -373, 162, -373, 159, -22, 2856, - -373, -373, -373, -373, -373, 83, 83, -53, -53, 101, - 101, 101, 101, -76, -76, 113, 84, 85, 86, 201, - 204, -107, -373, 2568, 143, 161, -373, 2568, 145, 144, - 160, -373, -86, 163, -373, 2568, -373, 148, 167, 1347, - 152, 153, 1568, -373, -373, -373, -373, -373, 2568, 169, - -373, 2568, 168, 2568, 157, -373, 2568, 154, -80, -373, - -373, -21, 2568, 1568, 361, -373, -5, -373, 2568, -373, - -373, -373, -373, -373, -373, -373, 2568, -373, -373, -373, - 158, 151, -373, 1347, 2568, 164, -373, -373, 1126, 1347, - -2, -373, -373, -373, -373, -101, -373, -373, -373, -373, - -373, 1347, -373 + -71, -49, 63, -374, -44, -374, -18, -374, -374, -374, + -374, 7, 115, 3617, -374, -374, -22, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, 19, 24, 39, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -74, -374, -374, 224, -374, -374, + -374, 122, 10, 14, 17, 23, 33, -51, -374, -374, + 3617, -374, -151, -50, -41, 2, -187, -374, 187, 1377, + 3746, 4012, 3746, 3746, -374, -48, -374, 3746, -374, -374, + -374, -374, -374, 94, -374, 115, 3769, -17, -374, -374, + -374, -374, -374, 3746, -374, 3746, -374, 4012, -374, -374, + -374, -374, -374, -70, -374, -374, 479, -374, -374, 54, + 54, -374, -374, -374, -374, 4012, 54, 54, 115, -374, + -7, -1, -193, 22, -92, -80, -77, -374, -374, -374, + -374, -374, -374, 2873, 27, -374, 8, 106, 115, 1191, + -374, 3769, 3, -374, -374, 12, -143, -374, -374, 13, + 26, 1850, 44, 45, 29, 2756, 48, 51, -374, -374, + -374, -374, -374, 3297, 3297, 3297, -374, -374, -374, -374, + -374, 30, -374, 55, -374, -59, -374, -374, -374, 64, + -89, 3406, 68, -46, 3297, 75, -124, 98, -76, 97, + 57, 53, 59, 184, 186, -101, -374, -374, -141, -374, + 60, 3865, 80, -374, -374, -374, -374, 721, -374, -374, + -374, -374, -374, -374, -374, -374, -374, 115, -374, -374, + -185, 2647, -180, -374, -374, -374, -374, -374, -374, -374, + 85, -374, 3195, 3769, -374, -48, -133, -374, -374, -374, + 1400, -374, 117, -374, -70, -374, -374, 210, 2319, 3297, + -374, -374, -130, 3297, 2984, -374, -374, -39, -374, 1850, + -374, -374, 3297, 187, -374, -374, 3297, 88, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, 3297, -374, 3297, 3297, 3297, 3297, 3297, 3297, 3297, + 3297, 3297, 3297, 3297, 3297, 3297, 3297, 3297, 3297, 3297, + 3297, 3297, 3297, 3297, -374, -374, -374, -48, 2647, -163, + 2647, -374, -374, 2647, -374, -374, 87, 115, 70, 3769, + 27, 115, -374, -374, -374, -374, -374, -374, 91, -374, + -374, 2984, -29, -374, -28, 89, 115, 96, -374, 963, + 92, 89, -374, 99, -374, 100, -26, 3508, -374, -374, + -374, -374, -374, 75, 75, -124, -124, 98, 98, 98, + 98, -76, -76, 97, 57, 53, 59, 184, 186, -186, + -374, 27, -374, 2647, -374, -144, -374, -374, -128, 226, + -374, -374, 3297, -374, 101, 123, 1850, 103, 111, 2091, + -374, -374, -374, -374, -374, 3297, 125, -374, 3297, -374, + 2545, -374, -374, -48, 102, -23, 3297, 2091, 341, -374, + -5, -374, 2647, -374, -374, -374, -374, -374, -374, -374, + 27, -374, 112, 89, -374, 1850, 3297, 118, -374, -374, + 1609, 1850, -3, -374, -374, -374, -116, -374, -374, -374, + -374, -374, 1850, -374 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -373, -373, -373, -373, -373, -373, -7, -373, -373, -79, - -373, -373, -373, -373, -373, -373, -373, -373, -373, -373, - -373, -373, -373, -373, 4, -373, -92, -70, -130, -95, - 52, 55, 56, 51, 57, 58, -373, -152, -158, -373, - -175, -230, 6, 29, -373, -373, -373, 136, 241, 236, - 146, -373, -373, -243, -6, -373, 116, -373, -77, -373, - -373, -82, -9, -74, -373, -373, 302, -373, 224, -145, - -321, 41, -286, 114, -176, -372, -373, -373, -48, 298, - 109, 121, -373, -373, 39, -373, -373, -69, -373, -68, - -373, -373, -373, -373, -373, -373, 305, -373, -373, -229, - 165, -373, -373 + -374, -374, -374, -374, -374, -374, 0, -374, -374, -94, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -9, -374, -114, -105, -111, -107, + 9, 16, 11, 18, 20, 6, -374, -150, -145, -374, + -197, 78, 15, 21, -374, -374, -374, -374, 202, -6, + -374, -374, -374, -374, -127, -11, -374, -374, 71, -374, + -374, -78, -374, -374, -165, -13, -374, -374, -20, -374, + 171, -160, 4, -2, -241, -374, 66, -200, -373, -374, + -374, -85, 261, 65, 77, -374, -374, -4, -374, -374, + -100, -374, -103, -374, -374, -374, -374, -374, -374, 271, + -374, -374, -109, -374, -374, 25, -374, -374 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -313 + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -334 static const yytype_int16 yytable[] = { - 109, 14, 131, 105, 276, 129, 145, 130, 251, 281, - 255, 259, 330, 464, 465, 97, 464, 465, 343, 286, - 319, 320, 268, 159, 160, 157, 11, 12, 13, 412, - 11, 12, 13, 259, 351, 146, 147, 148, 98, 163, - 367, 248, 289, 290, 1, 272, 15, 16, 170, 273, - 449, 4, 297, 5, 340, 406, 140, 141, 171, 249, - 336, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 449, 341, 7, 125, 33, 34, 35, 152, 126, - 37, 38, 39, 40, 332, 172, 119, 109, 294, 438, - 105, 344, 295, 353, 153, 332, 255, 156, 161, 332, - 333, 8, 97, 362, 145, 332, 94, 364, 366, 354, - 405, 363, 164, 431, 123, 166, 373, 409, 367, 482, - 353, 435, 413, 133, 268, 98, 353, 127, 94, 128, - 331, 174, 231, 146, 147, 148, 439, 380, 321, 322, - 134, 245, 459, 135, 252, 247, 173, 455, 159, 136, - 457, 291, 381, 292, 315, 316, 401, 370, 166, 260, - 166, 332, 471, 120, 121, 124, 254, 122, 419, 137, - 472, 231, 332, 432, 402, 138, 15, 16, 420, 309, - 427, 460, 332, 344, 428, 332, 366, 143, 255, 389, - 390, 391, 392, 317, 318, 336, 284, 285, 144, -312, - 255, 15, 16, 165, -115, 33, 34, 35, 162, 158, - 37, 323, 324, 375, 146, 147, 148, 311, 258, 466, - -19, 430, 480, 385, 386, 15, 16, 231, 393, 394, - 33, 34, 35, 169, 126, 37, -20, 245, 337, 250, - 441, 277, 271, 444, 11, 12, 13, 387, 388, 344, - 293, 255, 254, 350, 33, 34, 35, 260, 334, 37, - 166, 85, 86, 87, 270, 278, 174, 461, 231, 274, - 452, 275, 279, 453, 231, 344, 282, 368, 344, 231, - 154, 12, 155, 131, 287, 374, 159, 474, 130, 475, - 344, 283, 477, 479, 312, 313, 314, -45, 344, 298, - 325, 328, 326, 140, 327, 479, 329, -44, 347, 259, - 346, 352, 15, 16, 356, 349, 382, 383, 384, 254, - 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 358, -39, 251, 403, 410, - 260, 33, 34, 35, 254, 126, 37, 38, 39, 40, - 407, 415, 231, 408, 411, 368, 254, 332, 422, 424, - 421, 426, 231, 425, 433, 434, 436, 440, 437, 443, - 442, -49, 454, 463, 448, 446, 458, 395, 456, 398, - 473, 396, 338, 397, 476, 242, 399, 246, 400, 357, - 132, 359, 339, 269, 414, 462, 142, 371, 360, 478, - 416, 139, 481, 0, 0, 0, 0, 254, 0, 0, - 231, 0, 0, 231, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, - 0, 0, 0, 0, 231, 0, 0, 0, 0, 0, + 124, 297, 119, 144, 11, -331, 160, 272, 302, 188, + 178, 351, 16, 476, 477, 476, 477, -332, 307, 146, + -333, 7, 8, 9, 173, 7, 8, 9, 111, 289, + 183, 340, 341, 279, 112, 161, 162, 163, 183, 168, + 353, 177, 179, 282, 181, 182, 310, 311, 271, 185, + 4, 7, 8, 9, 448, 169, 358, 356, 160, 1, + 282, 363, 188, 5, 188, 146, 463, 177, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 423, 293, + 193, 147, 450, 294, 463, 353, 318, 161, 162, 163, + 10, 155, 156, 371, 137, 167, 353, 124, 371, 119, + 451, 354, 382, 336, 337, 359, 384, 385, 180, 372, + 353, 135, 383, 12, 452, 391, -331, 422, 172, 424, + 370, -332, 426, 124, 493, 111, 361, 98, 99, 100, + 289, 112, 279, 315, 192, 187, -333, 316, 352, 167, + 167, 15, 178, 252, 148, 251, 167, 167, 149, 194, + 274, 150, 267, 195, 264, 419, 367, 151, 342, 343, + 268, 269, 275, 188, 312, 276, 313, 152, 270, 136, + 153, 398, 158, 177, 278, 183, 124, 386, 124, 98, + 99, 100, 449, 388, 385, 159, 399, 353, 252, 356, + 251, 186, 421, 436, 437, 330, 444, 353, 353, 472, + 445, 338, 339, 353, 305, 306, 344, 345, 420, 469, + 7, 8, 9, 361, -20, 361, 374, 375, 361, 393, + -21, 483, 403, 404, -116, 332, 191, 17, 18, 407, + 408, 409, 410, 405, 406, 455, 458, 411, 412, 478, + 284, 491, 367, 273, 252, 291, 251, 98, 99, 100, + 282, 283, 447, 292, 386, 295, 35, 138, 139, 473, + 140, 39, 40, 41, 42, 298, 299, 357, 296, 303, + 124, 300, 304, 278, 308, 485, -46, 124, 361, 486, + 488, 490, 170, 8, 171, 252, 314, 251, 470, 319, + 347, 252, 490, 346, 195, 349, 252, 348, 251, 350, + 466, -45, 155, 467, 378, 361, 333, 334, 335, 364, + -40, 427, 432, 392, 429, 353, 441, 361, 439, 141, + 442, 142, 443, 453, 400, 401, 402, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 456, 471, 457, 460, -50, 143, 98, + 99, 100, 462, 475, 484, 413, 124, 418, 487, 415, + 366, 263, 290, 414, 379, 377, 107, 416, 252, 431, + 417, 428, 474, 157, 389, 380, 252, 433, 251, 492, + 489, 154, 0, 0, 0, 0, 438, 0, 0, 0, + 0, 0, 0, 0, 430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 231, 0, 0, 0, 0, 231, - 231, 0, 0, 15, 16, 17, 18, 19, 20, 178, - 179, 180, 231, 181, 182, 183, 184, 185, 0, 0, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 0, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 186, 127, 83, 128, 187, 188, 189, - 190, 191, 0, 0, 192, 193, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 18, 19, 20, 0, 0, - 0, 0, 0, 84, 85, 86, 87, 0, 88, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 94, 0, 0, 0, 0, 0, 0, 0, 0, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 0, 0, 83, 0, 0, 0, 0, 0, + 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 252, 0, 251, 252, 0, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 194, 0, 0, 0, 0, 0, 195, 196, 197, - 198, 0, 0, 85, 86, 87, 0, 0, 0, 0, - 0, 0, 199, 200, 201, 15, 16, 17, 18, 19, - 20, 178, 179, 180, 0, 181, 182, 183, 184, 185, - 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 0, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 186, 127, 83, 128, 187, - 188, 189, 190, 191, 0, 0, 192, 193, 0, 0, - 0, 0, 0, 267, 0, 0, 17, 18, 19, 20, - 0, 0, 0, 0, 0, 84, 85, 86, 87, 0, - 88, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 94, 0, 0, 0, 0, 0, 0, - 0, 0, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 0, 0, 83, 0, 0, 0, + 0, 0, 0, 0, 252, 0, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 194, 0, 0, 0, 0, 0, 195, - 196, 197, 198, 0, 0, 85, 86, 87, 0, 0, - 0, 0, 0, 0, 199, 200, 335, 15, 16, 17, - 18, 19, 20, 178, 179, 180, 0, 181, 182, 183, - 184, 185, 0, 0, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 186, 127, 83, - 128, 187, 188, 189, 190, 191, 0, 0, 192, 193, - 0, 0, 0, 0, 0, 355, 0, 0, 17, 18, - 19, 20, 0, 0, 0, 0, 0, 84, 85, 86, - 87, 0, 88, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 94, 0, 0, 0, 0, - 0, 0, 0, 0, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 0, 0, 83, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 194, 0, 0, 0, 0, - 0, 195, 196, 197, 198, 0, 0, 85, 86, 87, - 0, 0, 0, 0, 0, 0, 199, 200, 423, 15, - 16, 17, 18, 19, 20, 178, 179, 180, 0, 181, - 182, 183, 184, 185, 464, 465, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 0, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 186, - 127, 83, 128, 187, 188, 189, 190, 191, 0, 0, - 192, 193, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 18, 19, 20, 0, 0, 0, 0, 0, 84, - 85, 86, 87, 0, 88, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 94, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 0, 0, - 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 194, 0, 0, - 0, 0, 0, 195, 196, 197, 198, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 199, 200, - 15, 16, 17, 18, 19, 20, 178, 179, 180, 0, - 181, 182, 183, 184, 185, 0, 0, 21, 22, 23, + 0, 0, 252, 0, 251, 0, 0, 252, 252, 251, + 251, 0, 0, 0, 0, 0, 0, 0, 0, 252, + 0, 251, 17, 18, 19, 20, 21, 22, 199, 200, + 201, 0, 202, 203, 204, 205, 206, 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 0, 36, 37, 38, 39, 40, 41, 42, + 34, 35, 36, 37, 0, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 186, 127, 83, 128, 187, 188, 189, 190, 191, 0, - 0, 192, 193, 0, 0, 0, 0, 0, 0, 0, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 207, 141, 96, 142, 208, 209, 210, + 211, 212, 0, 0, 213, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84, 85, 86, 87, 0, 88, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, + 0, 0, 0, 97, 98, 99, 100, 0, 101, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 194, 0, - 0, 0, 0, 0, 195, 196, 197, 198, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 200, 15, 16, 17, 18, 19, 20, 178, 179, 180, - 0, 181, 182, 183, 184, 185, 0, 0, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 0, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 186, 127, 83, 128, 187, 188, 189, 190, 191, - 0, 0, 192, 193, 0, 0, 0, 0, 0, 0, + 215, 0, 0, 0, 0, 0, 216, 217, 218, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 84, 85, 86, 87, 0, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 194, - 0, 0, 0, 0, 0, 195, 196, 197, 198, 15, - 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, - 199, 141, 0, 0, 0, 0, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 0, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 0, - 127, 83, 128, 187, 188, 189, 190, 191, 0, 0, - 192, 193, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 18, 19, 20, 0, 0, 0, 0, 0, 84, - 85, 86, 87, 0, 88, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 94, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 0, 127, - 83, 128, 187, 188, 189, 190, 191, 0, 0, 192, - 193, 0, 0, 0, 0, 0, 0, 194, 0, 0, - 0, 0, 0, 195, 196, 197, 198, 0, 0, 85, - 86, 87, 0, 0, 0, 0, 0, 0, 199, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 194, 0, 0, 0, - 0, 0, 195, 196, 197, 198, 15, 16, 17, 18, - 19, 20, 0, 0, 0, 0, 0, 280, 0, 0, - 0, 0, 0, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 0, 126, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 0, 127, 83, 128, - 187, 188, 189, 190, 191, 0, 0, 192, 193, 0, - 0, 0, 0, 0, 0, 17, 18, 19, 20, 0, - 0, 0, 0, 0, 0, 0, 365, 85, 86, 87, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 0, 0, 94, 0, 0, 0, 0, 0, - 0, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 0, 127, 83, 128, 187, 188, 189, - 190, 191, 0, 0, 192, 193, 0, 0, 0, 0, - 0, 0, 0, 0, 194, 17, 18, 19, 20, 0, - 195, 196, 197, 198, 85, 86, 87, 0, 0, 0, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 0, 127, 83, 128, 187, 188, 189, - 190, 191, 0, 0, 192, 193, 0, 0, 0, 0, - 0, 194, 0, 0, 253, 0, 0, 195, 196, 197, - 198, 0, 0, 0, 85, 86, 87, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, - 0, 194, 0, 0, 342, 0, 0, 195, 196, 197, - 198, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 0, 127, 83, 128, 187, 188, - 189, 190, 191, 0, 0, 192, 193, 0, 0, 0, - 0, 0, 0, 17, 18, 19, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 85, 86, 87, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 0, 127, 83, 128, 187, 188, 189, 190, 191, - 0, 0, 192, 193, 0, 0, 0, 0, 0, 0, - 0, 0, 194, 0, 0, 404, 0, 0, 195, 196, - 197, 198, 85, 86, 87, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 17, 18, 19, 20, 0, 194, - 0, 0, 0, 0, 0, 195, 196, 197, 198, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 220, 221, 222, 17, 18, 19, 20, 21, 22, + 199, 200, 201, 0, 202, 203, 204, 205, 206, 0, + 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 296, 0, 127, 83, 128, 187, 188, 189, 190, - 191, 0, 0, 192, 193, 0, 0, 0, 0, 0, - 0, 17, 18, 19, 20, 0, 0, 0, 0, 0, - 0, 0, 0, 85, 86, 87, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 207, 141, 96, 142, 208, + 209, 210, 211, 212, 0, 0, 213, 214, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, + 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 215, 0, 0, 0, 0, 0, 216, 217, + 218, 219, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 220, 221, 355, 17, 18, 19, 20, + 21, 22, 199, 200, 201, 0, 202, 203, 204, 205, + 206, 0, 0, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 0, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 207, 141, 96, + 142, 208, 209, 210, 211, 212, 0, 0, 213, 214, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 97, 98, 99, + 100, 0, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, + 216, 217, 218, 219, 17, 18, 19, 20, 21, 22, + 0, 0, 0, 0, 0, 220, 221, 440, 0, 0, + 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 138, 139, 0, 140, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 0, 0, 96, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 143, 98, 99, 100, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, + 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 18, 19, 20, 21, 22, 35, + 174, 175, 0, 176, 39, 40, 41, 42, 0, 0, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 138, 139, 288, 140, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 0, 0, 96, 0, 0, 0, + 0, 143, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, + 0, 0, 0, 0, 143, 98, 99, 100, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 108, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 18, 19, 20, 21, 22, 199, 200, + 201, 0, 202, 203, 204, 205, 206, 476, 477, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 373, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 207, 141, 96, 142, 208, 209, 210, + 211, 212, 0, 0, 213, 214, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 97, 98, 99, 100, 0, 101, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 215, 0, 0, 0, 0, 0, 216, 217, 218, 219, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 220, 221, 17, 18, 19, 20, 21, 22, 199, + 200, 201, 0, 202, 203, 204, 205, 206, 0, 0, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 0, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 207, 141, 96, 142, 208, 209, + 210, 211, 212, 0, 0, 213, 214, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 97, 98, 99, 100, 0, 101, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 215, 0, 0, 0, 0, 0, 216, 217, 218, + 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 220, 221, 17, 18, 19, 20, 21, 22, + 199, 200, 201, 0, 202, 203, 204, 205, 206, 0, + 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 0, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 207, 141, 96, 142, 208, + 209, 210, 211, 212, 0, 0, 213, 214, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 98, 99, 100, 0, + 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 215, 0, 0, 0, 0, 0, 216, 217, + 218, 219, 17, 18, 19, 20, 21, 22, 0, 0, + 0, 0, 0, 220, 156, 0, 0, 0, 0, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 0, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 0, 141, 96, 142, 208, 209, 210, + 211, 212, 0, 0, 213, 214, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 97, 98, 99, 100, 0, 101, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 215, 0, 0, 0, 0, 0, 216, 217, 218, 219, + 19, 20, 21, 22, 0, 0, 0, 0, 0, 0, + 0, 220, 0, 0, 0, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, + 141, 96, 142, 208, 209, 210, 211, 212, 0, 0, + 213, 214, 19, 20, 21, 22, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 0, 141, 96, 142, 208, 209, 210, 211, 212, + 0, 0, 213, 214, 0, 0, 0, 0, 0, 0, + 0, 19, 20, 21, 22, 0, 215, 0, 0, 0, + 0, 0, 216, 217, 218, 219, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 360, 468, + 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 0, 141, 96, 142, 208, 209, 210, 211, 212, 0, + 0, 213, 214, 0, 0, 0, 0, 0, 215, 0, + 0, 0, 0, 0, 216, 217, 218, 219, 19, 20, + 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, + 360, 0, 0, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 0, 141, 96, + 142, 208, 209, 210, 211, 212, 0, 215, 213, 214, + 0, 0, 0, 216, 217, 218, 219, 17, 18, 19, + 20, 21, 22, 0, 0, 0, 0, 0, 301, 0, + 0, 0, 0, 0, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 138, 139, 0, + 140, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 0, 141, + 96, 142, 208, 209, 210, 211, 212, 0, 0, 213, + 214, 0, 0, 0, 215, 0, 0, 277, 0, 0, + 216, 217, 218, 219, 0, 0, 0, 0, 143, 98, + 99, 100, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 107, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 19, 20, 21, 22, 0, 215, 0, 0, 0, 0, + 0, 216, 217, 218, 219, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, + 141, 96, 142, 208, 209, 210, 211, 212, 0, 0, + 213, 214, 19, 20, 21, 22, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 0, 141, 96, 142, 208, 209, 210, 211, 212, + 0, 0, 213, 214, 0, 0, 0, 0, 0, 0, + 0, 19, 20, 21, 22, 0, 215, 0, 0, 365, + 0, 0, 216, 217, 218, 219, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 317, + 0, 141, 96, 142, 208, 209, 210, 211, 212, 0, + 0, 213, 214, 19, 20, 21, 22, 0, 215, 0, + 0, 0, 0, 0, 216, 217, 218, 219, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 429, 0, - 127, 83, 128, 187, 188, 189, 190, 191, 0, 0, - 192, 193, 0, 0, 0, 0, 0, 0, 0, 0, - 194, 0, 0, 0, 0, 0, 195, 196, 197, 198, - 85, 86, 87, 15, 16, 17, 18, 19, 20, 0, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 446, 0, 141, 96, 142, 208, 209, 210, 211, + 212, 0, 0, 213, 214, 0, 0, 0, 0, 0, + 17, 18, 19, 20, 21, 22, 0, 215, 0, 0, + 0, 0, 0, 216, 217, 218, 219, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 0, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 0, 0, 96, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 215, + 0, 0, 0, 0, 0, 216, 217, 218, 219, 0, + 0, 97, 98, 99, 100, 0, 101, 0, 0, 17, + 18, 0, 0, 0, 102, 103, 104, 105, 106, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 17, 18, 19, 20, 21, 22, 35, 138, + 139, 0, 140, 39, 40, 41, 42, 0, 0, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 138, 139, 108, 140, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 0, 0, 96, 0, 0, 17, 18, + 143, 98, 99, 100, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 107, 0, + 0, 0, 0, 143, 98, 99, 100, 35, 36, 37, + 0, 38, 39, 40, 41, 42, 0, 0, 0, 0, + 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, + 98, 99, 100, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 107, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, + 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 0, 0, 0, 0, 0, 0, + 0, 0, 108, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 0, 0, 96 +}; + +static const yytype_int16 yycheck[] = +{ + 13, 201, 13, 97, 4, 97, 4, 172, 205, 136, + 119, 112, 12, 18, 19, 18, 19, 97, 215, 97, + 97, 95, 96, 97, 118, 95, 96, 97, 13, 189, + 223, 107, 108, 183, 13, 33, 34, 35, 223, 226, + 226, 119, 120, 223, 122, 123, 105, 106, 241, 127, + 99, 95, 96, 97, 240, 242, 241, 257, 4, 130, + 223, 241, 189, 0, 191, 143, 439, 145, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 241, 222, + 150, 101, 226, 226, 457, 226, 231, 33, 34, 35, + 134, 242, 243, 226, 94, 115, 226, 110, 226, 110, + 244, 242, 299, 227, 228, 270, 303, 304, 121, 242, + 226, 133, 242, 131, 242, 312, 97, 358, 118, 360, + 285, 97, 363, 136, 240, 110, 271, 125, 126, 127, + 290, 110, 282, 222, 147, 135, 97, 226, 239, 159, + 160, 134, 251, 156, 134, 156, 166, 167, 134, 219, + 242, 134, 165, 153, 160, 352, 283, 134, 234, 235, + 166, 167, 242, 290, 223, 242, 225, 134, 168, 243, + 221, 316, 222, 251, 183, 223, 189, 304, 191, 125, + 126, 127, 423, 222, 381, 226, 331, 226, 201, 389, + 201, 97, 357, 222, 222, 241, 222, 226, 226, 222, + 226, 103, 104, 226, 213, 214, 109, 110, 353, 450, + 95, 96, 97, 358, 221, 360, 99, 100, 363, 313, + 221, 462, 336, 337, 222, 234, 243, 3, 4, 340, + 341, 342, 343, 338, 339, 432, 436, 344, 345, 244, + 134, 244, 369, 221, 257, 242, 257, 125, 126, 127, + 223, 243, 397, 241, 381, 242, 32, 33, 34, 456, + 36, 37, 38, 39, 40, 221, 221, 267, 242, 221, + 283, 242, 221, 282, 244, 475, 221, 290, 423, 476, + 480, 481, 95, 96, 97, 298, 222, 298, 453, 221, + 237, 304, 492, 236, 294, 111, 309, 238, 309, 113, + 445, 221, 242, 448, 94, 450, 231, 232, 233, 224, + 222, 224, 221, 313, 244, 226, 224, 462, 222, 95, + 221, 97, 222, 97, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 242, 242, 222, 243, 222, 124, 125, + 126, 127, 241, 12, 242, 346, 369, 351, 240, 348, + 282, 159, 191, 347, 298, 294, 142, 349, 381, 371, + 350, 367, 457, 112, 309, 298, 389, 381, 389, 482, + 480, 110, -1, -1, -1, -1, 386, -1, -1, -1, + -1, -1, -1, -1, 369, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 436, -1, 436, 439, -1, 439, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 457, -1, 457, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 475, -1, 475, -1, -1, 480, 481, 480, + 481, -1, -1, -1, -1, -1, -1, -1, -1, 492, + -1, 492, 3, 4, 5, 6, 7, 8, 9, 10, + 11, -1, 13, 14, 15, 16, 17, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 0, 36, 37, 38, 39, + 31, 32, 33, 34, -1, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 124, 125, 126, 127, -1, 129, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 142, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 187, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 221, -1, -1, -1, -1, -1, 227, 228, 229, 230, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 242, 243, 244, 3, 4, 5, 6, 7, 8, + 9, 10, 11, -1, 13, 14, 15, 16, 17, -1, + -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, -1, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, -1, -1, 105, 106, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 124, 125, 126, 127, -1, + 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 142, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 187, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 221, -1, -1, -1, -1, -1, 227, 228, + 229, 230, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 242, 243, 244, 3, 4, 5, 6, + 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, + 17, -1, -1, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, -1, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, -1, -1, 105, 106, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 124, 125, 126, + 127, -1, 129, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 142, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 221, -1, -1, -1, -1, -1, + 227, 228, 229, 230, 3, 4, 5, 6, 7, 8, + -1, -1, -1, -1, -1, 242, 243, 244, -1, -1, + -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, -1, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, -1, -1, 96, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 124, 125, 126, 127, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 142, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 187, -1, + 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 3, 4, 5, 6, 7, 8, 32, + 33, 34, -1, 36, 37, 38, 39, 40, -1, -1, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 244, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 0, 0, 83, 0, 194, 0, 0, - 0, 0, 0, 195, 196, 197, 198, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 84, 85, 86, 87, 0, 88, 0, - 0, 0, 0, 0, 0, 0, 89, 90, 91, 92, - 93, 94 -}; - -#define yypact_value_is_default(yystate) \ - ((yystate) == (-373)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - -static const yytype_int16 yycheck[] = -{ - 9, 8, 84, 9, 180, 84, 4, 84, 86, 184, - 162, 36, 101, 18, 19, 9, 18, 19, 248, 194, - 96, 97, 167, 105, 106, 104, 84, 85, 86, 350, - 84, 85, 86, 36, 263, 33, 34, 35, 9, 113, - 283, 203, 94, 95, 119, 202, 3, 4, 130, 206, - 422, 88, 210, 0, 203, 341, 222, 223, 132, 221, - 236, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 443, 221, 123, 81, 32, 33, 34, 206, 36, - 37, 38, 39, 40, 206, 139, 122, 96, 202, 410, - 96, 249, 206, 206, 222, 206, 248, 104, 107, 206, - 222, 120, 96, 278, 4, 206, 131, 282, 283, 222, - 340, 222, 119, 220, 86, 124, 291, 346, 361, 220, - 206, 407, 352, 123, 269, 96, 206, 84, 131, 86, - 219, 138, 141, 33, 34, 35, 222, 295, 214, 215, - 123, 150, 222, 123, 222, 152, 200, 433, 230, 123, - 436, 203, 310, 205, 207, 208, 331, 202, 167, 165, - 169, 206, 448, 33, 34, 223, 162, 37, 202, 123, - 456, 180, 206, 403, 332, 201, 3, 4, 202, 221, - 202, 202, 206, 341, 206, 206, 361, 202, 340, 319, - 320, 321, 322, 92, 93, 371, 192, 193, 206, 224, - 352, 3, 4, 223, 202, 32, 33, 34, 203, 36, - 37, 98, 99, 292, 33, 34, 35, 213, 123, 224, - 201, 379, 224, 315, 316, 3, 4, 236, 323, 324, - 32, 33, 34, 223, 36, 37, 201, 246, 245, 201, - 415, 201, 221, 419, 84, 85, 86, 317, 318, 407, - 202, 403, 248, 262, 32, 33, 34, 263, 36, 37, - 269, 114, 115, 116, 222, 201, 273, 442, 277, 222, - 428, 222, 222, 431, 283, 433, 201, 283, 436, 288, - 84, 85, 86, 365, 224, 292, 368, 463, 365, 464, - 448, 201, 468, 469, 211, 212, 213, 201, 456, 201, - 216, 100, 217, 222, 218, 481, 102, 201, 204, 36, - 223, 203, 3, 4, 88, 224, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 83, 202, 86, 203, 348, - 346, 32, 33, 34, 340, 36, 37, 38, 39, 40, - 221, 201, 361, 204, 222, 361, 352, 206, 202, 204, - 367, 202, 371, 201, 221, 204, 221, 204, 224, 202, - 222, 202, 204, 12, 221, 223, 222, 325, 221, 328, - 222, 326, 246, 327, 220, 144, 329, 151, 330, 273, - 88, 277, 246, 169, 353, 443, 98, 288, 277, 468, - 361, 96, 470, -1, -1, -1, -1, 403, -1, -1, - 419, -1, -1, 422, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 260, -1, -1, -1, -1, - -1, -1, -1, -1, 443, -1, -1, -1, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, -1, -1, 96, -1, -1, -1, + -1, 124, 125, 126, 127, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 142, + -1, -1, -1, -1, 124, 125, 126, 127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 463, -1, -1, -1, -1, 468, - 469, -1, -1, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 481, 13, 14, 15, 16, 17, -1, -1, + -1, -1, 142, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 187, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, + 11, -1, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 244, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 124, 125, 126, 127, -1, 129, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 142, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 187, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 221, -1, -1, -1, -1, -1, 227, 228, 229, 230, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 242, 243, 3, 4, 5, 6, 7, 8, 9, + 10, 11, -1, 13, 14, 15, 16, 17, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, @@ -1602,317 +2118,279 @@ static const yytype_int16 yycheck[] = 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, -1, -1, 94, 95, -1, -1, -1, -1, - -1, -1, -1, -1, 5, 6, 7, 8, -1, -1, - -1, -1, -1, 113, 114, 115, 116, -1, 118, 20, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, -1, -1, 105, 106, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 124, 125, 126, 127, -1, 129, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 142, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 187, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 221, -1, -1, -1, -1, -1, 227, 228, 229, + 230, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 242, 243, 3, 4, 5, 6, 7, 8, + 9, 10, 11, -1, 13, 14, 15, 16, 17, -1, + -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, -1, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, -1, -1, 105, 106, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 124, 125, 126, 127, -1, + 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 142, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 187, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 221, -1, -1, -1, -1, -1, 227, 228, + 229, 230, 3, 4, 5, 6, 7, 8, -1, -1, + -1, -1, -1, 242, 243, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 131, -1, -1, -1, -1, -1, -1, -1, -1, + 31, 32, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, -1, -1, 85, -1, -1, -1, -1, -1, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, -1, 95, 96, 97, 98, 99, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 201, -1, -1, -1, -1, -1, 207, 208, 209, - 210, -1, -1, 114, 115, 116, -1, -1, -1, -1, - -1, -1, 222, 223, 224, 3, 4, 5, 6, 7, - 8, 9, 10, 11, -1, 13, 14, 15, 16, 17, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, -1, -1, 94, 95, -1, -1, - -1, -1, -1, 224, -1, -1, 5, 6, 7, 8, - -1, -1, -1, -1, -1, 113, 114, 115, 116, -1, - 118, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 131, -1, -1, -1, -1, -1, -1, - -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, -1, -1, 85, -1, -1, -1, + -1, -1, -1, 124, 125, 126, 127, -1, 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 201, -1, -1, -1, -1, -1, 207, - 208, 209, 210, -1, -1, 114, 115, 116, -1, -1, - -1, -1, -1, -1, 222, 223, 224, 3, 4, 5, - 6, 7, 8, 9, 10, 11, -1, 13, 14, 15, - 16, 17, -1, -1, 20, 21, 22, 23, 24, 25, + -1, 142, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 187, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 221, -1, -1, -1, -1, -1, 227, 228, 229, 230, + 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, + -1, 242, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, + 95, 96, 97, 98, 99, 100, 101, 102, -1, -1, + 105, 106, 5, 6, 7, 8, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, -1, 95, 96, 97, 98, 99, 100, 101, 102, + -1, -1, 105, 106, -1, -1, -1, -1, -1, -1, + -1, 5, 6, 7, 8, -1, 221, -1, -1, -1, + -1, -1, 227, 228, 229, 230, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 243, 244, + -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + -1, 95, 96, 97, 98, 99, 100, 101, 102, -1, + -1, 105, 106, -1, -1, -1, -1, -1, 221, -1, + -1, -1, -1, -1, 227, 228, 229, 230, 5, 6, + 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, + 243, -1, -1, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, -1, 95, 96, + 97, 98, 99, 100, 101, 102, -1, 221, 105, 106, + -1, -1, -1, 227, 228, 229, 230, 3, 4, 5, + 6, 7, 8, -1, -1, -1, -1, -1, 242, -1, + -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, -1, -1, 94, 95, - -1, -1, -1, -1, -1, 224, -1, -1, 5, 6, - 7, 8, -1, -1, -1, -1, -1, 113, 114, 115, - 116, -1, 118, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 131, -1, -1, -1, -1, - -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, -1, -1, 85, -1, + 86, 87, 88, 89, 90, 91, 92, 93, -1, 95, + 96, 97, 98, 99, 100, 101, 102, -1, -1, 105, + 106, -1, -1, -1, 221, -1, -1, 224, -1, -1, + 227, 228, 229, 230, -1, -1, -1, -1, 124, 125, + 126, 127, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 201, -1, -1, -1, -1, - -1, 207, 208, 209, 210, -1, -1, 114, 115, 116, - -1, -1, -1, -1, -1, -1, 222, 223, 224, 3, - 4, 5, 6, 7, 8, 9, 10, 11, -1, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, -1, -1, - 94, 95, -1, -1, -1, -1, -1, -1, -1, -1, - 5, 6, 7, 8, -1, -1, -1, -1, -1, 113, - 114, 115, 116, -1, 118, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 131, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 5, 6, 7, 8, -1, 221, -1, -1, -1, -1, + -1, 227, 228, 229, 230, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, - 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 201, -1, -1, - -1, -1, -1, 207, 208, 209, 210, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 222, 223, - 3, 4, 5, 6, 7, 8, 9, 10, 11, -1, - 13, 14, 15, 16, 17, -1, -1, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, + 95, 96, 97, 98, 99, 100, 101, 102, -1, -1, + 105, 106, 5, 6, 7, 8, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, - -1, 94, 95, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 113, 114, 115, 116, -1, 118, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 131, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 201, -1, - -1, -1, -1, -1, 207, 208, 209, 210, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 222, - 223, 3, 4, 5, 6, 7, 8, 9, 10, 11, - -1, 13, 14, 15, 16, 17, -1, -1, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, -1, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - -1, -1, 94, 95, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 113, 114, 115, 116, -1, 118, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 131, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 201, - -1, -1, -1, -1, -1, 207, 208, 209, 210, 3, - 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, - 222, 223, -1, -1, -1, -1, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, -1, 95, 96, 97, 98, 99, 100, 101, 102, + -1, -1, 105, 106, -1, -1, -1, -1, -1, -1, + -1, 5, 6, 7, 8, -1, 221, -1, -1, 224, + -1, -1, 227, 228, 229, 230, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, - 84, 85, 86, 87, 88, 89, 90, 91, -1, -1, - 94, 95, -1, -1, -1, -1, -1, -1, -1, -1, - 5, 6, 7, 8, -1, -1, -1, -1, -1, 113, - 114, 115, 116, -1, 118, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 131, -1, -1, - -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, -1, 84, - 85, 86, 87, 88, 89, 90, 91, -1, -1, 94, - 95, -1, -1, -1, -1, -1, -1, 201, -1, -1, - -1, -1, -1, 207, 208, 209, 210, -1, -1, 114, - 115, 116, -1, -1, -1, -1, -1, -1, 222, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 201, -1, -1, -1, - -1, -1, 207, 208, 209, 210, 3, 4, 5, 6, - 7, 8, -1, -1, -1, -1, -1, 222, -1, -1, - -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, -1, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, -1, 84, 85, 86, - 87, 88, 89, 90, 91, -1, -1, 94, 95, -1, - -1, -1, -1, -1, -1, 5, 6, 7, 8, -1, - -1, -1, -1, -1, -1, -1, 113, 114, 115, 116, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, -1, -1, 131, -1, -1, -1, -1, -1, - -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, - 90, 91, -1, -1, 94, 95, -1, -1, -1, -1, - -1, -1, -1, -1, 201, 5, 6, 7, 8, -1, - 207, 208, 209, 210, 114, 115, 116, -1, -1, -1, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, -1, 84, 85, 86, 87, 88, 89, - 90, 91, -1, -1, 94, 95, -1, -1, -1, -1, - -1, 201, -1, -1, 204, -1, -1, 207, 208, 209, - 210, -1, -1, -1, 114, 115, 116, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 5, 6, 7, 8, - -1, 201, -1, -1, 204, -1, -1, 207, 208, 209, - 210, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, -1, 84, 85, 86, 87, 88, - 89, 90, 91, -1, -1, 94, 95, -1, -1, -1, - -1, -1, -1, 5, 6, 7, 8, -1, -1, -1, - -1, -1, -1, -1, -1, 114, 115, 116, 20, 21, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + -1, 95, 96, 97, 98, 99, 100, 101, 102, -1, + -1, 105, 106, 5, 6, 7, 8, -1, 221, -1, + -1, -1, -1, -1, 227, 228, 229, 230, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, -1, 84, 85, 86, 87, 88, 89, 90, 91, - -1, -1, 94, 95, -1, -1, -1, -1, -1, -1, - -1, -1, 201, -1, -1, 204, -1, -1, 207, 208, - 209, 210, 114, 115, 116, -1, -1, -1, -1, -1, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, -1, 95, 96, 97, 98, 99, 100, 101, + 102, -1, -1, 105, 106, -1, -1, -1, -1, -1, + 3, 4, 5, 6, 7, 8, -1, 221, -1, -1, + -1, -1, -1, 227, 228, 229, 230, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, -1, -1, 96, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 221, + -1, -1, -1, -1, -1, 227, 228, 229, 230, -1, + -1, 124, 125, 126, 127, -1, 129, -1, -1, 3, + 4, -1, -1, -1, 137, 138, 139, 140, 141, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 5, 6, 7, 8, -1, 201, - -1, -1, -1, -1, -1, 207, 208, 209, 210, 20, + -1, -1, 3, 4, 5, 6, 7, 8, 32, 33, + 34, -1, 36, 37, 38, 39, 40, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 31, 32, 33, 34, 187, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, -1, 84, 85, 86, 87, 88, 89, 90, - 91, -1, -1, 94, 95, -1, -1, -1, -1, -1, - -1, 5, 6, 7, 8, -1, -1, -1, -1, -1, - -1, -1, -1, 114, 115, 116, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, - 84, 85, 86, 87, 88, 89, 90, 91, -1, -1, - 94, 95, -1, -1, -1, -1, -1, -1, -1, -1, - 201, -1, -1, -1, -1, -1, 207, 208, 209, 210, - 114, 115, 116, 3, 4, 5, 6, 7, 8, -1, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, -1, -1, 96, -1, -1, 3, 4, + 124, 125, 126, 127, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 142, -1, + -1, -1, -1, 124, 125, 126, 127, 32, 33, 34, + -1, 36, 37, 38, 39, 40, -1, -1, -1, -1, + -1, 142, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, -1, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, -1, -1, 85, -1, 201, -1, -1, - -1, -1, -1, 207, 208, 209, 210, -1, -1, -1, + -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 113, 114, 115, 116, -1, 118, -1, - -1, -1, -1, -1, -1, -1, 126, 127, 128, 129, - 130, 131 + -1, -1, -1, -1, -1, -1, 187, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, + 125, 126, 127, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 142, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 5, 6, 7, + 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, + -1, -1, 187, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, -1, -1, 96 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 119, 226, 228, 88, 0, 230, 123, 120, 227, - 232, 84, 85, 86, 231, 3, 4, 5, 6, 7, - 8, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 85, 113, 114, 115, 116, 118, 126, - 127, 128, 129, 130, 131, 229, 233, 267, 268, 269, - 270, 271, 276, 277, 278, 279, 283, 285, 286, 287, - 288, 289, 290, 291, 292, 321, 322, 323, 327, 122, - 33, 34, 37, 86, 223, 231, 36, 84, 86, 234, - 283, 286, 291, 123, 123, 123, 123, 123, 201, 321, - 222, 223, 304, 202, 206, 4, 33, 34, 35, 273, - 274, 284, 206, 222, 84, 86, 231, 234, 36, 286, - 286, 287, 203, 288, 231, 223, 287, 293, 294, 223, - 286, 288, 139, 200, 231, 280, 281, 282, 9, 10, - 11, 13, 14, 15, 16, 17, 83, 87, 88, 89, - 90, 91, 94, 95, 201, 207, 208, 209, 210, 222, - 223, 224, 234, 235, 236, 238, 239, 240, 241, 242, - 243, 244, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 265, 267, 268, - 279, 287, 298, 299, 300, 301, 305, 306, 307, 310, - 316, 320, 273, 272, 275, 287, 274, 231, 203, 221, - 201, 86, 222, 204, 249, 262, 266, 287, 123, 36, - 279, 324, 325, 326, 231, 295, 296, 224, 294, 293, - 222, 221, 202, 206, 222, 222, 299, 201, 201, 222, - 222, 265, 201, 201, 249, 249, 265, 224, 302, 94, - 95, 203, 205, 202, 202, 206, 82, 263, 201, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 221, - 264, 249, 211, 212, 213, 207, 208, 92, 93, 96, - 97, 214, 215, 98, 99, 216, 217, 218, 100, 102, - 101, 219, 206, 222, 36, 224, 299, 231, 272, 275, - 203, 221, 204, 266, 263, 297, 223, 204, 325, 224, - 287, 324, 203, 206, 222, 224, 88, 281, 83, 298, - 306, 317, 265, 222, 265, 113, 265, 278, 279, 309, - 202, 305, 237, 265, 231, 234, 245, 246, 247, 248, - 263, 263, 249, 249, 249, 251, 251, 252, 252, 253, - 253, 253, 253, 254, 254, 255, 256, 257, 258, 259, - 260, 265, 263, 203, 204, 266, 297, 221, 204, 324, - 287, 222, 295, 266, 296, 201, 309, 318, 319, 202, - 202, 231, 202, 224, 204, 201, 202, 202, 206, 82, - 263, 220, 266, 221, 204, 297, 221, 224, 295, 222, - 204, 265, 222, 202, 299, 308, 223, 311, 221, 300, - 303, 304, 263, 263, 204, 297, 221, 297, 222, 222, - 202, 265, 303, 12, 18, 19, 224, 312, 313, 314, - 315, 297, 297, 222, 299, 265, 220, 299, 312, 299, - 224, 314, 220 + 0, 130, 246, 248, 99, 0, 250, 95, 96, 97, + 134, 251, 131, 247, 252, 134, 251, 3, 4, 5, + 6, 7, 8, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 96, 124, 125, 126, + 127, 129, 137, 138, 139, 140, 141, 142, 187, 249, + 253, 287, 288, 289, 290, 291, 297, 298, 299, 300, + 305, 306, 307, 308, 310, 311, 312, 313, 314, 344, + 345, 346, 347, 348, 352, 133, 243, 251, 33, 34, + 36, 95, 97, 124, 254, 300, 306, 313, 134, 134, + 134, 134, 134, 221, 344, 242, 243, 327, 222, 226, + 4, 33, 34, 35, 293, 294, 295, 313, 226, 242, + 95, 97, 251, 254, 33, 34, 36, 306, 347, 306, + 310, 306, 306, 223, 309, 306, 97, 251, 299, 315, + 316, 243, 310, 150, 219, 251, 301, 303, 304, 9, + 10, 11, 13, 14, 15, 16, 17, 94, 98, 99, + 100, 101, 102, 105, 106, 221, 227, 228, 229, 230, + 242, 243, 244, 254, 255, 256, 258, 259, 260, 261, + 262, 263, 264, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 285, 287, + 288, 300, 310, 321, 322, 323, 324, 328, 329, 330, + 333, 339, 343, 293, 294, 292, 296, 310, 294, 294, + 251, 241, 309, 221, 242, 242, 242, 224, 269, 282, + 286, 310, 223, 243, 134, 251, 317, 318, 244, 316, + 315, 242, 241, 222, 226, 242, 242, 322, 221, 221, + 242, 242, 285, 221, 221, 269, 269, 285, 244, 325, + 105, 106, 223, 225, 222, 222, 226, 93, 283, 221, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 241, 284, 269, 231, 232, 233, 227, 228, 103, 104, + 107, 108, 234, 235, 109, 110, 236, 237, 238, 111, + 113, 112, 239, 226, 242, 244, 322, 251, 241, 309, + 243, 283, 319, 241, 224, 224, 286, 299, 350, 351, + 309, 226, 242, 244, 99, 100, 302, 303, 94, 321, + 329, 340, 285, 242, 285, 285, 299, 332, 222, 328, + 257, 285, 251, 254, 265, 266, 267, 268, 283, 283, + 269, 269, 269, 271, 271, 272, 272, 273, 273, 273, + 273, 274, 274, 275, 276, 277, 278, 279, 280, 285, + 283, 309, 319, 241, 319, 320, 319, 224, 317, 244, + 350, 318, 221, 332, 341, 342, 222, 222, 251, 222, + 244, 224, 221, 222, 222, 226, 93, 283, 240, 319, + 226, 244, 242, 97, 349, 285, 242, 222, 322, 331, + 243, 334, 241, 323, 326, 327, 283, 283, 244, 319, + 309, 242, 222, 285, 326, 12, 18, 19, 244, 335, + 336, 337, 338, 319, 242, 322, 285, 240, 322, 335, + 322, 244, 337, 240 }; #define yyerrok (yyerrstatus = 0) @@ -1927,18 +2405,9 @@ static const yytype_uint16 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1948,6 +2417,7 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -2010,7 +2480,7 @@ while (YYID (0)) #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex (&yylval, &yylloc, scanner) +# define YYLEX yylex (&yylval, &yylloc, state) #endif /* Enable debugging if requested. */ @@ -2113,20 +2583,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, state) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -2162,11 +2629,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, state) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , state); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -2203,6 +2670,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -2305,142 +2773,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; + int yyn = yypact[yystate]; - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -2476,9 +2917,10 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, state) break; } } - + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -2494,6 +2936,10 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ + + + + /*----------. | yyparse. | `----------*/ @@ -2520,59 +2966,24 @@ yyparse (state) #endif #endif { -/* The lookahead symbol. */ + /* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; -/* Location data for the lookahead symbol. */ +/* Number of syntax errors so far. */ +int yynerrs; +/* Location data for the look-ahead symbol. */ YYLTYPE yylloc; - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; - - YYSIZE_T yystacksize; - + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -2580,43 +2991,68 @@ YYLTYPE yylloc; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[2]; + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yyls = yylsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; yylsp = yyls; - #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 1; + yylloc.first_column = yylloc.last_column = 0; #endif -/* User initialization code. */ -/* Line 1590 of yacc.c */ -#line 53 "src/glsl/glsl_parser.yy" + /* User initialization code. */ +#line 85 "src/glsl/glsl_parser.yy" { yylloc.first_line = 1; yylloc.first_column = 1; @@ -2624,11 +3060,9 @@ YYLTYPE yylloc; yylloc.last_column = 1; yylloc.source = 0; } - -/* Line 1590 of yacc.c */ -#line 2630 "src/glsl/glsl_parser.cpp" +/* Line 1078 of yacc.c. */ +#line 3065 "src/glsl/glsl_parser.cpp" yylsp[0] = yylloc; - goto yysetstate; /*------------------------------------------------------------. @@ -2665,7 +3099,6 @@ YYLTYPE yylloc; &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); - yyls = yyls1; yyss = yyss1; yyvs = yyvs1; @@ -2687,9 +3120,9 @@ YYLTYPE yylloc; (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + YYSTACK_RELOCATE (yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -2710,9 +3143,6 @@ YYLTYPE yylloc; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -2721,16 +3151,16 @@ YYLTYPE yylloc; yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -2756,22 +3186,26 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -2812,2760 +3246,2634 @@ yyreduce: switch (yyn) { case 2: - -/* Line 1806 of yacc.c */ -#line 248 "src/glsl/glsl_parser.yy" +#line 298 "src/glsl/glsl_parser.yy" { - _mesa_glsl_initialize_types(state); - } + _mesa_glsl_initialize_types(state); + ;} break; case 3: - -/* Line 1806 of yacc.c */ -#line 252 "src/glsl/glsl_parser.yy" +#line 302 "src/glsl/glsl_parser.yy" { - delete state->symbols; - state->symbols = new(ralloc_parent(state)) glsl_symbol_table; - _mesa_glsl_initialize_types(state); - } + delete state->symbols; + state->symbols = new(ralloc_parent(state)) glsl_symbol_table; + _mesa_glsl_initialize_types(state); + ;} break; case 5: - -/* Line 1806 of yacc.c */ -#line 262 "src/glsl/glsl_parser.yy" +#line 312 "src/glsl/glsl_parser.yy" { - bool supported = false; - - switch ((yyvsp[(2) - (3)].n)) { - case 100: - state->es_shader = true; - supported = state->ctx->API == API_OPENGLES2 || - state->ctx->Extensions.ARB_ES2_compatibility; - break; - case 110: - case 120: - /* FINISHME: Once the OpenGL 3.0 'forward compatible' context or - * the OpenGL 3.2 Core context is supported, this logic will need - * change. Older versions of GLSL are no longer supported - * outside the compatibility contexts of 3.x. - */ - case 130: - case 140: - case 150: - case 330: - case 400: - case 410: - case 420: - supported = _mesa_is_desktop_gl(state->ctx) && - ((unsigned) (yyvsp[(2) - (3)].n)) <= state->ctx->Const.GLSLVersion; - break; - default: - supported = false; - break; - } - - state->language_version = (yyvsp[(2) - (3)].n); - state->version_string = - ralloc_asprintf(state, "GLSL%s %d.%02d", - state->es_shader ? " ES" : "", - state->language_version / 100, - state->language_version % 100); - - if (!supported) { - _mesa_glsl_error(& (yylsp[(2) - (3)]), state, "%s is not supported. " - "Supported versions are: %s\n", - state->version_string, - state->supported_version_string); - } - - if (state->language_version >= 140) { - state->ARB_uniform_buffer_object_enable = true; - } - } + state->process_version_directive(&(yylsp[(2) - (3)]), (yyvsp[(2) - (3)].n), NULL); + if (state->error) { + YYERROR; + } + ;} break; - case 10: - -/* Line 1806 of yacc.c */ + case 6: #line 319 "src/glsl/glsl_parser.yy" { - if (state->language_version == 110) { - _mesa_glsl_warning(& (yylsp[(1) - (2)]), state, - "pragma `invariant(all)' not supported in %s", - state->version_string); - } else { - state->all_invariant = true; - } - } + state->process_version_directive(&(yylsp[(2) - (4)]), (yyvsp[(2) - (4)].n), (yyvsp[(3) - (4)].identifier)); + if (state->error) { + YYERROR; + } + ;} break; - case 16: - -/* Line 1806 of yacc.c */ -#line 343 "src/glsl/glsl_parser.yy" + case 11: +#line 333 "src/glsl/glsl_parser.yy" { - if (!_mesa_glsl_process_extension((yyvsp[(2) - (5)].identifier), & (yylsp[(2) - (5)]), (yyvsp[(4) - (5)].identifier), & (yylsp[(4) - (5)]), state)) { - YYERROR; - } - } + if (!state->is_version(120, 100)) { + _mesa_glsl_warning(& (yylsp[(1) - (2)]), state, + "pragma `invariant(all)' not supported in %s " + "(GLSL ES 1.00 or GLSL 1.20 required)", + state->get_version_string()); + } else { + state->all_invariant = true; + } + ;} break; case 17: - -/* Line 1806 of yacc.c */ -#line 352 "src/glsl/glsl_parser.yy" +#line 358 "src/glsl/glsl_parser.yy" { - /* FINISHME: The NULL test is required because pragmas are set to - * FINISHME: NULL. (See production rule for external_declaration.) - */ - if ((yyvsp[(1) - (1)].node) != NULL) - state->translation_unit.push_tail(& (yyvsp[(1) - (1)].node)->link); - } + if (!_mesa_glsl_process_extension((yyvsp[(2) - (5)].identifier), & (yylsp[(2) - (5)]), (yyvsp[(4) - (5)].identifier), & (yylsp[(4) - (5)]), state)) { + YYERROR; + } + ;} break; case 18: - -/* Line 1806 of yacc.c */ -#line 360 "src/glsl/glsl_parser.yy" +#line 367 "src/glsl/glsl_parser.yy" { - /* FINISHME: The NULL test is required because pragmas are set to - * FINISHME: NULL. (See production rule for external_declaration.) - */ - if ((yyvsp[(2) - (2)].node) != NULL) - state->translation_unit.push_tail(& (yyvsp[(2) - (2)].node)->link); - } + /* FINISHME: The NULL test is required because pragmas are set to + * FINISHME: NULL. (See production rule for external_declaration.) + */ + if ((yyvsp[(1) - (1)].node) != NULL) + state->translation_unit.push_tail(& (yyvsp[(1) - (1)].node)->link); + ;} break; - case 21: - -/* Line 1806 of yacc.c */ -#line 376 "src/glsl/glsl_parser.yy" + case 19: +#line 375 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.identifier = (yyvsp[(1) - (1)].identifier); - } + /* FINISHME: The NULL test is required because pragmas are set to + * FINISHME: NULL. (See production rule for external_declaration.) + */ + if ((yyvsp[(2) - (2)].node) != NULL) + state->translation_unit.push_tail(& (yyvsp[(2) - (2)].node)->link); + ;} break; case 22: - -/* Line 1806 of yacc.c */ -#line 383 "src/glsl/glsl_parser.yy" +#line 391 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.int_constant = (yyvsp[(1) - (1)].n); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->primary_expression.identifier = (yyvsp[(1) - (1)].identifier); + ;} break; case 23: - -/* Line 1806 of yacc.c */ -#line 390 "src/glsl/glsl_parser.yy" +#line 398 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.uint_constant = (yyvsp[(1) - (1)].n); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->primary_expression.int_constant = (yyvsp[(1) - (1)].n); + ;} break; case 24: - -/* Line 1806 of yacc.c */ -#line 397 "src/glsl/glsl_parser.yy" +#line 405 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.float_constant = (yyvsp[(1) - (1)].real); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->primary_expression.uint_constant = (yyvsp[(1) - (1)].n); + ;} break; case 25: - -/* Line 1806 of yacc.c */ -#line 404 "src/glsl/glsl_parser.yy" +#line 412 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.bool_constant = (yyvsp[(1) - (1)].n); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->primary_expression.float_constant = (yyvsp[(1) - (1)].real); + ;} break; case 26: - -/* Line 1806 of yacc.c */ -#line 411 "src/glsl/glsl_parser.yy" - { - (yyval.expression) = (yyvsp[(2) - (3)].expression); - } - break; - - case 28: - -/* Line 1806 of yacc.c */ #line 419 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[(1) - (4)].expression), (yyvsp[(3) - (4)].expression), NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->primary_expression.bool_constant = (yyvsp[(1) - (1)].n); + ;} + break; + + case 27: +#line 426 "src/glsl/glsl_parser.yy" + { + (yyval.expression) = (yyvsp[(2) - (3)].expression); + ;} break; case 29: - -/* Line 1806 of yacc.c */ -#line 425 "src/glsl/glsl_parser.yy" +#line 434 "src/glsl/glsl_parser.yy" { - (yyval.expression) = (yyvsp[(1) - (1)].expression); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[(1) - (4)].expression), (yyvsp[(3) - (4)].expression), NULL); + (yyval.expression)->set_location(yylloc); + ;} break; case 30: - -/* Line 1806 of yacc.c */ -#line 429 "src/glsl/glsl_parser.yy" +#line 440 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[(1) - (3)].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->primary_expression.identifier = (yyvsp[(3) - (3)].identifier); - } + (yyval.expression) = (yyvsp[(1) - (1)].expression); + ;} break; case 31: - -/* Line 1806 of yacc.c */ -#line 436 "src/glsl/glsl_parser.yy" +#line 444 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[(1) - (2)].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[(1) - (3)].expression), NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->primary_expression.identifier = (yyvsp[(3) - (3)].identifier); + ;} break; case 32: - -/* Line 1806 of yacc.c */ -#line 442 "src/glsl/glsl_parser.yy" +#line 451 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[(1) - (2)].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[(1) - (2)].expression), NULL, NULL); + (yyval.expression)->set_location(yylloc); + ;} break; - case 36: - -/* Line 1806 of yacc.c */ -#line 460 "src/glsl/glsl_parser.yy" + case 33: +#line 457 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression), NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[(1) - (2)].expression), NULL, NULL); + (yyval.expression)->set_location(yylloc); + ;} break; - case 41: - -/* Line 1806 of yacc.c */ -#line 479 "src/glsl/glsl_parser.yy" + case 37: +#line 475 "src/glsl/glsl_parser.yy" { - (yyval.expression) = (yyvsp[(1) - (2)].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[(2) - (2)].expression)->link); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression), NULL); + (yyval.expression)->set_location(yylloc); + ;} break; case 42: - -/* Line 1806 of yacc.c */ -#line 485 "src/glsl/glsl_parser.yy" +#line 494 "src/glsl/glsl_parser.yy" { - (yyval.expression) = (yyvsp[(1) - (3)].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); - } + (yyval.expression) = (yyvsp[(1) - (2)].expression); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->expressions.push_tail(& (yyvsp[(2) - (2)].expression)->link); + ;} break; - case 44: - -/* Line 1806 of yacc.c */ -#line 501 "src/glsl/glsl_parser.yy" + case 43: +#line 500 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_function_expression((yyvsp[(1) - (1)].type_specifier)); - (yyval.expression)->set_location(yylloc); - } + (yyval.expression) = (yyvsp[(1) - (3)].expression); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); + ;} break; case 45: - -/* Line 1806 of yacc.c */ -#line 507 "src/glsl/glsl_parser.yy" +#line 516 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression((yyvsp[(1) - (1)].identifier)); - (yyval.expression) = new(ctx) ast_function_expression(callee); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_function_expression((yyvsp[(1) - (1)].type_specifier)); + (yyval.expression)->set_location(yylloc); + ;} break; case 46: - -/* Line 1806 of yacc.c */ -#line 514 "src/glsl/glsl_parser.yy" +#line 522 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression((yyvsp[(1) - (1)].identifier)); - (yyval.expression) = new(ctx) ast_function_expression(callee); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression((yyvsp[(1) - (1)].identifier)); + (yyval.expression) = new(ctx) ast_function_expression(callee); + (yyval.expression)->set_location(yylloc); + ;} break; - case 51: - -/* Line 1806 of yacc.c */ -#line 534 "src/glsl/glsl_parser.yy" + case 47: +#line 529 "src/glsl/glsl_parser.yy" { - (yyval.expression) = (yyvsp[(1) - (2)].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[(2) - (2)].expression)->link); - } + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression((yyvsp[(1) - (1)].identifier)); + (yyval.expression) = new(ctx) ast_function_expression(callee); + (yyval.expression)->set_location(yylloc); + ;} break; case 52: - -/* Line 1806 of yacc.c */ -#line 540 "src/glsl/glsl_parser.yy" +#line 549 "src/glsl/glsl_parser.yy" { - (yyval.expression) = (yyvsp[(1) - (3)].expression); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); - } + (yyval.expression) = (yyvsp[(1) - (2)].expression); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->expressions.push_tail(& (yyvsp[(2) - (2)].expression)->link); + ;} break; case 53: - -/* Line 1806 of yacc.c */ -#line 552 "src/glsl/glsl_parser.yy" +#line 555 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression((yyvsp[(1) - (2)].identifier)); - (yyval.expression) = new(ctx) ast_function_expression(callee); - (yyval.expression)->set_location(yylloc); - } + (yyval.expression) = (yyvsp[(1) - (3)].expression); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); + ;} break; - case 55: - -/* Line 1806 of yacc.c */ -#line 564 "src/glsl/glsl_parser.yy" + case 54: +#line 567 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[(2) - (2)].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression((yyvsp[(1) - (2)].identifier)); + (yyval.expression) = new(ctx) ast_function_expression(callee); + (yyval.expression)->set_location(yylloc); + ;} break; case 56: - -/* Line 1806 of yacc.c */ -#line 570 "src/glsl/glsl_parser.yy" +#line 579 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[(2) - (2)].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[(2) - (2)].expression), NULL, NULL); + (yyval.expression)->set_location(yylloc); + ;} break; case 57: - -/* Line 1806 of yacc.c */ -#line 576 "src/glsl/glsl_parser.yy" +#line 585 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression((yyvsp[(1) - (2)].n), (yyvsp[(2) - (2)].expression), NULL, NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[(2) - (2)].expression), NULL, NULL); + (yyval.expression)->set_location(yylloc); + ;} break; case 58: - -/* Line 1806 of yacc.c */ -#line 585 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_plus; } +#line 591 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression((yyvsp[(1) - (2)].n), (yyvsp[(2) - (2)].expression), NULL, NULL); + (yyval.expression)->set_location(yylloc); + ;} break; case 59: - -/* Line 1806 of yacc.c */ -#line 586 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_neg; } +#line 600 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_plus; ;} break; case 60: - -/* Line 1806 of yacc.c */ -#line 587 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_logic_not; } +#line 601 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_neg; ;} break; case 61: - -/* Line 1806 of yacc.c */ -#line 588 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_bit_not; } +#line 602 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_logic_not; ;} break; - case 63: - -/* Line 1806 of yacc.c */ -#line 594 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + case 62: +#line 603 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_bit_not; ;} break; case 64: - -/* Line 1806 of yacc.c */ -#line 600 "src/glsl/glsl_parser.yy" +#line 609 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 65: - -/* Line 1806 of yacc.c */ -#line 606 "src/glsl/glsl_parser.yy" +#line 615 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 67: - -/* Line 1806 of yacc.c */ -#line 616 "src/glsl/glsl_parser.yy" + case 66: +#line 621 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 68: - -/* Line 1806 of yacc.c */ -#line 622 "src/glsl/glsl_parser.yy" +#line 631 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 70: - -/* Line 1806 of yacc.c */ -#line 632 "src/glsl/glsl_parser.yy" + case 69: +#line 637 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 71: - -/* Line 1806 of yacc.c */ -#line 638 "src/glsl/glsl_parser.yy" +#line 647 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 73: - -/* Line 1806 of yacc.c */ -#line 648 "src/glsl/glsl_parser.yy" + case 72: +#line 653 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 74: - -/* Line 1806 of yacc.c */ -#line 654 "src/glsl/glsl_parser.yy" +#line 663 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 75: - -/* Line 1806 of yacc.c */ -#line 660 "src/glsl/glsl_parser.yy" +#line 669 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 76: - -/* Line 1806 of yacc.c */ -#line 666 "src/glsl/glsl_parser.yy" +#line 675 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 78: - -/* Line 1806 of yacc.c */ -#line 676 "src/glsl/glsl_parser.yy" + case 77: +#line 681 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 79: - -/* Line 1806 of yacc.c */ -#line 682 "src/glsl/glsl_parser.yy" +#line 691 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 81: - -/* Line 1806 of yacc.c */ -#line 692 "src/glsl/glsl_parser.yy" + case 80: +#line 697 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 83: - -/* Line 1806 of yacc.c */ -#line 702 "src/glsl/glsl_parser.yy" + case 82: +#line 707 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 85: - -/* Line 1806 of yacc.c */ -#line 712 "src/glsl/glsl_parser.yy" + case 84: +#line 717 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 87: - -/* Line 1806 of yacc.c */ -#line 722 "src/glsl/glsl_parser.yy" + case 86: +#line 727 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 89: - -/* Line 1806 of yacc.c */ -#line 732 "src/glsl/glsl_parser.yy" + case 88: +#line 737 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 91: - -/* Line 1806 of yacc.c */ -#line 742 "src/glsl/glsl_parser.yy" + case 90: +#line 747 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 93: - -/* Line 1806 of yacc.c */ -#line 752 "src/glsl/glsl_parser.yy" + case 92: +#line 757 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[(1) - (5)].expression), (yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].expression)); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; - case 95: - -/* Line 1806 of yacc.c */ -#line 762 "src/glsl/glsl_parser.yy" + case 94: +#line 767 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.expression) = new(ctx) ast_expression((yyvsp[(2) - (3)].n), (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression), NULL); - (yyval.expression)->set_location(yylloc); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[(1) - (5)].expression), (yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].expression)); + (yyval.expression)->set_location(yylloc); + ;} break; case 96: - -/* Line 1806 of yacc.c */ -#line 770 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_assign; } +#line 777 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.expression) = new(ctx) ast_expression((yyvsp[(2) - (3)].n), (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression), NULL); + (yyval.expression)->set_location(yylloc); + ;} break; case 97: - -/* Line 1806 of yacc.c */ -#line 771 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_mul_assign; } +#line 785 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_assign; ;} break; case 98: - -/* Line 1806 of yacc.c */ -#line 772 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_div_assign; } +#line 786 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_mul_assign; ;} break; case 99: - -/* Line 1806 of yacc.c */ -#line 773 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_mod_assign; } +#line 787 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_div_assign; ;} break; case 100: - -/* Line 1806 of yacc.c */ -#line 774 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_add_assign; } +#line 788 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_mod_assign; ;} break; case 101: - -/* Line 1806 of yacc.c */ -#line 775 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_sub_assign; } +#line 789 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_add_assign; ;} break; case 102: - -/* Line 1806 of yacc.c */ -#line 776 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_ls_assign; } +#line 790 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_sub_assign; ;} break; case 103: - -/* Line 1806 of yacc.c */ -#line 777 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_rs_assign; } +#line 791 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_ls_assign; ;} break; case 104: - -/* Line 1806 of yacc.c */ -#line 778 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_and_assign; } +#line 792 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_rs_assign; ;} break; case 105: - -/* Line 1806 of yacc.c */ -#line 779 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_xor_assign; } +#line 793 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_and_assign; ;} break; case 106: - -/* Line 1806 of yacc.c */ -#line 780 "src/glsl/glsl_parser.yy" - { (yyval.n) = ast_or_assign; } +#line 794 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_xor_assign; ;} break; case 107: - -/* Line 1806 of yacc.c */ -#line 785 "src/glsl/glsl_parser.yy" - { - (yyval.expression) = (yyvsp[(1) - (1)].expression); - } +#line 795 "src/glsl/glsl_parser.yy" + { (yyval.n) = ast_or_assign; ;} break; case 108: - -/* Line 1806 of yacc.c */ -#line 789 "src/glsl/glsl_parser.yy" +#line 800 "src/glsl/glsl_parser.yy" { - void *ctx = state; - if ((yyvsp[(1) - (3)].expression)->oper != ast_sequence) { - (yyval.expression) = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL); - (yyval.expression)->set_location(yylloc); - (yyval.expression)->expressions.push_tail(& (yyvsp[(1) - (3)].expression)->link); - } else { - (yyval.expression) = (yyvsp[(1) - (3)].expression); - } - - (yyval.expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); - } + (yyval.expression) = (yyvsp[(1) - (1)].expression); + ;} break; - case 110: - -/* Line 1806 of yacc.c */ -#line 809 "src/glsl/glsl_parser.yy" + case 109: +#line 804 "src/glsl/glsl_parser.yy" { - state->symbols->pop_scope(); - (yyval.node) = (yyvsp[(1) - (2)].function); - } + void *ctx = state; + if ((yyvsp[(1) - (3)].expression)->oper != ast_sequence) { + (yyval.expression) = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->expressions.push_tail(& (yyvsp[(1) - (3)].expression)->link); + } else { + (yyval.expression) = (yyvsp[(1) - (3)].expression); + } + + (yyval.expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); + ;} break; case 111: - -/* Line 1806 of yacc.c */ -#line 814 "src/glsl/glsl_parser.yy" +#line 824 "src/glsl/glsl_parser.yy" { - (yyval.node) = (yyvsp[(1) - (2)].declarator_list); - } + state->symbols->pop_scope(); + (yyval.node) = (yyvsp[(1) - (2)].function); + ;} break; case 112: - -/* Line 1806 of yacc.c */ -#line 818 "src/glsl/glsl_parser.yy" +#line 829 "src/glsl/glsl_parser.yy" { - (yyvsp[(3) - (4)].type_specifier)->precision = (yyvsp[(2) - (4)].n); - (yyvsp[(3) - (4)].type_specifier)->is_precision_statement = true; - (yyval.node) = (yyvsp[(3) - (4)].type_specifier); - } + (yyval.node) = (yyvsp[(1) - (2)].declarator_list); + ;} break; case 113: - -/* Line 1806 of yacc.c */ -#line 824 "src/glsl/glsl_parser.yy" +#line 833 "src/glsl/glsl_parser.yy" { - (yyval.node) = (yyvsp[(1) - (1)].node); - } + (yyvsp[(3) - (4)].type_specifier)->default_precision = (yyvsp[(2) - (4)].n); + (yyval.node) = (yyvsp[(3) - (4)].type_specifier); + ;} break; - case 117: - -/* Line 1806 of yacc.c */ -#line 840 "src/glsl/glsl_parser.yy" + case 114: +#line 838 "src/glsl/glsl_parser.yy" { - (yyval.function) = (yyvsp[(1) - (2)].function); - (yyval.function)->parameters.push_tail(& (yyvsp[(2) - (2)].parameter_declarator)->link); - } + (yyval.node) = (yyvsp[(1) - (1)].node); + ;} break; case 118: - -/* Line 1806 of yacc.c */ -#line 845 "src/glsl/glsl_parser.yy" +#line 854 "src/glsl/glsl_parser.yy" { - (yyval.function) = (yyvsp[(1) - (3)].function); - (yyval.function)->parameters.push_tail(& (yyvsp[(3) - (3)].parameter_declarator)->link); - } + (yyval.function) = (yyvsp[(1) - (2)].function); + (yyval.function)->parameters.push_tail(& (yyvsp[(2) - (2)].parameter_declarator)->link); + ;} break; case 119: - -/* Line 1806 of yacc.c */ -#line 853 "src/glsl/glsl_parser.yy" +#line 859 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.function) = new(ctx) ast_function(); - (yyval.function)->set_location(yylloc); - (yyval.function)->return_type = (yyvsp[(1) - (3)].fully_specified_type); - (yyval.function)->identifier = (yyvsp[(2) - (3)].identifier); - - state->symbols->add_function(new(state) ir_function((yyvsp[(2) - (3)].identifier))); - state->symbols->push_scope(); - } + (yyval.function) = (yyvsp[(1) - (3)].function); + (yyval.function)->parameters.push_tail(& (yyvsp[(3) - (3)].parameter_declarator)->link); + ;} break; case 120: - -/* Line 1806 of yacc.c */ #line 867 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); - (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); - (yyval.parameter_declarator)->type->set_location(yylloc); - (yyval.parameter_declarator)->type->specifier = (yyvsp[(1) - (2)].type_specifier); - (yyval.parameter_declarator)->identifier = (yyvsp[(2) - (2)].identifier); - } + void *ctx = state; + (yyval.function) = new(ctx) ast_function(); + (yyval.function)->set_location(yylloc); + (yyval.function)->return_type = (yyvsp[(1) - (3)].fully_specified_type); + (yyval.function)->identifier = (yyvsp[(2) - (3)].identifier); + + state->symbols->add_function(new(state) ir_function((yyvsp[(2) - (3)].identifier))); + state->symbols->push_scope(); + ;} break; case 121: - -/* Line 1806 of yacc.c */ -#line 877 "src/glsl/glsl_parser.yy" +#line 881 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); - (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); - (yyval.parameter_declarator)->type->set_location(yylloc); - (yyval.parameter_declarator)->type->specifier = (yyvsp[(1) - (5)].type_specifier); - (yyval.parameter_declarator)->identifier = (yyvsp[(2) - (5)].identifier); - (yyval.parameter_declarator)->is_array = true; - (yyval.parameter_declarator)->array_size = (yyvsp[(4) - (5)].expression); - } + void *ctx = state; + (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); + (yyval.parameter_declarator)->set_location(yylloc); + (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); + (yyval.parameter_declarator)->type->set_location(yylloc); + (yyval.parameter_declarator)->type->specifier = (yyvsp[(1) - (2)].type_specifier); + (yyval.parameter_declarator)->identifier = (yyvsp[(2) - (2)].identifier); + ;} break; case 122: - -/* Line 1806 of yacc.c */ -#line 892 "src/glsl/glsl_parser.yy" +#line 891 "src/glsl/glsl_parser.yy" { - (yyvsp[(1) - (3)].type_qualifier).flags.i |= (yyvsp[(2) - (3)].type_qualifier).flags.i; - - (yyval.parameter_declarator) = (yyvsp[(3) - (3)].parameter_declarator); - (yyval.parameter_declarator)->type->qualifier = (yyvsp[(1) - (3)].type_qualifier); - } + void *ctx = state; + (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); + (yyval.parameter_declarator)->set_location(yylloc); + (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); + (yyval.parameter_declarator)->type->set_location(yylloc); + (yyval.parameter_declarator)->type->specifier = (yyvsp[(1) - (3)].type_specifier); + (yyval.parameter_declarator)->identifier = (yyvsp[(2) - (3)].identifier); + (yyval.parameter_declarator)->array_specifier = (yyvsp[(3) - (3)].array_specifier); + ;} break; case 123: - -/* Line 1806 of yacc.c */ -#line 899 "src/glsl/glsl_parser.yy" +#line 905 "src/glsl/glsl_parser.yy" { - (yyval.parameter_declarator) = (yyvsp[(2) - (2)].parameter_declarator); - (yyval.parameter_declarator)->type->qualifier = (yyvsp[(1) - (2)].type_qualifier); - } + (yyval.parameter_declarator) = (yyvsp[(2) - (2)].parameter_declarator); + (yyval.parameter_declarator)->type->qualifier = (yyvsp[(1) - (2)].type_qualifier); + ;} break; case 124: - -/* Line 1806 of yacc.c */ -#line 904 "src/glsl/glsl_parser.yy" +#line 910 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyvsp[(1) - (3)].type_qualifier).flags.i |= (yyvsp[(2) - (3)].type_qualifier).flags.i; - - (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); - (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); - (yyval.parameter_declarator)->type->qualifier = (yyvsp[(1) - (3)].type_qualifier); - (yyval.parameter_declarator)->type->specifier = (yyvsp[(3) - (3)].type_specifier); - } + void *ctx = state; + (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); + (yyval.parameter_declarator)->set_location(yylloc); + (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); + (yyval.parameter_declarator)->type->qualifier = (yyvsp[(1) - (2)].type_qualifier); + (yyval.parameter_declarator)->type->specifier = (yyvsp[(2) - (2)].type_specifier); + ;} break; case 125: - -/* Line 1806 of yacc.c */ -#line 915 "src/glsl/glsl_parser.yy" +#line 922 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.parameter_declarator) = new(ctx) ast_parameter_declarator(); - (yyval.parameter_declarator)->set_location(yylloc); - (yyval.parameter_declarator)->type = new(ctx) ast_fully_specified_type(); - (yyval.parameter_declarator)->type->qualifier = (yyvsp[(1) - (2)].type_qualifier); - (yyval.parameter_declarator)->type->specifier = (yyvsp[(2) - (2)].type_specifier); - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + ;} break; case 126: - -/* Line 1806 of yacc.c */ #line 927 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - } + if ((yyvsp[(2) - (2)].type_qualifier).flags.q.constant) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate const qualifier"); + + (yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier); + (yyval.type_qualifier).flags.q.constant = 1; + ;} break; case 127: - -/* Line 1806 of yacc.c */ -#line 931 "src/glsl/glsl_parser.yy" +#line 935 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.in = 1; - } + if (((yyvsp[(1) - (2)].type_qualifier).flags.q.in || (yyvsp[(1) - (2)].type_qualifier).flags.q.out) && ((yyvsp[(2) - (2)].type_qualifier).flags.q.in || (yyvsp[(2) - (2)].type_qualifier).flags.q.out)) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate in/out/inout qualifier"); + + if (!state->ARB_shading_language_420pack_enable && (yyvsp[(2) - (2)].type_qualifier).flags.q.constant) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "const must be specified before " + "in/out/inout"); + + (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); + (yyval.type_qualifier).merge_qualifier(&(yylsp[(1) - (2)]), state, (yyvsp[(2) - (2)].type_qualifier)); + ;} break; case 128: - -/* Line 1806 of yacc.c */ -#line 936 "src/glsl/glsl_parser.yy" +#line 947 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.out = 1; - } + if ((yyvsp[(2) - (2)].type_qualifier).precision != ast_precision_none) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate precision qualifier"); + + if (!state->ARB_shading_language_420pack_enable && (yyvsp[(2) - (2)].type_qualifier).flags.i != 0) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "precision qualifiers must come last"); + + (yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier); + (yyval.type_qualifier).precision = (yyvsp[(1) - (2)].n); + ;} break; case 129: - -/* Line 1806 of yacc.c */ -#line 941 "src/glsl/glsl_parser.yy" +#line 960 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.in = 1; - (yyval.type_qualifier).flags.q.out = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.in = 1; + ;} break; - case 132: - -/* Line 1806 of yacc.c */ -#line 955 "src/glsl/glsl_parser.yy" + case 130: +#line 966 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (3)].identifier), false, NULL, NULL); - decl->set_location(yylloc); - - (yyval.declarator_list) = (yyvsp[(1) - (3)].declarator_list); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (3)].identifier), ir_var_auto, glsl_precision_undefined)); - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.out = 1; + ;} break; - case 133: - -/* Line 1806 of yacc.c */ -#line 965 "src/glsl/glsl_parser.yy" + case 131: +#line 972 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (5)].identifier), true, NULL, NULL); - decl->set_location(yylloc); - - (yyval.declarator_list) = (yyvsp[(1) - (5)].declarator_list); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (5)].identifier), ir_var_auto, glsl_precision_undefined)); - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.in = 1; + (yyval.type_qualifier).flags.q.out = 1; + ;} break; case 134: - -/* Line 1806 of yacc.c */ -#line 975 "src/glsl/glsl_parser.yy" +#line 988 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (6)].identifier), true, (yyvsp[(5) - (6)].expression), NULL); - decl->set_location(yylloc); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (3)].identifier), NULL, NULL); + decl->set_location(yylloc); - (yyval.declarator_list) = (yyvsp[(1) - (6)].declarator_list); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (6)].identifier), ir_var_auto, glsl_precision_undefined)); - } + (yyval.declarator_list) = (yyvsp[(1) - (3)].declarator_list); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (3)].identifier), ir_var_auto, glsl_precision_undefined)); + ;} break; case 135: - -/* Line 1806 of yacc.c */ -#line 985 "src/glsl/glsl_parser.yy" +#line 998 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (7)].identifier), true, NULL, (yyvsp[(7) - (7)].expression)); - decl->set_location(yylloc); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (4)].identifier), (yyvsp[(4) - (4)].array_specifier), NULL); + decl->set_location(yylloc); - (yyval.declarator_list) = (yyvsp[(1) - (7)].declarator_list); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (7)].identifier), ir_var_auto, glsl_precision_undefined)); - } + (yyval.declarator_list) = (yyvsp[(1) - (4)].declarator_list); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (4)].identifier), ir_var_auto, glsl_precision_undefined)); + ;} break; case 136: - -/* Line 1806 of yacc.c */ -#line 995 "src/glsl/glsl_parser.yy" +#line 1008 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (8)].identifier), true, (yyvsp[(5) - (8)].expression), (yyvsp[(8) - (8)].expression)); - decl->set_location(yylloc); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (6)].identifier), (yyvsp[(4) - (6)].array_specifier), (yyvsp[(6) - (6)].expression)); + decl->set_location(yylloc); - (yyval.declarator_list) = (yyvsp[(1) - (8)].declarator_list); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (8)].identifier), ir_var_auto, glsl_precision_undefined)); - } + (yyval.declarator_list) = (yyvsp[(1) - (6)].declarator_list); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (6)].identifier), ir_var_auto, glsl_precision_undefined)); + ;} break; case 137: - -/* Line 1806 of yacc.c */ -#line 1005 "src/glsl/glsl_parser.yy" +#line 1018 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (5)].identifier), false, NULL, (yyvsp[(5) - (5)].expression)); - decl->set_location(yylloc); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(3) - (5)].identifier), NULL, (yyvsp[(5) - (5)].expression)); + decl->set_location(yylloc); - (yyval.declarator_list) = (yyvsp[(1) - (5)].declarator_list); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (5)].identifier), ir_var_auto, glsl_precision_undefined)); - } + (yyval.declarator_list) = (yyvsp[(1) - (5)].declarator_list); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(3) - (5)].identifier), ir_var_auto, glsl_precision_undefined)); + ;} break; case 138: - -/* Line 1806 of yacc.c */ -#line 1019 "src/glsl/glsl_parser.yy" +#line 1032 "src/glsl/glsl_parser.yy" { - void *ctx = state; - /* Empty declaration list is valid. */ - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (1)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - } + void *ctx = state; + /* Empty declaration list is valid. */ + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (1)].fully_specified_type)); + (yyval.declarator_list)->set_location(yylloc); + ;} break; case 139: - -/* Line 1806 of yacc.c */ -#line 1026 "src/glsl/glsl_parser.yy" +#line 1039 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (2)].identifier), false, NULL, NULL); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (2)].identifier), NULL, NULL); - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (2)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (2)].fully_specified_type)); + (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + ;} break; case 140: - -/* Line 1806 of yacc.c */ -#line 1035 "src/glsl/glsl_parser.yy" +#line 1048 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (4)].identifier), true, NULL, NULL); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (3)].identifier), (yyvsp[(3) - (3)].array_specifier), NULL); - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (4)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (3)].fully_specified_type)); + (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + ;} break; case 141: - -/* Line 1806 of yacc.c */ -#line 1044 "src/glsl/glsl_parser.yy" +#line 1057 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (5)].identifier), true, (yyvsp[(4) - (5)].expression), NULL); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (5)].identifier), (yyvsp[(3) - (5)].array_specifier), (yyvsp[(5) - (5)].expression)); - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (5)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (5)].fully_specified_type)); + (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + ;} break; case 142: - -/* Line 1806 of yacc.c */ -#line 1053 "src/glsl/glsl_parser.yy" +#line 1066 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (6)].identifier), true, NULL, (yyvsp[(6) - (6)].expression)); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (4)].identifier), NULL, (yyvsp[(4) - (4)].expression)); - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (6)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (4)].fully_specified_type)); + (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->declarations.push_tail(&decl->link); + ;} break; case 143: - -/* Line 1806 of yacc.c */ -#line 1062 "src/glsl/glsl_parser.yy" +#line 1075 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (7)].identifier), true, (yyvsp[(4) - (7)].expression), (yyvsp[(7) - (7)].expression)); + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (2)].identifier), NULL, NULL); - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (7)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL); + (yyval.declarator_list)->set_location(yylloc); + (yyval.declarator_list)->invariant = true; + + (yyval.declarator_list)->declarations.push_tail(&decl->link); + ;} break; case 144: - -/* Line 1806 of yacc.c */ -#line 1071 "src/glsl/glsl_parser.yy" +#line 1089 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (4)].identifier), false, NULL, (yyvsp[(4) - (4)].expression)); - - (yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[(1) - (4)].fully_specified_type)); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + void *ctx = state; + (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); + (yyval.fully_specified_type)->set_location(yylloc); + (yyval.fully_specified_type)->specifier = (yyvsp[(1) - (1)].type_specifier); + ;} break; case 145: - -/* Line 1806 of yacc.c */ -#line 1080 "src/glsl/glsl_parser.yy" +#line 1096 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (2)].identifier), false, NULL, NULL); - - (yyval.declarator_list) = new(ctx) ast_declarator_list(NULL); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->invariant = true; - - (yyval.declarator_list)->declarations.push_tail(&decl->link); - } + void *ctx = state; + (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); + (yyval.fully_specified_type)->set_location(yylloc); + (yyval.fully_specified_type)->qualifier = (yyvsp[(1) - (2)].type_qualifier); + (yyval.fully_specified_type)->specifier = (yyvsp[(2) - (2)].type_specifier); + ;} break; case 146: - -/* Line 1806 of yacc.c */ -#line 1094 "src/glsl/glsl_parser.yy" +#line 1107 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); - (yyval.fully_specified_type)->set_location(yylloc); - (yyval.fully_specified_type)->specifier = (yyvsp[(1) - (1)].type_specifier); - } - break; - - case 147: - -/* Line 1806 of yacc.c */ -#line 1101 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.fully_specified_type) = new(ctx) ast_fully_specified_type(); - (yyval.fully_specified_type)->set_location(yylloc); - (yyval.fully_specified_type)->qualifier = (yyvsp[(1) - (2)].type_qualifier); - (yyval.fully_specified_type)->specifier = (yyvsp[(2) - (2)].type_specifier); - } + (yyval.type_qualifier) = (yyvsp[(3) - (4)].type_qualifier); + ;} break; case 148: - -/* Line 1806 of yacc.c */ -#line 1112 "src/glsl/glsl_parser.yy" +#line 1115 "src/glsl/glsl_parser.yy" { - (yyval.type_qualifier) = (yyvsp[(3) - (4)].type_qualifier); - } + (yyval.type_qualifier) = (yyvsp[(1) - (3)].type_qualifier); + if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[(3) - (3)]), state, (yyvsp[(3) - (3)].type_qualifier))) { + YYERROR; + } + ;} + break; + + case 149: +#line 1124 "src/glsl/glsl_parser.yy" + { (yyval.n) = (yyvsp[(1) - (1)].n); ;} break; case 150: - -/* Line 1806 of yacc.c */ -#line 1120 "src/glsl/glsl_parser.yy" - { - (yyval.type_qualifier) = (yyvsp[(1) - (3)].type_qualifier); - if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[(3) - (3)]), state, (yyvsp[(3) - (3)].type_qualifier))) { - YYERROR; - } - } +#line 1125 "src/glsl/glsl_parser.yy" + { (yyval.n) = (yyvsp[(1) - (1)].n); ;} break; case 151: - -/* Line 1806 of yacc.c */ #line 1130 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; - /* Layout qualifiers for ARB_fragment_coord_conventions. */ - if (!(yyval.type_qualifier).flags.i && state->ARB_fragment_coord_conventions_enable) { - if (strcmp((yyvsp[(1) - (1)].identifier), "origin_upper_left") == 0) { - (yyval.type_qualifier).flags.q.origin_upper_left = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "pixel_center_integer") == 0) { - (yyval.type_qualifier).flags.q.pixel_center_integer = 1; - } + /* Layout qualifiers for ARB_fragment_coord_conventions. */ + if (!(yyval.type_qualifier).flags.i && (state->ARB_fragment_coord_conventions_enable || + state->is_version(150, 0))) { + if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "origin_upper_left", state) == 0) { + (yyval.type_qualifier).flags.q.origin_upper_left = 1; + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "pixel_center_integer", + state) == 0) { + (yyval.type_qualifier).flags.q.pixel_center_integer = 1; + } - if ((yyval.type_qualifier).flags.i && state->ARB_fragment_coord_conventions_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "GL_ARB_fragment_coord_conventions layout " - "identifier `%s' used\n", (yyvsp[(1) - (1)].identifier)); - } - } + if ((yyval.type_qualifier).flags.i && state->ARB_fragment_coord_conventions_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, + "GL_ARB_fragment_coord_conventions layout " + "identifier `%s' used", (yyvsp[(1) - (1)].identifier)); + } + } - /* Layout qualifiers for AMD/ARB_conservative_depth. */ - if (!(yyval.type_qualifier).flags.i && - (state->AMD_conservative_depth_enable || - state->ARB_conservative_depth_enable)) { - if (strcmp((yyvsp[(1) - (1)].identifier), "depth_any") == 0) { - (yyval.type_qualifier).flags.q.depth_any = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "depth_greater") == 0) { - (yyval.type_qualifier).flags.q.depth_greater = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "depth_less") == 0) { - (yyval.type_qualifier).flags.q.depth_less = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "depth_unchanged") == 0) { - (yyval.type_qualifier).flags.q.depth_unchanged = 1; - } - - if ((yyval.type_qualifier).flags.i && state->AMD_conservative_depth_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "GL_AMD_conservative_depth " - "layout qualifier `%s' is used\n", (yyvsp[(1) - (1)].identifier)); - } - if ((yyval.type_qualifier).flags.i && state->ARB_conservative_depth_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "GL_ARB_conservative_depth " - "layout qualifier `%s' is used\n", (yyvsp[(1) - (1)].identifier)); - } - } + /* Layout qualifiers for AMD/ARB_conservative_depth. */ + if (!(yyval.type_qualifier).flags.i && + (state->AMD_conservative_depth_enable || + state->ARB_conservative_depth_enable)) { + if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "depth_any", state) == 0) { + (yyval.type_qualifier).flags.q.depth_any = 1; + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "depth_greater", state) == 0) { + (yyval.type_qualifier).flags.q.depth_greater = 1; + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "depth_less", state) == 0) { + (yyval.type_qualifier).flags.q.depth_less = 1; + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "depth_unchanged", + state) == 0) { + (yyval.type_qualifier).flags.q.depth_unchanged = 1; + } - /* See also uniform_block_layout_qualifier. */ - if (!(yyval.type_qualifier).flags.i && state->ARB_uniform_buffer_object_enable) { - if (strcmp((yyvsp[(1) - (1)].identifier), "std140") == 0) { - (yyval.type_qualifier).flags.q.std140 = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "shared") == 0) { - (yyval.type_qualifier).flags.q.shared = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "column_major") == 0) { - (yyval.type_qualifier).flags.q.column_major = 1; - } + if ((yyval.type_qualifier).flags.i && state->AMD_conservative_depth_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, + "GL_AMD_conservative_depth " + "layout qualifier `%s' is used", (yyvsp[(1) - (1)].identifier)); + } + if ((yyval.type_qualifier).flags.i && state->ARB_conservative_depth_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, + "GL_ARB_conservative_depth " + "layout qualifier `%s' is used", (yyvsp[(1) - (1)].identifier)); + } + } - if ((yyval.type_qualifier).flags.i && state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "layout qualifier `%s' is used\n", (yyvsp[(1) - (1)].identifier)); - } - } + /* See also interface_block_layout_qualifier. */ + if (!(yyval.type_qualifier).flags.i && state->has_uniform_buffer_objects()) { + if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "std140", state) == 0) { + (yyval.type_qualifier).flags.q.std140 = 1; + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "shared", state) == 0) { + (yyval.type_qualifier).flags.q.shared = 1; + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "column_major", state) == 0) { + (yyval.type_qualifier).flags.q.column_major = 1; + /* "row_major" is a reserved word in GLSL 1.30+. Its token is parsed + * below in the interface_block_layout_qualifier rule. + * + * It is not a reserved word in GLSL ES 3.00, so it's handled here as + * an identifier. + * + * Also, this takes care of alternate capitalizations of + * "row_major" (which is necessary because layout qualifiers + * are case-insensitive in desktop GLSL). + */ + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "row_major", state) == 0) { + (yyval.type_qualifier).flags.q.row_major = 1; + /* "packed" is a reserved word in GLSL, and its token is + * parsed below in the interface_block_layout_qualifier rule. + * However, we must take care of alternate capitalizations of + * "packed", because layout qualifiers are case-insensitive + * in desktop GLSL. + */ + } else if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), "packed", state) == 0) { + (yyval.type_qualifier).flags.q.packed = 1; + } - if (!(yyval.type_qualifier).flags.i) { - _mesa_glsl_error(& (yylsp[(1) - (1)]), state, "unrecognized layout identifier " - "`%s'\n", (yyvsp[(1) - (1)].identifier)); - YYERROR; - } - } + if ((yyval.type_qualifier).flags.i && state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, + "#version 140 / GL_ARB_uniform_buffer_object " + "layout qualifier `%s' is used", (yyvsp[(1) - (1)].identifier)); + } + } + + /* Layout qualifiers for GLSL 1.50 geometry shaders. */ + if (!(yyval.type_qualifier).flags.i) { + struct { + const char *s; + GLenum e; + } map[] = { + { "points", GL_POINTS }, + { "lines", GL_LINES }, + { "lines_adjacency", GL_LINES_ADJACENCY }, + { "line_strip", GL_LINE_STRIP }, + { "triangles", GL_TRIANGLES }, + { "triangles_adjacency", GL_TRIANGLES_ADJACENCY }, + { "triangle_strip", GL_TRIANGLE_STRIP }, + }; + for (unsigned i = 0; i < Elements(map); i++) { + if (match_layout_qualifier((yyvsp[(1) - (1)].identifier), map[i].s, state) == 0) { + (yyval.type_qualifier).flags.q.prim_type = 1; + (yyval.type_qualifier).prim_type = map[i].e; + break; + } + } + + if ((yyval.type_qualifier).flags.i && !state->is_version(150, 0)) { + _mesa_glsl_error(& (yylsp[(1) - (1)]), state, "#version 150 layout " + "qualifier `%s' used", (yyvsp[(1) - (1)].identifier)); + } + } + + if (!(yyval.type_qualifier).flags.i) { + _mesa_glsl_error(& (yylsp[(1) - (1)]), state, "unrecognized layout identifier " + "`%s'", (yyvsp[(1) - (1)].identifier)); + YYERROR; + } + ;} break; case 152: - -/* Line 1806 of yacc.c */ -#line 1198 "src/glsl/glsl_parser.yy" +#line 1250 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; - if (state->ARB_explicit_attrib_location_enable) { - /* FINISHME: Handle 'index' once GL_ARB_blend_func_exteneded and - * FINISHME: GLSL 1.30 (or later) are supported. - */ - if (strcmp("location", (yyvsp[(1) - (3)].identifier)) == 0) { - (yyval.type_qualifier).flags.q.explicit_location = 1; + if (match_layout_qualifier("location", (yyvsp[(1) - (3)].identifier), state) == 0) { + (yyval.type_qualifier).flags.q.explicit_location = 1; - if ((yyvsp[(3) - (3)].n) >= 0) { - (yyval.type_qualifier).location = (yyvsp[(3) - (3)].n); - } else { - _mesa_glsl_error(& (yylsp[(3) - (3)]), state, - "invalid location %d specified\n", (yyvsp[(3) - (3)].n)); - YYERROR; - } - } + if ((yyvsp[(3) - (3)].n) >= 0) { + (yyval.type_qualifier).location = (yyvsp[(3) - (3)].n); + } else { + _mesa_glsl_error(& (yylsp[(3) - (3)]), state, "invalid location %d specified", (yyvsp[(3) - (3)].n)); + YYERROR; + } + } - if (strcmp("index", (yyvsp[(1) - (3)].identifier)) == 0) { - (yyval.type_qualifier).flags.q.explicit_index = 1; + if (match_layout_qualifier("index", (yyvsp[(1) - (3)].identifier), state) == 0) { + (yyval.type_qualifier).flags.q.explicit_index = 1; - if ((yyvsp[(3) - (3)].n) >= 0) { - (yyval.type_qualifier).index = (yyvsp[(3) - (3)].n); - } else { - _mesa_glsl_error(& (yylsp[(3) - (3)]), state, - "invalid index %d specified\n", (yyvsp[(3) - (3)].n)); - YYERROR; - } - } - } + if ((yyvsp[(3) - (3)].n) >= 0) { + (yyval.type_qualifier).index = (yyvsp[(3) - (3)].n); + } else { + _mesa_glsl_error(& (yylsp[(3) - (3)]), state, "invalid index %d specified", (yyvsp[(3) - (3)].n)); + YYERROR; + } + } - /* If the identifier didn't match any known layout identifiers, - * emit an error. - */ - if (!(yyval.type_qualifier).flags.i) { - _mesa_glsl_error(& (yylsp[(1) - (3)]), state, "unrecognized layout identifier " - "`%s'\n", (yyvsp[(1) - (3)].identifier)); - YYERROR; - } else if (state->ARB_explicit_attrib_location_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (3)]), state, - "GL_ARB_explicit_attrib_location layout " - "identifier `%s' used\n", (yyvsp[(1) - (3)].identifier)); - } - } + if ((state->ARB_shading_language_420pack_enable || + state->ARB_shader_atomic_counters_enable) && + match_layout_qualifier("binding", (yyvsp[(1) - (3)].identifier), state) == 0) { + (yyval.type_qualifier).flags.q.explicit_binding = 1; + (yyval.type_qualifier).binding = (yyvsp[(3) - (3)].n); + } + + if (state->ARB_shader_atomic_counters_enable && + match_layout_qualifier("offset", (yyvsp[(1) - (3)].identifier), state) == 0) { + (yyval.type_qualifier).flags.q.explicit_offset = 1; + (yyval.type_qualifier).offset = (yyvsp[(3) - (3)].n); + } + + if (match_layout_qualifier("max_vertices", (yyvsp[(1) - (3)].identifier), state) == 0) { + (yyval.type_qualifier).flags.q.max_vertices = 1; + + if ((yyvsp[(3) - (3)].n) < 0) { + _mesa_glsl_error(& (yylsp[(3) - (3)]), state, + "invalid max_vertices %d specified", (yyvsp[(3) - (3)].n)); + YYERROR; + } else { + (yyval.type_qualifier).max_vertices = (yyvsp[(3) - (3)].n); + if (!state->is_version(150, 0)) { + _mesa_glsl_error(& (yylsp[(3) - (3)]), state, + "#version 150 max_vertices qualifier " + "specified", (yyvsp[(3) - (3)].n)); + } + } + } + + /* If the identifier didn't match any known layout identifiers, + * emit an error. + */ + if (!(yyval.type_qualifier).flags.i) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, "unrecognized layout identifier " + "`%s'", (yyvsp[(1) - (3)].identifier)); + YYERROR; + } else if (state->ARB_explicit_attrib_location_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (3)]), state, + "GL_ARB_explicit_attrib_location layout " + "identifier `%s' used", (yyvsp[(1) - (3)].identifier)); + } + ;} break; case 153: - -/* Line 1806 of yacc.c */ -#line 1244 "src/glsl/glsl_parser.yy" +#line 1320 "src/glsl/glsl_parser.yy" { - (yyval.type_qualifier) = (yyvsp[(1) - (1)].type_qualifier); - /* Layout qualifiers for ARB_uniform_buffer_object. */ - if (!state->ARB_uniform_buffer_object_enable) { - _mesa_glsl_error(& (yylsp[(1) - (1)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "layout qualifier `%s' is used\n", (yyvsp[(1) - (1)].type_qualifier)); - } else if (state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "layout qualifier `%s' is used\n", (yyvsp[(1) - (1)].type_qualifier)); - } - } + (yyval.type_qualifier) = (yyvsp[(1) - (1)].type_qualifier); + /* Layout qualifiers for ARB_uniform_buffer_object. */ + if ((yyval.type_qualifier).flags.q.uniform && !state->has_uniform_buffer_objects()) { + _mesa_glsl_error(& (yylsp[(1) - (1)]), state, + "#version 140 / GL_ARB_uniform_buffer_object " + "layout qualifier `%s' is used", (yyvsp[(1) - (1)].type_qualifier)); + } else if ((yyval.type_qualifier).flags.q.uniform && state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, + "#version 140 / GL_ARB_uniform_buffer_object " + "layout qualifier `%s' is used", (yyvsp[(1) - (1)].type_qualifier)); + } + ;} break; case 154: - -/* Line 1806 of yacc.c */ -#line 1266 "src/glsl/glsl_parser.yy" +#line 1346 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.row_major = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.row_major = 1; + ;} break; case 155: - -/* Line 1806 of yacc.c */ -#line 1271 "src/glsl/glsl_parser.yy" +#line 1352 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.packed = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.packed = 1; + ;} break; case 156: - -/* Line 1806 of yacc.c */ -#line 1279 "src/glsl/glsl_parser.yy" +#line 1361 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.smooth = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.smooth = 1; + ;} break; case 157: - -/* Line 1806 of yacc.c */ -#line 1284 "src/glsl/glsl_parser.yy" +#line 1367 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.flat = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.flat = 1; + ;} break; case 158: - -/* Line 1806 of yacc.c */ -#line 1289 "src/glsl/glsl_parser.yy" +#line 1373 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.noperspective = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.noperspective = 1; + ;} break; case 159: - -/* Line 1806 of yacc.c */ -#line 1297 "src/glsl/glsl_parser.yy" +#line 1383 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.constant = 1; - } - break; - - case 162: - -/* Line 1806 of yacc.c */ -#line 1307 "src/glsl/glsl_parser.yy" - { - (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); - (yyval.type_qualifier).flags.i |= (yyvsp[(2) - (2)].type_qualifier).flags.i; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.invariant = 1; + ;} break; case 164: - -/* Line 1806 of yacc.c */ -#line 1313 "src/glsl/glsl_parser.yy" +#line 1393 "src/glsl/glsl_parser.yy" { - (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); - (yyval.type_qualifier).flags.i |= (yyvsp[(2) - (2)].type_qualifier).flags.i; - } + memset(&(yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).precision = (yyvsp[(1) - (1)].n); + ;} break; case 165: - -/* Line 1806 of yacc.c */ -#line 1318 "src/glsl/glsl_parser.yy" +#line 1412 "src/glsl/glsl_parser.yy" { - (yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier); - (yyval.type_qualifier).flags.q.invariant = 1; - } + if ((yyvsp[(2) - (2)].type_qualifier).flags.q.invariant) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate \"invariant\" qualifier"); + + if ((yyvsp[(2) - (2)].type_qualifier).has_layout()) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, + "\"invariant\" cannot be used with layout(...)"); + } + + (yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier); + (yyval.type_qualifier).flags.q.invariant = 1; + ;} break; case 166: - -/* Line 1806 of yacc.c */ -#line 1323 "src/glsl/glsl_parser.yy" +#line 1425 "src/glsl/glsl_parser.yy" { - (yyval.type_qualifier) = (yyvsp[(2) - (3)].type_qualifier); - (yyval.type_qualifier).flags.i |= (yyvsp[(3) - (3)].type_qualifier).flags.i; - (yyval.type_qualifier).flags.q.invariant = 1; - } + /* Section 4.3 of the GLSL 1.40 specification states: + * "...qualified with one of these interpolation qualifiers" + * + * GLSL 1.30 claims to allow "one or more", but insists that: + * "These interpolation qualifiers may only precede the qualifiers in, + * centroid in, out, or centroid out in a declaration." + * + * ...which means that e.g. smooth can't precede smooth, so there can be + * only one after all, and the 1.40 text is a clarification, not a change. + */ + if ((yyvsp[(2) - (2)].type_qualifier).has_interpolation()) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate interpolation qualifier"); + + if ((yyvsp[(2) - (2)].type_qualifier).has_layout()) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "interpolation qualifiers cannot be used " + "with layout(...)"); + } + + if (!state->ARB_shading_language_420pack_enable && (yyvsp[(2) - (2)].type_qualifier).flags.q.invariant) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "interpolation qualifiers must come " + "after \"invariant\""); + } + + (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); + (yyval.type_qualifier).merge_qualifier(&(yylsp[(1) - (2)]), state, (yyvsp[(2) - (2)].type_qualifier)); + ;} break; case 167: - -/* Line 1806 of yacc.c */ -#line 1329 "src/glsl/glsl_parser.yy" +#line 1453 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.invariant = 1; - } + /* The GLSL 1.50 grammar indicates that a layout(...) declaration can be + * used standalone or immediately before a storage qualifier. It cannot + * be used with interpolation qualifiers or invariant. There does not + * appear to be any text indicating that it must come before the storage + * qualifier, but always seems to in examples. + */ + if (!state->ARB_shading_language_420pack_enable && (yyvsp[(2) - (2)].type_qualifier).has_layout()) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate layout(...) qualifiers"); + + if ((yyvsp[(2) - (2)].type_qualifier).flags.q.invariant) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "layout(...) cannot be used with " + "the \"invariant\" qualifier"); + + if ((yyvsp[(2) - (2)].type_qualifier).has_interpolation()) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "layout(...) cannot be used with " + "interpolation qualifiers"); + } + + (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); + (yyval.type_qualifier).merge_qualifier(&(yylsp[(1) - (2)]), state, (yyvsp[(2) - (2)].type_qualifier)); + ;} break; case 168: - -/* Line 1806 of yacc.c */ -#line 1337 "src/glsl/glsl_parser.yy" +#line 1476 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.constant = 1; - } + if ((yyvsp[(2) - (2)].type_qualifier).has_auxiliary_storage()) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, + "duplicate auxiliary storage qualifier (centroid or sample)"); + } + + if (!state->ARB_shading_language_420pack_enable && + ((yyvsp[(2) - (2)].type_qualifier).flags.q.invariant || (yyvsp[(2) - (2)].type_qualifier).has_interpolation() || (yyvsp[(2) - (2)].type_qualifier).has_layout())) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "auxiliary storage qualifiers must come " + "just before storage qualifiers"); + } + (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); + (yyval.type_qualifier).flags.i |= (yyvsp[(2) - (2)].type_qualifier).flags.i; + ;} break; case 169: - -/* Line 1806 of yacc.c */ -#line 1342 "src/glsl/glsl_parser.yy" +#line 1491 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.attribute = 1; - } + /* Section 4.3 of the GLSL 1.20 specification states: + * "Variable declarations may have a storage qualifier specified..." + * 1.30 clarifies this to "may have one storage qualifier". + */ + if ((yyvsp[(2) - (2)].type_qualifier).has_storage()) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate storage qualifier"); + + if (!state->ARB_shading_language_420pack_enable && + ((yyvsp[(2) - (2)].type_qualifier).flags.q.invariant || (yyvsp[(2) - (2)].type_qualifier).has_interpolation() || (yyvsp[(2) - (2)].type_qualifier).has_layout() || + (yyvsp[(2) - (2)].type_qualifier).has_auxiliary_storage())) { + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "storage qualifiers must come after " + "invariant, interpolation, layout and auxiliary " + "storage qualifiers"); + } + + (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier); + (yyval.type_qualifier).merge_qualifier(&(yylsp[(1) - (2)]), state, (yyvsp[(2) - (2)].type_qualifier)); + ;} break; case 170: - -/* Line 1806 of yacc.c */ -#line 1347 "src/glsl/glsl_parser.yy" +#line 1511 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.varying = 1; - } + if ((yyvsp[(2) - (2)].type_qualifier).precision != ast_precision_none) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "duplicate precision qualifier"); + + if (!state->ARB_shading_language_420pack_enable && (yyvsp[(2) - (2)].type_qualifier).flags.i != 0) + _mesa_glsl_error(&(yylsp[(1) - (2)]), state, "precision qualifiers must come last"); + + (yyval.type_qualifier) = (yyvsp[(2) - (2)].type_qualifier); + (yyval.type_qualifier).precision = (yyvsp[(1) - (2)].n); + ;} break; case 171: - -/* Line 1806 of yacc.c */ -#line 1352 "src/glsl/glsl_parser.yy" +#line 1525 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.centroid = 1; - (yyval.type_qualifier).flags.q.varying = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.centroid = 1; + ;} break; case 172: - -/* Line 1806 of yacc.c */ -#line 1358 "src/glsl/glsl_parser.yy" +#line 1531 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.in = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).flags.q.sample = 1; + ;} break; case 173: - -/* Line 1806 of yacc.c */ -#line 1363 "src/glsl/glsl_parser.yy" +#line 1539 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.out = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.constant = 1; + ;} break; case 174: - -/* Line 1806 of yacc.c */ -#line 1368 "src/glsl/glsl_parser.yy" +#line 1545 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.centroid = 1; (yyval.type_qualifier).flags.q.in = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.attribute = 1; + ;} break; case 175: - -/* Line 1806 of yacc.c */ -#line 1373 "src/glsl/glsl_parser.yy" +#line 1551 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.centroid = 1; (yyval.type_qualifier).flags.q.out = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.varying = 1; + ;} break; case 176: - -/* Line 1806 of yacc.c */ -#line 1378 "src/glsl/glsl_parser.yy" +#line 1557 "src/glsl/glsl_parser.yy" { - memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - (yyval.type_qualifier).flags.q.uniform = 1; - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.in = 1; + ;} break; case 177: - -/* Line 1806 of yacc.c */ -#line 1386 "src/glsl/glsl_parser.yy" +#line 1563 "src/glsl/glsl_parser.yy" { - (yyval.type_specifier) = (yyvsp[(1) - (1)].type_specifier); - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.out = 1; + ;} break; case 178: - -/* Line 1806 of yacc.c */ -#line 1390 "src/glsl/glsl_parser.yy" +#line 1569 "src/glsl/glsl_parser.yy" { - (yyval.type_specifier) = (yyvsp[(2) - (2)].type_specifier); - (yyval.type_specifier)->precision = (yyvsp[(1) - (2)].n); - } + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.uniform = 1; + ;} + break; + + case 179: +#line 1578 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.array_specifier) = new(ctx) ast_array_specifier(yylloc); + ;} break; case 180: - -/* Line 1806 of yacc.c */ -#line 1399 "src/glsl/glsl_parser.yy" +#line 1583 "src/glsl/glsl_parser.yy" { - (yyval.type_specifier) = (yyvsp[(1) - (3)].type_specifier); - (yyval.type_specifier)->is_array = true; - (yyval.type_specifier)->array_size = NULL; - } + void *ctx = state; + (yyval.array_specifier) = new(ctx) ast_array_specifier(yylloc, (yyvsp[(2) - (3)].expression)); + ;} break; case 181: - -/* Line 1806 of yacc.c */ -#line 1405 "src/glsl/glsl_parser.yy" +#line 1588 "src/glsl/glsl_parser.yy" { - (yyval.type_specifier) = (yyvsp[(1) - (4)].type_specifier); - (yyval.type_specifier)->is_array = true; - (yyval.type_specifier)->array_size = (yyvsp[(3) - (4)].expression); - } + (yyval.array_specifier) = (yyvsp[(1) - (3)].array_specifier); + + if (!state->ARB_arrays_of_arrays_enable) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "GL_ARB_arrays_of_arrays " + "required for defining arrays of arrays"); + } else { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "only the outermost array dimension can " + "be unsized"); + } + ;} break; case 182: - -/* Line 1806 of yacc.c */ -#line 1414 "src/glsl/glsl_parser.yy" +#line 1602 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[(1) - (1)].identifier)); - (yyval.type_specifier)->set_location(yylloc); - } - break; + (yyval.array_specifier) = (yyvsp[(1) - (4)].array_specifier); - case 183: + if (!state->ARB_arrays_of_arrays_enable) { + _mesa_glsl_error(& (yylsp[(1) - (4)]), state, + "GL_ARB_arrays_of_arrays " + "required for defining arrays of arrays"); + } -/* Line 1806 of yacc.c */ -#line 1420 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[(1) - (1)].struct_specifier)); - (yyval.type_specifier)->set_location(yylloc); - } + (yyval.array_specifier)->add_dimension((yyvsp[(3) - (4)].expression)); + ;} break; case 184: - -/* Line 1806 of yacc.c */ -#line 1426 "src/glsl/glsl_parser.yy" +#line 1618 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[(1) - (1)].identifier)); - (yyval.type_specifier)->set_location(yylloc); - } + (yyval.type_specifier) = (yyvsp[(1) - (2)].type_specifier); + (yyval.type_specifier)->array_specifier = (yyvsp[(2) - (2)].array_specifier); + ;} break; case 185: - -/* Line 1806 of yacc.c */ -#line 1434 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "void"; } +#line 1626 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[(1) - (1)].identifier)); + (yyval.type_specifier)->set_location(yylloc); + ;} break; case 186: - -/* Line 1806 of yacc.c */ -#line 1435 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "float"; } +#line 1632 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[(1) - (1)].struct_specifier)); + (yyval.type_specifier)->set_location(yylloc); + ;} break; case 187: - -/* Line 1806 of yacc.c */ -#line 1436 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "int"; } +#line 1638 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[(1) - (1)].identifier)); + (yyval.type_specifier)->set_location(yylloc); + ;} break; case 188: - -/* Line 1806 of yacc.c */ -#line 1437 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "uint"; } +#line 1646 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "void"; ;} break; case 189: - -/* Line 1806 of yacc.c */ -#line 1438 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "bool"; } +#line 1647 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "float"; ;} break; case 190: - -/* Line 1806 of yacc.c */ -#line 1439 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "vec2"; } +#line 1648 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "int"; ;} break; case 191: - -/* Line 1806 of yacc.c */ -#line 1440 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "vec3"; } +#line 1649 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "uint"; ;} break; case 192: - -/* Line 1806 of yacc.c */ -#line 1441 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "vec4"; } +#line 1650 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "bool"; ;} break; case 193: - -/* Line 1806 of yacc.c */ -#line 1442 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "bvec2"; } +#line 1651 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "vec2"; ;} break; case 194: - -/* Line 1806 of yacc.c */ -#line 1443 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "bvec3"; } +#line 1652 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "vec3"; ;} break; case 195: - -/* Line 1806 of yacc.c */ -#line 1444 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "bvec4"; } +#line 1653 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "vec4"; ;} break; case 196: - -/* Line 1806 of yacc.c */ -#line 1445 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "ivec2"; } +#line 1654 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "bvec2"; ;} break; case 197: - -/* Line 1806 of yacc.c */ -#line 1446 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "ivec3"; } +#line 1655 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "bvec3"; ;} break; case 198: - -/* Line 1806 of yacc.c */ -#line 1447 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "ivec4"; } +#line 1656 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "bvec4"; ;} break; case 199: - -/* Line 1806 of yacc.c */ -#line 1448 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "uvec2"; } +#line 1657 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "ivec2"; ;} break; case 200: - -/* Line 1806 of yacc.c */ -#line 1449 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "uvec3"; } +#line 1658 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "ivec3"; ;} break; case 201: - -/* Line 1806 of yacc.c */ -#line 1450 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "uvec4"; } +#line 1659 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "ivec4"; ;} break; case 202: - -/* Line 1806 of yacc.c */ -#line 1451 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat2"; } +#line 1660 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "uvec2"; ;} break; case 203: - -/* Line 1806 of yacc.c */ -#line 1452 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat2x3"; } +#line 1661 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "uvec3"; ;} break; case 204: - -/* Line 1806 of yacc.c */ -#line 1453 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat2x4"; } +#line 1662 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "uvec4"; ;} break; case 205: - -/* Line 1806 of yacc.c */ -#line 1454 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat3x2"; } +#line 1663 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat2"; ;} break; case 206: - -/* Line 1806 of yacc.c */ -#line 1455 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat3"; } +#line 1664 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat2x3"; ;} break; case 207: - -/* Line 1806 of yacc.c */ -#line 1456 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat3x4"; } +#line 1665 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat2x4"; ;} break; case 208: - -/* Line 1806 of yacc.c */ -#line 1457 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat4x2"; } +#line 1666 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat3x2"; ;} break; case 209: - -/* Line 1806 of yacc.c */ -#line 1458 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat4x3"; } +#line 1667 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat3"; ;} break; case 210: - -/* Line 1806 of yacc.c */ -#line 1459 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "mat4"; } +#line 1668 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat3x4"; ;} break; case 211: - -/* Line 1806 of yacc.c */ -#line 1460 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler1D"; } +#line 1669 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat4x2"; ;} break; case 212: - -/* Line 1806 of yacc.c */ -#line 1461 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler2D"; } +#line 1670 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat4x3"; ;} break; case 213: - -/* Line 1806 of yacc.c */ -#line 1462 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler2DRect"; } +#line 1671 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "mat4"; ;} break; case 214: - -/* Line 1806 of yacc.c */ -#line 1463 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler3D"; } +#line 1672 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler1D"; ;} break; case 215: - -/* Line 1806 of yacc.c */ -#line 1464 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "samplerCube"; } +#line 1673 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2D"; ;} break; case 216: - -/* Line 1806 of yacc.c */ -#line 1465 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "samplerExternalOES"; } +#line 1674 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DRect"; ;} break; case 217: - -/* Line 1806 of yacc.c */ -#line 1466 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler1DShadow"; } +#line 1675 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler3D"; ;} break; case 218: - -/* Line 1806 of yacc.c */ -#line 1467 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler2DShadow"; } +#line 1676 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "samplerCube"; ;} break; case 219: - -/* Line 1806 of yacc.c */ -#line 1468 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler2DRectShadow"; } +#line 1677 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "samplerExternalOES"; ;} break; case 220: - -/* Line 1806 of yacc.c */ -#line 1469 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "samplerCubeShadow"; } +#line 1678 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler1DShadow"; ;} break; case 221: - -/* Line 1806 of yacc.c */ -#line 1470 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler1DArray"; } +#line 1679 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DShadow"; ;} break; case 222: - -/* Line 1806 of yacc.c */ -#line 1471 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler2DArray"; } +#line 1680 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DRectShadow"; ;} break; case 223: - -/* Line 1806 of yacc.c */ -#line 1472 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler1DArrayShadow"; } +#line 1681 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "samplerCubeShadow"; ;} break; case 224: - -/* Line 1806 of yacc.c */ -#line 1473 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "sampler2DArrayShadow"; } +#line 1682 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler1DArray"; ;} break; case 225: - -/* Line 1806 of yacc.c */ -#line 1474 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "samplerBuffer"; } +#line 1683 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DArray"; ;} break; case 226: - -/* Line 1806 of yacc.c */ -#line 1475 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isampler1D"; } +#line 1684 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler1DArrayShadow"; ;} break; case 227: - -/* Line 1806 of yacc.c */ -#line 1476 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isampler2D"; } +#line 1685 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DArrayShadow"; ;} break; case 228: - -/* Line 1806 of yacc.c */ -#line 1477 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isampler2DRect"; } +#line 1686 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "samplerBuffer"; ;} break; case 229: - -/* Line 1806 of yacc.c */ -#line 1478 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isampler3D"; } +#line 1687 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "samplerCubeArray"; ;} break; case 230: - -/* Line 1806 of yacc.c */ -#line 1479 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isamplerCube"; } +#line 1688 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "samplerCubeArrayShadow"; ;} break; case 231: - -/* Line 1806 of yacc.c */ -#line 1480 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isampler1DArray"; } +#line 1689 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler1D"; ;} break; case 232: - -/* Line 1806 of yacc.c */ -#line 1481 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isampler2DArray"; } +#line 1690 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler2D"; ;} break; case 233: - -/* Line 1806 of yacc.c */ -#line 1482 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "isamplerBuffer"; } +#line 1691 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler2DRect"; ;} break; case 234: - -/* Line 1806 of yacc.c */ -#line 1483 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usampler1D"; } +#line 1692 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler3D"; ;} break; case 235: - -/* Line 1806 of yacc.c */ -#line 1484 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usampler2D"; } +#line 1693 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isamplerCube"; ;} break; case 236: - -/* Line 1806 of yacc.c */ -#line 1485 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usampler2DRect"; } +#line 1694 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler1DArray"; ;} break; case 237: - -/* Line 1806 of yacc.c */ -#line 1486 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usampler3D"; } +#line 1695 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler2DArray"; ;} break; case 238: - -/* Line 1806 of yacc.c */ -#line 1487 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usamplerCube"; } +#line 1696 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isamplerBuffer"; ;} break; case 239: - -/* Line 1806 of yacc.c */ -#line 1488 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usampler1DArray"; } +#line 1697 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isamplerCubeArray"; ;} break; case 240: - -/* Line 1806 of yacc.c */ -#line 1489 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usampler2DArray"; } +#line 1698 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler1D"; ;} break; case 241: - -/* Line 1806 of yacc.c */ -#line 1490 "src/glsl/glsl_parser.yy" - { (yyval.identifier) = "usamplerBuffer"; } +#line 1699 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler2D"; ;} break; case 242: - -/* Line 1806 of yacc.c */ -#line 1494 "src/glsl/glsl_parser.yy" - { - if (!state->es_shader && state->language_version < 130) - _mesa_glsl_error(& (yylsp[(1) - (1)]), state, - "precision qualifier forbidden " - "in %s (1.30 or later " - "required)\n", - state->version_string); - - (yyval.n) = ast_precision_high; - } +#line 1700 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler2DRect"; ;} break; case 243: - -/* Line 1806 of yacc.c */ -#line 1504 "src/glsl/glsl_parser.yy" - { - if (!state->es_shader && state->language_version < 130) - _mesa_glsl_error(& (yylsp[(1) - (1)]), state, - "precision qualifier forbidden " - "in %s (1.30 or later " - "required)\n", - state->version_string); - - (yyval.n) = ast_precision_medium; - } +#line 1701 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler3D"; ;} break; case 244: - -/* Line 1806 of yacc.c */ -#line 1514 "src/glsl/glsl_parser.yy" - { - if (!state->es_shader && state->language_version < 130) - _mesa_glsl_error(& (yylsp[(1) - (1)]), state, - "precision qualifier forbidden " - "in %s (1.30 or later " - "required)\n", - state->version_string); - - (yyval.n) = ast_precision_low; - } +#line 1702 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usamplerCube"; ;} break; case 245: - -/* Line 1806 of yacc.c */ -#line 1528 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.struct_specifier) = new(ctx) ast_struct_specifier((yyvsp[(2) - (5)].identifier), (yyvsp[(4) - (5)].declarator_list)); - (yyval.struct_specifier)->set_location(yylloc); - state->symbols->add_type((yyvsp[(2) - (5)].identifier), glsl_type::void_type); - } +#line 1703 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler1DArray"; ;} break; case 246: - -/* Line 1806 of yacc.c */ -#line 1535 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.struct_specifier) = new(ctx) ast_struct_specifier(NULL, (yyvsp[(3) - (4)].declarator_list)); - (yyval.struct_specifier)->set_location(yylloc); - } +#line 1704 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler2DArray"; ;} break; case 247: - -/* Line 1806 of yacc.c */ -#line 1544 "src/glsl/glsl_parser.yy" - { - (yyval.declarator_list) = (yyvsp[(1) - (1)].declarator_list); - (yyvsp[(1) - (1)].declarator_list)->link.self_link(); - } +#line 1705 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usamplerBuffer"; ;} break; case 248: - -/* Line 1806 of yacc.c */ -#line 1549 "src/glsl/glsl_parser.yy" - { - (yyval.declarator_list) = (yyvsp[(1) - (2)].declarator_list); - (yyval.declarator_list)->link.insert_before(& (yyvsp[(2) - (2)].declarator_list)->link); - } +#line 1706 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usamplerCubeArray"; ;} break; case 249: - -/* Line 1806 of yacc.c */ -#line 1557 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); - - type->specifier = (yyvsp[(1) - (3)].type_specifier); - (yyval.declarator_list) = new(ctx) ast_declarator_list(type); - (yyval.declarator_list)->set_location(yylloc); - - (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[(2) - (3)].declaration)->link); - } +#line 1707 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DMS"; ;} break; case 250: - -/* Line 1806 of yacc.c */ -#line 1572 "src/glsl/glsl_parser.yy" - { - (yyval.declaration) = (yyvsp[(1) - (1)].declaration); - (yyvsp[(1) - (1)].declaration)->link.self_link(); - } +#line 1708 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler2DMS"; ;} break; case 251: - -/* Line 1806 of yacc.c */ -#line 1577 "src/glsl/glsl_parser.yy" - { - (yyval.declaration) = (yyvsp[(1) - (3)].declaration); - (yyval.declaration)->link.insert_before(& (yyvsp[(3) - (3)].declaration)->link); - } +#line 1709 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler2DMS"; ;} break; case 252: - -/* Line 1806 of yacc.c */ -#line 1585 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.declaration) = new(ctx) ast_declaration((yyvsp[(1) - (1)].identifier), false, NULL, NULL); - (yyval.declaration)->set_location(yylloc); - state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[(1) - (1)].identifier), ir_var_auto, glsl_precision_undefined)); - } +#line 1710 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "sampler2DMSArray"; ;} break; case 253: +#line 1711 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "isampler2DMSArray"; ;} + break; -/* Line 1806 of yacc.c */ -#line 1592 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.declaration) = new(ctx) ast_declaration((yyvsp[(1) - (4)].identifier), true, (yyvsp[(3) - (4)].expression), NULL); - (yyval.declaration)->set_location(yylloc); - } + case 254: +#line 1712 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "usampler2DMSArray"; ;} + break; + + case 255: +#line 1713 "src/glsl/glsl_parser.yy" + { (yyval.identifier) = "atomic_uint"; ;} break; case 256: +#line 1718 "src/glsl/glsl_parser.yy" + { + state->check_precision_qualifiers_allowed(&(yylsp[(1) - (1)])); + (yyval.n) = ast_precision_high; + ;} + break; -/* Line 1806 of yacc.c */ -#line 1610 "src/glsl/glsl_parser.yy" - { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); } + case 257: +#line 1723 "src/glsl/glsl_parser.yy" + { + state->check_precision_qualifiers_allowed(&(yylsp[(1) - (1)])); + (yyval.n) = ast_precision_medium; + ;} + break; + + case 258: +#line 1728 "src/glsl/glsl_parser.yy" + { + state->check_precision_qualifiers_allowed(&(yylsp[(1) - (1)])); + (yyval.n) = ast_precision_low; + ;} + break; + + case 259: +#line 1736 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.struct_specifier) = new(ctx) ast_struct_specifier((yyvsp[(2) - (5)].identifier), (yyvsp[(4) - (5)].declarator_list)); + (yyval.struct_specifier)->set_location(yylloc); + state->symbols->add_type((yyvsp[(2) - (5)].identifier), glsl_type::void_type); + state->symbols->add_type_ast((yyvsp[(2) - (5)].identifier), new(ctx) ast_type_specifier((yyval.struct_specifier))); + ;} + break; + + case 260: +#line 1744 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.struct_specifier) = new(ctx) ast_struct_specifier(NULL, (yyvsp[(3) - (4)].declarator_list)); + (yyval.struct_specifier)->set_location(yylloc); + ;} + break; + + case 261: +#line 1753 "src/glsl/glsl_parser.yy" + { + (yyval.declarator_list) = (yyvsp[(1) - (1)].declarator_list); + (yyvsp[(1) - (1)].declarator_list)->link.self_link(); + ;} + break; + + case 262: +#line 1758 "src/glsl/glsl_parser.yy" + { + (yyval.declarator_list) = (yyvsp[(1) - (2)].declarator_list); + (yyval.declarator_list)->link.insert_before(& (yyvsp[(2) - (2)].declarator_list)->link); + ;} + break; + + case 263: +#line 1766 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + ast_fully_specified_type *const type = (yyvsp[(1) - (3)].fully_specified_type); + type->set_location(yylloc); + + if (type->qualifier.flags.i != 0) + _mesa_glsl_error(&(yylsp[(1) - (3)]), state, + "only precision qualifiers may be applied to " + "structure members"); + + (yyval.declarator_list) = new(ctx) ast_declarator_list(type); + (yyval.declarator_list)->set_location(yylloc); + + (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[(2) - (3)].declaration)->link); + ;} break; case 264: - -/* Line 1806 of yacc.c */ -#line 1625 "src/glsl/glsl_parser.yy" +#line 1785 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL); - (yyval.compound_statement)->set_location(yylloc); - } + (yyval.declaration) = (yyvsp[(1) - (1)].declaration); + (yyvsp[(1) - (1)].declaration)->link.self_link(); + ;} break; case 265: - -/* Line 1806 of yacc.c */ -#line 1631 "src/glsl/glsl_parser.yy" +#line 1790 "src/glsl/glsl_parser.yy" { - state->symbols->push_scope(); - } + (yyval.declaration) = (yyvsp[(1) - (3)].declaration); + (yyval.declaration)->link.insert_before(& (yyvsp[(3) - (3)].declaration)->link); + ;} break; case 266: - -/* Line 1806 of yacc.c */ -#line 1635 "src/glsl/glsl_parser.yy" +#line 1798 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[(3) - (4)].node)); - (yyval.compound_statement)->set_location(yylloc); - state->symbols->pop_scope(); - } + void *ctx = state; + (yyval.declaration) = new(ctx) ast_declaration((yyvsp[(1) - (1)].identifier), NULL, NULL); + (yyval.declaration)->set_location(yylloc); + ;} break; case 267: - -/* Line 1806 of yacc.c */ -#line 1644 "src/glsl/glsl_parser.yy" - { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); } +#line 1804 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.declaration) = new(ctx) ast_declaration((yyvsp[(1) - (2)].identifier), (yyvsp[(2) - (2)].array_specifier), NULL); + (yyval.declaration)->set_location(yylloc); + ;} break; case 269: - -/* Line 1806 of yacc.c */ -#line 1650 "src/glsl/glsl_parser.yy" +#line 1814 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL); - (yyval.compound_statement)->set_location(yylloc); - } + (yyval.expression) = (yyvsp[(2) - (3)].expression); + ;} break; case 270: - -/* Line 1806 of yacc.c */ -#line 1656 "src/glsl/glsl_parser.yy" +#line 1818 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[(2) - (3)].node)); - (yyval.compound_statement)->set_location(yylloc); - } + (yyval.expression) = (yyvsp[(2) - (4)].expression); + ;} break; case 271: - -/* Line 1806 of yacc.c */ -#line 1665 "src/glsl/glsl_parser.yy" +#line 1825 "src/glsl/glsl_parser.yy" { - if ((yyvsp[(1) - (1)].node) == NULL) { - _mesa_glsl_error(& (yylsp[(1) - (1)]), state, " statement\n"); - assert((yyvsp[(1) - (1)].node) != NULL); - } - - (yyval.node) = (yyvsp[(1) - (1)].node); - (yyval.node)->link.self_link(); - } + void *ctx = state; + (yyval.expression) = new(ctx) ast_aggregate_initializer(); + (yyval.expression)->set_location(yylloc); + (yyval.expression)->expressions.push_tail(& (yyvsp[(1) - (1)].expression)->link); + ;} break; case 272: - -/* Line 1806 of yacc.c */ -#line 1675 "src/glsl/glsl_parser.yy" +#line 1832 "src/glsl/glsl_parser.yy" { - if ((yyvsp[(2) - (2)].node) == NULL) { - _mesa_glsl_error(& (yylsp[(2) - (2)]), state, " statement\n"); - assert((yyvsp[(2) - (2)].node) != NULL); - } - (yyval.node) = (yyvsp[(1) - (2)].node); - (yyval.node)->link.insert_before(& (yyvsp[(2) - (2)].node)->link); - } - break; - - case 273: - -/* Line 1806 of yacc.c */ -#line 1687 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.node) = new(ctx) ast_expression_statement(NULL); - (yyval.node)->set_location(yylloc); - } + (yyvsp[(1) - (3)].expression)->expressions.push_tail(& (yyvsp[(3) - (3)].expression)->link); + ;} break; case 274: - -/* Line 1806 of yacc.c */ -#line 1693 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - (yyval.node) = new(ctx) ast_expression_statement((yyvsp[(1) - (2)].expression)); - (yyval.node)->set_location(yylloc); - } - break; - - case 275: - -/* Line 1806 of yacc.c */ -#line 1702 "src/glsl/glsl_parser.yy" - { - (yyval.node) = new(state) ast_selection_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].selection_rest_statement).then_statement, - (yyvsp[(5) - (5)].selection_rest_statement).else_statement); - (yyval.node)->set_location(yylloc); - } - break; - - case 276: - -/* Line 1806 of yacc.c */ -#line 1711 "src/glsl/glsl_parser.yy" - { - (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (3)].node); - (yyval.selection_rest_statement).else_statement = (yyvsp[(3) - (3)].node); - } - break; - - case 277: - -/* Line 1806 of yacc.c */ -#line 1716 "src/glsl/glsl_parser.yy" - { - (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (1)].node); - (yyval.selection_rest_statement).else_statement = NULL; - } - break; - - case 278: - -/* Line 1806 of yacc.c */ -#line 1724 "src/glsl/glsl_parser.yy" - { - (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].expression); - } - break; - - case 279: - -/* Line 1806 of yacc.c */ -#line 1728 "src/glsl/glsl_parser.yy" - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (4)].identifier), false, NULL, (yyvsp[(4) - (4)].expression)); - ast_declarator_list *declarator = new(ctx) ast_declarator_list((yyvsp[(1) - (4)].fully_specified_type)); - decl->set_location(yylloc); - declarator->set_location(yylloc); - - declarator->declarations.push_tail(&decl->link); - (yyval.node) = declarator; - } - break; - - case 280: - -/* Line 1806 of yacc.c */ -#line 1746 "src/glsl/glsl_parser.yy" - { - (yyval.node) = new(state) ast_switch_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].switch_body)); - (yyval.node)->set_location(yylloc); - } - break; - - case 281: - -/* Line 1806 of yacc.c */ -#line 1754 "src/glsl/glsl_parser.yy" - { - (yyval.switch_body) = new(state) ast_switch_body(NULL); - (yyval.switch_body)->set_location(yylloc); - } +#line 1844 "src/glsl/glsl_parser.yy" + { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;} break; case 282: - -/* Line 1806 of yacc.c */ -#line 1759 "src/glsl/glsl_parser.yy" +#line 1859 "src/glsl/glsl_parser.yy" { - (yyval.switch_body) = new(state) ast_switch_body((yyvsp[(2) - (3)].case_statement_list)); - (yyval.switch_body)->set_location(yylloc); - } + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL); + (yyval.compound_statement)->set_location(yylloc); + ;} break; case 283: - -/* Line 1806 of yacc.c */ -#line 1767 "src/glsl/glsl_parser.yy" +#line 1865 "src/glsl/glsl_parser.yy" { - (yyval.case_label) = new(state) ast_case_label((yyvsp[(2) - (3)].expression)); - (yyval.case_label)->set_location(yylloc); - } + state->symbols->push_scope(); + ;} break; case 284: - -/* Line 1806 of yacc.c */ -#line 1772 "src/glsl/glsl_parser.yy" +#line 1869 "src/glsl/glsl_parser.yy" { - (yyval.case_label) = new(state) ast_case_label(NULL); - (yyval.case_label)->set_location(yylloc); - } + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[(3) - (4)].node)); + (yyval.compound_statement)->set_location(yylloc); + state->symbols->pop_scope(); + ;} break; case 285: - -/* Line 1806 of yacc.c */ -#line 1780 "src/glsl/glsl_parser.yy" - { - ast_case_label_list *labels = new(state) ast_case_label_list(); - - labels->labels.push_tail(& (yyvsp[(1) - (1)].case_label)->link); - (yyval.case_label_list) = labels; - (yyval.case_label_list)->set_location(yylloc); - } - break; - - case 286: - -/* Line 1806 of yacc.c */ -#line 1788 "src/glsl/glsl_parser.yy" - { - (yyval.case_label_list) = (yyvsp[(1) - (2)].case_label_list); - (yyval.case_label_list)->labels.push_tail(& (yyvsp[(2) - (2)].case_label)->link); - } +#line 1878 "src/glsl/glsl_parser.yy" + { (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].compound_statement); ;} break; case 287: - -/* Line 1806 of yacc.c */ -#line 1796 "src/glsl/glsl_parser.yy" +#line 1884 "src/glsl/glsl_parser.yy" { - ast_case_statement *stmts = new(state) ast_case_statement((yyvsp[(1) - (2)].case_label_list)); - stmts->set_location(yylloc); - - stmts->stmts.push_tail(& (yyvsp[(2) - (2)].node)->link); - (yyval.case_statement) = stmts; - } + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL); + (yyval.compound_statement)->set_location(yylloc); + ;} break; case 288: - -/* Line 1806 of yacc.c */ -#line 1804 "src/glsl/glsl_parser.yy" +#line 1890 "src/glsl/glsl_parser.yy" { - (yyval.case_statement) = (yyvsp[(1) - (2)].case_statement); - (yyval.case_statement)->stmts.push_tail(& (yyvsp[(2) - (2)].node)->link); - } + void *ctx = state; + (yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[(2) - (3)].node)); + (yyval.compound_statement)->set_location(yylloc); + ;} break; case 289: - -/* Line 1806 of yacc.c */ -#line 1812 "src/glsl/glsl_parser.yy" +#line 1899 "src/glsl/glsl_parser.yy" { - ast_case_statement_list *cases= new(state) ast_case_statement_list(); - cases->set_location(yylloc); + if ((yyvsp[(1) - (1)].node) == NULL) { + _mesa_glsl_error(& (yylsp[(1) - (1)]), state, " statement"); + assert((yyvsp[(1) - (1)].node) != NULL); + } - cases->cases.push_tail(& (yyvsp[(1) - (1)].case_statement)->link); - (yyval.case_statement_list) = cases; - } + (yyval.node) = (yyvsp[(1) - (1)].node); + (yyval.node)->link.self_link(); + ;} break; case 290: - -/* Line 1806 of yacc.c */ -#line 1820 "src/glsl/glsl_parser.yy" +#line 1909 "src/glsl/glsl_parser.yy" { - (yyval.case_statement_list) = (yyvsp[(1) - (2)].case_statement_list); - (yyval.case_statement_list)->cases.push_tail(& (yyvsp[(2) - (2)].case_statement)->link); - } + if ((yyvsp[(2) - (2)].node) == NULL) { + _mesa_glsl_error(& (yylsp[(2) - (2)]), state, " statement"); + assert((yyvsp[(2) - (2)].node) != NULL); + } + (yyval.node) = (yyvsp[(1) - (2)].node); + (yyval.node)->link.insert_before(& (yyvsp[(2) - (2)].node)->link); + ;} break; case 291: - -/* Line 1806 of yacc.c */ -#line 1828 "src/glsl/glsl_parser.yy" +#line 1921 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, - NULL, (yyvsp[(3) - (5)].node), NULL, (yyvsp[(5) - (5)].node)); - (yyval.node)->set_location(yylloc); - } + void *ctx = state; + (yyval.node) = new(ctx) ast_expression_statement(NULL); + (yyval.node)->set_location(yylloc); + ;} break; case 292: - -/* Line 1806 of yacc.c */ -#line 1835 "src/glsl/glsl_parser.yy" +#line 1927 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, - NULL, (yyvsp[(5) - (7)].expression), NULL, (yyvsp[(2) - (7)].node)); - (yyval.node)->set_location(yylloc); - } + void *ctx = state; + (yyval.node) = new(ctx) ast_expression_statement((yyvsp[(1) - (2)].expression)); + (yyval.node)->set_location(yylloc); + ;} break; case 293: - -/* Line 1806 of yacc.c */ -#line 1842 "src/glsl/glsl_parser.yy" +#line 1936 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, - (yyvsp[(3) - (6)].node), (yyvsp[(4) - (6)].for_rest_statement).cond, (yyvsp[(4) - (6)].for_rest_statement).rest, (yyvsp[(6) - (6)].node)); - (yyval.node)->set_location(yylloc); - } + (yyval.node) = new(state) ast_selection_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].selection_rest_statement).then_statement, + (yyvsp[(5) - (5)].selection_rest_statement).else_statement); + (yyval.node)->set_location(yylloc); + ;} + break; + + case 294: +#line 1945 "src/glsl/glsl_parser.yy" + { + (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (3)].node); + (yyval.selection_rest_statement).else_statement = (yyvsp[(3) - (3)].node); + ;} + break; + + case 295: +#line 1950 "src/glsl/glsl_parser.yy" + { + (yyval.selection_rest_statement).then_statement = (yyvsp[(1) - (1)].node); + (yyval.selection_rest_statement).else_statement = NULL; + ;} + break; + + case 296: +#line 1958 "src/glsl/glsl_parser.yy" + { + (yyval.node) = (ast_node *) (yyvsp[(1) - (1)].expression); + ;} break; case 297: - -/* Line 1806 of yacc.c */ -#line 1858 "src/glsl/glsl_parser.yy" +#line 1962 "src/glsl/glsl_parser.yy" { - (yyval.node) = NULL; - } + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration((yyvsp[(2) - (4)].identifier), NULL, (yyvsp[(4) - (4)].expression)); + ast_declarator_list *declarator = new(ctx) ast_declarator_list((yyvsp[(1) - (4)].fully_specified_type)); + decl->set_location(yylloc); + declarator->set_location(yylloc); + + declarator->declarations.push_tail(&decl->link); + (yyval.node) = declarator; + ;} break; case 298: - -/* Line 1806 of yacc.c */ -#line 1865 "src/glsl/glsl_parser.yy" +#line 1980 "src/glsl/glsl_parser.yy" { - (yyval.for_rest_statement).cond = (yyvsp[(1) - (2)].node); - (yyval.for_rest_statement).rest = NULL; - } + (yyval.node) = new(state) ast_switch_statement((yyvsp[(3) - (5)].expression), (yyvsp[(5) - (5)].switch_body)); + (yyval.node)->set_location(yylloc); + ;} break; case 299: - -/* Line 1806 of yacc.c */ -#line 1870 "src/glsl/glsl_parser.yy" +#line 1988 "src/glsl/glsl_parser.yy" { - (yyval.for_rest_statement).cond = (yyvsp[(1) - (3)].node); - (yyval.for_rest_statement).rest = (yyvsp[(3) - (3)].expression); - } + (yyval.switch_body) = new(state) ast_switch_body(NULL); + (yyval.switch_body)->set_location(yylloc); + ;} break; case 300: - -/* Line 1806 of yacc.c */ -#line 1879 "src/glsl/glsl_parser.yy" +#line 1993 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); - (yyval.node)->set_location(yylloc); - } + (yyval.switch_body) = new(state) ast_switch_body((yyvsp[(2) - (3)].case_statement_list)); + (yyval.switch_body)->set_location(yylloc); + ;} break; case 301: - -/* Line 1806 of yacc.c */ -#line 1885 "src/glsl/glsl_parser.yy" +#line 2001 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); - (yyval.node)->set_location(yylloc); - } + (yyval.case_label) = new(state) ast_case_label((yyvsp[(2) - (3)].expression)); + (yyval.case_label)->set_location(yylloc); + ;} break; case 302: - -/* Line 1806 of yacc.c */ -#line 1891 "src/glsl/glsl_parser.yy" +#line 2006 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); - (yyval.node)->set_location(yylloc); - } + (yyval.case_label) = new(state) ast_case_label(NULL); + (yyval.case_label)->set_location(yylloc); + ;} break; case 303: - -/* Line 1806 of yacc.c */ -#line 1897 "src/glsl/glsl_parser.yy" +#line 2014 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[(2) - (3)].expression)); - (yyval.node)->set_location(yylloc); - } + ast_case_label_list *labels = new(state) ast_case_label_list(); + + labels->labels.push_tail(& (yyvsp[(1) - (1)].case_label)->link); + (yyval.case_label_list) = labels; + (yyval.case_label_list)->set_location(yylloc); + ;} break; case 304: - -/* Line 1806 of yacc.c */ -#line 1903 "src/glsl/glsl_parser.yy" +#line 2022 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); - (yyval.node)->set_location(yylloc); - } + (yyval.case_label_list) = (yyvsp[(1) - (2)].case_label_list); + (yyval.case_label_list)->labels.push_tail(& (yyvsp[(2) - (2)].case_label)->link); + ;} break; case 305: +#line 2030 "src/glsl/glsl_parser.yy" + { + ast_case_statement *stmts = new(state) ast_case_statement((yyvsp[(1) - (2)].case_label_list)); + stmts->set_location(yylloc); -/* Line 1806 of yacc.c */ -#line 1911 "src/glsl/glsl_parser.yy" - { (yyval.node) = (yyvsp[(1) - (1)].function_definition); } + stmts->stmts.push_tail(& (yyvsp[(2) - (2)].node)->link); + (yyval.case_statement) = stmts; + ;} break; case 306: - -/* Line 1806 of yacc.c */ -#line 1912 "src/glsl/glsl_parser.yy" - { (yyval.node) = (yyvsp[(1) - (1)].node); } +#line 2038 "src/glsl/glsl_parser.yy" + { + (yyval.case_statement) = (yyvsp[(1) - (2)].case_statement); + (yyval.case_statement)->stmts.push_tail(& (yyvsp[(2) - (2)].node)->link); + ;} break; case 307: +#line 2046 "src/glsl/glsl_parser.yy" + { + ast_case_statement_list *cases= new(state) ast_case_statement_list(); + cases->set_location(yylloc); -/* Line 1806 of yacc.c */ -#line 1913 "src/glsl/glsl_parser.yy" - { (yyval.node) = NULL; } + cases->cases.push_tail(& (yyvsp[(1) - (1)].case_statement)->link); + (yyval.case_statement_list) = cases; + ;} break; case 308: - -/* Line 1806 of yacc.c */ -#line 1914 "src/glsl/glsl_parser.yy" - { (yyval.node) = NULL; } +#line 2054 "src/glsl/glsl_parser.yy" + { + (yyval.case_statement_list) = (yyvsp[(1) - (2)].case_statement_list); + (yyval.case_statement_list)->cases.push_tail(& (yyvsp[(2) - (2)].case_statement)->link); + ;} break; case 309: - -/* Line 1806 of yacc.c */ -#line 1919 "src/glsl/glsl_parser.yy" +#line 2062 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.function_definition) = new(ctx) ast_function_definition(); - (yyval.function_definition)->set_location(yylloc); - (yyval.function_definition)->prototype = (yyvsp[(1) - (2)].function); - (yyval.function_definition)->body = (yyvsp[(2) - (2)].compound_statement); - - state->symbols->pop_scope(); - } + void *ctx = state; + (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, + NULL, (yyvsp[(3) - (5)].node), NULL, (yyvsp[(5) - (5)].node)); + (yyval.node)->set_location(yylloc); + ;} break; case 310: - -/* Line 1806 of yacc.c */ -#line 1933 "src/glsl/glsl_parser.yy" +#line 2069 "src/glsl/glsl_parser.yy" { - void *ctx = state; - (yyval.node) = new(ctx) ast_uniform_block(*state->default_uniform_qualifier, - (yyvsp[(2) - (6)].identifier), (yyvsp[(4) - (6)].declarator_list)); - - if (!state->ARB_uniform_buffer_object_enable) { - _mesa_glsl_error(& (yylsp[(1) - (6)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } else if (state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (6)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } - } + void *ctx = state; + (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, + NULL, (yyvsp[(5) - (7)].expression), NULL, (yyvsp[(2) - (7)].node)); + (yyval.node)->set_location(yylloc); + ;} break; case 311: - -/* Line 1806 of yacc.c */ -#line 1949 "src/glsl/glsl_parser.yy" +#line 2076 "src/glsl/glsl_parser.yy" { - void *ctx = state; - - ast_type_qualifier qual = *state->default_uniform_qualifier; - if (!qual.merge_qualifier(& (yylsp[(1) - (7)]), state, (yyvsp[(1) - (7)].type_qualifier))) { - YYERROR; - } - (yyval.node) = new(ctx) ast_uniform_block(qual, (yyvsp[(3) - (7)].identifier), (yyvsp[(5) - (7)].declarator_list)); - - if (!state->ARB_uniform_buffer_object_enable) { - _mesa_glsl_error(& (yylsp[(1) - (7)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } else if (state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (7)]), state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } - } + void *ctx = state; + (yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, + (yyvsp[(3) - (6)].node), (yyvsp[(4) - (6)].for_rest_statement).cond, (yyvsp[(4) - (6)].for_rest_statement).rest, (yyvsp[(6) - (6)].node)); + (yyval.node)->set_location(yylloc); + ;} break; - case 312: - -/* Line 1806 of yacc.c */ -#line 1972 "src/glsl/glsl_parser.yy" + case 315: +#line 2092 "src/glsl/glsl_parser.yy" { - (yyval.declarator_list) = (yyvsp[(1) - (1)].declarator_list); - (yyvsp[(1) - (1)].declarator_list)->link.self_link(); - } - break; - - case 313: - -/* Line 1806 of yacc.c */ -#line 1977 "src/glsl/glsl_parser.yy" - { - (yyval.declarator_list) = (yyvsp[(1) - (2)].declarator_list); - (yyvsp[(2) - (2)].declarator_list)->link.insert_before(& (yyval.declarator_list)->link); - } + (yyval.node) = NULL; + ;} break; case 316: - -/* Line 1806 of yacc.c */ -#line 1991 "src/glsl/glsl_parser.yy" +#line 2099 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); - - type->qualifier = (yyvsp[(1) - (5)].type_qualifier); - type->qualifier.flags.q.uniform = true; - type->specifier = (yyvsp[(3) - (5)].type_specifier); - (yyval.declarator_list) = new(ctx) ast_declarator_list(type); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->ubo_qualifiers_valid = true; - - (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[(4) - (5)].declaration)->link); - } + (yyval.for_rest_statement).cond = (yyvsp[(1) - (2)].node); + (yyval.for_rest_statement).rest = NULL; + ;} break; case 317: - -/* Line 1806 of yacc.c */ -#line 2006 "src/glsl/glsl_parser.yy" +#line 2104 "src/glsl/glsl_parser.yy" { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); - - type->qualifier.flags.q.uniform = true; - type->specifier = (yyvsp[(2) - (4)].type_specifier); - (yyval.declarator_list) = new(ctx) ast_declarator_list(type); - (yyval.declarator_list)->set_location(yylloc); - (yyval.declarator_list)->ubo_qualifiers_valid = true; - - (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[(3) - (4)].declaration)->link); - } + (yyval.for_rest_statement).cond = (yyvsp[(1) - (3)].node); + (yyval.for_rest_statement).rest = (yyvsp[(3) - (3)].expression); + ;} break; case 318: - -/* Line 1806 of yacc.c */ -#line 2023 "src/glsl/glsl_parser.yy" +#line 2113 "src/glsl/glsl_parser.yy" { - if (!state->default_uniform_qualifier->merge_qualifier(& (yylsp[(1) - (3)]), state, - (yyvsp[(1) - (3)].type_qualifier))) { - YYERROR; - } - } + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); + (yyval.node)->set_location(yylloc); + ;} + break; + + case 319: +#line 2119 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); + (yyval.node)->set_location(yylloc); + ;} + break; + + case 320: +#line 2125 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); + (yyval.node)->set_location(yylloc); + ;} + break; + + case 321: +#line 2131 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[(2) - (3)].expression)); + (yyval.node)->set_location(yylloc); + ;} + break; + + case 322: +#line 2137 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); + (yyval.node)->set_location(yylloc); + ;} + break; + + case 323: +#line 2145 "src/glsl/glsl_parser.yy" + { (yyval.node) = (yyvsp[(1) - (1)].function_definition); ;} + break; + + case 324: +#line 2146 "src/glsl/glsl_parser.yy" + { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + break; + + case 325: +#line 2147 "src/glsl/glsl_parser.yy" + { (yyval.node) = NULL; ;} + break; + + case 326: +#line 2148 "src/glsl/glsl_parser.yy" + { (yyval.node) = (yyvsp[(1) - (1)].node); ;} + break; + + case 327: +#line 2153 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.function_definition) = new(ctx) ast_function_definition(); + (yyval.function_definition)->set_location(yylloc); + (yyval.function_definition)->prototype = (yyvsp[(1) - (2)].function); + (yyval.function_definition)->body = (yyvsp[(2) - (2)].compound_statement); + + state->symbols->pop_scope(); + ;} + break; + + case 328: +#line 2167 "src/glsl/glsl_parser.yy" + { + (yyval.node) = (yyvsp[(1) - (1)].interface_block); + ;} + break; + + case 329: +#line 2171 "src/glsl/glsl_parser.yy" + { + ast_interface_block *block = (yyvsp[(2) - (2)].interface_block); + if (!block->layout.merge_qualifier(& (yylsp[(1) - (2)]), state, (yyvsp[(1) - (2)].type_qualifier))) { + YYERROR; + } + (yyval.node) = block; + ;} + break; + + case 330: +#line 2182 "src/glsl/glsl_parser.yy" + { + ast_interface_block *const block = (yyvsp[(6) - (7)].interface_block); + + block->block_name = (yyvsp[(2) - (7)].identifier); + block->declarations.push_degenerate_list_at_head(& (yyvsp[(4) - (7)].declarator_list)->link); + + if ((yyvsp[(1) - (7)].type_qualifier).flags.q.uniform) { + if (!state->has_uniform_buffer_objects()) { + _mesa_glsl_error(& (yylsp[(1) - (7)]), state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks"); + } else if (state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& (yylsp[(1) - (7)]), state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks"); + } + } else { + if (state->es_shader || state->language_version < 150) { + _mesa_glsl_error(& (yylsp[(1) - (7)]), state, + "#version 150 required for using " + "interface blocks"); + } + } + + /* From the GLSL 1.50.11 spec, section 4.3.7 ("Interface Blocks"): + * "It is illegal to have an input block in a vertex shader + * or an output block in a fragment shader" + */ + if ((state->stage == MESA_SHADER_VERTEX) && (yyvsp[(1) - (7)].type_qualifier).flags.q.in) { + _mesa_glsl_error(& (yylsp[(1) - (7)]), state, + "`in' interface block is not allowed for " + "a vertex shader"); + } else if ((state->stage == MESA_SHADER_FRAGMENT) && (yyvsp[(1) - (7)].type_qualifier).flags.q.out) { + _mesa_glsl_error(& (yylsp[(1) - (7)]), state, + "`out' interface block is not allowed for " + "a fragment shader"); + } + + /* Since block arrays require names, and both features are added in + * the same language versions, we don't have to explicitly + * version-check both things. + */ + if (block->instance_name != NULL) { + state->check_version(150, 300, & (yylsp[(1) - (7)]), "interface blocks with " + "an instance name are not allowed"); + } + + unsigned interface_type_mask; + struct ast_type_qualifier temp_type_qualifier; + + /* Get a bitmask containing only the in/out/uniform flags, allowing us + * to ignore other irrelevant flags like interpolation qualifiers. + */ + temp_type_qualifier.flags.i = 0; + temp_type_qualifier.flags.q.uniform = true; + temp_type_qualifier.flags.q.in = true; + temp_type_qualifier.flags.q.out = true; + interface_type_mask = temp_type_qualifier.flags.i; + + /* Get the block's interface qualifier. The interface_qualifier + * production rule guarantees that only one bit will be set (and + * it will be in/out/uniform). + */ + unsigned block_interface_qualifier = (yyvsp[(1) - (7)].type_qualifier).flags.i; + + block->layout.flags.i |= block_interface_qualifier; + + foreach_list_typed (ast_declarator_list, member, link, &block->declarations) { + ast_type_qualifier& qualifier = member->type->qualifier; + if ((qualifier.flags.i & interface_type_mask) == 0) { + /* GLSLangSpec.1.50.11, 4.3.7 (Interface Blocks): + * "If no optional qualifier is used in a member declaration, the + * qualifier of the variable is just in, out, or uniform as declared + * by interface-qualifier." + */ + qualifier.flags.i |= block_interface_qualifier; + } else if ((qualifier.flags.i & interface_type_mask) != + block_interface_qualifier) { + /* GLSLangSpec.1.50.11, 4.3.7 (Interface Blocks): + * "If optional qualifiers are used, they can include interpolation + * and storage qualifiers and they must declare an input, output, + * or uniform variable consistent with the interface qualifier of + * the block." + */ + _mesa_glsl_error(& (yylsp[(1) - (7)]), state, + "uniform/in/out qualifier on " + "interface block member does not match " + "the interface block"); + } + } + + (yyval.interface_block) = block; + ;} + break; + + case 331: +#line 2279 "src/glsl/glsl_parser.yy" + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.in = 1; + ;} + break; + + case 332: +#line 2285 "src/glsl/glsl_parser.yy" + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.out = 1; + ;} + break; + + case 333: +#line 2291 "src/glsl/glsl_parser.yy" + { + memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); + (yyval.type_qualifier).precision = ast_precision_none; + (yyval.type_qualifier).flags.q.uniform = 1; + ;} + break; + + case 334: +#line 2300 "src/glsl/glsl_parser.yy" + { + (yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier, + NULL, NULL); + ;} + break; + + case 335: +#line 2305 "src/glsl/glsl_parser.yy" + { + (yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier, + (yyvsp[(1) - (1)].identifier), NULL); + ;} + break; + + case 336: +#line 2310 "src/glsl/glsl_parser.yy" + { + (yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier, + (yyvsp[(1) - (2)].identifier), (yyvsp[(2) - (2)].array_specifier)); + ;} + break; + + case 337: +#line 2318 "src/glsl/glsl_parser.yy" + { + (yyval.declarator_list) = (yyvsp[(1) - (1)].declarator_list); + (yyvsp[(1) - (1)].declarator_list)->link.self_link(); + ;} + break; + + case 338: +#line 2323 "src/glsl/glsl_parser.yy" + { + (yyval.declarator_list) = (yyvsp[(1) - (2)].declarator_list); + (yyvsp[(2) - (2)].declarator_list)->link.insert_before(& (yyval.declarator_list)->link); + ;} + break; + + case 339: +#line 2331 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + ast_fully_specified_type *type = (yyvsp[(1) - (3)].fully_specified_type); + type->set_location(yylloc); + + if (type->qualifier.flags.q.attribute) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "keyword 'attribute' cannot be used with " + "interface block member"); + } else if (type->qualifier.flags.q.varying) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "keyword 'varying' cannot be used with " + "interface block member"); + } + + (yyval.declarator_list) = new(ctx) ast_declarator_list(type); + (yyval.declarator_list)->set_location(yylloc); + + (yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[(2) - (3)].declaration)->link); + ;} + break; + + case 340: +#line 2355 "src/glsl/glsl_parser.yy" + { + if (!state->default_uniform_qualifier->merge_qualifier(& (yylsp[(1) - (3)]), state, (yyvsp[(1) - (3)].type_qualifier))) { + YYERROR; + } + (yyval.node) = NULL; + ;} + break; + + case 341: +#line 2363 "src/glsl/glsl_parser.yy" + { + void *ctx = state; + (yyval.node) = NULL; + if (state->stage != MESA_SHADER_GEOMETRY) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "input layout qualifiers only valid in " + "geometry shaders"); + } else if (!(yyvsp[(1) - (3)].type_qualifier).flags.q.prim_type) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "input layout qualifiers must specify a primitive" + " type"); + } else { + /* Make sure this is a valid input primitive type. */ + switch ((yyvsp[(1) - (3)].type_qualifier).prim_type) { + case GL_POINTS: + case GL_LINES: + case GL_LINES_ADJACENCY: + case GL_TRIANGLES: + case GL_TRIANGLES_ADJACENCY: + (yyval.node) = new(ctx) ast_gs_input_layout((yylsp[(1) - (3)]), (yyvsp[(1) - (3)].type_qualifier).prim_type); + break; + default: + _mesa_glsl_error(&(yylsp[(1) - (3)]), state, + "invalid geometry shader input primitive type"); + break; + } + } + ;} + break; + + case 342: +#line 2393 "src/glsl/glsl_parser.yy" + { + if (state->stage != MESA_SHADER_GEOMETRY) { + _mesa_glsl_error(& (yylsp[(1) - (3)]), state, + "out layout qualifiers only valid in " + "geometry shaders"); + } else { + if ((yyvsp[(1) - (3)].type_qualifier).flags.q.prim_type) { + /* Make sure this is a valid output primitive type. */ + switch ((yyvsp[(1) - (3)].type_qualifier).prim_type) { + case GL_POINTS: + case GL_LINE_STRIP: + case GL_TRIANGLE_STRIP: + break; + default: + _mesa_glsl_error(&(yylsp[(1) - (3)]), state, "invalid geometry shader output " + "primitive type"); + break; + } + } + if (!state->out_qualifier->merge_qualifier(& (yylsp[(1) - (3)]), state, (yyvsp[(1) - (3)].type_qualifier))) + YYERROR; + } + (yyval.node) = NULL; + ;} break; - -/* Line 1806 of yacc.c */ -#line 5556 "src/glsl/glsl_parser.cpp" +/* Line 1267 of yacc.c. */ +#line 5875 "src/glsl/glsl_parser.cpp" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -5594,10 +5902,6 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -5605,44 +5909,45 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (&yylloc, state, YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (&yylloc, state, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (&yylloc, state, yymsg); + } + else + { + yyerror (&yylloc, state, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } - yyerror_range[1] = yylloc; + yyerror_range[0] = yylloc; if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -5659,7 +5964,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -5675,7 +5980,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - yyerror_range[1] = yylsp[1-yylen]; + yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -5694,7 +5999,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -5709,7 +6014,7 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - yyerror_range[1] = *yylsp; + yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, state); YYPOPSTACK (1); @@ -5717,12 +6022,15 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; - yyerror_range[2] = yylloc; + yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + the look-ahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ @@ -5746,7 +6054,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -5757,14 +6065,9 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, state); - } + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, state); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h index e3047d5ab..279c118ec 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h @@ -1,21 +1,24 @@ -/* A Bison parser, made by GNU Bison 2.5. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -26,11 +29,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -95,158 +97,395 @@ SAMPLER2DARRAY = 313, SAMPLER1DARRAYSHADOW = 314, SAMPLER2DARRAYSHADOW = 315, - ISAMPLER1D = 316, - ISAMPLER2D = 317, - ISAMPLER3D = 318, - ISAMPLERCUBE = 319, - ISAMPLER1DARRAY = 320, - ISAMPLER2DARRAY = 321, - USAMPLER1D = 322, - USAMPLER2D = 323, - USAMPLER3D = 324, - USAMPLERCUBE = 325, - USAMPLER1DARRAY = 326, - USAMPLER2DARRAY = 327, - SAMPLER2DRECT = 328, - ISAMPLER2DRECT = 329, - USAMPLER2DRECT = 330, - SAMPLER2DRECTSHADOW = 331, - SAMPLERBUFFER = 332, - ISAMPLERBUFFER = 333, - USAMPLERBUFFER = 334, - SAMPLEREXTERNALOES = 335, - STRUCT = 336, - VOID_TOK = 337, - WHILE = 338, - IDENTIFIER = 339, - TYPE_IDENTIFIER = 340, - NEW_IDENTIFIER = 341, - FLOATCONSTANT = 342, - INTCONSTANT = 343, - UINTCONSTANT = 344, - BOOLCONSTANT = 345, - FIELD_SELECTION = 346, - LEFT_OP = 347, - RIGHT_OP = 348, - INC_OP = 349, - DEC_OP = 350, - LE_OP = 351, - GE_OP = 352, - EQ_OP = 353, - NE_OP = 354, - AND_OP = 355, - OR_OP = 356, - XOR_OP = 357, - MUL_ASSIGN = 358, - DIV_ASSIGN = 359, - ADD_ASSIGN = 360, - MOD_ASSIGN = 361, - LEFT_ASSIGN = 362, - RIGHT_ASSIGN = 363, - AND_ASSIGN = 364, - XOR_ASSIGN = 365, - OR_ASSIGN = 366, - SUB_ASSIGN = 367, - INVARIANT = 368, - LOWP = 369, - MEDIUMP = 370, - HIGHP = 371, - SUPERP = 372, - PRECISION = 373, - VERSION_TOK = 374, - EXTENSION = 375, - LINE = 376, - COLON = 377, - EOL = 378, - INTERFACE = 379, - OUTPUT = 380, - PRAGMA_DEBUG_ON = 381, - PRAGMA_DEBUG_OFF = 382, - PRAGMA_OPTIMIZE_ON = 383, - PRAGMA_OPTIMIZE_OFF = 384, - PRAGMA_INVARIANT_ALL = 385, - LAYOUT_TOK = 386, - ASM = 387, - CLASS = 388, - UNION = 389, - ENUM = 390, - TYPEDEF = 391, - TEMPLATE = 392, - THIS = 393, - PACKED_TOK = 394, - GOTO = 395, - INLINE_TOK = 396, - NOINLINE = 397, - VOLATILE = 398, - PUBLIC_TOK = 399, - STATIC = 400, - EXTERN = 401, - EXTERNAL = 402, - LONG_TOK = 403, - SHORT_TOK = 404, - DOUBLE_TOK = 405, - HALF = 406, - FIXED_TOK = 407, - UNSIGNED = 408, - INPUT_TOK = 409, - OUPTUT = 410, - HVEC2 = 411, - HVEC3 = 412, - HVEC4 = 413, - DVEC2 = 414, - DVEC3 = 415, - DVEC4 = 416, - FVEC2 = 417, - FVEC3 = 418, - FVEC4 = 419, - SAMPLER3DRECT = 420, - SIZEOF = 421, - CAST = 422, - NAMESPACE = 423, - USING = 424, - ERROR_TOK = 425, - COMMON = 426, - PARTITION = 427, - ACTIVE = 428, - FILTER = 429, - IMAGE1D = 430, - IMAGE2D = 431, - IMAGE3D = 432, - IMAGECUBE = 433, - IMAGE1DARRAY = 434, - IMAGE2DARRAY = 435, - IIMAGE1D = 436, - IIMAGE2D = 437, - IIMAGE3D = 438, - IIMAGECUBE = 439, - IIMAGE1DARRAY = 440, - IIMAGE2DARRAY = 441, - UIMAGE1D = 442, - UIMAGE2D = 443, - UIMAGE3D = 444, - UIMAGECUBE = 445, - UIMAGE1DARRAY = 446, - UIMAGE2DARRAY = 447, - IMAGE1DSHADOW = 448, - IMAGE2DSHADOW = 449, - IMAGEBUFFER = 450, - IIMAGEBUFFER = 451, - UIMAGEBUFFER = 452, - IMAGE1DARRAYSHADOW = 453, - IMAGE2DARRAYSHADOW = 454, - ROW_MAJOR = 455 + SAMPLERCUBEARRAY = 316, + SAMPLERCUBEARRAYSHADOW = 317, + ISAMPLER1D = 318, + ISAMPLER2D = 319, + ISAMPLER3D = 320, + ISAMPLERCUBE = 321, + ISAMPLER1DARRAY = 322, + ISAMPLER2DARRAY = 323, + ISAMPLERCUBEARRAY = 324, + USAMPLER1D = 325, + USAMPLER2D = 326, + USAMPLER3D = 327, + USAMPLERCUBE = 328, + USAMPLER1DARRAY = 329, + USAMPLER2DARRAY = 330, + USAMPLERCUBEARRAY = 331, + SAMPLER2DRECT = 332, + ISAMPLER2DRECT = 333, + USAMPLER2DRECT = 334, + SAMPLER2DRECTSHADOW = 335, + SAMPLERBUFFER = 336, + ISAMPLERBUFFER = 337, + USAMPLERBUFFER = 338, + SAMPLER2DMS = 339, + ISAMPLER2DMS = 340, + USAMPLER2DMS = 341, + SAMPLER2DMSARRAY = 342, + ISAMPLER2DMSARRAY = 343, + USAMPLER2DMSARRAY = 344, + SAMPLEREXTERNALOES = 345, + ATOMIC_UINT = 346, + STRUCT = 347, + VOID_TOK = 348, + WHILE = 349, + IDENTIFIER = 350, + TYPE_IDENTIFIER = 351, + NEW_IDENTIFIER = 352, + FLOATCONSTANT = 353, + INTCONSTANT = 354, + UINTCONSTANT = 355, + BOOLCONSTANT = 356, + FIELD_SELECTION = 357, + LEFT_OP = 358, + RIGHT_OP = 359, + INC_OP = 360, + DEC_OP = 361, + LE_OP = 362, + GE_OP = 363, + EQ_OP = 364, + NE_OP = 365, + AND_OP = 366, + OR_OP = 367, + XOR_OP = 368, + MUL_ASSIGN = 369, + DIV_ASSIGN = 370, + ADD_ASSIGN = 371, + MOD_ASSIGN = 372, + LEFT_ASSIGN = 373, + RIGHT_ASSIGN = 374, + AND_ASSIGN = 375, + XOR_ASSIGN = 376, + OR_ASSIGN = 377, + SUB_ASSIGN = 378, + INVARIANT = 379, + LOWP = 380, + MEDIUMP = 381, + HIGHP = 382, + SUPERP = 383, + PRECISION = 384, + VERSION_TOK = 385, + EXTENSION = 386, + LINE = 387, + COLON = 388, + EOL = 389, + INTERFACE = 390, + OUTPUT = 391, + PRAGMA_DEBUG_ON = 392, + PRAGMA_DEBUG_OFF = 393, + PRAGMA_OPTIMIZE_ON = 394, + PRAGMA_OPTIMIZE_OFF = 395, + PRAGMA_INVARIANT_ALL = 396, + LAYOUT_TOK = 397, + ASM = 398, + CLASS = 399, + UNION = 400, + ENUM = 401, + TYPEDEF = 402, + TEMPLATE = 403, + THIS = 404, + PACKED_TOK = 405, + GOTO = 406, + INLINE_TOK = 407, + NOINLINE = 408, + VOLATILE = 409, + PUBLIC_TOK = 410, + STATIC = 411, + EXTERN = 412, + EXTERNAL = 413, + LONG_TOK = 414, + SHORT_TOK = 415, + DOUBLE_TOK = 416, + HALF = 417, + FIXED_TOK = 418, + UNSIGNED = 419, + INPUT_TOK = 420, + OUPTUT = 421, + HVEC2 = 422, + HVEC3 = 423, + HVEC4 = 424, + DVEC2 = 425, + DVEC3 = 426, + DVEC4 = 427, + FVEC2 = 428, + FVEC3 = 429, + FVEC4 = 430, + SAMPLER3DRECT = 431, + SIZEOF = 432, + CAST = 433, + NAMESPACE = 434, + USING = 435, + COHERENT = 436, + RESTRICT = 437, + READONLY = 438, + WRITEONLY = 439, + RESOURCE = 440, + PATCH = 441, + SAMPLE = 442, + SUBROUTINE = 443, + ERROR_TOK = 444, + COMMON = 445, + PARTITION = 446, + ACTIVE = 447, + FILTER = 448, + IMAGE1D = 449, + IMAGE2D = 450, + IMAGE3D = 451, + IMAGECUBE = 452, + IMAGE1DARRAY = 453, + IMAGE2DARRAY = 454, + IIMAGE1D = 455, + IIMAGE2D = 456, + IIMAGE3D = 457, + IIMAGECUBE = 458, + IIMAGE1DARRAY = 459, + IIMAGE2DARRAY = 460, + UIMAGE1D = 461, + UIMAGE2D = 462, + UIMAGE3D = 463, + UIMAGECUBE = 464, + UIMAGE1DARRAY = 465, + UIMAGE2DARRAY = 466, + IMAGE1DSHADOW = 467, + IMAGE2DSHADOW = 468, + IMAGEBUFFER = 469, + IIMAGEBUFFER = 470, + UIMAGEBUFFER = 471, + IMAGE1DARRAYSHADOW = 472, + IMAGE2DARRAYSHADOW = 473, + ROW_MAJOR = 474, + THEN = 475 }; #endif +/* Tokens. */ +#define ATTRIBUTE 258 +#define CONST_TOK 259 +#define BOOL_TOK 260 +#define FLOAT_TOK 261 +#define INT_TOK 262 +#define UINT_TOK 263 +#define BREAK 264 +#define CONTINUE 265 +#define DO 266 +#define ELSE 267 +#define FOR 268 +#define IF 269 +#define DISCARD 270 +#define RETURN 271 +#define SWITCH 272 +#define CASE 273 +#define DEFAULT 274 +#define BVEC2 275 +#define BVEC3 276 +#define BVEC4 277 +#define IVEC2 278 +#define IVEC3 279 +#define IVEC4 280 +#define UVEC2 281 +#define UVEC3 282 +#define UVEC4 283 +#define VEC2 284 +#define VEC3 285 +#define VEC4 286 +#define CENTROID 287 +#define IN_TOK 288 +#define OUT_TOK 289 +#define INOUT_TOK 290 +#define UNIFORM 291 +#define VARYING 292 +#define NOPERSPECTIVE 293 +#define FLAT 294 +#define SMOOTH 295 +#define MAT2X2 296 +#define MAT2X3 297 +#define MAT2X4 298 +#define MAT3X2 299 +#define MAT3X3 300 +#define MAT3X4 301 +#define MAT4X2 302 +#define MAT4X3 303 +#define MAT4X4 304 +#define SAMPLER1D 305 +#define SAMPLER2D 306 +#define SAMPLER3D 307 +#define SAMPLERCUBE 308 +#define SAMPLER1DSHADOW 309 +#define SAMPLER2DSHADOW 310 +#define SAMPLERCUBESHADOW 311 +#define SAMPLER1DARRAY 312 +#define SAMPLER2DARRAY 313 +#define SAMPLER1DARRAYSHADOW 314 +#define SAMPLER2DARRAYSHADOW 315 +#define SAMPLERCUBEARRAY 316 +#define SAMPLERCUBEARRAYSHADOW 317 +#define ISAMPLER1D 318 +#define ISAMPLER2D 319 +#define ISAMPLER3D 320 +#define ISAMPLERCUBE 321 +#define ISAMPLER1DARRAY 322 +#define ISAMPLER2DARRAY 323 +#define ISAMPLERCUBEARRAY 324 +#define USAMPLER1D 325 +#define USAMPLER2D 326 +#define USAMPLER3D 327 +#define USAMPLERCUBE 328 +#define USAMPLER1DARRAY 329 +#define USAMPLER2DARRAY 330 +#define USAMPLERCUBEARRAY 331 +#define SAMPLER2DRECT 332 +#define ISAMPLER2DRECT 333 +#define USAMPLER2DRECT 334 +#define SAMPLER2DRECTSHADOW 335 +#define SAMPLERBUFFER 336 +#define ISAMPLERBUFFER 337 +#define USAMPLERBUFFER 338 +#define SAMPLER2DMS 339 +#define ISAMPLER2DMS 340 +#define USAMPLER2DMS 341 +#define SAMPLER2DMSARRAY 342 +#define ISAMPLER2DMSARRAY 343 +#define USAMPLER2DMSARRAY 344 +#define SAMPLEREXTERNALOES 345 +#define ATOMIC_UINT 346 +#define STRUCT 347 +#define VOID_TOK 348 +#define WHILE 349 +#define IDENTIFIER 350 +#define TYPE_IDENTIFIER 351 +#define NEW_IDENTIFIER 352 +#define FLOATCONSTANT 353 +#define INTCONSTANT 354 +#define UINTCONSTANT 355 +#define BOOLCONSTANT 356 +#define FIELD_SELECTION 357 +#define LEFT_OP 358 +#define RIGHT_OP 359 +#define INC_OP 360 +#define DEC_OP 361 +#define LE_OP 362 +#define GE_OP 363 +#define EQ_OP 364 +#define NE_OP 365 +#define AND_OP 366 +#define OR_OP 367 +#define XOR_OP 368 +#define MUL_ASSIGN 369 +#define DIV_ASSIGN 370 +#define ADD_ASSIGN 371 +#define MOD_ASSIGN 372 +#define LEFT_ASSIGN 373 +#define RIGHT_ASSIGN 374 +#define AND_ASSIGN 375 +#define XOR_ASSIGN 376 +#define OR_ASSIGN 377 +#define SUB_ASSIGN 378 +#define INVARIANT 379 +#define LOWP 380 +#define MEDIUMP 381 +#define HIGHP 382 +#define SUPERP 383 +#define PRECISION 384 +#define VERSION_TOK 385 +#define EXTENSION 386 +#define LINE 387 +#define COLON 388 +#define EOL 389 +#define INTERFACE 390 +#define OUTPUT 391 +#define PRAGMA_DEBUG_ON 392 +#define PRAGMA_DEBUG_OFF 393 +#define PRAGMA_OPTIMIZE_ON 394 +#define PRAGMA_OPTIMIZE_OFF 395 +#define PRAGMA_INVARIANT_ALL 396 +#define LAYOUT_TOK 397 +#define ASM 398 +#define CLASS 399 +#define UNION 400 +#define ENUM 401 +#define TYPEDEF 402 +#define TEMPLATE 403 +#define THIS 404 +#define PACKED_TOK 405 +#define GOTO 406 +#define INLINE_TOK 407 +#define NOINLINE 408 +#define VOLATILE 409 +#define PUBLIC_TOK 410 +#define STATIC 411 +#define EXTERN 412 +#define EXTERNAL 413 +#define LONG_TOK 414 +#define SHORT_TOK 415 +#define DOUBLE_TOK 416 +#define HALF 417 +#define FIXED_TOK 418 +#define UNSIGNED 419 +#define INPUT_TOK 420 +#define OUPTUT 421 +#define HVEC2 422 +#define HVEC3 423 +#define HVEC4 424 +#define DVEC2 425 +#define DVEC3 426 +#define DVEC4 427 +#define FVEC2 428 +#define FVEC3 429 +#define FVEC4 430 +#define SAMPLER3DRECT 431 +#define SIZEOF 432 +#define CAST 433 +#define NAMESPACE 434 +#define USING 435 +#define COHERENT 436 +#define RESTRICT 437 +#define READONLY 438 +#define WRITEONLY 439 +#define RESOURCE 440 +#define PATCH 441 +#define SAMPLE 442 +#define SUBROUTINE 443 +#define ERROR_TOK 444 +#define COMMON 445 +#define PARTITION 446 +#define ACTIVE 447 +#define FILTER 448 +#define IMAGE1D 449 +#define IMAGE2D 450 +#define IMAGE3D 451 +#define IMAGECUBE 452 +#define IMAGE1DARRAY 453 +#define IMAGE2DARRAY 454 +#define IIMAGE1D 455 +#define IIMAGE2D 456 +#define IIMAGE3D 457 +#define IIMAGECUBE 458 +#define IIMAGE1DARRAY 459 +#define IIMAGE2DARRAY 460 +#define UIMAGE1D 461 +#define UIMAGE2D 462 +#define UIMAGE3D 463 +#define UIMAGECUBE 464 +#define UIMAGE1DARRAY 465 +#define UIMAGE2DARRAY 466 +#define IMAGE1DSHADOW 467 +#define IMAGE2DSHADOW 468 +#define IMAGEBUFFER 469 +#define IIMAGEBUFFER 470 +#define UIMAGEBUFFER 471 +#define IMAGE1DARRAYSHADOW 472 +#define IMAGE2DARRAYSHADOW 473 +#define ROW_MAJOR 474 +#define THEN 475 + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE +#line 96 "src/glsl/glsl_parser.yy" { - -/* Line 2068 of yacc.c */ -#line 64 "src/glsl/glsl_parser.yy" - int n; float real; const char *identifier; @@ -255,6 +494,7 @@ typedef union YYSTYPE ast_node *node; ast_type_specifier *type_specifier; + ast_array_specifier *array_specifier; ast_fully_specified_type *fully_specified_type; ast_function *function; ast_parameter_declarator *parameter_declarator; @@ -269,6 +509,7 @@ typedef union YYSTYPE ast_case_label_list *case_label_list; ast_case_statement *case_statement; ast_case_statement_list *case_statement_list; + ast_interface_block *interface_block; struct { ast_node *cond; @@ -279,15 +520,13 @@ typedef union YYSTYPE ast_node *then_statement; ast_node *else_statement; } selection_rest_statement; - - - -/* Line 2068 of yacc.c */ -#line 287 "src/glsl/glsl_parser.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 1529 of yacc.c. */ +#line 526 "src/glsl/glsl_parser.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif @@ -306,4 +545,3 @@ typedef struct YYLTYPE #endif - diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy index 54a94a163..f4055212a 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser.yy @@ -25,7 +25,7 @@ #include #include #include - + #include "ast.h" #include "glsl_parser_extras.h" #include "glsl_types.h" @@ -36,16 +36,48 @@ # pragma warning(disable: 4244) // warning C4244: '=' : conversion from 'double' to 'float', possible loss of data #endif // defined(_MSC_VER) -#define YYLEX_PARAM state->scanner - #undef yyerror static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) { _mesa_glsl_error(loc, st, "%s", msg); } + +static int +_mesa_glsl_lex(YYSTYPE *val, YYLTYPE *loc, _mesa_glsl_parse_state *state) +{ + return _mesa_glsl_lexer_lex(val, loc, state->scanner); +} + +static bool match_layout_qualifier(const char *s1, const char *s2, + _mesa_glsl_parse_state *state) +{ + /* From the GLSL 1.50 spec, section 4.3.8 (Layout Qualifiers): + * + * "The tokens in any layout-qualifier-id-list ... are not case + * sensitive, unless explicitly noted otherwise." + * + * The text "unless explicitly noted otherwise" appears to be + * vacuous--no desktop GLSL spec (up through GLSL 4.40) notes + * otherwise. + * + * However, the GLSL ES 3.00 spec says, in section 4.3.8 (Layout + * Qualifiers): + * + * "As for other identifiers, they are case sensitive." + * + * So we need to do a case-sensitive or a case-insensitive match, + * depending on whether we are compiling for GLSL ES. + */ + if (state->es_shader) + return strcmp(s1, s2); + else + return strcasecmp(s1, s2); +} %} +%expect 0 + %pure-parser %error-verbose @@ -58,7 +90,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) @$.source = 0; } -%lex-param {void *scanner} +%lex-param {struct _mesa_glsl_parse_state *state} %parse-param {struct _mesa_glsl_parse_state *state} %union { @@ -70,6 +102,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) ast_node *node; ast_type_specifier *type_specifier; + ast_array_specifier *array_specifier; ast_fully_specified_type *fully_specified_type; ast_function *function; ast_parameter_declarator *parameter_declarator; @@ -84,6 +117,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) ast_case_label_list *case_label_list; ast_case_statement *case_statement; ast_case_statement_list *case_statement_list; + ast_interface_block *interface_block; struct { ast_node *cond; @@ -106,15 +140,21 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %token MAT4X2 MAT4X3 MAT4X4 %token SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW %token SAMPLERCUBESHADOW SAMPLER1DARRAY SAMPLER2DARRAY SAMPLER1DARRAYSHADOW -%token SAMPLER2DARRAYSHADOW ISAMPLER1D ISAMPLER2D ISAMPLER3D ISAMPLERCUBE -%token ISAMPLER1DARRAY ISAMPLER2DARRAY USAMPLER1D USAMPLER2D USAMPLER3D -%token USAMPLERCUBE USAMPLER1DARRAY USAMPLER2DARRAY +%token SAMPLER2DARRAYSHADOW SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW +%token ISAMPLER1D ISAMPLER2D ISAMPLER3D ISAMPLERCUBE +%token ISAMPLER1DARRAY ISAMPLER2DARRAY ISAMPLERCUBEARRAY +%token USAMPLER1D USAMPLER2D USAMPLER3D USAMPLERCUBE USAMPLER1DARRAY +%token USAMPLER2DARRAY USAMPLERCUBEARRAY %token SAMPLER2DRECT ISAMPLER2DRECT USAMPLER2DRECT SAMPLER2DRECTSHADOW %token SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER +%token SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS +%token SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token SAMPLEREXTERNALOES +%token ATOMIC_UINT %token STRUCT VOID_TOK WHILE %token IDENTIFIER TYPE_IDENTIFIER NEW_IDENTIFIER %type any_identifier +%type instance_name_opt %token FLOATCONSTANT %token INTCONSTANT UINTCONSTANT BOOLCONSTANT %token FIELD_SELECTION @@ -140,6 +180,8 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4 %token SAMPLER3DRECT %token SIZEOF CAST NAMESPACE USING +%token COHERENT RESTRICT READONLY WRITEONLY RESOURCE PATCH SAMPLE +%token SUBROUTINE %token ERROR_TOK @@ -157,14 +199,16 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %type simple_statement %type precision_qualifier %type type_qualifier +%type auxiliary_storage_qualifier %type storage_qualifier %type interpolation_qualifier %type layout_qualifier %type layout_qualifier_id_list layout_qualifier_id -%type uniform_block_layout_qualifier +%type interface_block_layout_qualifier +%type interface_qualifier %type type_specifier -%type type_specifier_no_prec %type type_specifier_nonarray +%type array_specifier %type basic_type_specifier_nonarray %type fully_specified_type %type function_prototype @@ -174,7 +218,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %type parameter_declarator %type parameter_declaration %type parameter_qualifier -%type parameter_type_qualifier +%type parameter_direction_qualifier %type parameter_type_specifier %type function_definition %type compound_statement_no_new_scope @@ -217,10 +261,12 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %type init_declarator_list %type single_declaration %type initializer +%type initializer_list %type declaration %type declaration_statement %type jump_statement -%type uniform_block +%type interface_block +%type basic_interface_block %type struct_specifier %type struct_declaration_list %type struct_declaration @@ -241,1788 +287,2130 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %type conditionopt %type for_init_statement %type for_rest_statement +%type integer_constant +%type layout_defaults + +%right THEN ELSE %% -translation_unit: - version_statement extension_statement_list - { - _mesa_glsl_initialize_types(state); - } - external_declaration_list - { - delete state->symbols; - state->symbols = new(ralloc_parent(state)) glsl_symbol_table; - _mesa_glsl_initialize_types(state); - } - ; +translation_unit: + version_statement extension_statement_list + { + _mesa_glsl_initialize_types(state); + } + external_declaration_list + { + delete state->symbols; + state->symbols = new(ralloc_parent(state)) glsl_symbol_table; + _mesa_glsl_initialize_types(state); + } + ; version_statement: - /* blank - no #version specified: defaults are already set */ - | VERSION_TOK INTCONSTANT EOL - { - bool supported = false; - - switch ($2) { - case 100: - state->es_shader = true; - supported = state->ctx->API == API_OPENGLES2 || - state->ctx->Extensions.ARB_ES2_compatibility; - break; - case 110: - case 120: - /* FINISHME: Once the OpenGL 3.0 'forward compatible' context or - * the OpenGL 3.2 Core context is supported, this logic will need - * change. Older versions of GLSL are no longer supported - * outside the compatibility contexts of 3.x. - */ - case 130: - case 140: - case 150: - case 330: - case 400: - case 410: - case 420: - supported = _mesa_is_desktop_gl(state->ctx) && - ((unsigned) $2) <= state->ctx->Const.GLSLVersion; - break; - default: - supported = false; - break; - } - - state->language_version = $2; - state->version_string = - ralloc_asprintf(state, "GLSL%s %d.%02d", - state->es_shader ? " ES" : "", - state->language_version / 100, - state->language_version % 100); - - if (!supported) { - _mesa_glsl_error(& @2, state, "%s is not supported. " - "Supported versions are: %s\n", - state->version_string, - state->supported_version_string); - } - - if (state->language_version >= 140) { - state->ARB_uniform_buffer_object_enable = true; - } - } - ; + /* blank - no #version specified: defaults are already set */ + | VERSION_TOK INTCONSTANT EOL + { + state->process_version_directive(&@2, $2, NULL); + if (state->error) { + YYERROR; + } + } + | VERSION_TOK INTCONSTANT any_identifier EOL + { + state->process_version_directive(&@2, $2, $3); + if (state->error) { + YYERROR; + } + } + ; pragma_statement: - PRAGMA_DEBUG_ON EOL - | PRAGMA_DEBUG_OFF EOL - | PRAGMA_OPTIMIZE_ON EOL - | PRAGMA_OPTIMIZE_OFF EOL - | PRAGMA_INVARIANT_ALL EOL - { - if (state->language_version == 110) { - _mesa_glsl_warning(& @1, state, - "pragma `invariant(all)' not supported in %s", - state->version_string); - } else { - state->all_invariant = true; - } - } - ; + PRAGMA_DEBUG_ON EOL + | PRAGMA_DEBUG_OFF EOL + | PRAGMA_OPTIMIZE_ON EOL + | PRAGMA_OPTIMIZE_OFF EOL + | PRAGMA_INVARIANT_ALL EOL + { + if (!state->is_version(120, 100)) { + _mesa_glsl_warning(& @1, state, + "pragma `invariant(all)' not supported in %s " + "(GLSL ES 1.00 or GLSL 1.20 required)", + state->get_version_string()); + } else { + state->all_invariant = true; + } + } + ; extension_statement_list: - | extension_statement_list extension_statement - ; + | extension_statement_list extension_statement + ; any_identifier: - IDENTIFIER - | TYPE_IDENTIFIER - | NEW_IDENTIFIER - ; + IDENTIFIER + | TYPE_IDENTIFIER + | NEW_IDENTIFIER + ; extension_statement: - EXTENSION any_identifier COLON any_identifier EOL - { - if (!_mesa_glsl_process_extension($2, & @2, $4, & @4, state)) { - YYERROR; - } - } - ; + EXTENSION any_identifier COLON any_identifier EOL + { + if (!_mesa_glsl_process_extension($2, & @2, $4, & @4, state)) { + YYERROR; + } + } + ; external_declaration_list: - external_declaration - { - /* FINISHME: The NULL test is required because pragmas are set to - * FINISHME: NULL. (See production rule for external_declaration.) - */ - if ($1 != NULL) - state->translation_unit.push_tail(& $1->link); - } - | external_declaration_list external_declaration - { - /* FINISHME: The NULL test is required because pragmas are set to - * FINISHME: NULL. (See production rule for external_declaration.) - */ - if ($2 != NULL) - state->translation_unit.push_tail(& $2->link); - } - ; + external_declaration + { + /* FINISHME: The NULL test is required because pragmas are set to + * FINISHME: NULL. (See production rule for external_declaration.) + */ + if ($1 != NULL) + state->translation_unit.push_tail(& $1->link); + } + | external_declaration_list external_declaration + { + /* FINISHME: The NULL test is required because pragmas are set to + * FINISHME: NULL. (See production rule for external_declaration.) + */ + if ($2 != NULL) + state->translation_unit.push_tail(& $2->link); + } + ; variable_identifier: - IDENTIFIER - | NEW_IDENTIFIER - ; + IDENTIFIER + | NEW_IDENTIFIER + ; primary_expression: - variable_identifier - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); - $$->set_location(yylloc); - $$->primary_expression.identifier = $1; - } - | INTCONSTANT - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); - $$->set_location(yylloc); - $$->primary_expression.int_constant = $1; - } - | UINTCONSTANT - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); - $$->set_location(yylloc); - $$->primary_expression.uint_constant = $1; - } - | FLOATCONSTANT - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); - $$->set_location(yylloc); - $$->primary_expression.float_constant = $1; - } - | BOOLCONSTANT - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); - $$->set_location(yylloc); - $$->primary_expression.bool_constant = $1; - } - | '(' expression ')' - { - $$ = $2; - } - ; + variable_identifier + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL); + $$->set_location(yylloc); + $$->primary_expression.identifier = $1; + } + | INTCONSTANT + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL); + $$->set_location(yylloc); + $$->primary_expression.int_constant = $1; + } + | UINTCONSTANT + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL); + $$->set_location(yylloc); + $$->primary_expression.uint_constant = $1; + } + | FLOATCONSTANT + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL); + $$->set_location(yylloc); + $$->primary_expression.float_constant = $1; + } + | BOOLCONSTANT + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL); + $$->set_location(yylloc); + $$->primary_expression.bool_constant = $1; + } + | '(' expression ')' + { + $$ = $2; + } + ; postfix_expression: - primary_expression - | postfix_expression '[' integer_expression ']' - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_array_index, $1, $3, NULL); - $$->set_location(yylloc); - } - | function_call - { - $$ = $1; - } - | postfix_expression '.' any_identifier - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_field_selection, $1, NULL, NULL); - $$->set_location(yylloc); - $$->primary_expression.identifier = $3; - } - | postfix_expression INC_OP - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_post_inc, $1, NULL, NULL); - $$->set_location(yylloc); - } - | postfix_expression DEC_OP - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_post_dec, $1, NULL, NULL); - $$->set_location(yylloc); - } - ; + primary_expression + | postfix_expression '[' integer_expression ']' + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_array_index, $1, $3, NULL); + $$->set_location(yylloc); + } + | function_call + { + $$ = $1; + } + | postfix_expression '.' any_identifier + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_field_selection, $1, NULL, NULL); + $$->set_location(yylloc); + $$->primary_expression.identifier = $3; + } + | postfix_expression INC_OP + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_post_inc, $1, NULL, NULL); + $$->set_location(yylloc); + } + | postfix_expression DEC_OP + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_post_dec, $1, NULL, NULL); + $$->set_location(yylloc); + } + ; integer_expression: - expression - ; + expression + ; function_call: - function_call_or_method - ; + function_call_or_method + ; function_call_or_method: - function_call_generic - | postfix_expression '.' method_call_generic - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_field_selection, $1, $3, NULL); - $$->set_location(yylloc); - } - ; + function_call_generic + | postfix_expression '.' method_call_generic + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_field_selection, $1, $3, NULL); + $$->set_location(yylloc); + } + ; function_call_generic: - function_call_header_with_parameters ')' - | function_call_header_no_parameters ')' - ; + function_call_header_with_parameters ')' + | function_call_header_no_parameters ')' + ; function_call_header_no_parameters: - function_call_header VOID_TOK - | function_call_header - ; + function_call_header VOID_TOK + | function_call_header + ; function_call_header_with_parameters: - function_call_header assignment_expression - { - $$ = $1; - $$->set_location(yylloc); - $$->expressions.push_tail(& $2->link); - } - | function_call_header_with_parameters ',' assignment_expression - { - $$ = $1; - $$->set_location(yylloc); - $$->expressions.push_tail(& $3->link); - } - ; + function_call_header assignment_expression + { + $$ = $1; + $$->set_location(yylloc); + $$->expressions.push_tail(& $2->link); + } + | function_call_header_with_parameters ',' assignment_expression + { + $$ = $1; + $$->set_location(yylloc); + $$->expressions.push_tail(& $3->link); + } + ; - // Grammar Note: Constructors look like functions, but lexical - // analysis recognized most of them as keywords. They are now - // recognized through "type_specifier". + // Grammar Note: Constructors look like functions, but lexical + // analysis recognized most of them as keywords. They are now + // recognized through "type_specifier". function_call_header: - function_identifier '(' - ; + function_identifier '(' + ; function_identifier: - type_specifier - { - void *ctx = state; - $$ = new(ctx) ast_function_expression($1); - $$->set_location(yylloc); - } - | variable_identifier - { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression($1); - $$ = new(ctx) ast_function_expression(callee); - $$->set_location(yylloc); - } - | FIELD_SELECTION - { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression($1); - $$ = new(ctx) ast_function_expression(callee); - $$->set_location(yylloc); - } - ; + type_specifier + { + void *ctx = state; + $$ = new(ctx) ast_function_expression($1); + $$->set_location(yylloc); + } + | variable_identifier + { + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression($1); + $$ = new(ctx) ast_function_expression(callee); + $$->set_location(yylloc); + } + | FIELD_SELECTION + { + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression($1); + $$ = new(ctx) ast_function_expression(callee); + $$->set_location(yylloc); + } + ; method_call_generic: - method_call_header_with_parameters ')' - | method_call_header_no_parameters ')' - ; + method_call_header_with_parameters ')' + | method_call_header_no_parameters ')' + ; method_call_header_no_parameters: - method_call_header VOID_TOK - | method_call_header - ; + method_call_header VOID_TOK + | method_call_header + ; method_call_header_with_parameters: - method_call_header assignment_expression - { - $$ = $1; - $$->set_location(yylloc); - $$->expressions.push_tail(& $2->link); - } - | method_call_header_with_parameters ',' assignment_expression - { - $$ = $1; - $$->set_location(yylloc); - $$->expressions.push_tail(& $3->link); - } - ; + method_call_header assignment_expression + { + $$ = $1; + $$->set_location(yylloc); + $$->expressions.push_tail(& $2->link); + } + | method_call_header_with_parameters ',' assignment_expression + { + $$ = $1; + $$->set_location(yylloc); + $$->expressions.push_tail(& $3->link); + } + ; - // Grammar Note: Constructors look like methods, but lexical - // analysis recognized most of them as keywords. They are now - // recognized through "type_specifier". + // Grammar Note: Constructors look like methods, but lexical + // analysis recognized most of them as keywords. They are now + // recognized through "type_specifier". method_call_header: - variable_identifier '(' - { - void *ctx = state; - ast_expression *callee = new(ctx) ast_expression($1); - $$ = new(ctx) ast_function_expression(callee); - $$->set_location(yylloc); - } - ; + variable_identifier '(' + { + void *ctx = state; + ast_expression *callee = new(ctx) ast_expression($1); + $$ = new(ctx) ast_function_expression(callee); + $$->set_location(yylloc); + } + ; - // Grammar Note: No traditional style type casts. + // Grammar Note: No traditional style type casts. unary_expression: - postfix_expression - | INC_OP unary_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_pre_inc, $2, NULL, NULL); - $$->set_location(yylloc); - } - | DEC_OP unary_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_pre_dec, $2, NULL, NULL); - $$->set_location(yylloc); - } - | unary_operator unary_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression($1, $2, NULL, NULL); - $$->set_location(yylloc); - } - ; + postfix_expression + | INC_OP unary_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_pre_inc, $2, NULL, NULL); + $$->set_location(yylloc); + } + | DEC_OP unary_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_pre_dec, $2, NULL, NULL); + $$->set_location(yylloc); + } + | unary_operator unary_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression($1, $2, NULL, NULL); + $$->set_location(yylloc); + } + ; - // Grammar Note: No '*' or '&' unary ops. Pointers are not supported. + // Grammar Note: No '*' or '&' unary ops. Pointers are not supported. unary_operator: - '+' { $$ = ast_plus; } - | '-' { $$ = ast_neg; } - | '!' { $$ = ast_logic_not; } - | '~' { $$ = ast_bit_not; } - ; + '+' { $$ = ast_plus; } + | '-' { $$ = ast_neg; } + | '!' { $$ = ast_logic_not; } + | '~' { $$ = ast_bit_not; } + ; multiplicative_expression: - unary_expression - | multiplicative_expression '*' unary_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_mul, $1, $3); - $$->set_location(yylloc); - } - | multiplicative_expression '/' unary_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_div, $1, $3); - $$->set_location(yylloc); - } - | multiplicative_expression '%' unary_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_mod, $1, $3); - $$->set_location(yylloc); - } - ; + unary_expression + | multiplicative_expression '*' unary_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_mul, $1, $3); + $$->set_location(yylloc); + } + | multiplicative_expression '/' unary_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_div, $1, $3); + $$->set_location(yylloc); + } + | multiplicative_expression '%' unary_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_mod, $1, $3); + $$->set_location(yylloc); + } + ; additive_expression: - multiplicative_expression - | additive_expression '+' multiplicative_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_add, $1, $3); - $$->set_location(yylloc); - } - | additive_expression '-' multiplicative_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_sub, $1, $3); - $$->set_location(yylloc); - } - ; + multiplicative_expression + | additive_expression '+' multiplicative_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_add, $1, $3); + $$->set_location(yylloc); + } + | additive_expression '-' multiplicative_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_sub, $1, $3); + $$->set_location(yylloc); + } + ; shift_expression: - additive_expression - | shift_expression LEFT_OP additive_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_lshift, $1, $3); - $$->set_location(yylloc); - } - | shift_expression RIGHT_OP additive_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_rshift, $1, $3); - $$->set_location(yylloc); - } - ; + additive_expression + | shift_expression LEFT_OP additive_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_lshift, $1, $3); + $$->set_location(yylloc); + } + | shift_expression RIGHT_OP additive_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_rshift, $1, $3); + $$->set_location(yylloc); + } + ; relational_expression: - shift_expression - | relational_expression '<' shift_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_less, $1, $3); - $$->set_location(yylloc); - } - | relational_expression '>' shift_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_greater, $1, $3); - $$->set_location(yylloc); - } - | relational_expression LE_OP shift_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_lequal, $1, $3); - $$->set_location(yylloc); - } - | relational_expression GE_OP shift_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_gequal, $1, $3); - $$->set_location(yylloc); - } - ; + shift_expression + | relational_expression '<' shift_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_less, $1, $3); + $$->set_location(yylloc); + } + | relational_expression '>' shift_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_greater, $1, $3); + $$->set_location(yylloc); + } + | relational_expression LE_OP shift_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_lequal, $1, $3); + $$->set_location(yylloc); + } + | relational_expression GE_OP shift_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_gequal, $1, $3); + $$->set_location(yylloc); + } + ; equality_expression: - relational_expression - | equality_expression EQ_OP relational_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_equal, $1, $3); - $$->set_location(yylloc); - } - | equality_expression NE_OP relational_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_nequal, $1, $3); - $$->set_location(yylloc); - } - ; + relational_expression + | equality_expression EQ_OP relational_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_equal, $1, $3); + $$->set_location(yylloc); + } + | equality_expression NE_OP relational_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_nequal, $1, $3); + $$->set_location(yylloc); + } + ; and_expression: - equality_expression - | and_expression '&' equality_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_bit_and, $1, $3); - $$->set_location(yylloc); - } - ; + equality_expression + | and_expression '&' equality_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_bit_and, $1, $3); + $$->set_location(yylloc); + } + ; exclusive_or_expression: - and_expression - | exclusive_or_expression '^' and_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_bit_xor, $1, $3); - $$->set_location(yylloc); - } - ; + and_expression + | exclusive_or_expression '^' and_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_bit_xor, $1, $3); + $$->set_location(yylloc); + } + ; inclusive_or_expression: - exclusive_or_expression - | inclusive_or_expression '|' exclusive_or_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3); - $$->set_location(yylloc); - } - ; + exclusive_or_expression + | inclusive_or_expression '|' exclusive_or_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_bit_or, $1, $3); + $$->set_location(yylloc); + } + ; logical_and_expression: - inclusive_or_expression - | logical_and_expression AND_OP inclusive_or_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_logic_and, $1, $3); - $$->set_location(yylloc); - } - ; + inclusive_or_expression + | logical_and_expression AND_OP inclusive_or_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_logic_and, $1, $3); + $$->set_location(yylloc); + } + ; logical_xor_expression: - logical_and_expression - | logical_xor_expression XOR_OP logical_and_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_logic_xor, $1, $3); - $$->set_location(yylloc); - } - ; + logical_and_expression + | logical_xor_expression XOR_OP logical_and_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_logic_xor, $1, $3); + $$->set_location(yylloc); + } + ; logical_or_expression: - logical_xor_expression - | logical_or_expression OR_OP logical_xor_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression_bin(ast_logic_or, $1, $3); - $$->set_location(yylloc); - } - ; + logical_xor_expression + | logical_or_expression OR_OP logical_xor_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression_bin(ast_logic_or, $1, $3); + $$->set_location(yylloc); + } + ; conditional_expression: - logical_or_expression - | logical_or_expression '?' expression ':' assignment_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression(ast_conditional, $1, $3, $5); - $$->set_location(yylloc); - } - ; + logical_or_expression + | logical_or_expression '?' expression ':' assignment_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_conditional, $1, $3, $5); + $$->set_location(yylloc); + } + ; assignment_expression: - conditional_expression - | unary_expression assignment_operator assignment_expression - { - void *ctx = state; - $$ = new(ctx) ast_expression($2, $1, $3, NULL); - $$->set_location(yylloc); - } - ; + conditional_expression + | unary_expression assignment_operator assignment_expression + { + void *ctx = state; + $$ = new(ctx) ast_expression($2, $1, $3, NULL); + $$->set_location(yylloc); + } + ; assignment_operator: - '=' { $$ = ast_assign; } - | MUL_ASSIGN { $$ = ast_mul_assign; } - | DIV_ASSIGN { $$ = ast_div_assign; } - | MOD_ASSIGN { $$ = ast_mod_assign; } - | ADD_ASSIGN { $$ = ast_add_assign; } - | SUB_ASSIGN { $$ = ast_sub_assign; } - | LEFT_ASSIGN { $$ = ast_ls_assign; } - | RIGHT_ASSIGN { $$ = ast_rs_assign; } - | AND_ASSIGN { $$ = ast_and_assign; } - | XOR_ASSIGN { $$ = ast_xor_assign; } - | OR_ASSIGN { $$ = ast_or_assign; } - ; + '=' { $$ = ast_assign; } + | MUL_ASSIGN { $$ = ast_mul_assign; } + | DIV_ASSIGN { $$ = ast_div_assign; } + | MOD_ASSIGN { $$ = ast_mod_assign; } + | ADD_ASSIGN { $$ = ast_add_assign; } + | SUB_ASSIGN { $$ = ast_sub_assign; } + | LEFT_ASSIGN { $$ = ast_ls_assign; } + | RIGHT_ASSIGN { $$ = ast_rs_assign; } + | AND_ASSIGN { $$ = ast_and_assign; } + | XOR_ASSIGN { $$ = ast_xor_assign; } + | OR_ASSIGN { $$ = ast_or_assign; } + ; expression: - assignment_expression - { - $$ = $1; - } - | expression ',' assignment_expression - { - void *ctx = state; - if ($1->oper != ast_sequence) { - $$ = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL); - $$->set_location(yylloc); - $$->expressions.push_tail(& $1->link); - } else { - $$ = $1; - } + assignment_expression + { + $$ = $1; + } + | expression ',' assignment_expression + { + void *ctx = state; + if ($1->oper != ast_sequence) { + $$ = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL); + $$->set_location(yylloc); + $$->expressions.push_tail(& $1->link); + } else { + $$ = $1; + } - $$->expressions.push_tail(& $3->link); - } - ; + $$->expressions.push_tail(& $3->link); + } + ; constant_expression: - conditional_expression - ; + conditional_expression + ; declaration: - function_prototype ';' - { - state->symbols->pop_scope(); - $$ = $1; - } - | init_declarator_list ';' - { - $$ = $1; - } - | PRECISION precision_qualifier type_specifier_no_prec ';' - { - $3->precision = $2; - $3->is_precision_statement = true; - $$ = $3; - } - | uniform_block - { - $$ = $1; - } - ; + function_prototype ';' + { + state->symbols->pop_scope(); + $$ = $1; + } + | init_declarator_list ';' + { + $$ = $1; + } + | PRECISION precision_qualifier type_specifier ';' + { + $3->default_precision = $2; + $$ = $3; + } + | interface_block + { + $$ = $1; + } + ; function_prototype: - function_declarator ')' - ; + function_declarator ')' + ; function_declarator: - function_header - | function_header_with_parameters - ; + function_header + | function_header_with_parameters + ; function_header_with_parameters: - function_header parameter_declaration - { - $$ = $1; - $$->parameters.push_tail(& $2->link); - } - | function_header_with_parameters ',' parameter_declaration - { - $$ = $1; - $$->parameters.push_tail(& $3->link); - } - ; + function_header parameter_declaration + { + $$ = $1; + $$->parameters.push_tail(& $2->link); + } + | function_header_with_parameters ',' parameter_declaration + { + $$ = $1; + $$->parameters.push_tail(& $3->link); + } + ; function_header: - fully_specified_type variable_identifier '(' - { - void *ctx = state; - $$ = new(ctx) ast_function(); - $$->set_location(yylloc); - $$->return_type = $1; - $$->identifier = $2; + fully_specified_type variable_identifier '(' + { + void *ctx = state; + $$ = new(ctx) ast_function(); + $$->set_location(yylloc); + $$->return_type = $1; + $$->identifier = $2; - state->symbols->add_function(new(state) ir_function($2)); - state->symbols->push_scope(); - } - ; + state->symbols->add_function(new(state) ir_function($2)); + state->symbols->push_scope(); + } + ; parameter_declarator: - type_specifier any_identifier - { - void *ctx = state; - $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); - $$->type = new(ctx) ast_fully_specified_type(); - $$->type->set_location(yylloc); - $$->type->specifier = $1; - $$->identifier = $2; - } - | type_specifier any_identifier '[' constant_expression ']' - { - void *ctx = state; - $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); - $$->type = new(ctx) ast_fully_specified_type(); - $$->type->set_location(yylloc); - $$->type->specifier = $1; - $$->identifier = $2; - $$->is_array = true; - $$->array_size = $4; - } - ; + type_specifier any_identifier + { + void *ctx = state; + $$ = new(ctx) ast_parameter_declarator(); + $$->set_location(yylloc); + $$->type = new(ctx) ast_fully_specified_type(); + $$->type->set_location(yylloc); + $$->type->specifier = $1; + $$->identifier = $2; + } + | type_specifier any_identifier array_specifier + { + void *ctx = state; + $$ = new(ctx) ast_parameter_declarator(); + $$->set_location(yylloc); + $$->type = new(ctx) ast_fully_specified_type(); + $$->type->set_location(yylloc); + $$->type->specifier = $1; + $$->identifier = $2; + $$->array_specifier = $3; + } + ; parameter_declaration: - parameter_type_qualifier parameter_qualifier parameter_declarator - { - $1.flags.i |= $2.flags.i; - - $$ = $3; - $$->type->qualifier = $1; - } - | parameter_qualifier parameter_declarator - { - $$ = $2; - $$->type->qualifier = $1; - } - | parameter_type_qualifier parameter_qualifier parameter_type_specifier - { - void *ctx = state; - $1.flags.i |= $2.flags.i; - - $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); - $$->type = new(ctx) ast_fully_specified_type(); - $$->type->qualifier = $1; - $$->type->specifier = $3; - } - | parameter_qualifier parameter_type_specifier - { - void *ctx = state; - $$ = new(ctx) ast_parameter_declarator(); - $$->set_location(yylloc); - $$->type = new(ctx) ast_fully_specified_type(); - $$->type->qualifier = $1; - $$->type->specifier = $2; - } - ; + parameter_qualifier parameter_declarator + { + $$ = $2; + $$->type->qualifier = $1; + } + | parameter_qualifier parameter_type_specifier + { + void *ctx = state; + $$ = new(ctx) ast_parameter_declarator(); + $$->set_location(yylloc); + $$->type = new(ctx) ast_fully_specified_type(); + $$->type->qualifier = $1; + $$->type->specifier = $2; + } + ; parameter_qualifier: - /* empty */ - { - memset(& $$, 0, sizeof($$)); - } - | IN_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.in = 1; - } - | OUT_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.out = 1; - } - | INOUT_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.in = 1; - $$.flags.q.out = 1; - } - ; + /* empty */ + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + } + | CONST_TOK parameter_qualifier + { + if ($2.flags.q.constant) + _mesa_glsl_error(&@1, state, "duplicate const qualifier"); + + $$ = $2; + $$.flags.q.constant = 1; + } + | parameter_direction_qualifier parameter_qualifier + { + if (($1.flags.q.in || $1.flags.q.out) && ($2.flags.q.in || $2.flags.q.out)) + _mesa_glsl_error(&@1, state, "duplicate in/out/inout qualifier"); + + if (!state->ARB_shading_language_420pack_enable && $2.flags.q.constant) + _mesa_glsl_error(&@1, state, "const must be specified before " + "in/out/inout"); + + $$ = $1; + $$.merge_qualifier(&@1, state, $2); + } + | precision_qualifier parameter_qualifier + { + if ($2.precision != ast_precision_none) + _mesa_glsl_error(&@1, state, "duplicate precision qualifier"); + + if (!state->ARB_shading_language_420pack_enable && $2.flags.i != 0) + _mesa_glsl_error(&@1, state, "precision qualifiers must come last"); + + $$ = $2; + $$.precision = $1; + } + +parameter_direction_qualifier: + IN_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.in = 1; + } + | OUT_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.out = 1; + } + | INOUT_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.in = 1; + $$.flags.q.out = 1; + } + ; parameter_type_specifier: - type_specifier - ; + type_specifier + ; init_declarator_list: - single_declaration - | init_declarator_list ',' any_identifier - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, NULL); - decl->set_location(yylloc); - $$ = $1; - $$->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); - } - | init_declarator_list ',' any_identifier '[' ']' - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, NULL); - decl->set_location(yylloc); + single_declaration + | init_declarator_list ',' any_identifier + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($3, NULL, NULL); + decl->set_location(yylloc); - $$ = $1; - $$->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); - } - | init_declarator_list ',' any_identifier '[' constant_expression ']' - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, NULL); - decl->set_location(yylloc); + $$ = $1; + $$->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); + } + | init_declarator_list ',' any_identifier array_specifier + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($3, $4, NULL); + decl->set_location(yylloc); - $$ = $1; - $$->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); - } - | init_declarator_list ',' any_identifier '[' ']' '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($3, true, NULL, $7); - decl->set_location(yylloc); + $$ = $1; + $$->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); + } + | init_declarator_list ',' any_identifier array_specifier '=' initializer + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($3, $4, $6); + decl->set_location(yylloc); - $$ = $1; - $$->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); - } - | init_declarator_list ',' any_identifier '[' constant_expression ']' '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($3, true, $5, $8); - decl->set_location(yylloc); + $$ = $1; + $$->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); + } + | init_declarator_list ',' any_identifier '=' initializer + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($3, NULL, $5); + decl->set_location(yylloc); - $$ = $1; - $$->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); - } - | init_declarator_list ',' any_identifier '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($3, false, NULL, $5); - decl->set_location(yylloc); + $$ = $1; + $$->declarations.push_tail(&decl->link); + state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); + } + ; - $$ = $1; - $$->declarations.push_tail(&decl->link); - state->symbols->add_variable(new(state) ir_variable(NULL, $3, ir_var_auto, glsl_precision_undefined)); - } - ; - - // Grammar Note: No 'enum', or 'typedef'. + // Grammar Note: No 'enum', or 'typedef'. single_declaration: - fully_specified_type - { - void *ctx = state; - /* Empty declaration list is valid. */ - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - } - | fully_specified_type any_identifier - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL); + fully_specified_type + { + void *ctx = state; + /* Empty declaration list is valid. */ + $$ = new(ctx) ast_declarator_list($1); + $$->set_location(yylloc); + } + | fully_specified_type any_identifier + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL); - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - $$->declarations.push_tail(&decl->link); - } - | fully_specified_type any_identifier '[' ']' - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, NULL); + $$ = new(ctx) ast_declarator_list($1); + $$->set_location(yylloc); + $$->declarations.push_tail(&decl->link); + } + | fully_specified_type any_identifier array_specifier + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, $3, NULL); - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - $$->declarations.push_tail(&decl->link); - } - | fully_specified_type any_identifier '[' constant_expression ']' - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, NULL); + $$ = new(ctx) ast_declarator_list($1); + $$->set_location(yylloc); + $$->declarations.push_tail(&decl->link); + } + | fully_specified_type any_identifier array_specifier '=' initializer + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, $3, $5); - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - $$->declarations.push_tail(&decl->link); - } - | fully_specified_type any_identifier '[' ']' '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, true, NULL, $6); + $$ = new(ctx) ast_declarator_list($1); + $$->set_location(yylloc); + $$->declarations.push_tail(&decl->link); + } + | fully_specified_type any_identifier '=' initializer + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, NULL, $4); - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - $$->declarations.push_tail(&decl->link); - } - | fully_specified_type any_identifier '[' constant_expression ']' '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, true, $4, $7); + $$ = new(ctx) ast_declarator_list($1); + $$->set_location(yylloc); + $$->declarations.push_tail(&decl->link); + } + | INVARIANT variable_identifier // Vertex only. + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL); - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - $$->declarations.push_tail(&decl->link); - } - | fully_specified_type any_identifier '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4); + $$ = new(ctx) ast_declarator_list(NULL); + $$->set_location(yylloc); + $$->invariant = true; - $$ = new(ctx) ast_declarator_list($1); - $$->set_location(yylloc); - $$->declarations.push_tail(&decl->link); - } - | INVARIANT variable_identifier // Vertex only. - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, NULL); - - $$ = new(ctx) ast_declarator_list(NULL); - $$->set_location(yylloc); - $$->invariant = true; - - $$->declarations.push_tail(&decl->link); - } - ; + $$->declarations.push_tail(&decl->link); + } + ; fully_specified_type: - type_specifier - { - void *ctx = state; - $$ = new(ctx) ast_fully_specified_type(); - $$->set_location(yylloc); - $$->specifier = $1; - } - | type_qualifier type_specifier - { - void *ctx = state; - $$ = new(ctx) ast_fully_specified_type(); - $$->set_location(yylloc); - $$->qualifier = $1; - $$->specifier = $2; - } - ; + type_specifier + { + void *ctx = state; + $$ = new(ctx) ast_fully_specified_type(); + $$->set_location(yylloc); + $$->specifier = $1; + } + | type_qualifier type_specifier + { + void *ctx = state; + $$ = new(ctx) ast_fully_specified_type(); + $$->set_location(yylloc); + $$->qualifier = $1; + $$->specifier = $2; + } + ; layout_qualifier: - LAYOUT_TOK '(' layout_qualifier_id_list ')' - { - $$ = $3; - } - ; + LAYOUT_TOK '(' layout_qualifier_id_list ')' + { + $$ = $3; + } + ; layout_qualifier_id_list: - layout_qualifier_id - | layout_qualifier_id_list ',' layout_qualifier_id - { - $$ = $1; - if (!$$.merge_qualifier(& @3, state, $3)) { - YYERROR; - } - } - ; + layout_qualifier_id + | layout_qualifier_id_list ',' layout_qualifier_id + { + $$ = $1; + if (!$$.merge_qualifier(& @3, state, $3)) { + YYERROR; + } + } + ; + +integer_constant: + INTCONSTANT { $$ = $1; } + | UINTCONSTANT { $$ = $1; } + ; layout_qualifier_id: - any_identifier - { - memset(& $$, 0, sizeof($$)); + any_identifier + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; - /* Layout qualifiers for ARB_fragment_coord_conventions. */ - if (!$$.flags.i && state->ARB_fragment_coord_conventions_enable) { - if (strcmp($1, "origin_upper_left") == 0) { - $$.flags.q.origin_upper_left = 1; - } else if (strcmp($1, "pixel_center_integer") == 0) { - $$.flags.q.pixel_center_integer = 1; - } + /* Layout qualifiers for ARB_fragment_coord_conventions. */ + if (!$$.flags.i && (state->ARB_fragment_coord_conventions_enable || + state->is_version(150, 0))) { + if (match_layout_qualifier($1, "origin_upper_left", state) == 0) { + $$.flags.q.origin_upper_left = 1; + } else if (match_layout_qualifier($1, "pixel_center_integer", + state) == 0) { + $$.flags.q.pixel_center_integer = 1; + } - if ($$.flags.i && state->ARB_fragment_coord_conventions_warn) { - _mesa_glsl_warning(& @1, state, - "GL_ARB_fragment_coord_conventions layout " - "identifier `%s' used\n", $1); - } - } + if ($$.flags.i && state->ARB_fragment_coord_conventions_warn) { + _mesa_glsl_warning(& @1, state, + "GL_ARB_fragment_coord_conventions layout " + "identifier `%s' used", $1); + } + } - /* Layout qualifiers for AMD/ARB_conservative_depth. */ - if (!$$.flags.i && - (state->AMD_conservative_depth_enable || - state->ARB_conservative_depth_enable)) { - if (strcmp($1, "depth_any") == 0) { - $$.flags.q.depth_any = 1; - } else if (strcmp($1, "depth_greater") == 0) { - $$.flags.q.depth_greater = 1; - } else if (strcmp($1, "depth_less") == 0) { - $$.flags.q.depth_less = 1; - } else if (strcmp($1, "depth_unchanged") == 0) { - $$.flags.q.depth_unchanged = 1; - } - - if ($$.flags.i && state->AMD_conservative_depth_warn) { - _mesa_glsl_warning(& @1, state, - "GL_AMD_conservative_depth " - "layout qualifier `%s' is used\n", $1); - } - if ($$.flags.i && state->ARB_conservative_depth_warn) { - _mesa_glsl_warning(& @1, state, - "GL_ARB_conservative_depth " - "layout qualifier `%s' is used\n", $1); - } - } + /* Layout qualifiers for AMD/ARB_conservative_depth. */ + if (!$$.flags.i && + (state->AMD_conservative_depth_enable || + state->ARB_conservative_depth_enable)) { + if (match_layout_qualifier($1, "depth_any", state) == 0) { + $$.flags.q.depth_any = 1; + } else if (match_layout_qualifier($1, "depth_greater", state) == 0) { + $$.flags.q.depth_greater = 1; + } else if (match_layout_qualifier($1, "depth_less", state) == 0) { + $$.flags.q.depth_less = 1; + } else if (match_layout_qualifier($1, "depth_unchanged", + state) == 0) { + $$.flags.q.depth_unchanged = 1; + } - /* See also uniform_block_layout_qualifier. */ - if (!$$.flags.i && state->ARB_uniform_buffer_object_enable) { - if (strcmp($1, "std140") == 0) { - $$.flags.q.std140 = 1; - } else if (strcmp($1, "shared") == 0) { - $$.flags.q.shared = 1; - } else if (strcmp($1, "column_major") == 0) { - $$.flags.q.column_major = 1; - } + if ($$.flags.i && state->AMD_conservative_depth_warn) { + _mesa_glsl_warning(& @1, state, + "GL_AMD_conservative_depth " + "layout qualifier `%s' is used", $1); + } + if ($$.flags.i && state->ARB_conservative_depth_warn) { + _mesa_glsl_warning(& @1, state, + "GL_ARB_conservative_depth " + "layout qualifier `%s' is used", $1); + } + } - if ($$.flags.i && state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "layout qualifier `%s' is used\n", $1); - } - } + /* See also interface_block_layout_qualifier. */ + if (!$$.flags.i && state->has_uniform_buffer_objects()) { + if (match_layout_qualifier($1, "std140", state) == 0) { + $$.flags.q.std140 = 1; + } else if (match_layout_qualifier($1, "shared", state) == 0) { + $$.flags.q.shared = 1; + } else if (match_layout_qualifier($1, "column_major", state) == 0) { + $$.flags.q.column_major = 1; + /* "row_major" is a reserved word in GLSL 1.30+. Its token is parsed + * below in the interface_block_layout_qualifier rule. + * + * It is not a reserved word in GLSL ES 3.00, so it's handled here as + * an identifier. + * + * Also, this takes care of alternate capitalizations of + * "row_major" (which is necessary because layout qualifiers + * are case-insensitive in desktop GLSL). + */ + } else if (match_layout_qualifier($1, "row_major", state) == 0) { + $$.flags.q.row_major = 1; + /* "packed" is a reserved word in GLSL, and its token is + * parsed below in the interface_block_layout_qualifier rule. + * However, we must take care of alternate capitalizations of + * "packed", because layout qualifiers are case-insensitive + * in desktop GLSL. + */ + } else if (match_layout_qualifier($1, "packed", state) == 0) { + $$.flags.q.packed = 1; + } - if (!$$.flags.i) { - _mesa_glsl_error(& @1, state, "unrecognized layout identifier " - "`%s'\n", $1); - YYERROR; - } - } - | any_identifier '=' INTCONSTANT - { - memset(& $$, 0, sizeof($$)); + if ($$.flags.i && state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "layout qualifier `%s' is used", $1); + } + } - if (state->ARB_explicit_attrib_location_enable) { - /* FINISHME: Handle 'index' once GL_ARB_blend_func_exteneded and - * FINISHME: GLSL 1.30 (or later) are supported. - */ - if (strcmp("location", $1) == 0) { - $$.flags.q.explicit_location = 1; + /* Layout qualifiers for GLSL 1.50 geometry shaders. */ + if (!$$.flags.i) { + struct { + const char *s; + GLenum e; + } map[] = { + { "points", GL_POINTS }, + { "lines", GL_LINES }, + { "lines_adjacency", GL_LINES_ADJACENCY }, + { "line_strip", GL_LINE_STRIP }, + { "triangles", GL_TRIANGLES }, + { "triangles_adjacency", GL_TRIANGLES_ADJACENCY }, + { "triangle_strip", GL_TRIANGLE_STRIP }, + }; + for (unsigned i = 0; i < Elements(map); i++) { + if (match_layout_qualifier($1, map[i].s, state) == 0) { + $$.flags.q.prim_type = 1; + $$.prim_type = map[i].e; + break; + } + } - if ($3 >= 0) { - $$.location = $3; - } else { - _mesa_glsl_error(& @3, state, - "invalid location %d specified\n", $3); - YYERROR; - } - } + if ($$.flags.i && !state->is_version(150, 0)) { + _mesa_glsl_error(& @1, state, "#version 150 layout " + "qualifier `%s' used", $1); + } + } - if (strcmp("index", $1) == 0) { - $$.flags.q.explicit_index = 1; + if (!$$.flags.i) { + _mesa_glsl_error(& @1, state, "unrecognized layout identifier " + "`%s'", $1); + YYERROR; + } + } + | any_identifier '=' integer_constant + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; - if ($3 >= 0) { - $$.index = $3; - } else { - _mesa_glsl_error(& @3, state, - "invalid index %d specified\n", $3); - YYERROR; - } - } - } + if (match_layout_qualifier("location", $1, state) == 0) { + $$.flags.q.explicit_location = 1; - /* If the identifier didn't match any known layout identifiers, - * emit an error. - */ - if (!$$.flags.i) { - _mesa_glsl_error(& @1, state, "unrecognized layout identifier " - "`%s'\n", $1); - YYERROR; - } else if (state->ARB_explicit_attrib_location_warn) { - _mesa_glsl_warning(& @1, state, - "GL_ARB_explicit_attrib_location layout " - "identifier `%s' used\n", $1); - } - } - | uniform_block_layout_qualifier - { - $$ = $1; - /* Layout qualifiers for ARB_uniform_buffer_object. */ - if (!state->ARB_uniform_buffer_object_enable) { - _mesa_glsl_error(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "layout qualifier `%s' is used\n", $1); - } else if (state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "layout qualifier `%s' is used\n", $1); - } - } - ; + if ($3 >= 0) { + $$.location = $3; + } else { + _mesa_glsl_error(& @3, state, "invalid location %d specified", $3); + YYERROR; + } + } + + if (match_layout_qualifier("index", $1, state) == 0) { + $$.flags.q.explicit_index = 1; + + if ($3 >= 0) { + $$.index = $3; + } else { + _mesa_glsl_error(& @3, state, "invalid index %d specified", $3); + YYERROR; + } + } + + if ((state->ARB_shading_language_420pack_enable || + state->ARB_shader_atomic_counters_enable) && + match_layout_qualifier("binding", $1, state) == 0) { + $$.flags.q.explicit_binding = 1; + $$.binding = $3; + } + + if (state->ARB_shader_atomic_counters_enable && + match_layout_qualifier("offset", $1, state) == 0) { + $$.flags.q.explicit_offset = 1; + $$.offset = $3; + } + + if (match_layout_qualifier("max_vertices", $1, state) == 0) { + $$.flags.q.max_vertices = 1; + + if ($3 < 0) { + _mesa_glsl_error(& @3, state, + "invalid max_vertices %d specified", $3); + YYERROR; + } else { + $$.max_vertices = $3; + if (!state->is_version(150, 0)) { + _mesa_glsl_error(& @3, state, + "#version 150 max_vertices qualifier " + "specified", $3); + } + } + } + + /* If the identifier didn't match any known layout identifiers, + * emit an error. + */ + if (!$$.flags.i) { + _mesa_glsl_error(& @1, state, "unrecognized layout identifier " + "`%s'", $1); + YYERROR; + } else if (state->ARB_explicit_attrib_location_warn) { + _mesa_glsl_warning(& @1, state, + "GL_ARB_explicit_attrib_location layout " + "identifier `%s' used", $1); + } + } + | interface_block_layout_qualifier + { + $$ = $1; + /* Layout qualifiers for ARB_uniform_buffer_object. */ + if ($$.flags.q.uniform && !state->has_uniform_buffer_objects()) { + _mesa_glsl_error(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "layout qualifier `%s' is used", $1); + } else if ($$.flags.q.uniform && state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "layout qualifier `%s' is used", $1); + } + } + ; /* This is a separate language rule because we parse these as tokens * (due to them being reserved keywords) instead of identifiers like * most qualifiers. See the any_identifier path of * layout_qualifier_id for the others. + * + * Note that since layout qualifiers are case-insensitive in desktop + * GLSL, all of these qualifiers need to be handled as identifiers as + * well (by the any_identifier path of layout_qualifier_id). */ -uniform_block_layout_qualifier: - ROW_MAJOR - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.row_major = 1; - } - | PACKED_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.packed = 1; - } - ; +interface_block_layout_qualifier: + ROW_MAJOR + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.row_major = 1; + } + | PACKED_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.packed = 1; + } + ; interpolation_qualifier: - SMOOTH - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.smooth = 1; - } - | FLAT - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.flat = 1; - } - | NOPERSPECTIVE - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.noperspective = 1; - } - ; - -parameter_type_qualifier: - CONST_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.constant = 1; - } - ; + SMOOTH + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.smooth = 1; + } + | FLAT + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.flat = 1; + } + | NOPERSPECTIVE + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.noperspective = 1; + } + ; type_qualifier: - storage_qualifier - | layout_qualifier - | layout_qualifier storage_qualifier - { - $$ = $1; - $$.flags.i |= $2.flags.i; - } - | interpolation_qualifier - | interpolation_qualifier storage_qualifier - { - $$ = $1; - $$.flags.i |= $2.flags.i; - } - | INVARIANT storage_qualifier - { - $$ = $2; - $$.flags.q.invariant = 1; - } - | INVARIANT interpolation_qualifier storage_qualifier - { - $$ = $2; - $$.flags.i |= $3.flags.i; - $$.flags.q.invariant = 1; - } - | INVARIANT - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.invariant = 1; - } - ; + /* Single qualifiers */ + INVARIANT + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.invariant = 1; + } + | auxiliary_storage_qualifier + | storage_qualifier + | interpolation_qualifier + | layout_qualifier + | precision_qualifier + { + memset(&$$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.precision = $1; + } + + /* Multiple qualifiers: + * In GLSL 4.20, these can be specified in any order. In earlier versions, + * they appear in this order (see GLSL 1.50 section 4.7 & comments below): + * + * invariant interpolation auxiliary storage precision ...or... + * layout storage precision + * + * Each qualifier's rule ensures that the accumulated qualifiers on the right + * side don't contain any that must appear on the left hand side. + * For example, when processing a storage qualifier, we check that there are + * no auxiliary, interpolation, layout, or invariant qualifiers to the right. + */ + | INVARIANT type_qualifier + { + if ($2.flags.q.invariant) + _mesa_glsl_error(&@1, state, "duplicate \"invariant\" qualifier"); + + if ($2.has_layout()) { + _mesa_glsl_error(&@1, state, + "\"invariant\" cannot be used with layout(...)"); + } + + $$ = $2; + $$.flags.q.invariant = 1; + } + | interpolation_qualifier type_qualifier + { + /* Section 4.3 of the GLSL 1.40 specification states: + * "...qualified with one of these interpolation qualifiers" + * + * GLSL 1.30 claims to allow "one or more", but insists that: + * "These interpolation qualifiers may only precede the qualifiers in, + * centroid in, out, or centroid out in a declaration." + * + * ...which means that e.g. smooth can't precede smooth, so there can be + * only one after all, and the 1.40 text is a clarification, not a change. + */ + if ($2.has_interpolation()) + _mesa_glsl_error(&@1, state, "duplicate interpolation qualifier"); + + if ($2.has_layout()) { + _mesa_glsl_error(&@1, state, "interpolation qualifiers cannot be used " + "with layout(...)"); + } + + if (!state->ARB_shading_language_420pack_enable && $2.flags.q.invariant) { + _mesa_glsl_error(&@1, state, "interpolation qualifiers must come " + "after \"invariant\""); + } + + $$ = $1; + $$.merge_qualifier(&@1, state, $2); + } + | layout_qualifier type_qualifier + { + /* The GLSL 1.50 grammar indicates that a layout(...) declaration can be + * used standalone or immediately before a storage qualifier. It cannot + * be used with interpolation qualifiers or invariant. There does not + * appear to be any text indicating that it must come before the storage + * qualifier, but always seems to in examples. + */ + if (!state->ARB_shading_language_420pack_enable && $2.has_layout()) + _mesa_glsl_error(&@1, state, "duplicate layout(...) qualifiers"); + + if ($2.flags.q.invariant) + _mesa_glsl_error(&@1, state, "layout(...) cannot be used with " + "the \"invariant\" qualifier"); + + if ($2.has_interpolation()) { + _mesa_glsl_error(&@1, state, "layout(...) cannot be used with " + "interpolation qualifiers"); + } + + $$ = $1; + $$.merge_qualifier(&@1, state, $2); + } + | auxiliary_storage_qualifier type_qualifier + { + if ($2.has_auxiliary_storage()) { + _mesa_glsl_error(&@1, state, + "duplicate auxiliary storage qualifier (centroid or sample)"); + } + + if (!state->ARB_shading_language_420pack_enable && + ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout())) { + _mesa_glsl_error(&@1, state, "auxiliary storage qualifiers must come " + "just before storage qualifiers"); + } + $$ = $1; + $$.flags.i |= $2.flags.i; + } + | storage_qualifier type_qualifier + { + /* Section 4.3 of the GLSL 1.20 specification states: + * "Variable declarations may have a storage qualifier specified..." + * 1.30 clarifies this to "may have one storage qualifier". + */ + if ($2.has_storage()) + _mesa_glsl_error(&@1, state, "duplicate storage qualifier"); + + if (!state->ARB_shading_language_420pack_enable && + ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout() || + $2.has_auxiliary_storage())) { + _mesa_glsl_error(&@1, state, "storage qualifiers must come after " + "invariant, interpolation, layout and auxiliary " + "storage qualifiers"); + } + + $$ = $1; + $$.merge_qualifier(&@1, state, $2); + } + | precision_qualifier type_qualifier + { + if ($2.precision != ast_precision_none) + _mesa_glsl_error(&@1, state, "duplicate precision qualifier"); + + if (!state->ARB_shading_language_420pack_enable && $2.flags.i != 0) + _mesa_glsl_error(&@1, state, "precision qualifiers must come last"); + + $$ = $2; + $$.precision = $1; + } + ; + +auxiliary_storage_qualifier: + CENTROID + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.centroid = 1; + } + | SAMPLE + { + memset(& $$, 0, sizeof($$)); + $$.flags.q.sample = 1; + } + /* TODO: "patch" also goes here someday. */ storage_qualifier: - CONST_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.constant = 1; - } - | ATTRIBUTE - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.attribute = 1; - } - | VARYING - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.varying = 1; - } - | CENTROID VARYING - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.centroid = 1; - $$.flags.q.varying = 1; - } - | IN_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.in = 1; - } - | OUT_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.out = 1; - } - | CENTROID IN_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.centroid = 1; $$.flags.q.in = 1; - } - | CENTROID OUT_TOK - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.centroid = 1; $$.flags.q.out = 1; - } - | UNIFORM - { - memset(& $$, 0, sizeof($$)); - $$.flags.q.uniform = 1; - } - ; + CONST_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.constant = 1; + } + | ATTRIBUTE + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.attribute = 1; + } + | VARYING + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.varying = 1; + } + | IN_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.in = 1; + } + | OUT_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.out = 1; + } + | UNIFORM + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.uniform = 1; + } + ; + +array_specifier: + '[' ']' + { + void *ctx = state; + $$ = new(ctx) ast_array_specifier(yylloc); + } + | '[' constant_expression ']' + { + void *ctx = state; + $$ = new(ctx) ast_array_specifier(yylloc, $2); + } + | array_specifier '[' ']' + { + $$ = $1; + + if (!state->ARB_arrays_of_arrays_enable) { + _mesa_glsl_error(& @1, state, + "GL_ARB_arrays_of_arrays " + "required for defining arrays of arrays"); + } else { + _mesa_glsl_error(& @1, state, + "only the outermost array dimension can " + "be unsized"); + } + } + | array_specifier '[' constant_expression ']' + { + $$ = $1; + + if (!state->ARB_arrays_of_arrays_enable) { + _mesa_glsl_error(& @1, state, + "GL_ARB_arrays_of_arrays " + "required for defining arrays of arrays"); + } + + $$->add_dimension($3); + } + ; type_specifier: - type_specifier_no_prec - { - $$ = $1; - } - | precision_qualifier type_specifier_no_prec - { - $$ = $2; - $$->precision = $1; - } - ; - -type_specifier_no_prec: - type_specifier_nonarray - | type_specifier_nonarray '[' ']' - { - $$ = $1; - $$->is_array = true; - $$->array_size = NULL; - } - | type_specifier_nonarray '[' constant_expression ']' - { - $$ = $1; - $$->is_array = true; - $$->array_size = $3; - } - ; + type_specifier_nonarray + | type_specifier_nonarray array_specifier + { + $$ = $1; + $$->array_specifier = $2; + } + ; type_specifier_nonarray: - basic_type_specifier_nonarray - { - void *ctx = state; - $$ = new(ctx) ast_type_specifier($1); - $$->set_location(yylloc); - } - | struct_specifier - { - void *ctx = state; - $$ = new(ctx) ast_type_specifier($1); - $$->set_location(yylloc); - } - | TYPE_IDENTIFIER - { - void *ctx = state; - $$ = new(ctx) ast_type_specifier($1); - $$->set_location(yylloc); - } - ; + basic_type_specifier_nonarray + { + void *ctx = state; + $$ = new(ctx) ast_type_specifier($1); + $$->set_location(yylloc); + } + | struct_specifier + { + void *ctx = state; + $$ = new(ctx) ast_type_specifier($1); + $$->set_location(yylloc); + } + | TYPE_IDENTIFIER + { + void *ctx = state; + $$ = new(ctx) ast_type_specifier($1); + $$->set_location(yylloc); + } + ; basic_type_specifier_nonarray: - VOID_TOK { $$ = "void"; } - | FLOAT_TOK { $$ = "float"; } - | INT_TOK { $$ = "int"; } - | UINT_TOK { $$ = "uint"; } - | BOOL_TOK { $$ = "bool"; } - | VEC2 { $$ = "vec2"; } - | VEC3 { $$ = "vec3"; } - | VEC4 { $$ = "vec4"; } - | BVEC2 { $$ = "bvec2"; } - | BVEC3 { $$ = "bvec3"; } - | BVEC4 { $$ = "bvec4"; } - | IVEC2 { $$ = "ivec2"; } - | IVEC3 { $$ = "ivec3"; } - | IVEC4 { $$ = "ivec4"; } - | UVEC2 { $$ = "uvec2"; } - | UVEC3 { $$ = "uvec3"; } - | UVEC4 { $$ = "uvec4"; } - | MAT2X2 { $$ = "mat2"; } - | MAT2X3 { $$ = "mat2x3"; } - | MAT2X4 { $$ = "mat2x4"; } - | MAT3X2 { $$ = "mat3x2"; } - | MAT3X3 { $$ = "mat3"; } - | MAT3X4 { $$ = "mat3x4"; } - | MAT4X2 { $$ = "mat4x2"; } - | MAT4X3 { $$ = "mat4x3"; } - | MAT4X4 { $$ = "mat4"; } - | SAMPLER1D { $$ = "sampler1D"; } - | SAMPLER2D { $$ = "sampler2D"; } - | SAMPLER2DRECT { $$ = "sampler2DRect"; } - | SAMPLER3D { $$ = "sampler3D"; } - | SAMPLERCUBE { $$ = "samplerCube"; } - | SAMPLEREXTERNALOES { $$ = "samplerExternalOES"; } - | SAMPLER1DSHADOW { $$ = "sampler1DShadow"; } - | SAMPLER2DSHADOW { $$ = "sampler2DShadow"; } - | SAMPLER2DRECTSHADOW { $$ = "sampler2DRectShadow"; } - | SAMPLERCUBESHADOW { $$ = "samplerCubeShadow"; } - | SAMPLER1DARRAY { $$ = "sampler1DArray"; } - | SAMPLER2DARRAY { $$ = "sampler2DArray"; } - | SAMPLER1DARRAYSHADOW { $$ = "sampler1DArrayShadow"; } - | SAMPLER2DARRAYSHADOW { $$ = "sampler2DArrayShadow"; } - | SAMPLERBUFFER { $$ = "samplerBuffer"; } - | ISAMPLER1D { $$ = "isampler1D"; } - | ISAMPLER2D { $$ = "isampler2D"; } - | ISAMPLER2DRECT { $$ = "isampler2DRect"; } - | ISAMPLER3D { $$ = "isampler3D"; } - | ISAMPLERCUBE { $$ = "isamplerCube"; } - | ISAMPLER1DARRAY { $$ = "isampler1DArray"; } - | ISAMPLER2DARRAY { $$ = "isampler2DArray"; } - | ISAMPLERBUFFER { $$ = "isamplerBuffer"; } - | USAMPLER1D { $$ = "usampler1D"; } - | USAMPLER2D { $$ = "usampler2D"; } - | USAMPLER2DRECT { $$ = "usampler2DRect"; } - | USAMPLER3D { $$ = "usampler3D"; } - | USAMPLERCUBE { $$ = "usamplerCube"; } - | USAMPLER1DARRAY { $$ = "usampler1DArray"; } - | USAMPLER2DARRAY { $$ = "usampler2DArray"; } - | USAMPLERBUFFER { $$ = "usamplerBuffer"; } - ; + VOID_TOK { $$ = "void"; } + | FLOAT_TOK { $$ = "float"; } + | INT_TOK { $$ = "int"; } + | UINT_TOK { $$ = "uint"; } + | BOOL_TOK { $$ = "bool"; } + | VEC2 { $$ = "vec2"; } + | VEC3 { $$ = "vec3"; } + | VEC4 { $$ = "vec4"; } + | BVEC2 { $$ = "bvec2"; } + | BVEC3 { $$ = "bvec3"; } + | BVEC4 { $$ = "bvec4"; } + | IVEC2 { $$ = "ivec2"; } + | IVEC3 { $$ = "ivec3"; } + | IVEC4 { $$ = "ivec4"; } + | UVEC2 { $$ = "uvec2"; } + | UVEC3 { $$ = "uvec3"; } + | UVEC4 { $$ = "uvec4"; } + | MAT2X2 { $$ = "mat2"; } + | MAT2X3 { $$ = "mat2x3"; } + | MAT2X4 { $$ = "mat2x4"; } + | MAT3X2 { $$ = "mat3x2"; } + | MAT3X3 { $$ = "mat3"; } + | MAT3X4 { $$ = "mat3x4"; } + | MAT4X2 { $$ = "mat4x2"; } + | MAT4X3 { $$ = "mat4x3"; } + | MAT4X4 { $$ = "mat4"; } + | SAMPLER1D { $$ = "sampler1D"; } + | SAMPLER2D { $$ = "sampler2D"; } + | SAMPLER2DRECT { $$ = "sampler2DRect"; } + | SAMPLER3D { $$ = "sampler3D"; } + | SAMPLERCUBE { $$ = "samplerCube"; } + | SAMPLEREXTERNALOES { $$ = "samplerExternalOES"; } + | SAMPLER1DSHADOW { $$ = "sampler1DShadow"; } + | SAMPLER2DSHADOW { $$ = "sampler2DShadow"; } + | SAMPLER2DRECTSHADOW { $$ = "sampler2DRectShadow"; } + | SAMPLERCUBESHADOW { $$ = "samplerCubeShadow"; } + | SAMPLER1DARRAY { $$ = "sampler1DArray"; } + | SAMPLER2DARRAY { $$ = "sampler2DArray"; } + | SAMPLER1DARRAYSHADOW { $$ = "sampler1DArrayShadow"; } + | SAMPLER2DARRAYSHADOW { $$ = "sampler2DArrayShadow"; } + | SAMPLERBUFFER { $$ = "samplerBuffer"; } + | SAMPLERCUBEARRAY { $$ = "samplerCubeArray"; } + | SAMPLERCUBEARRAYSHADOW { $$ = "samplerCubeArrayShadow"; } + | ISAMPLER1D { $$ = "isampler1D"; } + | ISAMPLER2D { $$ = "isampler2D"; } + | ISAMPLER2DRECT { $$ = "isampler2DRect"; } + | ISAMPLER3D { $$ = "isampler3D"; } + | ISAMPLERCUBE { $$ = "isamplerCube"; } + | ISAMPLER1DARRAY { $$ = "isampler1DArray"; } + | ISAMPLER2DARRAY { $$ = "isampler2DArray"; } + | ISAMPLERBUFFER { $$ = "isamplerBuffer"; } + | ISAMPLERCUBEARRAY { $$ = "isamplerCubeArray"; } + | USAMPLER1D { $$ = "usampler1D"; } + | USAMPLER2D { $$ = "usampler2D"; } + | USAMPLER2DRECT { $$ = "usampler2DRect"; } + | USAMPLER3D { $$ = "usampler3D"; } + | USAMPLERCUBE { $$ = "usamplerCube"; } + | USAMPLER1DARRAY { $$ = "usampler1DArray"; } + | USAMPLER2DARRAY { $$ = "usampler2DArray"; } + | USAMPLERBUFFER { $$ = "usamplerBuffer"; } + | USAMPLERCUBEARRAY { $$ = "usamplerCubeArray"; } + | SAMPLER2DMS { $$ = "sampler2DMS"; } + | ISAMPLER2DMS { $$ = "isampler2DMS"; } + | USAMPLER2DMS { $$ = "usampler2DMS"; } + | SAMPLER2DMSARRAY { $$ = "sampler2DMSArray"; } + | ISAMPLER2DMSARRAY { $$ = "isampler2DMSArray"; } + | USAMPLER2DMSARRAY { $$ = "usampler2DMSArray"; } + | ATOMIC_UINT { $$ = "atomic_uint"; } + ; precision_qualifier: - HIGHP { - if (!state->es_shader && state->language_version < 130) - _mesa_glsl_error(& @1, state, - "precision qualifier forbidden " - "in %s (1.30 or later " - "required)\n", - state->version_string); - - $$ = ast_precision_high; - } - | MEDIUMP { - if (!state->es_shader && state->language_version < 130) - _mesa_glsl_error(& @1, state, - "precision qualifier forbidden " - "in %s (1.30 or later " - "required)\n", - state->version_string); - - $$ = ast_precision_medium; - } - | LOWP { - if (!state->es_shader && state->language_version < 130) - _mesa_glsl_error(& @1, state, - "precision qualifier forbidden " - "in %s (1.30 or later " - "required)\n", - state->version_string); - - $$ = ast_precision_low; - } - ; + HIGHP + { + state->check_precision_qualifiers_allowed(&@1); + $$ = ast_precision_high; + } + | MEDIUMP + { + state->check_precision_qualifiers_allowed(&@1); + $$ = ast_precision_medium; + } + | LOWP + { + state->check_precision_qualifiers_allowed(&@1); + $$ = ast_precision_low; + } + ; struct_specifier: - STRUCT any_identifier '{' struct_declaration_list '}' - { - void *ctx = state; - $$ = new(ctx) ast_struct_specifier($2, $4); - $$->set_location(yylloc); - state->symbols->add_type($2, glsl_type::void_type); - } - | STRUCT '{' struct_declaration_list '}' - { - void *ctx = state; - $$ = new(ctx) ast_struct_specifier(NULL, $3); - $$->set_location(yylloc); - } - ; + STRUCT any_identifier '{' struct_declaration_list '}' + { + void *ctx = state; + $$ = new(ctx) ast_struct_specifier($2, $4); + $$->set_location(yylloc); + state->symbols->add_type($2, glsl_type::void_type); + state->symbols->add_type_ast($2, new(ctx) ast_type_specifier($$)); + } + | STRUCT '{' struct_declaration_list '}' + { + void *ctx = state; + $$ = new(ctx) ast_struct_specifier(NULL, $3); + $$->set_location(yylloc); + } + ; struct_declaration_list: - struct_declaration - { - $$ = $1; - $1->link.self_link(); - } - | struct_declaration_list struct_declaration - { - $$ = $1; - $$->link.insert_before(& $2->link); - } - ; + struct_declaration + { + $$ = $1; + $1->link.self_link(); + } + | struct_declaration_list struct_declaration + { + $$ = $1; + $$->link.insert_before(& $2->link); + } + ; struct_declaration: - type_specifier struct_declarator_list ';' - { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); + fully_specified_type struct_declarator_list ';' + { + void *ctx = state; + ast_fully_specified_type *const type = $1; + type->set_location(yylloc); - type->specifier = $1; - $$ = new(ctx) ast_declarator_list(type); - $$->set_location(yylloc); + if (type->qualifier.flags.i != 0) + _mesa_glsl_error(&@1, state, + "only precision qualifiers may be applied to " + "structure members"); - $$->declarations.push_degenerate_list_at_head(& $2->link); - } - ; + $$ = new(ctx) ast_declarator_list(type); + $$->set_location(yylloc); + + $$->declarations.push_degenerate_list_at_head(& $2->link); + } + ; struct_declarator_list: - struct_declarator - { - $$ = $1; - $1->link.self_link(); - } - | struct_declarator_list ',' struct_declarator - { - $$ = $1; - $$->link.insert_before(& $3->link); - } - ; + struct_declarator + { + $$ = $1; + $1->link.self_link(); + } + | struct_declarator_list ',' struct_declarator + { + $$ = $1; + $$->link.insert_before(& $3->link); + } + ; struct_declarator: - any_identifier - { - void *ctx = state; - $$ = new(ctx) ast_declaration($1, false, NULL, NULL); - $$->set_location(yylloc); - state->symbols->add_variable(new(state) ir_variable(NULL, $1, ir_var_auto, glsl_precision_undefined)); - } - | any_identifier '[' constant_expression ']' - { - void *ctx = state; - $$ = new(ctx) ast_declaration($1, true, $3, NULL); - $$->set_location(yylloc); - } - ; + any_identifier + { + void *ctx = state; + $$ = new(ctx) ast_declaration($1, NULL, NULL); + $$->set_location(yylloc); + } + | any_identifier array_specifier + { + void *ctx = state; + $$ = new(ctx) ast_declaration($1, $2, NULL); + $$->set_location(yylloc); + } + ; initializer: - assignment_expression - ; + assignment_expression + | '{' initializer_list '}' + { + $$ = $2; + } + | '{' initializer_list ',' '}' + { + $$ = $2; + } + ; + +initializer_list: + initializer + { + void *ctx = state; + $$ = new(ctx) ast_aggregate_initializer(); + $$->set_location(yylloc); + $$->expressions.push_tail(& $1->link); + } + | initializer_list ',' initializer + { + $1->expressions.push_tail(& $3->link); + } + ; declaration_statement: - declaration - ; + declaration + ; - // Grammar Note: labeled statements for SWITCH only; 'goto' is not - // supported. + // Grammar Note: labeled statements for SWITCH only; 'goto' is not + // supported. statement: - compound_statement { $$ = (ast_node *) $1; } - | simple_statement - ; + compound_statement { $$ = (ast_node *) $1; } + | simple_statement + ; simple_statement: - declaration_statement - | expression_statement - | selection_statement - | switch_statement - | iteration_statement - | jump_statement - ; + declaration_statement + | expression_statement + | selection_statement + | switch_statement + | iteration_statement + | jump_statement + ; compound_statement: - '{' '}' - { - void *ctx = state; - $$ = new(ctx) ast_compound_statement(true, NULL); - $$->set_location(yylloc); - } - | '{' - { - state->symbols->push_scope(); - } - statement_list '}' - { - void *ctx = state; - $$ = new(ctx) ast_compound_statement(true, $3); - $$->set_location(yylloc); - state->symbols->pop_scope(); - } - ; + '{' '}' + { + void *ctx = state; + $$ = new(ctx) ast_compound_statement(true, NULL); + $$->set_location(yylloc); + } + | '{' + { + state->symbols->push_scope(); + } + statement_list '}' + { + void *ctx = state; + $$ = new(ctx) ast_compound_statement(true, $3); + $$->set_location(yylloc); + state->symbols->pop_scope(); + } + ; statement_no_new_scope: - compound_statement_no_new_scope { $$ = (ast_node *) $1; } - | simple_statement - ; + compound_statement_no_new_scope { $$ = (ast_node *) $1; } + | simple_statement + ; compound_statement_no_new_scope: - '{' '}' - { - void *ctx = state; - $$ = new(ctx) ast_compound_statement(false, NULL); - $$->set_location(yylloc); - } - | '{' statement_list '}' - { - void *ctx = state; - $$ = new(ctx) ast_compound_statement(false, $2); - $$->set_location(yylloc); - } - ; + '{' '}' + { + void *ctx = state; + $$ = new(ctx) ast_compound_statement(false, NULL); + $$->set_location(yylloc); + } + | '{' statement_list '}' + { + void *ctx = state; + $$ = new(ctx) ast_compound_statement(false, $2); + $$->set_location(yylloc); + } + ; statement_list: - statement - { - if ($1 == NULL) { - _mesa_glsl_error(& @1, state, " statement\n"); - assert($1 != NULL); - } + statement + { + if ($1 == NULL) { + _mesa_glsl_error(& @1, state, " statement"); + assert($1 != NULL); + } - $$ = $1; - $$->link.self_link(); - } - | statement_list statement - { - if ($2 == NULL) { - _mesa_glsl_error(& @2, state, " statement\n"); - assert($2 != NULL); - } - $$ = $1; - $$->link.insert_before(& $2->link); - } - ; + $$ = $1; + $$->link.self_link(); + } + | statement_list statement + { + if ($2 == NULL) { + _mesa_glsl_error(& @2, state, " statement"); + assert($2 != NULL); + } + $$ = $1; + $$->link.insert_before(& $2->link); + } + ; expression_statement: - ';' - { - void *ctx = state; - $$ = new(ctx) ast_expression_statement(NULL); - $$->set_location(yylloc); - } - | expression ';' - { - void *ctx = state; - $$ = new(ctx) ast_expression_statement($1); - $$->set_location(yylloc); - } - ; + ';' + { + void *ctx = state; + $$ = new(ctx) ast_expression_statement(NULL); + $$->set_location(yylloc); + } + | expression ';' + { + void *ctx = state; + $$ = new(ctx) ast_expression_statement($1); + $$->set_location(yylloc); + } + ; selection_statement: - IF '(' expression ')' selection_rest_statement - { - $$ = new(state) ast_selection_statement($3, $5.then_statement, - $5.else_statement); - $$->set_location(yylloc); - } - ; + IF '(' expression ')' selection_rest_statement + { + $$ = new(state) ast_selection_statement($3, $5.then_statement, + $5.else_statement); + $$->set_location(yylloc); + } + ; selection_rest_statement: - statement ELSE statement - { - $$.then_statement = $1; - $$.else_statement = $3; - } - | statement - { - $$.then_statement = $1; - $$.else_statement = NULL; - } - ; + statement ELSE statement + { + $$.then_statement = $1; + $$.else_statement = $3; + } + | statement %prec THEN + { + $$.then_statement = $1; + $$.else_statement = NULL; + } + ; condition: - expression - { - $$ = (ast_node *) $1; - } - | fully_specified_type any_identifier '=' initializer - { - void *ctx = state; - ast_declaration *decl = new(ctx) ast_declaration($2, false, NULL, $4); - ast_declarator_list *declarator = new(ctx) ast_declarator_list($1); - decl->set_location(yylloc); - declarator->set_location(yylloc); + expression + { + $$ = (ast_node *) $1; + } + | fully_specified_type any_identifier '=' initializer + { + void *ctx = state; + ast_declaration *decl = new(ctx) ast_declaration($2, NULL, $4); + ast_declarator_list *declarator = new(ctx) ast_declarator_list($1); + decl->set_location(yylloc); + declarator->set_location(yylloc); - declarator->declarations.push_tail(&decl->link); - $$ = declarator; - } - ; + declarator->declarations.push_tail(&decl->link); + $$ = declarator; + } + ; /* * siwtch_statement grammar is based on the syntax described in the body * of the GLSL spec, not in it's appendix!!! */ switch_statement: - SWITCH '(' expression ')' switch_body - { - $$ = new(state) ast_switch_statement($3, $5); - $$->set_location(yylloc); - } - ; + SWITCH '(' expression ')' switch_body + { + $$ = new(state) ast_switch_statement($3, $5); + $$->set_location(yylloc); + } + ; switch_body: - '{' '}' - { - $$ = new(state) ast_switch_body(NULL); - $$->set_location(yylloc); - } - | '{' case_statement_list '}' - { - $$ = new(state) ast_switch_body($2); - $$->set_location(yylloc); - } - ; + '{' '}' + { + $$ = new(state) ast_switch_body(NULL); + $$->set_location(yylloc); + } + | '{' case_statement_list '}' + { + $$ = new(state) ast_switch_body($2); + $$->set_location(yylloc); + } + ; case_label: - CASE expression ':' - { - $$ = new(state) ast_case_label($2); - $$->set_location(yylloc); - } - | DEFAULT ':' - { - $$ = new(state) ast_case_label(NULL); - $$->set_location(yylloc); - } - ; + CASE expression ':' + { + $$ = new(state) ast_case_label($2); + $$->set_location(yylloc); + } + | DEFAULT ':' + { + $$ = new(state) ast_case_label(NULL); + $$->set_location(yylloc); + } + ; case_label_list: - case_label - { - ast_case_label_list *labels = new(state) ast_case_label_list(); + case_label + { + ast_case_label_list *labels = new(state) ast_case_label_list(); - labels->labels.push_tail(& $1->link); - $$ = labels; - $$->set_location(yylloc); - } - | case_label_list case_label - { - $$ = $1; - $$->labels.push_tail(& $2->link); - } - ; + labels->labels.push_tail(& $1->link); + $$ = labels; + $$->set_location(yylloc); + } + | case_label_list case_label + { + $$ = $1; + $$->labels.push_tail(& $2->link); + } + ; case_statement: - case_label_list statement - { - ast_case_statement *stmts = new(state) ast_case_statement($1); - stmts->set_location(yylloc); + case_label_list statement + { + ast_case_statement *stmts = new(state) ast_case_statement($1); + stmts->set_location(yylloc); - stmts->stmts.push_tail(& $2->link); - $$ = stmts; - } - | case_statement statement - { - $$ = $1; - $$->stmts.push_tail(& $2->link); - } - ; + stmts->stmts.push_tail(& $2->link); + $$ = stmts; + } + | case_statement statement + { + $$ = $1; + $$->stmts.push_tail(& $2->link); + } + ; case_statement_list: - case_statement - { - ast_case_statement_list *cases= new(state) ast_case_statement_list(); - cases->set_location(yylloc); + case_statement + { + ast_case_statement_list *cases= new(state) ast_case_statement_list(); + cases->set_location(yylloc); - cases->cases.push_tail(& $1->link); - $$ = cases; - } - | case_statement_list case_statement - { - $$ = $1; - $$->cases.push_tail(& $2->link); - } - ; + cases->cases.push_tail(& $1->link); + $$ = cases; + } + | case_statement_list case_statement + { + $$ = $1; + $$->cases.push_tail(& $2->link); + } + ; iteration_statement: - WHILE '(' condition ')' statement_no_new_scope - { - void *ctx = state; - $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, - NULL, $3, NULL, $5); - $$->set_location(yylloc); - } - | DO statement WHILE '(' expression ')' ';' - { - void *ctx = state; - $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, - NULL, $5, NULL, $2); - $$->set_location(yylloc); - } - | FOR '(' for_init_statement for_rest_statement ')' statement_no_new_scope - { - void *ctx = state; - $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, - $3, $4.cond, $4.rest, $6); - $$->set_location(yylloc); - } - ; + WHILE '(' condition ')' statement_no_new_scope + { + void *ctx = state; + $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while, + NULL, $3, NULL, $5); + $$->set_location(yylloc); + } + | DO statement WHILE '(' expression ')' ';' + { + void *ctx = state; + $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while, + NULL, $5, NULL, $2); + $$->set_location(yylloc); + } + | FOR '(' for_init_statement for_rest_statement ')' statement_no_new_scope + { + void *ctx = state; + $$ = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for, + $3, $4.cond, $4.rest, $6); + $$->set_location(yylloc); + } + ; for_init_statement: - expression_statement - | declaration_statement - ; + expression_statement + | declaration_statement + ; conditionopt: - condition - | /* empty */ - { - $$ = NULL; - } - ; + condition + | /* empty */ + { + $$ = NULL; + } + ; for_rest_statement: - conditionopt ';' - { - $$.cond = $1; - $$.rest = NULL; - } - | conditionopt ';' expression - { - $$.cond = $1; - $$.rest = $3; - } - ; + conditionopt ';' + { + $$.cond = $1; + $$.rest = NULL; + } + | conditionopt ';' expression + { + $$.cond = $1; + $$.rest = $3; + } + ; - // Grammar Note: No 'goto'. Gotos are not supported. + // Grammar Note: No 'goto'. Gotos are not supported. jump_statement: - CONTINUE ';' - { - void *ctx = state; - $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); - $$->set_location(yylloc); - } - | BREAK ';' - { - void *ctx = state; - $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); - $$->set_location(yylloc); - } - | RETURN ';' - { - void *ctx = state; - $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); - $$->set_location(yylloc); - } - | RETURN expression ';' - { - void *ctx = state; - $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, $2); - $$->set_location(yylloc); - } - | DISCARD ';' // Fragment shader only. - { - void *ctx = state; - $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); - $$->set_location(yylloc); - } - ; + CONTINUE ';' + { + void *ctx = state; + $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL); + $$->set_location(yylloc); + } + | BREAK ';' + { + void *ctx = state; + $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL); + $$->set_location(yylloc); + } + | RETURN ';' + { + void *ctx = state; + $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL); + $$->set_location(yylloc); + } + | RETURN expression ';' + { + void *ctx = state; + $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, $2); + $$->set_location(yylloc); + } + | DISCARD ';' // Fragment shader only. + { + void *ctx = state; + $$ = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL); + $$->set_location(yylloc); + } + ; external_declaration: - function_definition { $$ = $1; } - | declaration { $$ = $1; } - | pragma_statement { $$ = NULL; } - | layout_defaults { $$ = NULL; } - ; + function_definition { $$ = $1; } + | declaration { $$ = $1; } + | pragma_statement { $$ = NULL; } + | layout_defaults { $$ = $1; } + ; function_definition: - function_prototype compound_statement_no_new_scope - { - void *ctx = state; - $$ = new(ctx) ast_function_definition(); - $$->set_location(yylloc); - $$->prototype = $1; - $$->body = $2; + function_prototype compound_statement_no_new_scope + { + void *ctx = state; + $$ = new(ctx) ast_function_definition(); + $$->set_location(yylloc); + $$->prototype = $1; + $$->body = $2; - state->symbols->pop_scope(); - } - ; + state->symbols->pop_scope(); + } + ; /* layout_qualifieropt is packed into this rule */ -uniform_block: - UNIFORM NEW_IDENTIFIER '{' member_list '}' ';' - { - void *ctx = state; - $$ = new(ctx) ast_uniform_block(*state->default_uniform_qualifier, - $2, $4); +interface_block: + basic_interface_block + { + $$ = $1; + } + | layout_qualifier basic_interface_block + { + ast_interface_block *block = $2; + if (!block->layout.merge_qualifier(& @1, state, $1)) { + YYERROR; + } + $$ = block; + } + ; - if (!state->ARB_uniform_buffer_object_enable) { - _mesa_glsl_error(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } else if (state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } - } - | layout_qualifier UNIFORM NEW_IDENTIFIER '{' member_list '}' ';' - { - void *ctx = state; +basic_interface_block: + interface_qualifier NEW_IDENTIFIER '{' member_list '}' instance_name_opt ';' + { + ast_interface_block *const block = $6; - ast_type_qualifier qual = *state->default_uniform_qualifier; - if (!qual.merge_qualifier(& @1, state, $1)) { - YYERROR; - } - $$ = new(ctx) ast_uniform_block(qual, $3, $5); + block->block_name = $2; + block->declarations.push_degenerate_list_at_head(& $4->link); - if (!state->ARB_uniform_buffer_object_enable) { - _mesa_glsl_error(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } else if (state->ARB_uniform_buffer_object_warn) { - _mesa_glsl_warning(& @1, state, - "#version 140 / GL_ARB_uniform_buffer_object " - "required for defining uniform blocks\n"); - } - } - ; + if ($1.flags.q.uniform) { + if (!state->has_uniform_buffer_objects()) { + _mesa_glsl_error(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks"); + } else if (state->ARB_uniform_buffer_object_warn) { + _mesa_glsl_warning(& @1, state, + "#version 140 / GL_ARB_uniform_buffer_object " + "required for defining uniform blocks"); + } + } else { + if (state->es_shader || state->language_version < 150) { + _mesa_glsl_error(& @1, state, + "#version 150 required for using " + "interface blocks"); + } + } + + /* From the GLSL 1.50.11 spec, section 4.3.7 ("Interface Blocks"): + * "It is illegal to have an input block in a vertex shader + * or an output block in a fragment shader" + */ + if ((state->stage == MESA_SHADER_VERTEX) && $1.flags.q.in) { + _mesa_glsl_error(& @1, state, + "`in' interface block is not allowed for " + "a vertex shader"); + } else if ((state->stage == MESA_SHADER_FRAGMENT) && $1.flags.q.out) { + _mesa_glsl_error(& @1, state, + "`out' interface block is not allowed for " + "a fragment shader"); + } + + /* Since block arrays require names, and both features are added in + * the same language versions, we don't have to explicitly + * version-check both things. + */ + if (block->instance_name != NULL) { + state->check_version(150, 300, & @1, "interface blocks with " + "an instance name are not allowed"); + } + + unsigned interface_type_mask; + struct ast_type_qualifier temp_type_qualifier; + + /* Get a bitmask containing only the in/out/uniform flags, allowing us + * to ignore other irrelevant flags like interpolation qualifiers. + */ + temp_type_qualifier.flags.i = 0; + temp_type_qualifier.flags.q.uniform = true; + temp_type_qualifier.flags.q.in = true; + temp_type_qualifier.flags.q.out = true; + interface_type_mask = temp_type_qualifier.flags.i; + + /* Get the block's interface qualifier. The interface_qualifier + * production rule guarantees that only one bit will be set (and + * it will be in/out/uniform). + */ + unsigned block_interface_qualifier = $1.flags.i; + + block->layout.flags.i |= block_interface_qualifier; + + foreach_list_typed (ast_declarator_list, member, link, &block->declarations) { + ast_type_qualifier& qualifier = member->type->qualifier; + if ((qualifier.flags.i & interface_type_mask) == 0) { + /* GLSLangSpec.1.50.11, 4.3.7 (Interface Blocks): + * "If no optional qualifier is used in a member declaration, the + * qualifier of the variable is just in, out, or uniform as declared + * by interface-qualifier." + */ + qualifier.flags.i |= block_interface_qualifier; + } else if ((qualifier.flags.i & interface_type_mask) != + block_interface_qualifier) { + /* GLSLangSpec.1.50.11, 4.3.7 (Interface Blocks): + * "If optional qualifiers are used, they can include interpolation + * and storage qualifiers and they must declare an input, output, + * or uniform variable consistent with the interface qualifier of + * the block." + */ + _mesa_glsl_error(& @1, state, + "uniform/in/out qualifier on " + "interface block member does not match " + "the interface block"); + } + } + + $$ = block; + } + ; + +interface_qualifier: + IN_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.in = 1; + } + | OUT_TOK + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.out = 1; + } + | UNIFORM + { + memset(& $$, 0, sizeof($$)); + $$.precision = ast_precision_none; + $$.flags.q.uniform = 1; + } + ; + +instance_name_opt: + /* empty */ + { + $$ = new(state) ast_interface_block(*state->default_uniform_qualifier, + NULL, NULL); + } + | NEW_IDENTIFIER + { + $$ = new(state) ast_interface_block(*state->default_uniform_qualifier, + $1, NULL); + } + | NEW_IDENTIFIER array_specifier + { + $$ = new(state) ast_interface_block(*state->default_uniform_qualifier, + $1, $2); + } + ; member_list: - member_declaration - { - $$ = $1; - $1->link.self_link(); - } - | member_declaration member_list - { - $$ = $1; - $2->link.insert_before(& $$->link); - } - ; - -/* Specifying "uniform" inside of a uniform block is redundant. */ -uniformopt: - /* nothing */ - | UNIFORM - ; + member_declaration + { + $$ = $1; + $1->link.self_link(); + } + | member_declaration member_list + { + $$ = $1; + $2->link.insert_before(& $$->link); + } + ; member_declaration: - layout_qualifier uniformopt type_specifier struct_declarator_list ';' - { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); + fully_specified_type struct_declarator_list ';' + { + void *ctx = state; + ast_fully_specified_type *type = $1; + type->set_location(yylloc); - type->qualifier = $1; - type->qualifier.flags.q.uniform = true; - type->specifier = $3; - $$ = new(ctx) ast_declarator_list(type); - $$->set_location(yylloc); - $$->ubo_qualifiers_valid = true; + if (type->qualifier.flags.q.attribute) { + _mesa_glsl_error(& @1, state, + "keyword 'attribute' cannot be used with " + "interface block member"); + } else if (type->qualifier.flags.q.varying) { + _mesa_glsl_error(& @1, state, + "keyword 'varying' cannot be used with " + "interface block member"); + } - $$->declarations.push_degenerate_list_at_head(& $4->link); - } - | uniformopt type_specifier struct_declarator_list ';' - { - void *ctx = state; - ast_fully_specified_type *type = new(ctx) ast_fully_specified_type(); - type->set_location(yylloc); + $$ = new(ctx) ast_declarator_list(type); + $$->set_location(yylloc); - type->qualifier.flags.q.uniform = true; - type->specifier = $2; - $$ = new(ctx) ast_declarator_list(type); - $$->set_location(yylloc); - $$->ubo_qualifiers_valid = true; - - $$->declarations.push_degenerate_list_at_head(& $3->link); - } - ; + $$->declarations.push_degenerate_list_at_head(& $2->link); + } + ; layout_defaults: - layout_qualifier UNIFORM ';' - { - if (!state->default_uniform_qualifier->merge_qualifier(& @1, state, - $1)) { - YYERROR; - } - } + layout_qualifier UNIFORM ';' + { + if (!state->default_uniform_qualifier->merge_qualifier(& @1, state, $1)) { + YYERROR; + } + $$ = NULL; + } + + | layout_qualifier IN_TOK ';' + { + void *ctx = state; + $$ = NULL; + if (state->stage != MESA_SHADER_GEOMETRY) { + _mesa_glsl_error(& @1, state, + "input layout qualifiers only valid in " + "geometry shaders"); + } else if (!$1.flags.q.prim_type) { + _mesa_glsl_error(& @1, state, + "input layout qualifiers must specify a primitive" + " type"); + } else { + /* Make sure this is a valid input primitive type. */ + switch ($1.prim_type) { + case GL_POINTS: + case GL_LINES: + case GL_LINES_ADJACENCY: + case GL_TRIANGLES: + case GL_TRIANGLES_ADJACENCY: + $$ = new(ctx) ast_gs_input_layout(@1, $1.prim_type); + break; + default: + _mesa_glsl_error(&@1, state, + "invalid geometry shader input primitive type"); + break; + } + } + } + + | layout_qualifier OUT_TOK ';' + { + if (state->stage != MESA_SHADER_GEOMETRY) { + _mesa_glsl_error(& @1, state, + "out layout qualifiers only valid in " + "geometry shaders"); + } else { + if ($1.flags.q.prim_type) { + /* Make sure this is a valid output primitive type. */ + switch ($1.prim_type) { + case GL_POINTS: + case GL_LINE_STRIP: + case GL_TRIANGLE_STRIP: + break; + default: + _mesa_glsl_error(&@1, state, "invalid geometry shader output " + "primitive type"); + break; + } + } + if (!state->out_qualifier->merge_qualifier(& @1, state, $1)) + YYERROR; + } + $$ = NULL; + } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp index b32973b8c..156a0f9fa 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.cpp @@ -36,30 +36,52 @@ extern "C" { #include "glsl_parser.h" #include "ir_optimization.h" #include "loop_analysis.h" +#include "standalone_scaffolding.h" + +/** + * Format a short human-readable description of the given GLSL version. + */ +const char * +glsl_compute_version_string(void *mem_ctx, bool is_es, unsigned version) +{ + return ralloc_asprintf(mem_ctx, "GLSL%s %d.%02d", is_es ? " ES" : "", + version / 100, version % 100); +} + + +static unsigned known_desktop_glsl_versions[] = + { 110, 120, 130, 140, 150, 330, 400, 410, 420, 430, 440 }; + _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, - GLenum target, void *mem_ctx) - : ctx(_ctx) + gl_shader_stage stage, + void *mem_ctx) + : ctx(_ctx), switch_state() { - switch (target) { - case GL_VERTEX_SHADER: this->target = vertex_shader; break; - case GL_FRAGMENT_SHADER: this->target = fragment_shader; break; - case GL_GEOMETRY_SHADER: this->target = geometry_shader; break; - } + assert(stage < MESA_SHADER_STAGES); + this->stage = stage; this->scanner = NULL; this->translation_unit.make_empty(); this->symbols = new(mem_ctx) glsl_symbol_table; + + this->num_uniform_blocks = 0; + this->uniform_block_array_size = 0; + this->uniform_blocks = NULL; + this->info_log = ralloc_strdup(mem_ctx, ""); this->error = false; this->loop_nesting_ast = NULL; - this->switch_state.switch_nesting_ast = NULL; - this->num_builtins_to_link = 0; + this->struct_specifier_depth = 0; + + this->uses_builtin_functions = false; /* Set default language version and extensions */ - this->language_version = 110; + this->language_version = ctx->Const.ForceGLSLVersion ? + ctx->Const.ForceGLSLVersion : 110; this->es_shader = false; + this->had_version_string = false; this->ARB_texture_rectangle_enable = true; /* OpenGL ES 2.0 has different defaults from desktop GL. */ @@ -75,32 +97,85 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes; this->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits; this->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits; - this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs; - this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents; - this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4; - this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits; + this->Const.MaxVertexAttribs = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs; + this->Const.MaxVertexUniformComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents; + this->Const.MaxVertexTextureImageUnits = ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits; this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits; - this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents; + this->Const.MaxTextureImageUnits = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; + this->Const.MaxFragmentUniformComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents; + this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset; + this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset; this->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers; - const unsigned lowest_version = - (ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility - ? 100 : 110; - const unsigned highest_version = - _mesa_is_desktop_gl(ctx) ? ctx->Const.GLSLVersion : 100; + /* 1.50 constants */ + this->Const.MaxVertexOutputComponents = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + this->Const.MaxGeometryInputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents; + this->Const.MaxGeometryOutputComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents; + this->Const.MaxFragmentInputComponents = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents; + this->Const.MaxGeometryTextureImageUnits = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits; + this->Const.MaxGeometryOutputVertices = ctx->Const.MaxGeometryOutputVertices; + this->Const.MaxGeometryTotalOutputComponents = ctx->Const.MaxGeometryTotalOutputComponents; + this->Const.MaxGeometryUniformComponents = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents; + + this->Const.MaxVertexAtomicCounters = ctx->Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters; + this->Const.MaxGeometryAtomicCounters = ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters; + this->Const.MaxFragmentAtomicCounters = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters; + this->Const.MaxCombinedAtomicCounters = ctx->Const.MaxCombinedAtomicCounters; + this->Const.MaxAtomicBufferBindings = ctx->Const.MaxAtomicBufferBindings; + + this->current_function = NULL; + this->toplevel_ir = NULL; + this->found_return = false; + this->all_invariant = false; + this->user_structures = NULL; + this->num_user_structures = 0; + + /* Populate the list of supported GLSL versions */ + /* FINISHME: Once the OpenGL 3.0 'forward compatible' context or + * the OpenGL 3.2 Core context is supported, this logic will need + * change. Older versions of GLSL are no longer supported + * outside the compatibility contexts of 3.x. + */ + this->num_supported_versions = 0; + if (_mesa_is_desktop_gl(ctx)) { + for (unsigned i = 0; i < ARRAY_SIZE(known_desktop_glsl_versions); i++) { + if (known_desktop_glsl_versions[i] <= ctx->Const.GLSLVersion) { + this->supported_versions[this->num_supported_versions].ver + = known_desktop_glsl_versions[i]; + this->supported_versions[this->num_supported_versions].es = false; + this->num_supported_versions++; + } + } + } + if (ctx->API == API_OPENGLES2 || ctx->Extensions.ARB_ES2_compatibility) { + this->supported_versions[this->num_supported_versions].ver = 100; + this->supported_versions[this->num_supported_versions].es = true; + this->num_supported_versions++; + } + if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) { + this->supported_versions[this->num_supported_versions].ver = 300; + this->supported_versions[this->num_supported_versions].es = true; + this->num_supported_versions++; + } + assert(this->num_supported_versions + <= ARRAY_SIZE(this->supported_versions)); + + /* Create a string for use in error messages to tell the user which GLSL + * versions are supported. + */ char *supported = ralloc_strdup(this, ""); - - for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) { - const char *const prefix = (ver == lowest_version) + for (unsigned i = 0; i < this->num_supported_versions; i++) { + unsigned ver = this->supported_versions[i].ver; + const char *const prefix = (i == 0) ? "" - : ((ver == highest_version) ? ", and " : ", "); + : ((i == this->num_supported_versions - 1) ? ", and " : ", "); + const char *const suffix = (this->supported_versions[i].es) ? " ES" : ""; - ralloc_asprintf_append(& supported, "%s%d.%02d%s", + ralloc_asprintf_append(& supported, "%s%u.%02u%s", prefix, ver / 100, ver % 100, - (ver == 100) ? " ES" : ""); + suffix); } this->supported_version_string = supported; @@ -111,15 +186,167 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->default_uniform_qualifier = new(this) ast_type_qualifier; this->default_uniform_qualifier->flags.q.shared = 1; this->default_uniform_qualifier->flags.q.column_major = 1; + + this->gs_input_prim_type_specified = false; + this->gs_input_prim_type = GL_POINTS; + this->gs_input_size = 0; + this->out_qualifier = new(this) ast_type_qualifier(); + memset(this->atomic_counter_offsets, 0, + sizeof(this->atomic_counter_offsets)); } -const char * -_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target) +/** + * Determine whether the current GLSL version is sufficiently high to support + * a certain feature, and generate an error message if it isn't. + * + * \param required_glsl_version and \c required_glsl_es_version are + * interpreted as they are in _mesa_glsl_parse_state::is_version(). + * + * \param locp is the parser location where the error should be reported. + * + * \param fmt (and additional arguments) constitute a printf-style error + * message to report if the version check fails. Information about the + * current and required GLSL versions will be appended. So, for example, if + * the GLSL version being compiled is 1.20, and check_version(130, 300, locp, + * "foo unsupported") is called, the error message will be "foo unsupported in + * GLSL 1.20 (GLSL 1.30 or GLSL 3.00 ES required)". + */ +bool +_mesa_glsl_parse_state::check_version(unsigned required_glsl_version, + unsigned required_glsl_es_version, + YYLTYPE *locp, const char *fmt, ...) { - switch (target) { - case vertex_shader: return "vertex"; - case fragment_shader: return "fragment"; - case geometry_shader: return "geometry"; + if (this->is_version(required_glsl_version, required_glsl_es_version)) + return true; + + va_list args; + va_start(args, fmt); + char *problem = ralloc_vasprintf(this, fmt, args); + va_end(args); + const char *glsl_version_string + = glsl_compute_version_string(this, false, required_glsl_version); + const char *glsl_es_version_string + = glsl_compute_version_string(this, true, required_glsl_es_version); + const char *requirement_string = ""; + if (required_glsl_version && required_glsl_es_version) { + requirement_string = ralloc_asprintf(this, " (%s or %s required)", + glsl_version_string, + glsl_es_version_string); + } else if (required_glsl_version) { + requirement_string = ralloc_asprintf(this, " (%s required)", + glsl_version_string); + } else if (required_glsl_es_version) { + requirement_string = ralloc_asprintf(this, " (%s required)", + glsl_es_version_string); + } + _mesa_glsl_error(locp, this, "%s in %s%s", + problem, this->get_version_string(), + requirement_string); + + return false; +} + +/** + * Process a GLSL #version directive. + * + * \param version is the integer that follows the #version token. + * + * \param ident is a string identifier that follows the integer, if any is + * present. Otherwise NULL. + */ +void +_mesa_glsl_parse_state::process_version_directive(YYLTYPE *locp, int version, + const char *ident) +{ + bool es_token_present = false; + if (ident) { + if (strcmp(ident, "es") == 0) { + es_token_present = true; + } else if (version >= 150) { + if (strcmp(ident, "core") == 0) { + /* Accept the token. There's no need to record that this is + * a core profile shader since that's the only profile we support. + */ + } else if (strcmp(ident, "compatibility") == 0) { + _mesa_glsl_error(locp, this, + "the compatibility profile is not supported"); + } else { + _mesa_glsl_error(locp, this, + "\"%s\" is not a valid shading language profile; " + "if present, it must be \"core\"", ident); + } + } else { + _mesa_glsl_error(locp, this, + "illegal text following version number"); + } + } + + this->es_shader = es_token_present; + if (version == 100) { + if (es_token_present) { + _mesa_glsl_error(locp, this, + "GLSL 1.00 ES should be selected using " + "`#version 100'"); + } else { + this->es_shader = true; + } + } + + if (this->es_shader) { + this->ARB_texture_rectangle_enable = false; + } + + this->language_version = version; + this->had_version_string = true; + + bool supported = false; + for (unsigned i = 0; i < this->num_supported_versions; i++) { + if (this->supported_versions[i].ver == (unsigned) version + && this->supported_versions[i].es == this->es_shader) { + supported = true; + break; + } + } + + if (!supported) { + _mesa_glsl_error(locp, this, "%s is not supported. " + "Supported versions are: %s", + this->get_version_string(), + this->supported_version_string); + + /* On exit, the language_version must be set to a valid value. + * Later calls to _mesa_glsl_initialize_types will misbehave if + * the version is invalid. + */ + switch (this->ctx->API) { + case API_OPENGL_COMPAT: + case API_OPENGL_CORE: + this->language_version = this->ctx->Const.GLSLVersion; + break; + + case API_OPENGLES: + assert(!"Should not get here."); + /* FALLTHROUGH */ + + case API_OPENGLES2: + this->language_version = 100; + break; + } + } +} + + +/** + * Translate a gl_shader_stage to a short shader stage name for debug + * printouts and error messages. + */ +const char * +_mesa_shader_stage_to_string(unsigned stage) +{ + switch (stage) { + case MESA_SHADER_VERTEX: return "vertex"; + case MESA_SHADER_FRAGMENT: return "fragment"; + case MESA_SHADER_GEOMETRY: return "geometry"; } assert(!"Should not get here."); @@ -132,12 +359,16 @@ _mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target) 'id' is the implementation-defined ID of the given message. */ static void _mesa_glsl_msg(const YYLTYPE *locp, _mesa_glsl_parse_state *state, - GLenum type, GLuint id, const char *fmt, va_list ap) + GLenum type, const char *fmt, va_list ap) { - bool error = (type == GL_DEBUG_TYPE_ERROR_ARB); + bool error = (type == MESA_DEBUG_TYPE_ERROR); + GLuint msg_id = 0; assert(state->info_log != NULL); + /* Get the offset that the new message will be written to. */ + int msg_offset = strlen(state->info_log); + ralloc_asprintf_append(&state->info_log, "%u:%u(%u): %s: ", locp->source, locp->first_line, @@ -145,6 +376,12 @@ _mesa_glsl_msg(const YYLTYPE *locp, _mesa_glsl_parse_state *state, error ? "error" : "warning"); ralloc_vasprintf_append(&state->info_log, fmt, ap); + const char *const msg = &state->info_log[msg_offset]; + struct gl_context *ctx = state->ctx; + + /* Report the error via GL_ARB_debug_output. */ + _mesa_shader_debug(ctx, type, &msg_id, msg, strlen(msg)); + ralloc_strcat(&state->info_log, "\n"); } @@ -153,12 +390,11 @@ _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state, const char *fmt, ...) { va_list ap; - GLenum type = GL_DEBUG_TYPE_ERROR_ARB; state->error = true; va_start(ap, fmt); - _mesa_glsl_msg(locp, state, type, SHADER_ERROR_UNKNOWN, fmt, ap); + _mesa_glsl_msg(locp, state, MESA_DEBUG_TYPE_ERROR, fmt, ap); va_end(ap); } @@ -168,10 +404,9 @@ _mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state, const char *fmt, ...) { va_list ap; - GLenum type = GL_DEBUG_TYPE_OTHER_ARB; va_start(ap, fmt); - _mesa_glsl_msg(locp, state, type, 0, fmt, ap); + _mesa_glsl_msg(locp, state, MESA_DEBUG_TYPE_OTHER, fmt, ap); va_end(ap); } @@ -197,15 +432,6 @@ struct _mesa_glsl_extension { */ const char *name; - /** True if this extension is available to vertex shaders */ - bool avail_in_VS; - - /** True if this extension is available to geometry shaders */ - bool avail_in_GS; - - /** True if this extension is available to fragment shaders */ - bool avail_in_FS; - /** True if this extension is available to desktop GL shaders */ bool avail_in_GL; @@ -252,9 +478,9 @@ struct _mesa_glsl_extension { void set_flags(_mesa_glsl_parse_state *state, ext_behavior behavior) const; }; -#define EXT(NAME, VS, GS, FS, GL, ES, SUPPORTED_FLAG) \ - { "GL_" #NAME, VS, GS, FS, GL, ES, &gl_extensions::SUPPORTED_FLAG, \ - &_mesa_glsl_parse_state::NAME##_enable, \ +#define EXT(NAME, GL, ES, SUPPORTED_FLAG) \ + { "GL_" #NAME, GL, ES, &gl_extensions::SUPPORTED_FLAG, \ + &_mesa_glsl_parse_state::NAME##_enable, \ &_mesa_glsl_parse_state::NAME##_warn } /** @@ -262,27 +488,42 @@ struct _mesa_glsl_extension { * and the conditions under which they are supported. */ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { - /* target availability API availability */ - /* name VS GS FS GL ES supported flag */ - EXT(ARB_conservative_depth, false, false, true, true, false, ARB_conservative_depth), - EXT(ARB_draw_buffers, false, false, true, true, false, dummy_true), - EXT(ARB_draw_instanced, true, false, false, true, false, ARB_draw_instanced), - EXT(ARB_explicit_attrib_location, true, false, true, true, false, ARB_explicit_attrib_location), - EXT(ARB_fragment_coord_conventions, true, false, true, true, false, ARB_fragment_coord_conventions), - EXT(ARB_texture_rectangle, true, false, true, true, false, dummy_true), - EXT(EXT_texture_array, true, false, true, true, false, EXT_texture_array), - EXT(ARB_shader_texture_lod, true, false, true, true, true, ARB_shader_texture_lod), - EXT(EXT_shader_texture_lod, true, false, true, true, true, ARB_shader_texture_lod), - EXT(ARB_shader_stencil_export, false, false, true, true, false, ARB_shader_stencil_export), - EXT(AMD_conservative_depth, false, false, true, true, false, ARB_conservative_depth), - EXT(AMD_shader_stencil_export, false, false, true, true, false, ARB_shader_stencil_export), - EXT(OES_texture_3D, true, false, true, false, true, EXT_texture3D), - EXT(OES_EGL_image_external, true, false, true, false, true, OES_EGL_image_external), - EXT(ARB_shader_bit_encoding, true, true, true, true, false, ARB_shader_bit_encoding), - EXT(ARB_uniform_buffer_object, true, false, true, true, false, ARB_uniform_buffer_object), - EXT(OES_standard_derivatives, false, false, true, false, true, OES_standard_derivatives), - EXT(EXT_shadow_samplers, true, false, true, false, true, EXT_shadow_samplers), - EXT(EXT_frag_depth, true, false, true, false, true, EXT_frag_depth), + /* API availability */ + /* name GL ES supported flag */ + EXT(ARB_arrays_of_arrays, true, false, ARB_arrays_of_arrays), + EXT(ARB_conservative_depth, true, false, ARB_conservative_depth), + EXT(ARB_draw_buffers, true, false, dummy_true), + EXT(ARB_draw_instanced, true, false, ARB_draw_instanced), + EXT(ARB_explicit_attrib_location, true, false, ARB_explicit_attrib_location), + EXT(ARB_fragment_coord_conventions, true, false, ARB_fragment_coord_conventions), + EXT(ARB_texture_rectangle, true, false, dummy_true), + EXT(EXT_texture_array, true, false, EXT_texture_array), + EXT(ARB_shader_texture_lod, true, false, ARB_shader_texture_lod), + EXT(EXT_shader_texture_lod, false, true, ARB_shader_texture_lod), + EXT(ARB_shader_stencil_export, true, false, ARB_shader_stencil_export), + EXT(AMD_conservative_depth, true, false, ARB_conservative_depth), + EXT(AMD_shader_stencil_export, true, false, ARB_shader_stencil_export), + EXT(OES_texture_3D, false, true, EXT_texture3D), + EXT(OES_EGL_image_external, false, true, OES_EGL_image_external), + EXT(ARB_shader_bit_encoding, true, false, ARB_shader_bit_encoding), + EXT(ARB_uniform_buffer_object, true, false, ARB_uniform_buffer_object), + EXT(OES_standard_derivatives, false, true, OES_standard_derivatives), + EXT(EXT_shadow_samplers, false, true, EXT_shadow_samplers), + EXT(EXT_frag_depth, false, true, EXT_frag_depth), + EXT(ARB_texture_cube_map_array, true, false, ARB_texture_cube_map_array), + EXT(ARB_shading_language_packing, true, false, ARB_shading_language_packing), + EXT(ARB_shading_language_420pack, true, false, ARB_shading_language_420pack), + EXT(ARB_texture_multisample, true, false, ARB_texture_multisample), + EXT(ARB_texture_query_levels, true, false, ARB_texture_query_levels), + EXT(ARB_texture_query_lod, true, false, ARB_texture_query_lod), + EXT(ARB_gpu_shader5, true, false, ARB_gpu_shader5), + EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer), + EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix), + EXT(ARB_texture_gather, true, false, ARB_texture_gather), + EXT(ARB_shader_atomic_counters, true, false, ARB_shader_atomic_counters), + EXT(ARB_sample_shading, true, false, ARB_sample_shading), + EXT(AMD_shader_trinary_minmax, true, false, dummy_true), + EXT(ARB_viewport_array, true, false, ARB_viewport_array), }; #undef EXT @@ -295,30 +536,6 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { bool _mesa_glsl_extension::compatible_with_state(const _mesa_glsl_parse_state * state) const { - /* Check that this extension matches the type of shader we are - * compiling to. - */ - switch (state->target) { - case vertex_shader: - if (!this->avail_in_VS) { - return false; - } - break; - case geometry_shader: - if (!this->avail_in_GS) { - return false; - } - break; - case fragment_shader: - if (!this->avail_in_FS) { - return false; - } - break; - default: - assert (!"Unrecognized shader target"); - return false; - } - /* Check that this extension matches whether we are compiling * for desktop GL or GLES. */ @@ -384,14 +601,14 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, behavior = extension_disable; } else { _mesa_glsl_error(behavior_locp, state, - "Unknown extension behavior `%s'", + "unknown extension behavior `%s'", behavior_string); return false; } if (strcmp(name, "all") == 0) { if ((behavior == extension_enable) || (behavior == extension_require)) { - _mesa_glsl_error(name_locp, state, "Cannot %s all extensions", + _mesa_glsl_error(name_locp, state, "cannot %s all extensions", (behavior == extension_enable) ? "enable" : "require"); return false; @@ -414,11 +631,11 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, if (behavior == extension_require) { _mesa_glsl_error(name_locp, state, fmt, - name, _mesa_glsl_shader_target_name(state->target)); + name, _mesa_shader_stage_to_string(state->stage)); return false; } else { _mesa_glsl_warning(name_locp, state, fmt, - name, _mesa_glsl_shader_target_name(state->target)); + name, _mesa_shader_stage_to_string(state->stage)); } } } @@ -426,6 +643,106 @@ _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, return true; } + +/** + * Recurses through and if is an aggregate initializer + * and sets 's field to . Gives later functions + * (process_array_constructor, et al) sufficient information to do type + * checking. + * + * Operates on assignments involving an aggregate initializer. E.g., + * + * vec4 pos = {1.0, -1.0, 0.0, 1.0}; + * + * or more ridiculously, + * + * struct S { + * vec4 v[2]; + * }; + * + * struct { + * S a[2], b; + * int c; + * } aggregate = { + * { + * { + * { + * {1.0, 2.0, 3.0, 4.0}, // a[0].v[0] + * {5.0, 6.0, 7.0, 8.0} // a[0].v[1] + * } // a[0].v + * }, // a[0] + * { + * { + * {1.0, 2.0, 3.0, 4.0}, // a[1].v[0] + * {5.0, 6.0, 7.0, 8.0} // a[1].v[1] + * } // a[1].v + * } // a[1] + * }, // a + * { + * { + * {1.0, 2.0, 3.0, 4.0}, // b.v[0] + * {5.0, 6.0, 7.0, 8.0} // b.v[1] + * } // b.v + * }, // b + * 4 // c + * }; + * + * This pass is necessary because the right-hand side of e = { ... } + * doesn't contain sufficient information to determine if the types match. + */ +void +_mesa_ast_set_aggregate_type(const glsl_type *type, + ast_expression *expr) +{ + ast_aggregate_initializer *ai = (ast_aggregate_initializer *)expr; + ai->constructor_type = type; + + /* If the aggregate is an array, recursively set its elements' types. */ + if (type->is_array()) { + /* Each array element has the type type->element_type(). + * + * E.g., if if struct S[2] we want to set each element's type to + * struct S. + */ + for (exec_node *expr_node = ai->expressions.head; + !expr_node->is_tail_sentinel(); + expr_node = expr_node->next) { + ast_expression *expr = exec_node_data(ast_expression, expr_node, + link); + + if (expr->oper == ast_aggregate) + _mesa_ast_set_aggregate_type(type->element_type(), expr); + } + + /* If the aggregate is a struct, recursively set its fields' types. */ + } else if (type->is_record()) { + exec_node *expr_node = ai->expressions.head; + + /* Iterate through the struct's fields. */ + for (unsigned i = 0; !expr_node->is_tail_sentinel() && i < type->length; + i++, expr_node = expr_node->next) { + ast_expression *expr = exec_node_data(ast_expression, expr_node, + link); + + if (expr->oper == ast_aggregate) { + _mesa_ast_set_aggregate_type(type->fields.structure[i].type, expr); + } + } + /* If the aggregate is a matrix, set its columns' types. */ + } else if (type->is_matrix()) { + for (exec_node *expr_node = ai->expressions.head; + !expr_node->is_tail_sentinel(); + expr_node = expr_node->next) { + ast_expression *expr = exec_node_data(ast_expression, expr_node, + link); + + if (expr->oper == ast_aggregate) + _mesa_ast_set_aggregate_type(type->column_type(), expr); + } + } +} + + void _mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q) { @@ -453,6 +770,8 @@ _mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q) if (q->flags.q.centroid) printf("centroid "); + if (q->flags.q.sample) + printf("sample "); if (q->flags.q.uniform) printf("uniform "); if (q->flags.q.smooth) @@ -480,16 +799,10 @@ ast_node::ast_node(void) static void -ast_opt_array_size_print(bool is_array, const ast_expression *array_size) +ast_opt_array_dimensions_print(const ast_array_specifier *array_specifier) { - if (is_array) { - printf("[ "); - - if (array_size) - array_size->print(); - - printf("] "); - } + if (array_specifier) + array_specifier->print(); } @@ -625,6 +938,19 @@ ast_expression::print(void) const break; } + case ast_aggregate: { + printf("{ "); + foreach_list_const(n, & this->expressions) { + if (n != this->expressions.get_head()) + printf(", "); + + ast_node *ast = exec_node_data(ast_node, n, link); + ast->print(); + } + printf("} "); + break; + } + default: assert(0); break; @@ -634,7 +960,8 @@ ast_expression::print(void) const ast_expression::ast_expression(int oper, ast_expression *ex0, ast_expression *ex1, - ast_expression *ex2) + ast_expression *ex2) : + primary_expression() { this->oper = ast_operators(oper); this->subexpressions[0] = ex0; @@ -677,7 +1004,8 @@ ast_function::print(void) const ast_function::ast_function(void) - : is_definition(false), signature(NULL) + : return_type(NULL), identifier(NULL), is_definition(false), + signature(NULL) { /* empty */ } @@ -697,7 +1025,7 @@ ast_parameter_declarator::print(void) const type->print(); if (identifier) printf("%s ", identifier); - ast_opt_array_size_print(!!is_array, array_size); + ast_opt_array_dimensions_print(array_specifier); } @@ -713,7 +1041,7 @@ void ast_declaration::print(void) const { printf("%s ", identifier); - ast_opt_array_size_print(!!is_array, array_size); + ast_opt_array_dimensions_print(array_specifier); if (initializer) { printf("= "); @@ -722,13 +1050,12 @@ ast_declaration::print(void) const } -ast_declaration::ast_declaration(const char *identifier, int is_array, - ast_expression *array_size, +ast_declaration::ast_declaration(const char *identifier, + ast_array_specifier *array_specifier, ast_expression *initializer) { this->identifier = identifier; - this->is_array = is_array; - this->array_size = array_size; + this->array_specifier = array_specifier; this->initializer = initializer; } @@ -759,7 +1086,6 @@ ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type) { this->type = type; this->invariant = false; - this->ubo_qualifiers_valid = false; } void @@ -787,6 +1113,7 @@ ast_jump_statement::print(void) const ast_jump_statement::ast_jump_statement(int mode, ast_expression *return_value) + : opt_return_value(NULL) { this->mode = ast_jump_modes(mode); @@ -999,8 +1326,118 @@ ast_struct_specifier::ast_struct_specifier(const char *identifier, } name = identifier; this->declarations.push_degenerate_list_at_head(&declarator_list->link); + is_declaration = true; } +static void +set_shader_inout_layout(struct gl_shader *shader, + struct _mesa_glsl_parse_state *state) +{ + if (shader->Stage != MESA_SHADER_GEOMETRY) { + /* Should have been prevented by the parser. */ + assert(!state->gs_input_prim_type_specified); + assert(!state->out_qualifier->flags.i); + return; + } + + shader->Geom.VerticesOut = 0; + if (state->out_qualifier->flags.q.max_vertices) + shader->Geom.VerticesOut = state->out_qualifier->max_vertices; + + if (state->gs_input_prim_type_specified) { + shader->Geom.InputType = state->gs_input_prim_type; + } else { + shader->Geom.InputType = PRIM_UNKNOWN; + } + + if (state->out_qualifier->flags.q.prim_type) { + shader->Geom.OutputType = state->out_qualifier->prim_type; + } else { + shader->Geom.OutputType = PRIM_UNKNOWN; + } +} + +extern "C" { + +void +_mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, + bool dump_ast, bool dump_hir) +{ + struct _mesa_glsl_parse_state *state = + new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); + const char *source = shader->Source; + + state->error = !!glcpp_preprocess(state, &source, &state->info_log, + &ctx->Extensions, ctx); + + if (!state->error) { + _mesa_glsl_lexer_ctor(state, source); + _mesa_glsl_parse(state); + _mesa_glsl_lexer_dtor(state); + } + + if (dump_ast) { + foreach_list_const(n, &state->translation_unit) { + ast_node *ast = exec_node_data(ast_node, n, link); + ast->print(); + } + printf("\n\n"); + } + + ralloc_free(shader->ir); + shader->ir = new(shader) exec_list; + if (!state->error && !state->translation_unit.is_empty()) + _mesa_ast_to_hir(shader->ir, state); + + if (!state->error) { + validate_ir_tree(shader->ir); + + /* Print out the unoptimized IR. */ + if (dump_hir) { + _mesa_print_ir(shader->ir, state); + } + } + + + if (!state->error && !shader->ir->is_empty()) { + struct gl_shader_compiler_options *options = + &ctx->ShaderCompilerOptions[shader->Stage]; + + /* Do some optimization at compile time to reduce shader IR size + * and reduce later work if the same shader is linked multiple times + */ + while (do_common_optimization(shader->ir, false, false, 32, options)) + ; + + validate_ir_tree(shader->ir); + } + + if (shader->InfoLog) + ralloc_free(shader->InfoLog); + + shader->symbols = state->symbols; + shader->CompileStatus = !state->error; + shader->InfoLog = state->info_log; + shader->Version = state->language_version; + shader->IsES = state->es_shader; + shader->uses_builtin_functions = state->uses_builtin_functions; + + if (shader->UniformBlocks) + ralloc_free(shader->UniformBlocks); + shader->NumUniformBlocks = state->num_uniform_blocks; + shader->UniformBlocks = state->uniform_blocks; + ralloc_steal(shader, shader->UniformBlocks); + + if (!state->error) + set_shader_inout_layout(shader, state); + + /* Retain any live IR, but trash the rest. */ + reparent_ir(shader->ir, shader->ir); + + ralloc_free(state); +} + +} /* extern "C" */ /** * Do the set of common optimizations passes * @@ -1015,13 +1452,15 @@ ast_struct_specifier::ast_struct_specifier(const char *identifier, * The setting of this flag only matters if * \c linked is \c true. * \param max_unroll_iterations Maximum number of loop iterations to be - * unrolled. Setting to 0 forces all loops - * to be unrolled. + * unrolled. Setting to 0 disables loop + * unrolling. + * \param options The driver's preferred shader options. */ bool do_common_optimization(exec_list *ir, bool linked, bool uniform_locations_assigned, - unsigned max_unroll_iterations) + unsigned max_unroll_iterations, + const struct gl_shader_compiler_options *options) { GLboolean progress = GL_FALSE; @@ -1033,8 +1472,17 @@ do_common_optimization(exec_list *ir, bool linked, progress = do_structure_splitting(ir) || progress; } progress = do_if_simplification(ir) || progress; + progress = opt_flatten_nested_if_blocks(ir) || progress; progress = do_copy_propagation(ir) || progress; progress = do_copy_propagation_elements(ir) || progress; + + if (options->OptimizeForAOS && !linked) + progress = opt_flip_matrices(ir) || progress; + + if (linked && options->OptimizeForAOS) { + progress = do_vectorize(ir) || progress; + } + if (linked) progress = do_dead_code(ir, uniform_locations_assigned) || progress; else @@ -1047,9 +1495,11 @@ do_common_optimization(exec_list *ir, bool linked, else progress = do_constant_variable_unlinked(ir) || progress; progress = do_constant_folding(ir) || progress; + progress = do_cse(ir) || progress; progress = do_algebraic(ir) || progress; progress = do_lower_jumps(ir) || progress; progress = do_vec_index_to_swizzle(ir) || progress; + progress = lower_vector_insert(ir, false) || progress; progress = do_swizzle_swizzle(ir) || progress; progress = do_noop_swizzle(ir) || progress; @@ -1091,7 +1541,7 @@ _mesa_destroy_shader_compiler(void) void _mesa_destroy_shader_compiler_caches(void) { - _mesa_glsl_release_functions(); + _mesa_glsl_release_builtin_functions(); } } diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h index f45aa4b9e..20a145530 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_parser_extras.h @@ -34,12 +34,6 @@ #include #include "glsl_symbol_table.h" -enum _mesa_glsl_parser_targets { - vertex_shader, - geometry_shader, - fragment_shader -}; - struct gl_context; struct glsl_switch_state { @@ -56,27 +50,104 @@ struct glsl_switch_state { bool is_switch_innermost; // if switch stmt is closest to break, ... }; +const char * +glsl_compute_version_string(void *mem_ctx, bool is_es, unsigned version); + +typedef struct YYLTYPE { + int first_line; + int first_column; + int last_line; + int last_column; + unsigned source; +} YYLTYPE; +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 + +extern void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state, + const char *fmt, ...); + + struct _mesa_glsl_parse_state { - _mesa_glsl_parse_state(struct gl_context *_ctx, GLenum target, + _mesa_glsl_parse_state(struct gl_context *_ctx, gl_shader_stage stage, void *mem_ctx); - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *mem = rzalloc_size(ctx, size); - assert(mem != NULL); + DECLARE_RALLOC_CXX_OPERATORS(_mesa_glsl_parse_state); - return mem; + /** + * Generate a string representing the GLSL version currently being compiled + * (useful for error messages). + */ + const char *get_version_string() + { + return glsl_compute_version_string(this, this->es_shader, + this->language_version); } - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. */ - static void operator delete(void *mem) + /** + * Determine whether the current GLSL version is sufficiently high to + * support a certain feature. + * + * \param required_glsl_version is the desktop GLSL version that is + * required to support the feature, or 0 if no version of desktop GLSL + * supports the feature. + * + * \param required_glsl_es_version is the GLSL ES version that is required + * to support the feature, or 0 if no version of GLSL ES suports the + * feature. + */ + bool is_version(unsigned required_glsl_version, + unsigned required_glsl_es_version) const { - ralloc_free(mem); + unsigned required_version = this->es_shader ? + required_glsl_es_version : required_glsl_version; + return required_version != 0 + && this->language_version >= required_version; } + bool check_version(unsigned required_glsl_version, + unsigned required_glsl_es_version, + YYLTYPE *locp, const char *fmt, ...) PRINTFLIKE(5, 6); + + bool check_precision_qualifiers_allowed(YYLTYPE *locp) + { + return check_version(130, 100, locp, + "precision qualifiers are forbidden"); + } + + bool check_bitwise_operations_allowed(YYLTYPE *locp) + { + return check_version(130, 300, locp, "bit-wise operations are forbidden"); + } + + bool check_explicit_attrib_location_allowed(YYLTYPE *locp, + const ir_variable *var) + { + if (!this->has_explicit_attrib_location()) { + const char *const requirement = this->es_shader + ? "GLSL ES 300" + : "GL_ARB_explicit_attrib_location extension or GLSL 330"; + + _mesa_glsl_error(locp, this, "%s explicit location requires %s", + mode_string(var), requirement); + return false; + } + + return true; + } + + bool has_explicit_attrib_location() const + { + return ARB_explicit_attrib_location_enable || is_version(330, 300); + } + + bool has_uniform_buffer_objects() const + { + return ARB_uniform_buffer_object_enable || is_version(140, 300); + } + + void process_version_directive(YYLTYPE *locp, int version, + const char *ident); + struct gl_context *const ctx; void *scanner; exec_list translation_unit; @@ -86,10 +157,23 @@ struct _mesa_glsl_parse_state { unsigned uniform_block_array_size; struct gl_uniform_block *uniform_blocks; + unsigned num_supported_versions; + struct { + unsigned ver; + bool es; + } supported_versions[12]; + bool es_shader; unsigned language_version; - const char *version_string; - enum _mesa_glsl_parser_targets target; + bool had_version_string; + gl_shader_stage stage; + + /** + * Number of nested struct_specifier levels + * + * Outside a struct_specifer, this is zero. + */ + unsigned struct_specifier_depth; /** * Default uniform layout qualifiers tracked during parsing. @@ -98,6 +182,24 @@ struct _mesa_glsl_parse_state { */ struct ast_type_qualifier *default_uniform_qualifier; + /** + * True if a geometry shader input primitive type was specified using a + * layout directive. + * + * Note: this value is computed at ast_to_hir time rather than at parse + * time. + */ + bool gs_input_prim_type_specified; + + /** + * If gs_input_prim_type_specified is true, the primitive type that was + * specified. Otherwise ignored. + */ + GLenum gs_input_prim_type; + + /** Output layout qualifiers from GLSL 1.50. (geometry shader controls)*/ + struct ast_type_qualifier *out_qualifier; + /** * Printable list of GLSL versions supported by the current context * @@ -121,7 +223,6 @@ struct _mesa_glsl_parse_state { unsigned MaxTextureCoords; unsigned MaxVertexAttribs; unsigned MaxVertexUniformComponents; - unsigned MaxVaryingFloats; unsigned MaxVertexTextureImageUnits; unsigned MaxCombinedTextureImageUnits; unsigned MaxTextureImageUnits; @@ -129,6 +230,27 @@ struct _mesa_glsl_parse_state { /* ARB_draw_buffers */ unsigned MaxDrawBuffers; + + /* 3.00 ES */ + int MinProgramTexelOffset; + int MaxProgramTexelOffset; + + /* 1.50 */ + unsigned MaxVertexOutputComponents; + unsigned MaxGeometryInputComponents; + unsigned MaxGeometryOutputComponents; + unsigned MaxFragmentInputComponents; + unsigned MaxGeometryTextureImageUnits; + unsigned MaxGeometryOutputVertices; + unsigned MaxGeometryTotalOutputComponents; + unsigned MaxGeometryUniformComponents; + + /* ARB_shader_atomic_counters */ + unsigned MaxVertexAtomicCounters; + unsigned MaxGeometryAtomicCounters; + unsigned MaxFragmentAtomicCounters; + unsigned MaxCombinedAtomicCounters; + unsigned MaxAtomicBufferBindings; } Const; /** @@ -173,6 +295,8 @@ struct _mesa_glsl_parse_state { * \name Enable bits for GLSL extensions */ /*@{*/ + bool ARB_arrays_of_arrays_enable; + bool ARB_arrays_of_arrays_warn; bool ARB_draw_buffers_enable; bool ARB_draw_buffers_warn; bool ARB_draw_instanced_enable; @@ -183,6 +307,8 @@ struct _mesa_glsl_parse_state { bool ARB_fragment_coord_conventions_warn; bool ARB_texture_rectangle_enable; bool ARB_texture_rectangle_warn; + bool ARB_texture_gather_enable; + bool ARB_texture_gather_warn; bool EXT_texture_array_enable; bool EXT_texture_array_warn; bool ARB_shader_texture_lod_enable; @@ -211,25 +337,51 @@ struct _mesa_glsl_parse_state { bool ARB_uniform_buffer_object_warn; bool OES_standard_derivatives_enable; bool OES_standard_derivatives_warn; + bool ARB_texture_cube_map_array_enable; + bool ARB_texture_cube_map_array_warn; + bool ARB_shading_language_packing_enable; + bool ARB_shading_language_packing_warn; + bool ARB_texture_multisample_enable; + bool ARB_texture_multisample_warn; + bool ARB_texture_query_levels_enable; + bool ARB_texture_query_levels_warn; + bool ARB_texture_query_lod_enable; + bool ARB_texture_query_lod_warn; + bool ARB_gpu_shader5_enable; + bool ARB_gpu_shader5_warn; + bool AMD_vertex_shader_layer_enable; + bool AMD_vertex_shader_layer_warn; + bool ARB_shading_language_420pack_enable; + bool ARB_shading_language_420pack_warn; + bool ARB_sample_shading_enable; + bool ARB_sample_shading_warn; + bool EXT_shader_integer_mix_enable; + bool EXT_shader_integer_mix_warn; + bool ARB_shader_atomic_counters_enable; + bool ARB_shader_atomic_counters_warn; + bool AMD_shader_trinary_minmax_enable; + bool AMD_shader_trinary_minmax_warn; + bool ARB_viewport_array_enable; + bool ARB_viewport_array_warn; /*@}*/ /** Extensions supported by the OpenGL implementation. */ const struct gl_extensions *extensions; - /** Shaders containing built-in functions that are used for linking. */ - struct gl_shader *builtins_to_link[16]; - unsigned num_builtins_to_link; -}; + bool uses_builtin_functions; -typedef struct YYLTYPE { - int first_line; - int first_column; - int last_line; - int last_column; - unsigned source; -} YYLTYPE; -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 + /** + * For geometry shaders, size of the most recently seen input declaration + * that was a sized array, or 0 if no sized input array declarations have + * been seen. + * + * Unused for other shader types. + */ + unsigned gs_input_size; + + /** Atomic counter offsets by binding */ + unsigned atomic_counter_offsets[MAX_COMBINED_ATOMIC_BUFFERS]; +}; # define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ @@ -250,9 +402,6 @@ do { \ (Current).source = 0; \ } while (0) -extern void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state, - const char *fmt, ...); - /** * Emit a warning to the shader log * @@ -268,8 +417,8 @@ extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state); union YYSTYPE; -extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc, - void *scanner); +extern int _mesa_glsl_lexer_lex(union YYSTYPE *yylval, YYLTYPE *yylloc, + void *scanner); extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *); @@ -285,13 +434,6 @@ extern bool _mesa_glsl_process_extension(const char *name, YYLTYPE *name_locp, YYLTYPE *behavior_locp, _mesa_glsl_parse_state *state); -/** - * Get the textual name of the specified shader target - */ -extern const char * -_mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target); - - #endif /* __cplusplus */ @@ -302,8 +444,15 @@ _mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target); extern "C" { #endif +/** + * Get the textual name of the specified shader stage (which is a + * gl_shader_stage). + */ +extern const char * +_mesa_shader_stage_to_string(unsigned stage); + extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log, - const struct gl_extensions *extensions, int api); + const struct gl_extensions *extensions, struct gl_context *gl_ctx); extern void _mesa_destroy_shader_compiler(void); extern void _mesa_destroy_shader_compiler_caches(void); diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp index bcb65d301..11569f47e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.cpp @@ -26,33 +26,77 @@ class symbol_table_entry { public: - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) + DECLARE_RALLOC_CXX_OPERATORS(symbol_table_entry); + + bool add_interface(const glsl_type *i, enum ir_variable_mode mode) { - void *entry = ralloc_size(ctx, size); - assert(entry != NULL); - return entry; + const glsl_type **dest; + + switch (mode) { + case ir_var_uniform: + dest = &ibu; + break; + case ir_var_shader_in: + dest = &ibi; + break; + case ir_var_shader_out: + dest = &ibo; + break; + default: + assert(!"Unsupported interface variable mode!"); + return false; + } + + if (*dest != NULL) { + return false; + } else { + *dest = i; + return true; + } } - /* If the user *does* call delete, that's OK, we will just ralloc_free. */ - static void operator delete(void *entry) + const glsl_type *get_interface(enum ir_variable_mode mode) { - ralloc_free(entry); + switch (mode) { + case ir_var_uniform: + return ibu; + case ir_var_shader_in: + return ibi; + case ir_var_shader_out: + return ibo; + default: + assert(!"Unsupported interface variable mode!"); + return NULL; + } } - symbol_table_entry(ir_variable *v) : v(v), f(0), t(0) {} - symbol_table_entry(ir_function *f) : v(0), f(f), t(0) {} - symbol_table_entry(const glsl_type *t) : v(0), f(0), t(t) {} + symbol_table_entry(ir_variable *v) : + v(v), f(0), t(0), ibu(0), ibi(0), ibo(0), a(0) {} + symbol_table_entry(ir_function *f) : + v(0), f(f), t(0), ibu(0), ibi(0), ibo(0), a(0) {} + symbol_table_entry(const glsl_type *t) : + v(0), f(0), t(t), ibu(0), ibi(0), ibo(0), a(0) {} + symbol_table_entry(const glsl_type *t, enum ir_variable_mode mode) : + v(0), f(0), t(0), ibu(0), ibi(0), ibo(0), a(0) + { + assert(t->is_interface()); + add_interface(t, mode); + } + symbol_table_entry(const class ast_type_specifier *a): + v(0), f(0), t(0), ibu(0), ibi(0), ibo(0), a(a) {} ir_variable *v; ir_function *f; const glsl_type *t; + const glsl_type *ibu; + const glsl_type *ibi; + const glsl_type *ibo; + const class ast_type_specifier *a; }; glsl_symbol_table::glsl_symbol_table() { - this->language_version = 120; + this->separate_function_namespace = false; this->table = _mesa_symbol_table_ctor(); this->mem_ctx = ralloc_context(NULL); } @@ -80,7 +124,7 @@ bool glsl_symbol_table::name_declared_this_scope(const char *name) bool glsl_symbol_table::add_variable(ir_variable *v) { - if (this->language_version == 110) { + if (this->separate_function_namespace) { /* In 1.10, functions and variables have separate namespaces. */ symbol_table_entry *existing = get_entry(v->name); if (name_declared_this_scope(v->name)) { @@ -118,9 +162,43 @@ bool glsl_symbol_table::add_type(const char *name, const glsl_type *t) return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0; } +static char *make_ast_name(const char *name) +{ + char *ast_name = new char[strlen("#ast.") + strlen(name) + 1]; + strcpy(ast_name, "#ast."); + strcat(ast_name + strlen("#ast."), name); + return ast_name; +} + +bool glsl_symbol_table::add_type_ast(const char *name, const class ast_type_specifier *a) +{ + symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(a); + char *ast_name = make_ast_name(name); + bool ret = _mesa_symbol_table_add_symbol(table, -1, ast_name, entry) == 0; + delete [] ast_name; + return ret; +} + +bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i, + enum ir_variable_mode mode) +{ + assert(i->is_interface()); + symbol_table_entry *entry = get_entry(name); + if (entry == NULL) { + symbol_table_entry *entry = + new(mem_ctx) symbol_table_entry(i, mode); + bool add_interface_symbol_result = + _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0; + assert(add_interface_symbol_result); + return add_interface_symbol_result; + } else { + return entry->add_interface(i, mode); + } +} + bool glsl_symbol_table::add_function(ir_function *f) { - if (this->language_version == 110 && name_declared_this_scope(f->name)) { + if (this->separate_function_namespace && name_declared_this_scope(f->name)) { /* In 1.10, functions and variables have separate namespaces. */ symbol_table_entry *existing = get_entry(f->name); if ((existing->f == NULL) && (existing->t == NULL)) { @@ -152,6 +230,21 @@ const glsl_type *glsl_symbol_table::get_type(const char *name) return entry != NULL ? entry->t : NULL; } +const class ast_type_specifier *glsl_symbol_table::get_type_ast(const char *name) +{ + char *ast_name = make_ast_name(name); + symbol_table_entry *entry = get_entry(ast_name); + delete [] ast_name; + return entry != NULL ? entry->a : NULL; +} + +const glsl_type *glsl_symbol_table::get_interface(const char *name, + enum ir_variable_mode mode) +{ + symbol_table_entry *entry = get_entry(name); + return entry != NULL ? entry->get_interface(mode) : NULL; +} + ir_function *glsl_symbol_table::get_function(const char *name) { symbol_table_entry *entry = get_entry(name); @@ -163,3 +256,18 @@ symbol_table_entry *glsl_symbol_table::get_entry(const char *name) return (symbol_table_entry *) _mesa_symbol_table_find_symbol(table, -1, name); } + +void +glsl_symbol_table::disable_variable(const char *name) +{ + /* Ideally we would remove the variable's entry from the symbol table, but + * that would be difficult. Fortunately, since this is only used for + * built-in variables, it won't be possible for the shader to re-introduce + * the variable later, so all we really need to do is to make sure that + * further attempts to access it using get_variable() will return NULL. + */ + symbol_table_entry *entry = get_entry(name); + if (entry != NULL) { + entry->v = NULL; + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h index 637bc033b..0e62448e2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_symbol_table.h @@ -77,7 +77,8 @@ public: glsl_symbol_table(); ~glsl_symbol_table(); - unsigned int language_version; + /* In 1.10, functions and variables have separate namespaces. */ + bool separate_function_namespace; void push_scope(); void pop_scope(); @@ -97,7 +98,10 @@ public: /*@{*/ bool add_variable(ir_variable *v); bool add_type(const char *name, const glsl_type *t); + bool add_type_ast(const char *name, const class ast_type_specifier *t); bool add_function(ir_function *f); + bool add_interface(const char *name, const glsl_type *i, + enum ir_variable_mode mode); /*@}*/ /** @@ -111,9 +115,20 @@ public: /*@{*/ ir_variable *get_variable(const char *name); const glsl_type *get_type(const char *name); + const class ast_type_specifier *get_type_ast(const char *name); ir_function *get_function(const char *name); + const glsl_type *get_interface(const char *name, + enum ir_variable_mode mode); /*@}*/ + /** + * Disable a previously-added variable so that it no longer appears to be + * in the symbol table. This is necessary when gl_PerVertex is redeclared, + * to ensure that previously-available built-in variables are no longer + * available. + */ + void disable_variable(const char *name); + private: symbol_table_entry *get_entry(const char *name); diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp b/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp index ef4a81e44..325b6e1b2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_types.cpp @@ -27,13 +27,14 @@ #include "glsl_symbol_table.h" #include "glsl_parser_extras.h" #include "glsl_types.h" -#include "builtin_types.h" +#include "main/glminimal.h" extern "C" { #include "program/hash_table.h" } hash_table *glsl_type::array_types = NULL; hash_table *glsl_type::record_types = NULL; +hash_table *glsl_type::interface_types = NULL; void *glsl_type::mem_ctx = NULL; void @@ -51,11 +52,12 @@ glsl_type::glsl_type(GLenum gl_type, gl_type(gl_type), base_type(base_type), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampler_type(0), + sampler_type(0), interface_packing(0), vector_elements(vector_elements), matrix_columns(matrix_columns), length(0) { init_ralloc_type_ctx(); + assert(name != NULL); this->name = ralloc_strdup(this->mem_ctx, name); /* Neither dimension is zero or both dimensions are zero. */ @@ -69,26 +71,29 @@ glsl_type::glsl_type(GLenum gl_type, gl_type(gl_type), base_type(GLSL_TYPE_SAMPLER), sampler_dimensionality(dim), sampler_shadow(shadow), - sampler_array(array), sampler_type(type), + sampler_array(array), sampler_type(type), interface_packing(0), vector_elements(0), matrix_columns(0), length(0) { init_ralloc_type_ctx(); + assert(name != NULL); this->name = ralloc_strdup(this->mem_ctx, name); memset(& fields, 0, sizeof(fields)); } glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, const char *name) : + gl_type(0), base_type(GLSL_TYPE_STRUCT), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampler_type(0), + sampler_type(0), interface_packing(0), vector_elements(0), matrix_columns(0), length(num_fields) { unsigned int i; init_ralloc_type_ctx(); + assert(name != NULL); this->name = ralloc_strdup(this->mem_ctx, name); this->fields.structure = ralloc_array(this->mem_ctx, glsl_struct_field, length); @@ -96,22 +101,45 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, this->fields.structure[i].type = fields[i].type; this->fields.structure[i].name = ralloc_strdup(this->fields.structure, fields[i].name); - this->fields.structure[i].precision = fields[i].precision; + this->fields.structure[i].precision = fields[i].precision; + this->fields.structure[i].location = fields[i].location; + this->fields.structure[i].interpolation = fields[i].interpolation; + this->fields.structure[i].centroid = fields[i].centroid; + this->fields.structure[i].sample = fields[i].sample; + this->fields.structure[i].row_major = fields[i].row_major; } } -static void -add_types_to_symbol_table(glsl_symbol_table *symtab, - const struct glsl_type *types, - unsigned num_types, bool warn) +glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, + enum glsl_interface_packing packing, const char *name) : + gl_type(0), + base_type(GLSL_TYPE_INTERFACE), + sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), + sampler_type(0), interface_packing((unsigned) packing), + vector_elements(0), matrix_columns(0), + length(num_fields) { - (void) warn; + unsigned int i; - for (unsigned i = 0; i < num_types; i++) { - symtab->add_type(types[i].name, & types[i]); + init_ralloc_type_ctx(); + assert(name != NULL); + this->name = ralloc_strdup(this->mem_ctx, name); + this->fields.structure = ralloc_array(this->mem_ctx, + glsl_struct_field, length); + for (i = 0; i < length; i++) { + this->fields.structure[i].type = fields[i].type; + this->fields.structure[i].name = ralloc_strdup(this->fields.structure, + fields[i].name); + this->fields.structure[i].precision = fields[i].precision; + this->fields.structure[i].location = fields[i].location; + this->fields.structure[i].interpolation = fields[i].interpolation; + this->fields.structure[i].centroid = fields[i].centroid; + this->fields.structure[i].sample = fields[i].sample; + this->fields.structure[i].row_major = fields[i].row_major; } } + bool glsl_type::contains_sampler() const { @@ -128,6 +156,42 @@ glsl_type::contains_sampler() const } } + +bool +glsl_type::contains_integer() const +{ + if (this->is_array()) { + return this->fields.array->contains_integer(); + } else if (this->is_record()) { + for (unsigned int i = 0; i < this->length; i++) { + if (this->fields.structure[i].type->contains_integer()) + return true; + } + return false; + } else { + return this->is_integer(); + } +} + +bool +glsl_type::contains_opaque() const { + switch (base_type) { + case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_ATOMIC_UINT: + return true; + case GLSL_TYPE_ARRAY: + return element_type()->contains_opaque(); + case GLSL_TYPE_STRUCT: + for (unsigned int i = 0; i < length; i++) { + if (fields.structure[i].type->contains_opaque()) + return true; + } + return false; + default: + return false; + } +} + gl_texture_index glsl_type::sampler_index() const { @@ -143,183 +207,21 @@ glsl_type::sampler_index() const case GLSL_SAMPLER_DIM_3D: return TEXTURE_3D_INDEX; case GLSL_SAMPLER_DIM_CUBE: - return TEXTURE_CUBE_INDEX; + return (t->sampler_array) ? TEXTURE_CUBE_ARRAY_INDEX : TEXTURE_CUBE_INDEX; case GLSL_SAMPLER_DIM_RECT: return TEXTURE_RECT_INDEX; case GLSL_SAMPLER_DIM_BUF: return TEXTURE_BUFFER_INDEX; case GLSL_SAMPLER_DIM_EXTERNAL: return TEXTURE_EXTERNAL_INDEX; + case GLSL_SAMPLER_DIM_MS: + return (t->sampler_array) ? TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX : TEXTURE_2D_MULTISAMPLE_INDEX; default: assert(!"Should not get here."); return TEXTURE_BUFFER_INDEX; } } -void -glsl_type::generate_100ES_types(glsl_symbol_table *symtab) -{ - add_types_to_symbol_table(symtab, builtin_core_types, - Elements(builtin_core_types), - false); - add_types_to_symbol_table(symtab, builtin_structure_types, - Elements(builtin_structure_types), - false); - add_types_to_symbol_table(symtab, void_type, 1, false); -} - -void -glsl_type::generate_110_types(glsl_symbol_table *symtab, bool add_deprecated) -{ - generate_100ES_types(symtab); - - add_types_to_symbol_table(symtab, builtin_110_types, - Elements(builtin_110_types), - false); - add_types_to_symbol_table(symtab, &_sampler3D_type, 1, false); - if (add_deprecated) { - add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types, - Elements(builtin_110_deprecated_structure_types), - false); - } -} - - -void -glsl_type::generate_120_types(glsl_symbol_table *symtab, bool add_deprecated) -{ - generate_110_types(symtab, add_deprecated); - - add_types_to_symbol_table(symtab, builtin_120_types, - Elements(builtin_120_types), false); -} - - -void -glsl_type::generate_130_types(glsl_symbol_table *symtab, bool add_deprecated) -{ - generate_120_types(symtab, add_deprecated); - - add_types_to_symbol_table(symtab, builtin_130_types, - Elements(builtin_130_types), false); - generate_EXT_texture_array_types(symtab, false); -} - - -void -glsl_type::generate_140_types(glsl_symbol_table *symtab) -{ - generate_130_types(symtab, false); - - add_types_to_symbol_table(symtab, builtin_140_types, - Elements(builtin_140_types), false); - - add_types_to_symbol_table(symtab, builtin_EXT_texture_buffer_object_types, - Elements(builtin_EXT_texture_buffer_object_types), - false); -} - - -void -glsl_type::generate_ARB_texture_rectangle_types(glsl_symbol_table *symtab, - bool warn) -{ - add_types_to_symbol_table(symtab, builtin_ARB_texture_rectangle_types, - Elements(builtin_ARB_texture_rectangle_types), - warn); -} - - -void -glsl_type::generate_EXT_texture_array_types(glsl_symbol_table *symtab, - bool warn) -{ - add_types_to_symbol_table(symtab, builtin_EXT_texture_array_types, - Elements(builtin_EXT_texture_array_types), - warn); -} - - -void -glsl_type::generate_OES_texture_3D_types(glsl_symbol_table *symtab, bool warn) -{ - add_types_to_symbol_table(symtab, &_sampler3D_type, 1, warn); -} - - -void -glsl_type::generate_EXT_shadow_samplers_types(glsl_symbol_table *symtab, bool warn) -{ - add_types_to_symbol_table(symtab, &builtin_110_types[2], 1, warn); -} - - - -void -glsl_type::generate_OES_EGL_image_external_types(glsl_symbol_table *symtab, - bool warn) -{ - add_types_to_symbol_table(symtab, builtin_OES_EGL_image_external_types, - Elements(builtin_OES_EGL_image_external_types), - warn); -} - -void -_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) -{ - switch (state->language_version) { - case 100: - assert(state->es_shader); - glsl_type::generate_100ES_types(state->symbols); - break; - case 110: - glsl_type::generate_110_types(state->symbols, true); - break; - case 120: - glsl_type::generate_120_types(state->symbols, true); - break; - case 130: - glsl_type::generate_130_types(state->symbols, true); - break; - case 140: - glsl_type::generate_140_types(state->symbols); - break; - default: - /* error */ - break; - } - - if (state->ARB_texture_rectangle_enable || - state->language_version >= 140) { - glsl_type::generate_ARB_texture_rectangle_types(state->symbols, - state->ARB_texture_rectangle_warn); - } - if (state->OES_texture_3D_enable && state->language_version == 100) { - glsl_type::generate_OES_texture_3D_types(state->symbols, - state->OES_texture_3D_warn); - } - - if (state->EXT_texture_array_enable && state->language_version < 130) { - // These are already included in 130; don't create twice. - glsl_type::generate_EXT_texture_array_types(state->symbols, - state->EXT_texture_array_warn); - } - - if (state->EXT_shadow_samplers_enable && state->es_shader) { - glsl_type::generate_EXT_shadow_samplers_types(state->symbols, - state->EXT_shadow_samplers_warn); - } - - /* We cannot check for language_version == 100 here because we need the - * types to support fixed-function program generation. But this is fine - * since the extension is never enabled for OpenGL contexts. - */ - if (state->OES_EGL_image_external_enable) { - glsl_type::generate_OES_EGL_image_external_types(state->symbols, - state->OES_EGL_image_external_warn); - } -} - const glsl_type *glsl_type::get_base_type() const { @@ -354,6 +256,8 @@ const glsl_type *glsl_type::get_scalar_type() const return int_type; case GLSL_TYPE_FLOAT: return float_type; + case GLSL_TYPE_BOOL: + return bool_type; default: /* Handle everything else */ return type; @@ -379,7 +283,7 @@ _mesa_glsl_release_types(void) glsl_type::glsl_type(const glsl_type *array, unsigned length) : base_type(GLSL_TYPE_ARRAY), sampler_dimensionality(0), sampler_shadow(0), sampler_array(0), - sampler_type(0), + sampler_type(0), interface_packing(0), vector_elements(0), matrix_columns(0), name(NULL), length(length) { @@ -399,13 +303,77 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) : if (length == 0) snprintf(n, name_length, "%s[]", array->name); - else - snprintf(n, name_length, "%s[%u]", array->name, length); + else { + /* insert outermost dimensions in the correct spot + * otherwise the dimension order will be backwards + */ + const char *pos = strchr(array->name, '['); + if (pos) { + int idx = pos - array->name; + snprintf(n, idx+1, "%s", array->name); + snprintf(n + idx, name_length - idx, "[%u]%s", + length, array->name + idx); + } else { + snprintf(n, name_length, "%s[%u]", array->name, length); + } + } this->name = n; } +const glsl_type * +glsl_type::vec(unsigned components) +{ + if (components == 0 || components > 4) + return error_type; + + static const glsl_type *const ts[] = { + float_type, vec2_type, vec3_type, vec4_type + }; + return ts[components - 1]; +} + + +const glsl_type * +glsl_type::ivec(unsigned components) +{ + if (components == 0 || components > 4) + return error_type; + + static const glsl_type *const ts[] = { + int_type, ivec2_type, ivec3_type, ivec4_type + }; + return ts[components - 1]; +} + + +const glsl_type * +glsl_type::uvec(unsigned components) +{ + if (components == 0 || components > 4) + return error_type; + + static const glsl_type *const ts[] = { + uint_type, uvec2_type, uvec3_type, uvec4_type + }; + return ts[components - 1]; +} + + +const glsl_type * +glsl_type::bvec(unsigned components) +{ + if (components == 0 || components > 4) + return error_type; + + static const glsl_type *const ts[] = { + bool_type, bvec2_type, bvec3_type, bvec4_type + }; + return ts[components - 1]; +} + + const glsl_type * glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns) { @@ -420,13 +388,13 @@ glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns) if (columns == 1) { switch (base_type) { case GLSL_TYPE_UINT: - return uint_type + (rows - 1); + return uvec(rows); case GLSL_TYPE_INT: - return int_type + (rows - 1); + return ivec(rows); case GLSL_TYPE_FLOAT: - return float_type + (rows - 1); + return vec(rows); case GLSL_TYPE_BOOL: - return bool_type + (rows - 1); + return bvec(rows); default: return error_type; } @@ -496,6 +464,45 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size) } +bool +glsl_type::record_compare(const glsl_type *b) const +{ + if (this->length != b->length) + return false; + + if (this->interface_packing != b->interface_packing) + return false; + + for (unsigned i = 0; i < this->length; i++) { + if (this->fields.structure[i].type != b->fields.structure[i].type) + return false; + if (strcmp(this->fields.structure[i].name, + b->fields.structure[i].name) != 0) + return false; + if (this->fields.structure[i].row_major + != b->fields.structure[i].row_major) + return false; + if (this->fields.structure[i].location + != b->fields.structure[i].location) + return false; + if (this->fields.structure[i].interpolation + != b->fields.structure[i].interpolation) + return false; + if (this->fields.structure[i].centroid + != b->fields.structure[i].centroid) + return false; + if (this->fields.structure[i].sample + != b->fields.structure[i].sample) + return false; + if (this->fields.structure[i].precision + != b->fields.structure[i].precision) + return false; + } + + return true; +} + + int glsl_type::record_key_compare(const void *a, const void *b) { @@ -508,20 +515,7 @@ glsl_type::record_key_compare(const void *a, const void *b) if (strcmp(key1->name, key2->name) != 0) return 1; - if (key1->length != key2->length) - return 1; - - for (unsigned i = 0; i < key1->length; i++) { - if (key1->fields.structure[i].type != key2->fields.structure[i].type) - return 1; - if (key1->fields.structure[i].precision != key2->fields.structure[i].precision) - return 1; - if (strcmp(key1->fields.structure[i].name, - key2->fields.structure[i].name) != 0) - return 1; - } - - return 0; + return !key1->record_compare(key2); } @@ -572,10 +566,38 @@ glsl_type::get_record_instance(const glsl_struct_field *fields, } +const glsl_type * +glsl_type::get_interface_instance(const glsl_struct_field *fields, + unsigned num_fields, + enum glsl_interface_packing packing, + const char *block_name) +{ + const glsl_type key(fields, num_fields, packing, block_name); + + if (interface_types == NULL) { + interface_types = hash_table_ctor(64, record_key_hash, record_key_compare); + } + + const glsl_type *t = (glsl_type *) hash_table_find(interface_types, & key); + if (t == NULL) { + t = new glsl_type(fields, num_fields, packing, block_name); + + hash_table_insert(interface_types, (void *) t, t); + } + + assert(t->base_type == GLSL_TYPE_INTERFACE); + assert(t->length == num_fields); + assert(strcmp(t->name, block_name) == 0); + + return t; +} + + const glsl_type * glsl_type::field_type(const char *name) const { - if (this->base_type != GLSL_TYPE_STRUCT) + if (this->base_type != GLSL_TYPE_STRUCT + && this->base_type != GLSL_TYPE_INTERFACE) return error_type; for (unsigned i = 0; i < this->length; i++) { @@ -586,7 +608,7 @@ glsl_type::field_type(const char *name) const return error_type; } -glsl_precision +const glsl_precision glsl_type::field_precision(const char *name) const { if (this->base_type != GLSL_TYPE_STRUCT) @@ -604,7 +626,8 @@ glsl_type::field_precision(const char *name) const int glsl_type::field_index(const char *name) const { - if (this->base_type != GLSL_TYPE_STRUCT) + if (this->base_type != GLSL_TYPE_STRUCT + && this->base_type != GLSL_TYPE_INTERFACE) return -1; for (unsigned i = 0; i < this->length; i++) { @@ -626,7 +649,8 @@ glsl_type::component_slots() const case GLSL_TYPE_BOOL: return this->components(); - case GLSL_TYPE_STRUCT: { + case GLSL_TYPE_STRUCT: + case GLSL_TYPE_INTERFACE: { unsigned size = 0; for (unsigned i = 0; i < this->length; i++) @@ -638,9 +662,14 @@ glsl_type::component_slots() const case GLSL_TYPE_ARRAY: return this->length * this->fields.array->component_slots(); - default: - return 0; + case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_ATOMIC_UINT: + case GLSL_TYPE_VOID: + case GLSL_TYPE_ERROR: + break; } + + return 0; } bool @@ -765,12 +794,6 @@ glsl_type::std140_base_alignment(bool row_major) const return -1; } -static unsigned -align(unsigned val, unsigned align) -{ - return (val + align - 1) / align * align; -} - unsigned glsl_type::std140_size(bool row_major) const { @@ -872,14 +895,105 @@ glsl_type::std140_size(bool row_major) const for (unsigned i = 0; i < this->length; i++) { const struct glsl_type *field_type = this->fields.structure[i].type; unsigned align = field_type->std140_base_alignment(row_major); - size = (size + align - 1) / align * align; + size = glsl_align(size, align); size += field_type->std140_size(row_major); } - size = align(size, - this->fields.structure[0].type->std140_base_alignment(row_major)); + size = glsl_align(size, + this->fields.structure[0].type->std140_base_alignment(row_major)); return size; } assert(!"not reached"); return -1; } + + +unsigned +glsl_type::count_attribute_slots() const +{ + /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: + * + * "A scalar input counts the same amount against this limit as a vec4, + * so applications may want to consider packing groups of four + * unrelated float inputs together into a vector to better utilize the + * capabilities of the underlying hardware. A matrix input will use up + * multiple locations. The number of locations used will equal the + * number of columns in the matrix." + * + * The spec does not explicitly say how arrays are counted. However, it + * should be safe to assume the total number of slots consumed by an array + * is the number of entries in the array multiplied by the number of slots + * consumed by a single element of the array. + * + * The spec says nothing about how structs are counted, because vertex + * attributes are not allowed to be (or contain) structs. However, Mesa + * allows varying structs, the number of varying slots taken up by a + * varying struct is simply equal to the sum of the number of slots taken + * up by each element. + */ + switch (this->base_type) { + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + case GLSL_TYPE_FLOAT: + case GLSL_TYPE_BOOL: + return this->matrix_columns; + + case GLSL_TYPE_STRUCT: + case GLSL_TYPE_INTERFACE: { + unsigned size = 0; + + for (unsigned i = 0; i < this->length; i++) + size += this->fields.structure[i].type->count_attribute_slots(); + + return size; + } + + case GLSL_TYPE_ARRAY: + return this->length * this->fields.array->count_attribute_slots(); + + case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_ATOMIC_UINT: + case GLSL_TYPE_VOID: + case GLSL_TYPE_ERROR: + break; + } + + assert(!"Unexpected type in count_attribute_slots()"); + + return 0; +} + +int +glsl_type::sampler_coordinate_components() const +{ + assert(is_sampler()); + + int size; + + switch (sampler_dimensionality) { + case GLSL_SAMPLER_DIM_1D: + case GLSL_SAMPLER_DIM_BUF: + size = 1; + break; + case GLSL_SAMPLER_DIM_2D: + case GLSL_SAMPLER_DIM_RECT: + case GLSL_SAMPLER_DIM_MS: + case GLSL_SAMPLER_DIM_EXTERNAL: + size = 2; + break; + case GLSL_SAMPLER_DIM_3D: + case GLSL_SAMPLER_DIM_CUBE: + size = 3; + break; + default: + assert(!"Should not get here."); + size = 1; + break; + } + + /* Array textures need an additional component for the array index. */ + if (sampler_array) + size += 1; + + return size; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/glsl_types.h b/3rdparty/glsl-optimizer/src/glsl/glsl_types.h index 95b7a8a6f..6c259882e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glsl_types.h +++ b/3rdparty/glsl-optimizer/src/glsl/glsl_types.h @@ -53,7 +53,9 @@ enum glsl_base_type { GLSL_TYPE_FLOAT, GLSL_TYPE_BOOL, GLSL_TYPE_SAMPLER, + GLSL_TYPE_ATOMIC_UINT, GLSL_TYPE_STRUCT, + GLSL_TYPE_INTERFACE, GLSL_TYPE_ARRAY, GLSL_TYPE_VOID, GLSL_TYPE_ERROR @@ -66,7 +68,14 @@ enum glsl_sampler_dim { GLSL_SAMPLER_DIM_CUBE, GLSL_SAMPLER_DIM_RECT, GLSL_SAMPLER_DIM_BUF, - GLSL_SAMPLER_DIM_EXTERNAL + GLSL_SAMPLER_DIM_EXTERNAL, + GLSL_SAMPLER_DIM_MS +}; + +enum glsl_interface_packing { + GLSL_INTERFACE_PACKING_STD140, + GLSL_INTERFACE_PACKING_SHARED, + GLSL_INTERFACE_PACKING_PACKED }; enum glsl_precision { @@ -91,6 +100,7 @@ struct glsl_type { * only \c GLSL_TYPE_FLOAT, \c GLSL_TYPE_INT, * and \c GLSL_TYPE_UINT are valid. */ + unsigned interface_packing:2; /* Callers of this ralloc-based new need not call delete. It's * easier to just ralloc_free 'mem_ctx' (or any of its ancestors). */ @@ -130,15 +140,15 @@ struct glsl_type { /** * Name of the data type * - * This may be \c NULL for anonymous structures, for arrays, or for - * function types. + * Will never be \c NULL. */ const char *name; /** * For \c GLSL_TYPE_ARRAY, this is the length of the array. For - * \c GLSL_TYPE_STRUCT, it is the number of elements in the structure and - * the number of values pointed to by \c fields.structure (below). + * \c GLSL_TYPE_STRUCT or \c GLSL_TYPE_INTERFACE, it is the number of + * elements in the structure and the number of values pointed to by + * \c fields.structure (below). */ unsigned length; @@ -151,40 +161,28 @@ struct glsl_type { struct glsl_struct_field *structure; /**< List of struct fields. */ } fields; - /** * \name Pointers to various public type singletons */ /*@{*/ - static const glsl_type *const error_type; - static const glsl_type *const void_type; - static const glsl_type *const int_type; - static const glsl_type *const ivec2_type; - static const glsl_type *const ivec3_type; - static const glsl_type *const ivec4_type; - static const glsl_type *const uint_type; - static const glsl_type *const uvec2_type; - static const glsl_type *const uvec3_type; - static const glsl_type *const uvec4_type; - static const glsl_type *const float_type; - static const glsl_type *const vec2_type; - static const glsl_type *const vec3_type; - static const glsl_type *const vec4_type; - static const glsl_type *const bool_type; - static const glsl_type *const bvec2_type; - static const glsl_type *const bvec3_type; - static const glsl_type *const bvec4_type; - static const glsl_type *const mat2_type; - static const glsl_type *const mat2x3_type; - static const glsl_type *const mat2x4_type; - static const glsl_type *const mat3x2_type; - static const glsl_type *const mat3_type; - static const glsl_type *const mat3x4_type; - static const glsl_type *const mat4x2_type; - static const glsl_type *const mat4x3_type; - static const glsl_type *const mat4_type; +#undef DECL_TYPE +#define DECL_TYPE(NAME, ...) \ + static const glsl_type *const NAME##_type; +#undef STRUCT_TYPE +#define STRUCT_TYPE(NAME) \ + static const glsl_type *const struct_##NAME##_type; +#include "builtin_type_macros.h" /*@}*/ + /** + * Convenience accessors for vector types (shorter than get_instance()). + * @{ + */ + static const glsl_type *vec(unsigned components); + static const glsl_type *ivec(unsigned components); + static const glsl_type *uvec(unsigned components); + static const glsl_type *bvec(unsigned components); + /**@}*/ /** * For numeric and boolean derrived types returns the basic scalar type @@ -238,6 +236,14 @@ struct glsl_type { unsigned num_fields, const char *name); + /** + * Get the instance of an interface block type + */ + static const glsl_type *get_interface_instance(const glsl_struct_field *fields, + unsigned num_fields, + enum glsl_interface_packing packing, + const char *block_name); + /** * Query the total number of scalars that make up a scalar, vector or matrix */ @@ -254,6 +260,18 @@ struct glsl_type { */ unsigned component_slots() const; + /** + * Calculate the number of attribute slots required to hold this type + * + * This implements the language rules of GLSL 1.50 for counting the number + * of slots used by a vertex attribute. It also determines the number of + * varying slots the type will use up in the absence of varying packing + * (and thus, it can be used to measure the number of varying slots used by + * the varyings that are generated by lower_packed_varyings). + */ + unsigned count_attribute_slots() const; + + /** * Alignment in bytes of the start of this type in a std140 uniform * block. @@ -349,6 +367,12 @@ struct glsl_type { return (base_type == GLSL_TYPE_UINT) || (base_type == GLSL_TYPE_INT); } + /** + * Query whether or not type is an integral type, or for struct and array + * types, contains an integral type. + */ + bool contains_integer() const; + /** * Query whether or not a type is a float type */ @@ -400,6 +424,14 @@ struct glsl_type { return base_type == GLSL_TYPE_STRUCT; } + /** + * Query whether or not a type is an interface + */ + bool is_interface() const + { + return base_type == GLSL_TYPE_INTERFACE; + } + /** * Query whether or not a type is the void type singleton. */ @@ -416,6 +448,32 @@ struct glsl_type { return base_type == GLSL_TYPE_ERROR; } + /** + * Return the amount of atomic counter storage required for a type. + */ + unsigned atomic_size() const + { + if (base_type == GLSL_TYPE_ATOMIC_UINT) + return ATOMIC_COUNTER_SIZE; + else if (is_array()) + return length * element_type()->atomic_size(); + else + return 0; + } + + /** + * Return whether a type contains any atomic counters. + */ + bool contains_atomic() const + { + return atomic_size() > 0; + } + + /** + * Return whether a type contains any opaque types. + */ + bool contains_opaque() const; + /** * Query the full type of a matrix row * @@ -444,7 +502,6 @@ struct glsl_type { : error_type; } - /** * Get the type of a structure field * @@ -454,7 +511,7 @@ struct glsl_type { */ const glsl_type *field_type(const char *name) const; - glsl_precision field_precision(const char *name) const; + const glsl_precision field_precision(const char *name) const; /** @@ -462,7 +519,6 @@ struct glsl_type { */ int field_index(const char *name) const; - /** * Query the number of elements in an array type * @@ -476,6 +532,33 @@ struct glsl_type { return is_array() ? length : -1; } + /** + * Query whether the array size for all dimensions has been declared. + */ + bool is_unsized_array() const + { + return is_array() && length == 0; + } + + /** + * Return the number of coordinate components needed for this sampler type. + * + * This is based purely on the sampler's dimensionality. For example, this + * returns 1 for sampler1D, and 3 for sampler2DArray. + * + * Note that this is often different than actual coordinate type used in + * a texturing built-in function, since those pack additional values (such + * as the shadow comparitor or projector) into the coordinate type. + */ + int sampler_coordinate_components() const; + + /** + * Compare a record type against another record type. + * + * This is useful for matching record types declared across shader stages. + */ + bool record_compare(const glsl_type *b) const; + private: /** * ralloc context for all glsl_type allocations @@ -500,6 +583,10 @@ private: glsl_type(const glsl_struct_field *fields, unsigned num_fields, const char *name); + /** Constructor for interface types */ + glsl_type(const glsl_struct_field *fields, unsigned num_fields, + enum glsl_interface_packing packing, const char *name); + /** Constructor for array types */ glsl_type(const glsl_type *array, unsigned length); @@ -509,48 +596,21 @@ private: /** Hash table containing the known record types. */ static struct hash_table *record_types; + /** Hash table containing the known interface types. */ + static struct hash_table *interface_types; + static int record_key_compare(const void *a, const void *b); static unsigned record_key_hash(const void *key); /** - * \name Pointers to various type singletons + * \name Built-in type flyweights */ /*@{*/ - static const glsl_type _error_type; - static const glsl_type _void_type; - static const glsl_type _sampler3D_type; - static const glsl_type builtin_core_types[]; - static const glsl_type builtin_structure_types[]; - static const glsl_type builtin_110_deprecated_structure_types[]; - static const glsl_type builtin_110_types[]; - static const glsl_type builtin_120_types[]; - static const glsl_type builtin_130_types[]; - static const glsl_type builtin_140_types[]; - static const glsl_type builtin_ARB_texture_rectangle_types[]; - static const glsl_type builtin_EXT_texture_array_types[]; - static const glsl_type builtin_EXT_texture_buffer_object_types[]; - static const glsl_type builtin_OES_EGL_image_external_types[]; - /*@}*/ - - /** - * \name Methods to populate a symbol table with built-in types. - * - * \internal - * This is one of the truely annoying things about C++. Methods that are - * completely internal and private to a type still have to be advertised to - * the world in a public header file. - */ - /*@{*/ - static void generate_100ES_types(glsl_symbol_table *); - static void generate_110_types(glsl_symbol_table *, bool add_deprecated); - static void generate_120_types(glsl_symbol_table *, bool add_deprecated); - static void generate_130_types(glsl_symbol_table *, bool add_deprecated); - static void generate_140_types(glsl_symbol_table *); - static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool); - static void generate_EXT_texture_array_types(glsl_symbol_table *, bool); - static void generate_OES_texture_3D_types(glsl_symbol_table *, bool); - static void generate_EXT_shadow_samplers_types(glsl_symbol_table *, bool); - static void generate_OES_EGL_image_external_types(glsl_symbol_table *, bool); +#undef DECL_TYPE +#define DECL_TYPE(NAME, ...) static const glsl_type _##NAME##_type; +#undef STRUCT_TYPE +#define STRUCT_TYPE(NAME) static const glsl_type _struct_##NAME##_type; +#include "builtin_type_macros.h" /*@}*/ /** @@ -569,9 +629,45 @@ private: struct glsl_struct_field { const struct glsl_type *type; const char *name; + bool row_major; glsl_precision precision; + + /** + * For interface blocks, gl_varying_slot corresponding to the input/output + * if this is a built-in input/output (i.e. a member of the built-in + * gl_PerVertex interface block); -1 otherwise. + * + * Ignored for structs. + */ + int location; + + /** + * For interface blocks, the interpolation mode (as in + * ir_variable::interpolation). 0 otherwise. + */ + unsigned interpolation:2; + + /** + * For interface blocks, 1 if this variable uses centroid interpolation (as + * in ir_variable::centroid). 0 otherwise. + */ + unsigned centroid:1; + + /** + * For interface blocks, 1 if this variable uses sample interpolation (as + * in ir_variable::sample). 0 otherwise. + */ + unsigned sample:1; }; +static inline unsigned int +glsl_align(unsigned int a, unsigned int align) +{ + return (a + align - 1) / align * align; +} + +#undef DECL_TYPE +#undef STRUCT_TYPE #endif /* __cplusplus */ #endif /* GLSL_TYPES_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp b/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp index 260b415a8..1e92c89ae 100644 --- a/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/hir_field_selection.cpp @@ -47,7 +47,58 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, YYLTYPE loc = expr->get_location(); if (op->type->is_error()) { /* silently propagate the error */ - } else if (op->type->is_vector()) { + } else if (op->type->base_type == GLSL_TYPE_STRUCT + || op->type->base_type == GLSL_TYPE_INTERFACE) { + result = new(ctx) ir_dereference_record(op, + expr->primary_expression.identifier); + + if (result->type->is_error()) { + _mesa_glsl_error(& loc, state, "cannot access field `%s' of " + "structure", + expr->primary_expression.identifier); + } + } else if (expr->subexpressions[1] != NULL) { + /* Handle "method calls" in GLSL 1.20 - namely, array.length() */ + state->check_version(120, 300, &loc, "methods not supported"); + + ast_expression *call = expr->subexpressions[1]; + assert(call->oper == ast_function_call); + + const char *method; + method = call->subexpressions[0]->primary_expression.identifier; + + if (strcmp(method, "length") == 0) { + if (!call->expressions.is_empty()) + _mesa_glsl_error(&loc, state, "length method takes no arguments"); + + if (op->type->is_array()) { + if (op->type->is_unsized_array()) + _mesa_glsl_error(&loc, state, "length called on unsized array"); + + result = new(ctx) ir_constant(op->type->array_size()); + } else if (op->type->is_vector()) { + if (state->ARB_shading_language_420pack_enable) { + /* .length() returns int. */ + result = new(ctx) ir_constant((int) op->type->vector_elements); + } else { + _mesa_glsl_error(&loc, state, "length method on matrix only available" + "with ARB_shading_language_420pack"); + } + } else if (op->type->is_matrix()) { + if (state->ARB_shading_language_420pack_enable) { + /* .length() returns int. */ + result = new(ctx) ir_constant((int) op->type->matrix_columns); + } else { + _mesa_glsl_error(&loc, state, "length method on matrix only available" + "with ARB_shading_language_420pack"); + } + } + } else { + _mesa_glsl_error(&loc, state, "unknown method: `%s'", method); + } + } else if (op->type->is_vector() || + (state->ARB_shading_language_420pack_enable && + op->type->is_scalar())) { ir_swizzle *swiz = ir_swizzle::create(op, expr->primary_expression.identifier, op->type->vector_elements); @@ -58,43 +109,12 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, * FINISHME: ir_swizzle::create. This allows the generation of more * FINISHME: specific error messages. */ - _mesa_glsl_error(& loc, state, "Invalid swizzle / mask `%s'", + _mesa_glsl_error(& loc, state, "invalid swizzle / mask `%s'", expr->primary_expression.identifier); } - } else if (op->type->base_type == GLSL_TYPE_STRUCT) { - result = new(ctx) ir_dereference_record(op, - expr->primary_expression.identifier); - - if (result->type->is_error()) { - _mesa_glsl_error(& loc, state, "Cannot access field `%s' of " - "structure", - expr->primary_expression.identifier); - } - } else if (expr->subexpressions[1] != NULL) { - /* Handle "method calls" in GLSL 1.20 - namely, array.length() */ - if (state->language_version < 120) - _mesa_glsl_error(&loc, state, "Methods not supported in GLSL 1.10."); - - ast_expression *call = expr->subexpressions[1]; - assert(call->oper == ast_function_call); - - const char *method; - method = call->subexpressions[0]->primary_expression.identifier; - - if (op->type->is_array() && strcmp(method, "length") == 0) { - if (!call->expressions.is_empty()) - _mesa_glsl_error(&loc, state, "length method takes no arguments."); - - if (op->type->array_size() == 0) - _mesa_glsl_error(&loc, state, "length called on unsized array."); - - result = new(ctx) ir_constant(op->type->array_size()); - } else { - _mesa_glsl_error(&loc, state, "Unknown method: `%s'.", method); - } } else { - _mesa_glsl_error(& loc, state, "Cannot access field `%s' of " - "non-structure / non-vector.", + _mesa_glsl_error(& loc, state, "cannot access field `%s' of " + "non-structure / non-vector", expr->primary_expression.identifier); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir.cpp b/3rdparty/glsl-optimizer/src/glsl/ir.cpp index a886a88e7..39b49bd0f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir.cpp @@ -208,53 +208,6 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, this->set_lhs(lhs); } - -ir_expression::ir_expression(int op, const struct glsl_type *type, - ir_rvalue *op0) -: ir_rvalue(precision_from_ir(op0)) -{ - assert(get_num_operands(ir_expression_operation(op)) == 1); - this->ir_type = ir_type_expression; - this->type = type; - this->operation = ir_expression_operation(op); - this->operands[0] = op0; - this->operands[1] = NULL; - this->operands[2] = NULL; - this->operands[3] = NULL; -} - -ir_expression::ir_expression(int op, const struct glsl_type *type, - ir_rvalue *op0, ir_rvalue *op1) -: ir_rvalue(higher_precision(op0,op1)) -{ - assert(((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1)) - || (get_num_operands(ir_expression_operation(op)) == 2)); - this->ir_type = ir_type_expression; - this->type = type; - this->operation = ir_expression_operation(op); - this->operands[0] = op0; - this->operands[1] = op1; - this->operands[2] = NULL; - this->operands[3] = NULL; -} - -ir_expression::ir_expression(int op, const struct glsl_type *type, - ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2) -: ir_rvalue(higher_precision(op0,op1)) -{ - assert( - ((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1)) || - ((op2 == NULL) && (get_num_operands(ir_expression_operation(op)) == 2)) || - (get_num_operands(ir_expression_operation(op)) == 3)); - this->ir_type = ir_type_expression; - this->type = type; - this->operation = ir_expression_operation(op); - this->operands[0] = op0; - this->operands[1] = op1; - this->operands[2] = op2; - this->operands[3] = NULL; -} - ir_expression::ir_expression(int op, const struct glsl_type *type, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2, ir_rvalue *op3) @@ -267,6 +220,12 @@ ir_expression::ir_expression(int op, const struct glsl_type *type, this->operands[1] = op1; this->operands[2] = op2; this->operands[3] = op3; +#ifndef NDEBUG + int num_operands = get_num_operands(this->operation); + for (int i = num_operands; i < 4; i++) { + assert(this->operands[i] == NULL); + } +#endif } ir_expression::ir_expression(int op, ir_rvalue *op0) @@ -307,6 +266,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) case ir_unop_cos_reduced: case ir_unop_dFdx: case ir_unop_dFdy: + case ir_unop_bitfield_reverse: this->type = op0->type; break; @@ -314,6 +274,9 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) case ir_unop_b2i: case ir_unop_u2i: case ir_unop_bitcast_f2i: + case ir_unop_bit_count: + case ir_unop_find_msb: + case ir_unop_find_lsb: this->type = glsl_type::get_instance(GLSL_TYPE_INT, op0->type->vector_elements, 1); break; @@ -341,6 +304,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) break; case ir_unop_noise: + case ir_unop_unpack_half_2x16_split_x: + case ir_unop_unpack_half_2x16_split_y: this->type = glsl_type::float_type; break; @@ -348,6 +313,25 @@ ir_expression::ir_expression(int op, ir_rvalue *op0) this->type = glsl_type::bool_type; break; + case ir_unop_pack_snorm_2x16: + case ir_unop_pack_snorm_4x8: + case ir_unop_pack_unorm_2x16: + case ir_unop_pack_unorm_4x8: + case ir_unop_pack_half_2x16: + this->type = glsl_type::uint_type; + break; + + case ir_unop_unpack_snorm_2x16: + case ir_unop_unpack_unorm_2x16: + case ir_unop_unpack_half_2x16: + this->type = glsl_type::vec2_type; + break; + + case ir_unop_unpack_snorm_4x8: + case ir_unop_unpack_unorm_4x8: + this->type = glsl_type::vec4_type; + break; + default: assert(!"not reached: missing automatic type setup for ir_expression"); this->type = op0->type; @@ -400,10 +384,15 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) case ir_binop_bit_and: case ir_binop_bit_xor: case ir_binop_bit_or: + assert(!op0->type->is_matrix()); + assert(!op1->type->is_matrix()); if (op0->type->is_scalar()) { - this->type = op1->type; + this->type = op1->type; } else if (op1->type->is_scalar()) { - this->type = op0->type; + this->type = op0->type; + } else { + assert(op0->type->vector_elements == op1->type->vector_elements); + this->type = op0->type; } break; @@ -422,9 +411,24 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) this->type = glsl_type::float_type; break; + case ir_binop_pack_half_2x16_split: + this->type = glsl_type::uint_type; + break; + + case ir_binop_imul_high: + case ir_binop_carry: + case ir_binop_borrow: case ir_binop_lshift: case ir_binop_rshift: + case ir_binop_bfm: + case ir_binop_ldexp: this->type = op0->type; + this->set_precision(op0->get_precision()); + break; + + case ir_binop_vector_extract: + this->type = op0->type->get_scalar_type(); + this->set_precision(op0->get_precision()); break; default: @@ -433,6 +437,39 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1) } } +ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, + ir_rvalue *op2) +: ir_rvalue(higher_precision(precision_from_ir(op0),higher_precision(op1,op2))) +{ + this->ir_type = ir_type_expression; + + this->operation = ir_expression_operation(op); + this->operands[0] = op0; + this->operands[1] = op1; + this->operands[2] = op2; + this->operands[3] = NULL; + + assert(op > ir_last_binop && op <= ir_last_triop); + + switch (this->operation) { + case ir_triop_fma: + case ir_triop_clamp: + case ir_triop_lrp: + case ir_triop_bitfield_extract: + case ir_triop_vector_insert: + this->type = op0->type; + break; + + case ir_triop_bfi: + case ir_triop_csel: + this->type = op1->type; + break; + + default: + assert(!"not reached: missing automatic type setup for ir_expression"); + this->type = glsl_type::float_type; + } +} unsigned int ir_expression::get_num_operands(ir_expression_operation op) @@ -445,10 +482,10 @@ ir_expression::get_num_operands(ir_expression_operation op) if (op <= ir_last_binop) return 2; - if (op <= ir_last_ternop) + if (op <= ir_last_triop) return 3; - if (op == ir_quadop_vector) + if (op <= ir_last_quadop) return 4; assert(false); @@ -495,11 +532,30 @@ static const char *const operator_strs[] = { "cos_reduced", "dFdx", "dFdy", + "packSnorm2x16", + "packSnorm4x8", + "packUnorm2x16", + "packUnorm4x8", + "packHalf2x16", + "unpackSnorm2x16", + "unpackSnorm4x8", + "unpackUnorm2x16", + "unpackUnorm4x8", + "unpackHalf2x16", + "unpackHalf2x16_split_x", + "unpackHalf2x16_split_y", + "bitfield_reverse", + "bit_count", + "find_msb", + "find_lsb", "noise", "+", "-", "*", + "imul_high", "/", + "carry", + "borrow", "%", "<", ">", @@ -521,9 +577,19 @@ static const char *const operator_strs[] = { "min", "max", "pow", + "packHalf2x16_split", + "bfm", "ubo_load", + "ldexp", + "vector_extract", + "fma", "clamp", - "mix", + "lrp", + "csel", + "bfi", + "bitfield_extract", + "vector_insert", + "bitfield_insert", "vector", }; @@ -584,46 +650,58 @@ ir_constant::ir_constant(const struct glsl_type *type, memcpy(& this->value, data, sizeof(this->value)); } -ir_constant::ir_constant(float f) +ir_constant::ir_constant(float f, unsigned vector_elements) : ir_rvalue(glsl_precision_undefined) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::float_type; - this->value.f[0] = f; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.f[i] = f; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.f[i] = 0; } } -ir_constant::ir_constant(unsigned int u) +ir_constant::ir_constant(unsigned int u, unsigned vector_elements) : ir_rvalue(glsl_precision_undefined) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::uint_type; - this->value.u[0] = u; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_UINT, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.u[i] = u; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.u[i] = 0; } } -ir_constant::ir_constant(int i) +ir_constant::ir_constant(int integer, unsigned vector_elements) : ir_rvalue(glsl_precision_undefined) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::int_type; - this->value.i[0] = i; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_INT, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.i[i] = integer; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.i[i] = 0; } } -ir_constant::ir_constant(bool b) +ir_constant::ir_constant(bool b, unsigned vector_elements) : ir_rvalue(glsl_precision_undefined) { + assert(vector_elements <= 4); this->ir_type = ir_type_constant; - this->type = glsl_type::bool_type; - this->value.b[0] = b; - for (int i = 1; i < 16; i++) { + this->type = glsl_type::get_instance(GLSL_TYPE_BOOL, vector_elements, 1); + for (unsigned i = 0; i < vector_elements; i++) { + this->value.b[i] = b; + } + for (unsigned i = vector_elements; i < 16; i++) { this->value.b[i] = false; } } @@ -1075,27 +1153,31 @@ ir_constant::has_value(const ir_constant *c) const } bool -ir_constant::is_zero() const +ir_constant::is_value(float f, int i) const { if (!this->type->is_scalar() && !this->type->is_vector()) return false; + /* Only accept boolean values for 0/1. */ + if (int(bool(i)) != i && this->type->is_boolean()) + return false; + for (unsigned c = 0; c < this->type->vector_elements; c++) { switch (this->type->base_type) { case GLSL_TYPE_FLOAT: - if (this->value.f[c] != 0.0) + if (this->value.f[c] != f) return false; break; case GLSL_TYPE_INT: - if (this->value.i[c] != 0) + if (this->value.i[c] != i) return false; break; case GLSL_TYPE_UINT: - if (this->value.u[c] != 0) + if (this->value.u[c] != unsigned(i)) return false; break; case GLSL_TYPE_BOOL: - if (this->value.b[c] != false) + if (this->value.b[c] != bool(i)) return false; break; default: @@ -1111,77 +1193,22 @@ ir_constant::is_zero() const return true; } +bool +ir_constant::is_zero() const +{ + return is_value(0.0, 0); +} + bool ir_constant::is_one() const { - if (!this->type->is_scalar() && !this->type->is_vector()) - return false; - - for (unsigned c = 0; c < this->type->vector_elements; c++) { - switch (this->type->base_type) { - case GLSL_TYPE_FLOAT: - if (this->value.f[c] != 1.0) - return false; - break; - case GLSL_TYPE_INT: - if (this->value.i[c] != 1) - return false; - break; - case GLSL_TYPE_UINT: - if (this->value.u[c] != 1) - return false; - break; - case GLSL_TYPE_BOOL: - if (this->value.b[c] != true) - return false; - break; - default: - /* The only other base types are structures, arrays, and samplers. - * Samplers cannot be constants, and the others should have been - * filtered out above. - */ - assert(!"Should not get here."); - return false; - } - } - - return true; + return is_value(1.0, 1); } bool ir_constant::is_negative_one() const { - if (!this->type->is_scalar() && !this->type->is_vector()) - return false; - - if (this->type->is_boolean()) - return false; - - for (unsigned c = 0; c < this->type->vector_elements; c++) { - switch (this->type->base_type) { - case GLSL_TYPE_FLOAT: - if (this->value.f[c] != -1.0) - return false; - break; - case GLSL_TYPE_INT: - if (this->value.i[c] != -1) - return false; - break; - case GLSL_TYPE_UINT: - if (int(this->value.u[c]) != -1) - return false; - break; - default: - /* The only other base types are structures, arrays, samplers, and - * booleans. Samplers cannot be constants, and the others should - * have been filtered out above. - */ - assert(!"Should not get here."); - return false; - } - } - - return true; + return is_value(-1.0, -1); } bool @@ -1230,11 +1257,6 @@ ir_constant::is_basis() const ir_loop::ir_loop() { this->ir_type = ir_type_loop; - this->cmp = ir_unop_neg; - this->from = NULL; - this->to = NULL; - this->increment = NULL; - this->counter = NULL; } @@ -1326,7 +1348,7 @@ ir_dereference::is_lvalue() const /* Every l-value derference chain eventually ends in a variable. */ - if ((var == NULL) || var->read_only) + if ((var == NULL) || var->data.read_only) return false; /* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec: @@ -1342,7 +1364,7 @@ ir_dereference::is_lvalue() const } -static const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txs" }; +static const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txf_ms", "txs", "lod", "tg4", "query_levels" }; const char *ir_texture::opcode_string() { @@ -1371,8 +1393,11 @@ ir_texture::set_sampler(ir_dereference *sampler, const glsl_type *type) this->sampler = sampler; this->type = type; - if (this->op == ir_txs) { + if (this->op == ir_txs || this->op == ir_query_levels) { assert(type->base_type == GLSL_TYPE_INT); + } else if (this->op == ir_lod) { + assert(type->vector_elements == 2); + assert(type->base_type == GLSL_TYPE_FLOAT); } else { assert(sampler->type->sampler_type == (int) type->base_type); if (sampler->type->sampler_shadow) @@ -1543,33 +1568,50 @@ ir_swizzle::variable_referenced() const ir_variable::ir_variable(const struct glsl_type *type, const char *name, ir_variable_mode mode, glsl_precision precision) - : max_array_access(0), read_only(false), centroid(false), invariant(false), - mode(mode), interpolation(INTERP_QUALIFIER_NONE), precision(precision) + : max_ifc_array_access(NULL) { this->ir_type = ir_type_variable; this->type = type; this->name = ralloc_strdup(this, name); - this->explicit_location = false; - this->has_initializer = false; - this->location = -1; - this->uniform_block = -1; + this->data.explicit_location = false; + this->data.has_initializer = false; + this->data.location = -1; + this->data.location_frac = 0; this->warn_extension = NULL; this->constant_value = NULL; this->constant_initializer = NULL; - this->origin_upper_left = false; - this->pixel_center_integer = false; - this->depth_layout = ir_depth_layout_none; - this->used = false; + this->data.origin_upper_left = false; + this->data.pixel_center_integer = false; + this->data.depth_layout = ir_depth_layout_none; + this->data.used = false; + this->data.read_only = false; + this->data.centroid = false; + this->data.sample = false; + this->data.invariant = false; + this->data.how_declared = ir_var_declared_normally; + this->data.mode = mode; + this->data.precision = precision; + this->data.interpolation = INTERP_QUALIFIER_NONE; + this->data.max_array_access = 0; + this->data.atomic.buffer_index = 0; + this->data.atomic.offset = 0; - if (type && type->base_type == GLSL_TYPE_SAMPLER) - this->read_only = true; + if (type != NULL) { + if (type->base_type == GLSL_TYPE_SAMPLER) + this->data.read_only = true; + + if (type->is_interface()) + this->init_interface_type(type); + else if (type->is_array() && type->fields.array->is_interface()) + this->init_interface_type(type->fields.array); + } } const char * -ir_variable::interpolation_string() const +interpolation_string(unsigned interpolation) { - switch (this->interpolation) { + switch (interpolation) { case INTERP_QUALIFIER_NONE: return "no"; case INTERP_QUALIFIER_SMOOTH: return "smooth"; case INTERP_QUALIFIER_FLAT: return "flat"; @@ -1584,11 +1626,11 @@ ir_variable::interpolation_string() const glsl_interp_qualifier ir_variable::determine_interpolation_mode(bool flat_shade) { - if (this->interpolation != INTERP_QUALIFIER_NONE) - return (glsl_interp_qualifier) this->interpolation; - int location = this->location; + if (this->data.interpolation != INTERP_QUALIFIER_NONE) + return (glsl_interp_qualifier) this->data.interpolation; + int location = this->data.location; bool is_gl_Color = - location == FRAG_ATTRIB_COL0 || location == FRAG_ATTRIB_COL1; + location == VARYING_SLOT_COL0 || location == VARYING_SLOT_COL1; if (flat_shade && is_gl_Color) return INTERP_QUALIFIER_FLAT; else @@ -1596,15 +1638,40 @@ ir_variable::determine_interpolation_mode(bool flat_shade) } -ir_function_signature::ir_function_signature(const glsl_type *return_type, glsl_precision precision) - : return_type(return_type), precision(precision), is_defined(false), _function(NULL) +ir_function_signature::ir_function_signature(const glsl_type *return_type, + glsl_precision precision, builtin_available_predicate b) + : return_type(return_type), precision(precision), is_defined(false), is_intrinsic(false), + builtin_avail(b), _function(NULL) { this->ir_type = ir_type_function_signature; - this->is_builtin = false; this->origin = NULL; } +bool +ir_function_signature::is_builtin() const +{ + return builtin_avail != NULL; +} + + +bool +ir_function_signature::is_builtin_available(const _mesa_glsl_parse_state *state) const +{ + /* We can't call the predicate without a state pointer, so just say that + * the signature is available. At compile time, we need the filtering, + * but also receive a valid state pointer. At link time, we're resolving + * imported built-in prototypes to their definitions, which will always + * be an exact match. So we can skip the filtering. + */ + if (state == NULL) + return true; + + assert(builtin_avail != NULL); + return builtin_avail(state); +} + + static bool modes_match(unsigned a, unsigned b) { @@ -1612,8 +1679,8 @@ modes_match(unsigned a, unsigned b) return true; /* Accept "in" vs. "const in" */ - if ((a == ir_var_const_in && b == ir_var_in) || - (b == ir_var_const_in && a == ir_var_in)) + if ((a == ir_var_const_in && b == ir_var_function_in) || + (b == ir_var_const_in && a == ir_var_function_in)) return true; return false; @@ -1623,26 +1690,21 @@ modes_match(unsigned a, unsigned b) const char * ir_function_signature::qualifiers_match(exec_list *params) { - exec_list_iterator iter_a = parameters.iterator(); - exec_list_iterator iter_b = params->iterator(); - /* check that the qualifiers match. */ - while (iter_a.has_next()) { - ir_variable *a = (ir_variable *)iter_a.get(); - ir_variable *b = (ir_variable *)iter_b.get(); + foreach_two_lists(a_node, &this->parameters, b_node, params) { + ir_variable *a = (ir_variable *) a_node; + ir_variable *b = (ir_variable *) b_node; /* NOTE: precision does not affect qualifier matching */ - if (a->read_only != b->read_only || - !modes_match(a->mode, b->mode) || - a->interpolation != b->interpolation || - a->centroid != b->centroid) { + if (a->data.read_only != b->data.read_only || + !modes_match(a->data.mode, b->data.mode) || + a->data.interpolation != b->data.interpolation || + a->data.centroid != b->data.centroid || + a->data.sample != b->data.sample) { /* parameter a's qualifiers don't match */ return a->name; } - - iter_a.next(); - iter_b.next(); } return NULL; } @@ -1655,12 +1717,6 @@ ir_function_signature::replace_parameters(exec_list *new_params) * parameter information comes from the function prototype, it may either * specify incorrect parameter names or not have names at all. */ - foreach_iter(exec_list_iterator, iter, parameters) { - assert(((ir_instruction *) iter.get())->as_variable() != NULL); - - iter.remove(); - } - new_params->move_nodes_to(¶meters); } @@ -1677,7 +1733,7 @@ ir_function::has_user_signature() { foreach_list(n, &this->signatures) { ir_function_signature *const sig = (ir_function_signature *) n; - if (!sig->is_builtin) + if (!sig->is_builtin()) return true; } return false; @@ -1697,8 +1753,8 @@ ir_rvalue::error_value(void *mem_ctx) void visit_exec_list(exec_list *list, ir_visitor *visitor) { - foreach_iter(exec_list_iterator, iter, *list) { - ((ir_instruction *)iter.get())->accept(visitor); + foreach_list_safe(n, list) { + ((ir_instruction *) n)->accept(visitor); } } @@ -1719,8 +1775,8 @@ steal_memory(ir_instruction *ir, void *new_ctx) */ if (constant != NULL) { if (constant->type->is_record()) { - foreach_iter(exec_list_iterator, iter, constant->components) { - ir_constant *field = (ir_constant *)iter.get(); + foreach_list(n, &constant->components) { + ir_constant *field = (ir_constant *) n; steal_memory(field, ir); } } else if (constant->type->is_array()) { @@ -1750,7 +1806,7 @@ precision_from_ir (ir_instruction* ir) return glsl_precision_undefined; ir_variable* var = ir->as_variable(); if (var) - return (glsl_precision)var->precision; + return (glsl_precision)var->data.precision; ir_rvalue* rv = ir->as_rvalue(); if (rv) return rv->get_precision(); @@ -1819,3 +1875,67 @@ ir_rvalue::as_rvalue_to_saturate() return NULL; } + + +unsigned +vertices_per_prim(GLenum prim) +{ + switch (prim) { + case GL_POINTS: + return 1; + case GL_LINES: + return 2; + case GL_TRIANGLES: + return 3; + case GL_LINES_ADJACENCY: + return 4; + case GL_TRIANGLES_ADJACENCY: + return 6; + default: + assert(!"Bad primitive"); + return 3; + } +} + +/** + * Generate a string describing the mode of a variable + */ +const char * +mode_string(const ir_variable *var) +{ + switch (var->data.mode) { + case ir_var_auto: + return (var->data.read_only) ? "global constant" : "global variable"; + + case ir_var_uniform: + return "uniform"; + + case ir_var_shader_in: + return "shader input"; + + case ir_var_shader_out: + return "shader output"; + + case ir_var_function_in: + case ir_var_const_in: + return "function input"; + + case ir_var_function_out: + return "function output"; + + case ir_var_function_inout: + return "function inout"; + + case ir_var_system_value: + return "shader input"; + + case ir_var_temporary: + return "compiler temporary"; + + case ir_var_mode_count: + break; + } + + assert(!"Should not get here."); + return "invalid variable"; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir.h b/3rdparty/glsl-optimizer/src/glsl/ir.h index e2abd3787..a4c0236e3 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir.h @@ -37,6 +37,8 @@ #include "main/mtypes.h" #include "main/macros.h" +#ifdef __cplusplus + /** * \defgroup IR Intermediate representation nodes * @@ -81,6 +83,9 @@ enum ir_node_type { ir_type_swizzle, ir_type_texture, ir_type_precision, + ir_type_typedecl, + ir_type_emit_vertex, + ir_type_end_primitive, ir_type_max /**< maximum ir_type enum number, for validation */ }; @@ -123,6 +128,7 @@ public: virtual class ir_dereference * as_dereference() { return NULL; } virtual class ir_dereference_array * as_dereference_array() { return NULL; } virtual class ir_dereference_variable *as_dereference_variable() { return NULL; } + virtual class ir_dereference_record *as_dereference_record() { return NULL; } virtual class ir_expression * as_expression() { return NULL; } virtual class ir_rvalue * as_rvalue() { return NULL; } virtual class ir_loop * as_loop() { return NULL; } @@ -131,10 +137,22 @@ public: virtual class ir_return * as_return() { return NULL; } virtual class ir_if * as_if() { return NULL; } virtual class ir_swizzle * as_swizzle() { return NULL; } + virtual class ir_texture * as_texture() { return NULL; } virtual class ir_constant * as_constant() { return NULL; } virtual class ir_discard * as_discard() { return NULL; } + virtual class ir_jump * as_jump() { return NULL; } /*@}*/ + /** + * IR equality method: Return true if the referenced instruction would + * return the same value as this one. + * + * This intended to be used for CSE and algebraic optimizations, on rvalues + * in particular. No support for other instruction types (assignments, + * jumps, calls, etc.) is planned. + */ + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + protected: ir_instruction() { @@ -273,12 +291,43 @@ protected: enum ir_variable_mode { ir_var_auto = 0, /**< Function local variables and globals. */ ir_var_uniform, /**< Variable declared as a uniform. */ - ir_var_in, - ir_var_out, - ir_var_inout, + ir_var_shader_in, + ir_var_shader_out, + ir_var_function_in, + ir_var_function_out, + ir_var_function_inout, ir_var_const_in, /**< "in" param that must be a constant expression */ ir_var_system_value, /**< Ex: front-face, instance-id, etc. */ - ir_var_temporary /**< Temporary variable generated during compilation. */ + ir_var_temporary, /**< Temporary variable generated during compilation. */ + ir_var_mode_count /**< Number of variable modes */ +}; + +/** + * Enum keeping track of how a variable was declared. For error checking of + * the gl_PerVertex redeclaration rules. + */ +enum ir_var_declaration_type { + /** + * Normal declaration (for most variables, this means an explicit + * declaration. Exception: temporaries are always implicitly declared, but + * they still use ir_var_declared_normally). + * + * Note: an ir_variable that represents a named interface block uses + * ir_var_declared_normally. + */ + ir_var_declared_normally = 0, + + /** + * Variable was explicitly declared (or re-declared) in an unnamed + * interface block. + */ + ir_var_declared_in_block, + + /** + * Variable is an implicitly declared built-in that has not been explicitly + * re-declared by the shader. + */ + ir_var_declared_implicitly, }; /** @@ -312,6 +361,21 @@ struct ir_state_slot { }; +/** + * Get the string value for an interpolation qualifier + * + * \return The string that would be used in a shader to specify \c + * mode will be returned. + * + * This function is used to generate error messages of the form "shader + * uses %s interpolation qualifier", so in the case where there is no + * interpolation qualifier, it returns "no". + * + * This function should only be used on a shader input or output variable. + */ +const char *interpolation_string(unsigned interpolation); + + class ir_variable : public ir_instruction { public: ir_variable(const struct glsl_type *, const char *, ir_variable_mode, glsl_precision); @@ -331,20 +395,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); - /** - * Get the string value for the interpolation qualifier - * - * \return The string that would be used in a shader to specify \c - * mode will be returned. - * - * This function is used to generate error messages of the form "shader - * uses %s interpolation qualifier", so in the case where there is no - * interpolation qualifier, it returns "no". - * - * This function should only be used on a shader input or output variable. - */ - const char *interpolation_string() const; - /** * Determine how this variable should be interpolated based on its * interpolation qualifier (if present), whether it is gl_Color or @@ -356,6 +406,100 @@ public: */ glsl_interp_qualifier determine_interpolation_mode(bool flat_shade); + /** + * Determine whether or not a variable is part of a uniform block. + */ + inline bool is_in_uniform_block() const + { + return this->data.mode == ir_var_uniform && this->interface_type != NULL; + } + + /** + * Determine whether or not a variable is the declaration of an interface + * block + * + * For the first declaration below, there will be an \c ir_variable named + * "instance" whose type and whose instance_type will be the same + * \cglsl_type. For the second declaration, there will be an \c ir_variable + * named "f" whose type is float and whose instance_type is B2. + * + * "instance" is an interface instance variable, but "f" is not. + * + * uniform B1 { + * float f; + * } instance; + * + * uniform B2 { + * float f; + * }; + */ + inline bool is_interface_instance() const + { + const glsl_type *const t = this->type; + + return (t == this->interface_type) + || (t->is_array() && t->fields.array == this->interface_type); + } + + /** + * Set this->interface_type on a newly created variable. + */ + void init_interface_type(const struct glsl_type *type) + { + assert(this->interface_type == NULL); + this->interface_type = type; + if (this->is_interface_instance()) { + this->max_ifc_array_access = + rzalloc_array(this, unsigned, type->length); + } + } + + /** + * Change this->interface_type on a variable that previously had a + * different, but compatible, interface_type. This is used during linking + * to set the size of arrays in interface blocks. + */ + void change_interface_type(const struct glsl_type *type) + { + if (this->max_ifc_array_access != NULL) { + /* max_ifc_array_access has already been allocated, so make sure the + * new interface has the same number of fields as the old one. + */ + assert(this->interface_type->length == type->length); + } + this->interface_type = type; + } + + /** + * Change this->interface_type on a variable that previously had a + * different, and incompatible, interface_type. This is used during + * compilation to handle redeclaration of the built-in gl_PerVertex + * interface block. + */ + void reinit_interface_type(const struct glsl_type *type) + { + if (this->max_ifc_array_access != NULL) { +#ifndef _NDEBUG + /* Redeclaring gl_PerVertex is only allowed if none of the built-ins + * it defines have been accessed yet; so it's safe to throw away the + * old max_ifc_array_access pointer, since all of its values are + * zero. + */ + for (unsigned i = 0; i < this->interface_type->length; i++) + assert(this->max_ifc_array_access[i] == 0); +#endif + ralloc_free(this->max_ifc_array_access); + this->max_ifc_array_access = NULL; + } + this->interface_type = NULL; + init_interface_type(type); + } + + const glsl_type *get_interface_type() const + { + return this->interface_type; + } + /** * Declared type of the variable */ @@ -367,126 +511,203 @@ public: const char *name; /** - * Highest element accessed with a constant expression array index + * For variables which satisfy the is_interface_instance() predicate, this + * points to an array of integers such that if the ith member of the + * interface block is an array, max_ifc_array_access[i] is the maximum + * array element of that member that has been accessed. If the ith member + * of the interface block is not an array, max_ifc_array_access[i] is + * unused. * - * Not used for non-array variables. + * For variables whose type is not an interface block, this pointer is + * NULL. */ - unsigned max_array_access; + unsigned *max_ifc_array_access; - /** - * Is the variable read-only? - * - * This is set for variables declared as \c const, shader inputs, - * and uniforms. - */ - unsigned read_only:1; - unsigned centroid:1; - unsigned invariant:1; + struct ir_variable_data { - /** - * Has this variable been used for reading or writing? - * - * Several GLSL semantic checks require knowledge of whether or not a - * variable has been used. For example, it is an error to redeclare a - * variable as invariant after it has been used. - * - * This is only maintained in the ast_to_hir.cpp path, not in - * Mesa's fixed function or ARB program paths. - */ - unsigned used:1; + /** + * Is the variable read-only? + * + * This is set for variables declared as \c const, shader inputs, + * and uniforms. + */ + unsigned read_only:1; + unsigned centroid:1; + unsigned sample:1; + unsigned invariant:1; - /** - * Has this variable been statically assigned? - * - * This answers whether the variable was assigned in any path of - * the shader during ast_to_hir. This doesn't answer whether it is - * still written after dead code removal, nor is it maintained in - * non-ast_to_hir.cpp (GLSL parsing) paths. - */ - unsigned assigned:1; + /** + * Has this variable been used for reading or writing? + * + * Several GLSL semantic checks require knowledge of whether or not a + * variable has been used. For example, it is an error to redeclare a + * variable as invariant after it has been used. + * + * This is only maintained in the ast_to_hir.cpp path, not in + * Mesa's fixed function or ARB program paths. + */ + unsigned used:1; - /** - * Storage class of the variable. - * - * \sa ir_variable_mode - */ - unsigned mode:3; + /** + * Has this variable been statically assigned? + * + * This answers whether the variable was assigned in any path of + * the shader during ast_to_hir. This doesn't answer whether it is + * still written after dead code removal, nor is it maintained in + * non-ast_to_hir.cpp (GLSL parsing) paths. + */ + unsigned assigned:1; - /** - * Interpolation mode for shader inputs / outputs - * - * \sa ir_variable_interpolation - */ - unsigned interpolation:2; + /** + * Enum indicating how the variable was declared. See + * ir_var_declaration_type. + * + * This is used to detect certain kinds of illegal variable redeclarations. + */ + unsigned how_declared:2; - unsigned precision:2; + /** + * Storage class of the variable. + * + * \sa ir_variable_mode + */ + unsigned mode:4; - /** - * \name ARB_fragment_coord_conventions - * @{ - */ - unsigned origin_upper_left:1; - unsigned pixel_center_integer:1; - /*@}*/ + /** + * Interpolation mode for shader inputs / outputs + * + * \sa ir_variable_interpolation + */ + unsigned interpolation:2; - /** - * Was the location explicitly set in the shader? - * - * If the location is explicitly set in the shader, it \b cannot be changed - * by the linker or by the API (e.g., calls to \c glBindAttribLocation have - * no effect). - */ - unsigned explicit_location:1; - unsigned explicit_index:1; + unsigned precision:2; - /** - * Does this variable have an initializer? - * - * This is used by the linker to cross-validiate initializers of global - * variables. - */ - unsigned has_initializer:1; + /** + * \name ARB_fragment_coord_conventions + * @{ + */ + unsigned origin_upper_left:1; + unsigned pixel_center_integer:1; + /*@}*/ - /** - * \brief Layout qualifier for gl_FragDepth. - * - * This is not equal to \c ir_depth_layout_none if and only if this - * variable is \c gl_FragDepth and a layout qualifier is specified. - */ - ir_depth_layout depth_layout; + /** + * Was the location explicitly set in the shader? + * + * If the location is explicitly set in the shader, it \b cannot be changed + * by the linker or by the API (e.g., calls to \c glBindAttribLocation have + * no effect). + */ + unsigned explicit_location:1; + unsigned explicit_index:1; - /** - * Storage location of the base of this variable - * - * The precise meaning of this field depends on the nature of the variable. - * - * - Vertex shader input: one of the values from \c gl_vert_attrib. - * - Vertex shader output: one of the values from \c gl_vert_result. - * - Fragment shader input: one of the values from \c gl_frag_attrib. - * - Fragment shader output: one of the values from \c gl_frag_result. - * - Uniforms: Per-stage uniform slot number for default uniform block. - * - Uniforms: Index within the uniform block definition for UBO members. - * - Other: This field is not currently used. - * - * If the variable is a uniform, shader input, or shader output, and the - * slot has not been assigned, the value will be -1. - */ - int location; + /** + * Was an initial binding explicitly set in the shader? + * + * If so, constant_value contains an integer ir_constant representing the + * initial binding point. + */ + unsigned explicit_binding:1; - /** - * Uniform block number for uniforms. - * - * This index is into the shader's list of uniform blocks, not the - * linked program's merged list. - * - * If the variable is not in a uniform block, the value will be -1. - */ - int uniform_block; + /** + * Does this variable have an initializer? + * + * This is used by the linker to cross-validiate initializers of global + * variables. + */ + unsigned has_initializer:1; - /** - * output index for dual source blending. - */ - int index; + /** + * Is this variable a generic output or input that has not yet been matched + * up to a variable in another stage of the pipeline? + * + * This is used by the linker as scratch storage while assigning locations + * to generic inputs and outputs. + */ + unsigned is_unmatched_generic_inout:1; + + /** + * If non-zero, then this variable may be packed along with other variables + * into a single varying slot, so this offset should be applied when + * accessing components. For example, an offset of 1 means that the x + * component of this variable is actually stored in component y of the + * location specified by \c location. + */ + unsigned location_frac:2; + + /** + * Non-zero if this variable was created by lowering a named interface + * block which was not an array. + * + * Note that this variable and \c from_named_ifc_block_array will never + * both be non-zero. + */ + unsigned from_named_ifc_block_nonarray:1; + + /** + * Non-zero if this variable was created by lowering a named interface + * block which was an array. + * + * Note that this variable and \c from_named_ifc_block_nonarray will never + * both be non-zero. + */ + unsigned from_named_ifc_block_array:1; + + /** + * \brief Layout qualifier for gl_FragDepth. + * + * This is not equal to \c ir_depth_layout_none if and only if this + * variable is \c gl_FragDepth and a layout qualifier is specified. + */ + ir_depth_layout depth_layout; + + /** + * Storage location of the base of this variable + * + * The precise meaning of this field depends on the nature of the variable. + * + * - Vertex shader input: one of the values from \c gl_vert_attrib. + * - Vertex shader output: one of the values from \c gl_varying_slot. + * - Geometry shader input: one of the values from \c gl_varying_slot. + * - Geometry shader output: one of the values from \c gl_varying_slot. + * - Fragment shader input: one of the values from \c gl_varying_slot. + * - Fragment shader output: one of the values from \c gl_frag_result. + * - Uniforms: Per-stage uniform slot number for default uniform block. + * - Uniforms: Index within the uniform block definition for UBO members. + * - Other: This field is not currently used. + * + * If the variable is a uniform, shader input, or shader output, and the + * slot has not been assigned, the value will be -1. + */ + int location; + + /** + * output index for dual source blending. + */ + int index; + + /** + * Initial binding point for a sampler or UBO. + * + * For array types, this represents the binding point for the first element. + */ + int binding; + + /** + * Location an atomic counter is stored at. + */ + struct { + unsigned buffer_index; + unsigned offset; + } atomic; + + /** + * Highest element accessed with a constant expression array index + * + * Not used for non-array variables. + */ + unsigned max_array_access; + + } data; /** * Built-in state that backs this uniform @@ -523,8 +744,22 @@ public: * objects. */ ir_constant *constant_initializer; + +private: + /** + * For variables that are in an interface block or are an instance of an + * interface block, this is the \c GLSL_TYPE_INTERFACE type for that block. + * + * \sa ir_variable::location + */ + const glsl_type *interface_type; }; +/** + * A function that returns whether a built-in function is available in the + * current shading language (based on version, ES or desktop, and extensions). + */ +typedef bool (*builtin_available_predicate)(const _mesa_glsl_parse_state *); /*@{*/ /** @@ -536,7 +771,8 @@ class ir_function_signature : public ir_instruction { * an ir_function. */ public: - ir_function_signature(const glsl_type *return_type, glsl_precision precision); + ir_function_signature(const glsl_type *return_type, glsl_precision precision, + builtin_available_predicate builtin_avail = NULL); virtual ir_function_signature *clone(void *mem_ctx, struct hash_table *ht) const; @@ -612,12 +848,27 @@ public: unsigned is_defined:1; /** Whether or not this function signature is a built-in. */ - unsigned is_builtin:1; + bool is_builtin() const; + + /** + * Whether or not this function is an intrinsic to be implemented + * by the driver. + */ + bool is_intrinsic; + + /** Whether or not a built-in is available for this shader. */ + bool is_builtin_available(const _mesa_glsl_parse_state *state) const; /** Body of instructions in the function. */ struct exec_list body; private: + /** + * A function pointer to a predicate that answers whether a built-in + * function is available in the current shader. NULL if not a built-in. + */ + builtin_available_predicate builtin_avail; + /** Function of which this signature is one overload. */ class ir_function *_function; @@ -672,32 +923,27 @@ public: this->signatures.push_tail(sig); } - /** - * Get an iterator for the set of function signatures - */ - exec_list_iterator iterator() - { - return signatures.iterator(); - } - /** * Find a signature that matches a set of actual parameters, taking implicit * conversions into account. Also flags whether the match was exact. */ - ir_function_signature *matching_signature(const exec_list *actual_param, + ir_function_signature *matching_signature(_mesa_glsl_parse_state *state, + const exec_list *actual_param, bool *match_is_exact); /** * Find a signature that matches a set of actual parameters, taking implicit * conversions into account. */ - ir_function_signature *matching_signature(const exec_list *actual_param); + ir_function_signature *matching_signature(_mesa_glsl_parse_state *state, + const exec_list *actual_param); /** * Find a signature that exactly matches a set of actual parameters without * any implicit type conversions. */ - ir_function_signature *exact_matching_signature(const exec_list *actual_ps); + ir_function_signature *exact_matching_signature(_mesa_glsl_parse_state *state, + const exec_list *actual_ps); /** * Name of the function. @@ -774,44 +1020,8 @@ public: return this; } - /** - * Get an iterator for the instructions of the loop body - */ - exec_list_iterator iterator() - { - return body_instructions.iterator(); - } - /** List of ir_instruction that make up the body of the loop. */ exec_list body_instructions; - - /** - * \name Loop counter and controls - * - * Represents a loop like a FORTRAN \c do-loop. - * - * \note - * If \c from and \c to are the same value, the loop will execute once. - */ - /*@{*/ - ir_rvalue *from; /** Value of the loop counter on the first - * iteration of the loop. - */ - ir_rvalue *to; /** Value of the loop counter on the last - * iteration of the loop. - */ - ir_rvalue *increment; - ir_variable *counter; - - /** - * Comparison operation in the loop terminator. - * - * If any of the loop control fields are non-\c NULL, this field must be - * one of \c ir_binop_less, \c ir_binop_greater, \c ir_binop_lequal, - * \c ir_binop_gequal, \c ir_binop_equal, or \c ir_binop_nequal. - */ - int cmp; - /*@}*/ }; @@ -901,7 +1111,7 @@ public: unsigned write_mask:4; }; -/* Update ir_expression::num_operands() and operator_strs when +/* Update ir_expression::get_num_operands() and operator_strs when * updating this list. */ enum ir_expression_operation { @@ -963,6 +1173,42 @@ enum ir_expression_operation { ir_unop_dFdy, /*@}*/ + /** + * \name Floating point pack and unpack operations. + */ + /*@{*/ + ir_unop_pack_snorm_2x16, + ir_unop_pack_snorm_4x8, + ir_unop_pack_unorm_2x16, + ir_unop_pack_unorm_4x8, + ir_unop_pack_half_2x16, + ir_unop_unpack_snorm_2x16, + ir_unop_unpack_snorm_4x8, + ir_unop_unpack_unorm_2x16, + ir_unop_unpack_unorm_4x8, + ir_unop_unpack_half_2x16, + /*@}*/ + + /** + * \name Lowered floating point unpacking operations. + * + * \see lower_packing_builtins_visitor::split_unpack_half_2x16 + */ + /*@{*/ + ir_unop_unpack_half_2x16_split_x, + ir_unop_unpack_half_2x16_split_y, + /*@}*/ + + /** + * \name Bit operations, part of ARB_gpu_shader5. + */ + /*@{*/ + ir_unop_bitfield_reverse, + ir_unop_bit_count, + ir_unop_find_msb, + ir_unop_find_lsb, + /*@}*/ + ir_unop_noise, /** @@ -972,9 +1218,25 @@ enum ir_expression_operation { ir_binop_add, ir_binop_sub, - ir_binop_mul, + ir_binop_mul, /**< Floating-point or low 32-bit integer multiply. */ + ir_binop_imul_high, /**< Calculates the high 32-bits of a 64-bit multiply. */ ir_binop_div, + /** + * Returns the carry resulting from the addition of the two arguments. + */ + /*@{*/ + ir_binop_carry, + /*@}*/ + + /** + * Returns the borrow resulting from the subtraction of the second argument + * from the first argument. + */ + /*@{*/ + ir_binop_borrow, + /*@}*/ + /** * Takes one of two combinations of arguments: * @@ -1029,6 +1291,24 @@ enum ir_expression_operation { ir_binop_pow, + /** + * \name Lowered floating point packing operations. + * + * \see lower_packing_builtins_visitor::split_pack_half_2x16 + */ + /*@{*/ + ir_binop_pack_half_2x16_split, + /*@}*/ + + /** + * \name First half of a lowered bitfieldInsert() operation. + * + * \see lower_instructions::bitfield_insert_to_bfm_bfi + */ + /*@{*/ + ir_binop_bfm, + /*@}*/ + /** * Load a value the size of a given GLSL type from a uniform block. * @@ -1037,17 +1317,82 @@ enum ir_expression_operation { */ ir_binop_ubo_load, + /** + * \name Multiplies a number by two to a power, part of ARB_gpu_shader5. + */ + /*@{*/ + ir_binop_ldexp, + /*@}*/ + + /** + * Extract a scalar from a vector + * + * operand0 is the vector + * operand1 is the index of the field to read from operand0 + */ + ir_binop_vector_extract, + /** * A sentinel marking the last of the binary operations. */ - ir_last_binop = ir_binop_ubo_load, + ir_last_binop = ir_binop_vector_extract, + + /** + * \name Fused floating-point multiply-add, part of ARB_gpu_shader5. + */ + /*@{*/ + ir_triop_fma, + /*@}*/ + + ir_triop_clamp, + ir_triop_lrp, + + /** + * \name Conditional Select + * + * A vector conditional select instruction (like ?:, but operating per- + * component on vectors). + * + * \see lower_instructions_visitor::ldexp_to_arith + */ + /*@{*/ + ir_triop_csel, + /*@}*/ + + /** + * \name Second half of a lowered bitfieldInsert() operation. + * + * \see lower_instructions::bitfield_insert_to_bfm_bfi + */ + /*@{*/ + ir_triop_bfi, + /*@}*/ + + ir_triop_bitfield_extract, + + /** + * Generate a value with one field of a vector changed + * + * operand0 is the vector + * operand1 is the value to write into the vector result + * operand2 is the index in operand0 to be modified + */ + ir_triop_vector_insert, + + /** + * A sentinel marking the last of the ternary operations. + */ + ir_last_triop = ir_triop_vector_insert, + + ir_quadop_bitfield_insert, - ir_ternop_clamp, - ir_ternop_mix, - ir_last_ternop = ir_ternop_mix, - ir_quadop_vector, + /** + * A sentinel marking the last of the ternary operations. + */ + ir_last_quadop = ir_quadop_vector, + /** * A sentinel marking the last of all operations. */ @@ -1056,36 +1401,32 @@ enum ir_expression_operation { class ir_expression : public ir_rvalue { public: + ir_expression(int op, const struct glsl_type *type, + ir_rvalue *op0, ir_rvalue *op1 = NULL, + ir_rvalue *op2 = NULL, ir_rvalue *op3 = NULL); + /** * Constructor for unary operation expressions */ - ir_expression(int op, const struct glsl_type *type, ir_rvalue *); ir_expression(int op, ir_rvalue *); /** * Constructor for binary operation expressions */ - ir_expression(int op, const struct glsl_type *type, - ir_rvalue *, ir_rvalue *); ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1); - + /** - * Constructor for ternary operation expressions + * Constructor for ternary operation expressions */ - ir_expression(int op, const struct glsl_type *type, - ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2); - - /** - * Constructor for quad operator expressions - */ - ir_expression(int op, const struct glsl_type *type, - ir_rvalue *, ir_rvalue *, ir_rvalue *, ir_rvalue *); + ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2); virtual ir_expression *as_expression() { return this; } + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const; /** @@ -1156,7 +1497,7 @@ public: ir_type = ir_type_call; assert(callee->return_type != NULL); actual_parameters->move_nodes_to(& this->actual_parameters); - this->use_builtin = callee->is_builtin; + this->use_builtin = callee->is_builtin(); } virtual ir_call *clone(void *mem_ctx, struct hash_table *ht) const; @@ -1175,14 +1516,6 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); - /** - * Get an iterator for the set of acutal parameters - */ - exec_list_iterator iterator() - { - return actual_parameters.iterator(); - } - /** * Get the name of the function being called. */ @@ -1228,6 +1561,12 @@ protected: { ir_type = ir_type_unset; } + +public: + virtual ir_jump *as_jump() + { + return this; + } }; class ir_return : public ir_jump { @@ -1356,7 +1695,11 @@ enum ir_texture_opcode { ir_txl, /**< Texture look-up with explicit LOD */ ir_txd, /**< Texture look-up with partial derivatvies */ ir_txf, /**< Texel fetch with explicit LOD */ - ir_txs /**< Texture size */ + ir_txf_ms, /**< Multisample texture fetch */ + ir_txs, /**< Texture size */ + ir_lod, /**< Texture lod query */ + ir_tg4, /**< Texture gather */ + ir_query_levels /**< Texture levels query */ }; @@ -1375,15 +1718,21 @@ enum ir_texture_opcode { * (txl 0 ) * (txd 0 (dPdx dPdy)) * (txf 0 ) + * (txf_ms + * ) * (txs ) + * (lod ) + * (tg4 ) + * (query_levels ) */ class ir_texture : public ir_rvalue { public: ir_texture(enum ir_texture_opcode op) - : ir_rvalue(glsl_precision_low), op(op), coordinate(NULL), + : ir_rvalue(glsl_precision_low), op(op), sampler(NULL), coordinate(NULL), offset(NULL) { this->ir_type = ir_type_texture; + memset(&lod_info, 0, sizeof(lod_info)); } virtual ir_texture *clone(void *mem_ctx, struct hash_table *) const; @@ -1395,8 +1744,15 @@ public: v->visit(this); } + virtual ir_texture *as_texture() + { + return this; + } + virtual ir_visitor_status accept(ir_hierarchical_visitor *); + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + /** * Return a string representing the ir_texture_opcode. */ @@ -1424,6 +1780,8 @@ public: union { ir_rvalue *lod; /**< Floating point LOD */ ir_rvalue *bias; /**< Floating point LOD bias */ + ir_rvalue *sample_index; /**< MSAA sample index */ + ir_rvalue *component; /**< Gather component selector */ struct { ir_rvalue *dPdx; /**< Partial derivative of coordinate wrt X */ ir_rvalue *dPdy; /**< Partial derivative of coordinate wrt Y */ @@ -1482,6 +1840,8 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + bool is_lvalue() const { return val->is_lvalue() && !mask.has_duplicates; @@ -1549,6 +1909,8 @@ public: return this; } + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + /** * Get the variable that is ultimately referenced by an r-value */ @@ -1607,6 +1969,8 @@ public: return this; } + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + /** * Get the variable that is ultimately referenced by an r-value */ @@ -1650,6 +2014,11 @@ public: virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL); + virtual ir_dereference_record *as_dereference_record() + { + return this; + } + /** * Get the variable that is ultimately referenced by an r-value */ @@ -1693,10 +2062,10 @@ union ir_constant_data { class ir_constant : public ir_rvalue { public: ir_constant(const struct glsl_type *type, const ir_constant_data *data); - ir_constant(bool b); - ir_constant(unsigned int u); - ir_constant(int i); - ir_constant(float f); + ir_constant(bool b, unsigned vector_elements=1); + ir_constant(unsigned int u, unsigned vector_elements=1); + ir_constant(int i, unsigned vector_elements=1); + ir_constant(float f, unsigned vector_elements=1); /** * Construct an ir_constant from a list of ir_constant values @@ -1736,6 +2105,8 @@ public: virtual ir_visitor_status accept(ir_hierarchical_visitor *); + virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset); + /** * Get a particular component of a constant as a specific type * @@ -1787,6 +2158,12 @@ public: */ bool has_value(const ir_constant *) const; + /** + * Return true if this ir_constant represents the given value. + * + * For vectors, this checks that each component is the given value. + */ + virtual bool is_value(float f, int i) const; virtual bool is_zero() const; virtual bool is_one() const; virtual bool is_negative_one() const; @@ -1839,9 +2216,77 @@ public: }; +class ir_typedecl_statement : public ir_instruction { +public: + ir_typedecl_statement(const glsl_type* type_decl) + { + this->ir_type = ir_type_typedecl; + this->type_decl = type_decl; + } + + virtual ir_typedecl_statement *clone(void *mem_ctx, struct hash_table *) const; + + virtual void accept(ir_visitor *v) + { + v->visit(this); + } + + virtual ir_visitor_status accept(ir_hierarchical_visitor *); + + const glsl_type* type_decl; +}; + + /*@}*/ +/** + * IR instruction to emit a vertex in a geometry shader. + */ +class ir_emit_vertex : public ir_instruction { +public: + ir_emit_vertex() + { + ir_type = ir_type_emit_vertex; + } + + virtual void accept(ir_visitor *v) + { + v->visit(this); + } + + virtual ir_emit_vertex *clone(void *mem_ctx, struct hash_table *) const + { + return new(mem_ctx) ir_emit_vertex(); + } + + virtual ir_visitor_status accept(ir_hierarchical_visitor *); +}; + +/** + * IR instruction to complete the current primitive and start a new one in a + * geometry shader. + */ +class ir_end_primitive : public ir_instruction { +public: + ir_end_primitive() + { + ir_type = ir_type_end_primitive; + } + + virtual void accept(ir_visitor *v) + { + v->visit(this); + } + + virtual ir_end_primitive *clone(void *mem_ctx, struct hash_table *) const + { + return new(mem_ctx) ir_end_primitive(); + } + + virtual ir_visitor_status accept(ir_hierarchical_visitor *); +}; + /** * Apply a visitor to each IR node in a list */ @@ -1893,10 +2338,17 @@ _mesa_glsl_initialize_variables(exec_list *instructions, struct _mesa_glsl_parse_state *state); extern void -_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state); +_mesa_glsl_initialize_builtin_functions(); + +extern ir_function_signature * +_mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state, + const char *name, exec_list *actual_parameters); + +extern gl_shader * +_mesa_glsl_get_builtin_function_shader(void); extern void -_mesa_glsl_release_functions(void); +_mesa_glsl_release_builtin_functions(void); extern void reparent_ir(exec_list *list, void *mem_ctx); @@ -1909,7 +2361,7 @@ import_prototypes(const exec_list *source, exec_list *dest, extern void do_set_program_inouts(exec_list *instructions, struct gl_program *prog, - bool is_fragment_shader); + gl_shader_stage shader_stage); extern glsl_precision precision_from_ir (ir_instruction* ir); @@ -1925,4 +2377,20 @@ extern char * prototype_string(const glsl_type *return_type, const char *name, exec_list *parameters); +const char * +mode_string(const ir_variable *var); + +extern "C" { +#endif /* __cplusplus */ + +extern void _mesa_print_ir(struct exec_list *instructions, + struct _mesa_glsl_parse_state *state); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +unsigned +vertices_per_prim(GLenum prim); + #endif /* IR_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp index 18cbb033f..5076aa514 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_basic_block.cpp @@ -43,8 +43,8 @@ static ir_if* as_if_skip_discard (ir_instruction* ir) bool only_discards = true; int count = 0; - foreach_iter(exec_list_iterator, iter, irif->then_instructions) { - ir_instruction *iir = (ir_instruction *)iter.get(); + foreach_list(node, &irif->then_instructions) { + ir_instruction *iir = (ir_instruction *)node; if (!iir->as_discard()) { only_discards = false; @@ -85,8 +85,8 @@ void call_for_basic_blocks(exec_list *instructions, ir_instruction *leader = NULL; ir_instruction *last = NULL; - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_if *ir_if; ir_loop *ir_loop; ir_function *ir_function; @@ -104,7 +104,7 @@ void call_for_basic_blocks(exec_list *instructions, callback(leader, ir, data); leader = NULL; call_for_basic_blocks(&ir_loop->body_instructions, callback, data); - } else if (ir->as_return() || ir->as_call()) { + } else if (ir->as_jump() || ir->as_call()) { callback(leader, ir, data); leader = NULL; } else if ((ir_function = ir->as_function())) { @@ -117,10 +117,8 @@ void call_for_basic_blocks(exec_list *instructions, * and the body of main(). Perhaps those instructions ought * to live inside of main(). */ - foreach_iter(exec_list_iterator, fun_iter, *ir_function) { - ir_function_signature *ir_sig; - - ir_sig = (ir_function_signature *)fun_iter.get(); + foreach_list(func_node, &ir_function->signatures) { + ir_function_signature *ir_sig = (ir_function_signature *) func_node; call_for_basic_blocks(&ir_sig->body, callback, data); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp index 2fea550ae..83812d1be 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_builder.cpp @@ -46,13 +46,14 @@ ir_factory::make_temp(const glsl_type *type, const char *name) } ir_assignment * -assign(deref lhs, operand rhs, int writemask) +assign(deref lhs, operand rhs, operand condition, int writemask) { void *mem_ctx = ralloc_parent(lhs.val); ir_assignment *assign = new(mem_ctx) ir_assignment(lhs.val, rhs.val, - NULL, writemask); + condition.val, + writemask); return assign; } @@ -63,6 +64,25 @@ assign(deref lhs, operand rhs) return assign(lhs, rhs, (1 << lhs.val->type->vector_elements) - 1); } +ir_assignment * +assign(deref lhs, operand rhs, int writemask) +{ + return assign(lhs, rhs, (ir_rvalue *) NULL, writemask); +} + +ir_assignment * +assign(deref lhs, operand rhs, operand condition) +{ + return assign(lhs, rhs, condition, (1 << lhs.val->type->vector_elements) - 1); +} + +ir_return * +ret(operand retval) +{ + void *mem_ctx = ralloc_parent(retval.val); + return new(mem_ctx) ir_return(retval.val); +} + ir_swizzle * swizzle(operand a, int swizzle, int components) { @@ -77,7 +97,7 @@ swizzle(operand a, int swizzle, int components) } ir_swizzle * -swizzle_for_size(operand a, int components) +swizzle_for_size(operand a, unsigned components) { void *mem_ctx = ralloc_parent(a.val); @@ -173,6 +193,14 @@ expr(ir_expression_operation op, operand a, operand b) return new(mem_ctx) ir_expression(op, a.val, b.val); } +ir_expression * +expr(ir_expression_operation op, operand a, operand b, operand c) +{ + void *mem_ctx = ralloc_parent(a.val); + + return new(mem_ctx) ir_expression(op, a.val, b.val, c.val); +} + ir_expression *add(operand a, operand b) { return expr(ir_binop_add, a, b); @@ -183,16 +211,68 @@ ir_expression *sub(operand a, operand b) return expr(ir_binop_sub, a, b); } +ir_expression *min2(operand a, operand b) +{ + return expr(ir_binop_min, a, b); +} + +ir_expression *max2(operand a, operand b) +{ + return expr(ir_binop_max, a, b); +} + ir_expression *mul(operand a, operand b) { return expr(ir_binop_mul, a, b); } +ir_expression *imul_high(operand a, operand b) +{ + return expr(ir_binop_imul_high, a, b); +} + +ir_expression *div(operand a, operand b) +{ + return expr(ir_binop_div, a, b); +} + +ir_expression *carry(operand a, operand b) +{ + return expr(ir_binop_carry, a, b); +} + +ir_expression *borrow(operand a, operand b) +{ + return expr(ir_binop_borrow, a, b); +} + +ir_expression *round_even(operand a) +{ + return expr(ir_unop_round_even, a); +} + ir_expression *dot(operand a, operand b) { return expr(ir_binop_dot, a, b); } +/* dot for vectors, mul for scalars */ +ir_expression *dotlike(operand a, operand b) +{ + assert(a.val->type == b.val->type); + + if (a.val->type->vector_elements == 1) + return expr(ir_binop_mul, a, b); + + return expr(ir_binop_dot, a, b); +} + +ir_expression* +clamp(operand a, operand b, operand c) +{ + return expr(ir_triop_clamp, a, b, c); +} + ir_expression * saturate(operand a) { @@ -203,4 +283,281 @@ saturate(operand a) new(mem_ctx) ir_constant(0.0f)); } +ir_expression * +abs(operand a) +{ + return expr(ir_unop_abs, a); +} + +ir_expression * +neg(operand a) +{ + return expr(ir_unop_neg, a); +} + +ir_expression * +sin(operand a) +{ + return expr(ir_unop_sin, a); +} + +ir_expression * +cos(operand a) +{ + return expr(ir_unop_cos, a); +} + +ir_expression * +exp(operand a) +{ + return expr(ir_unop_exp, a); +} + +ir_expression * +rsq(operand a) +{ + return expr(ir_unop_rsq, a); +} + +ir_expression * +sqrt(operand a) +{ + return expr(ir_unop_sqrt, a); +} + +ir_expression * +log(operand a) +{ + return expr(ir_unop_log, a); +} + +ir_expression * +sign(operand a) +{ + return expr(ir_unop_sign, a); +} + +ir_expression* +equal(operand a, operand b) +{ + return expr(ir_binop_equal, a, b); +} + +ir_expression* +nequal(operand a, operand b) +{ + return expr(ir_binop_nequal, a, b); +} + +ir_expression* +less(operand a, operand b) +{ + return expr(ir_binop_less, a, b); +} + +ir_expression* +greater(operand a, operand b) +{ + return expr(ir_binop_greater, a, b); +} + +ir_expression* +lequal(operand a, operand b) +{ + return expr(ir_binop_lequal, a, b); +} + +ir_expression* +gequal(operand a, operand b) +{ + return expr(ir_binop_gequal, a, b); +} + +ir_expression* +logic_not(operand a) +{ + return expr(ir_unop_logic_not, a); +} + +ir_expression* +logic_and(operand a, operand b) +{ + return expr(ir_binop_logic_and, a, b); +} + +ir_expression* +logic_or(operand a, operand b) +{ + return expr(ir_binop_logic_or, a, b); +} + +ir_expression* +bit_not(operand a) +{ + return expr(ir_unop_bit_not, a); +} + +ir_expression* +bit_and(operand a, operand b) +{ + return expr(ir_binop_bit_and, a, b); +} + +ir_expression* +bit_or(operand a, operand b) +{ + return expr(ir_binop_bit_or, a, b); +} + +ir_expression* +lshift(operand a, operand b) +{ + return expr(ir_binop_lshift, a, b); +} + +ir_expression* +rshift(operand a, operand b) +{ + return expr(ir_binop_rshift, a, b); +} + +ir_expression* +f2i(operand a) +{ + return expr(ir_unop_f2i, a); +} + +ir_expression* +bitcast_f2i(operand a) +{ + return expr(ir_unop_bitcast_f2i, a); +} + +ir_expression* +i2f(operand a) +{ + return expr(ir_unop_i2f, a); +} + +ir_expression* +bitcast_i2f(operand a) +{ + return expr(ir_unop_bitcast_i2f, a); +} + +ir_expression* +i2u(operand a) +{ + return expr(ir_unop_i2u, a); +} + +ir_expression* +u2i(operand a) +{ + return expr(ir_unop_u2i, a); +} + +ir_expression* +f2u(operand a) +{ + return expr(ir_unop_f2u, a); +} + +ir_expression* +bitcast_f2u(operand a) +{ + return expr(ir_unop_bitcast_f2u, a); +} + +ir_expression* +u2f(operand a) +{ + return expr(ir_unop_u2f, a); +} + +ir_expression* +bitcast_u2f(operand a) +{ + return expr(ir_unop_bitcast_u2f, a); +} + +ir_expression* +i2b(operand a) +{ + return expr(ir_unop_i2b, a); +} + +ir_expression* +b2i(operand a) +{ + return expr(ir_unop_b2i, a); +} + +ir_expression * +f2b(operand a) +{ + return expr(ir_unop_f2b, a); +} + +ir_expression * +b2f(operand a) +{ + return expr(ir_unop_b2f, a); +} + +ir_expression * +fma(operand a, operand b, operand c) +{ + return expr(ir_triop_fma, a, b, c); +} + +ir_expression * +lrp(operand x, operand y, operand a) +{ + return expr(ir_triop_lrp, x, y, a); +} + +ir_expression * +csel(operand a, operand b, operand c) +{ + return expr(ir_triop_csel, a, b, c); +} + +ir_expression * +bitfield_insert(operand a, operand b, operand c, operand d) +{ + void *mem_ctx = ralloc_parent(a.val); + return new(mem_ctx) ir_expression(ir_quadop_bitfield_insert, + a.val->type, a.val, b.val, c.val, d.val); +} + +ir_if* +if_tree(operand condition, + ir_instruction *then_branch) +{ + assert(then_branch != NULL); + + void *mem_ctx = ralloc_parent(condition.val); + + ir_if *result = new(mem_ctx) ir_if(condition.val); + result->then_instructions.push_tail(then_branch); + return result; +} + +ir_if* +if_tree(operand condition, + ir_instruction *then_branch, + ir_instruction *else_branch) +{ + assert(then_branch != NULL); + assert(else_branch != NULL); + + void *mem_ctx = ralloc_parent(condition.val); + + ir_if *result = new(mem_ctx) ir_if(condition.val); + result->then_instructions.push_tail(then_branch); + result->else_instructions.push_tail(else_branch); + return result; +} + } /* namespace ir_builder */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_builder.h b/3rdparty/glsl-optimizer/src/glsl/ir_builder.h index 7a0a196ee..f00e6f3b3 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_builder.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_builder.h @@ -25,6 +25,15 @@ namespace ir_builder { +#ifndef WRITEMASK_X +enum writemask { + WRITEMASK_X = 0x1, + WRITEMASK_Y = 0x2, + WRITEMASK_Z = 0x4, + WRITEMASK_W = 0x8, +}; +#endif + /** * This little class exists to let the helper expression generators * take either an ir_rvalue * or an ir_variable * to be automatically @@ -73,28 +82,121 @@ public: class ir_factory { public: + ir_factory(exec_list *instructions = NULL, void *mem_ctx = NULL) + : instructions(instructions), + mem_ctx(mem_ctx) + { + return; + } + void emit(ir_instruction *ir); ir_variable *make_temp(const glsl_type *type, const char *name); + ir_constant* + constant(float f) + { + return new(mem_ctx) ir_constant(f); + } + + ir_constant* + constant(int i) + { + return new(mem_ctx) ir_constant(i); + } + + ir_constant* + constant(unsigned u) + { + return new(mem_ctx) ir_constant(u); + } + + ir_constant* + constant(bool b) + { + return new(mem_ctx) ir_constant(b); + } + exec_list *instructions; void *mem_ctx; }; ir_assignment *assign(deref lhs, operand rhs); ir_assignment *assign(deref lhs, operand rhs, int writemask); +ir_assignment *assign(deref lhs, operand rhs, operand condition); +ir_assignment *assign(deref lhs, operand rhs, operand condition, int writemask); + +ir_return *ret(operand retval); ir_expression *expr(ir_expression_operation op, operand a); ir_expression *expr(ir_expression_operation op, operand a, operand b); +ir_expression *expr(ir_expression_operation op, operand a, operand b, operand c); ir_expression *add(operand a, operand b); ir_expression *sub(operand a, operand b); ir_expression *mul(operand a, operand b); +ir_expression *imul_high(operand a, operand b); +ir_expression *div(operand a, operand b); +ir_expression *carry(operand a, operand b); +ir_expression *borrow(operand a, operand b); +ir_expression *round_even(operand a); ir_expression *dot(operand a, operand b); +ir_expression *dotlike(operand a, operand b); +ir_expression *clamp(operand a, operand b, operand c); ir_expression *saturate(operand a); +ir_expression *abs(operand a); +ir_expression *neg(operand a); +ir_expression *sin(operand a); +ir_expression *cos(operand a); +ir_expression *exp(operand a); +ir_expression *rsq(operand a); +ir_expression *sqrt(operand a); +ir_expression *log(operand a); +ir_expression *sign(operand a); +ir_expression *equal(operand a, operand b); +ir_expression *nequal(operand a, operand b); +ir_expression *less(operand a, operand b); +ir_expression *greater(operand a, operand b); +ir_expression *lequal(operand a, operand b); +ir_expression *gequal(operand a, operand b); + +ir_expression *logic_not(operand a); +ir_expression *logic_and(operand a, operand b); +ir_expression *logic_or(operand a, operand b); + +ir_expression *bit_not(operand a); +ir_expression *bit_or(operand a, operand b); +ir_expression *bit_and(operand a, operand b); +ir_expression *lshift(operand a, operand b); +ir_expression *rshift(operand a, operand b); + +ir_expression *f2i(operand a); +ir_expression *bitcast_f2i(operand a); +ir_expression *i2f(operand a); +ir_expression *bitcast_i2f(operand a); +ir_expression *f2u(operand a); +ir_expression *bitcast_f2u(operand a); +ir_expression *u2f(operand a); +ir_expression *bitcast_u2f(operand a); +ir_expression *i2u(operand a); +ir_expression *u2i(operand a); +ir_expression *b2i(operand a); +ir_expression *i2b(operand a); +ir_expression *f2b(operand a); +ir_expression *b2f(operand a); + +ir_expression *min2(operand a, operand b); +ir_expression *max2(operand a, operand b); + +ir_expression *fma(operand a, operand b, operand c); +ir_expression *lrp(operand x, operand y, operand a); +ir_expression *csel(operand a, operand b, operand c); +ir_expression *bitfield_insert(operand a, operand b, operand c, operand d); + +ir_swizzle *swizzle(operand a, int swizzle, int components); /** * Swizzle away later components, but preserve the ordering. */ -ir_swizzle *swizzle_for_size(operand a, int components); +ir_swizzle *swizzle_for_size(operand a, unsigned components); ir_swizzle *swizzle_xxxx(operand a); ir_swizzle *swizzle_yyyy(operand a); @@ -108,4 +210,10 @@ ir_swizzle *swizzle_xy(operand a); ir_swizzle *swizzle_xyz(operand a); ir_swizzle *swizzle_xyzw(operand a); +ir_if *if_tree(operand condition, + ir_instruction *then_branch); +ir_if *if_tree(operand condition, + ir_instruction *then_branch, + ir_instruction *else_branch); + } /* namespace ir_builder */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp index 9f791c834..551196e75 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_clone.cpp @@ -36,32 +36,24 @@ ir_rvalue::clone(void *mem_ctx, struct hash_table *ht) const /** * Duplicate an IR variable - * - * \note - * This will probably be made \c virtual and moved to the base class - * eventually. */ ir_variable * ir_variable::clone(void *mem_ctx, struct hash_table *ht) const { ir_variable *var = new(mem_ctx) ir_variable(this->type, this->name, - (ir_variable_mode) this->mode, (glsl_precision)this->precision); + (ir_variable_mode) this->data.mode, (glsl_precision)this->data.precision); + + var->data.max_array_access = this->data.max_array_access; + if (this->is_interface_instance()) { + var->max_ifc_array_access = + rzalloc_array(var, unsigned, this->interface_type->length); + memcpy(var->max_ifc_array_access, this->max_ifc_array_access, + this->interface_type->length * sizeof(unsigned)); + } + + memcpy(&var->data, &this->data, sizeof(var->data)); - var->max_array_access = this->max_array_access; - var->read_only = this->read_only; - var->centroid = this->centroid; - var->invariant = this->invariant; - var->interpolation = this->interpolation; - var->location = this->location; - var->index = this->index; - var->uniform_block = this->uniform_block; var->warn_extension = this->warn_extension; - var->origin_upper_left = this->origin_upper_left; - var->pixel_center_integer = this->pixel_center_integer; - var->explicit_location = this->explicit_location; - var->explicit_index = this->explicit_index; - var->has_initializer = this->has_initializer; - var->depth_layout = this->depth_layout; var->num_state_slots = this->num_state_slots; if (this->state_slots) { @@ -81,6 +73,8 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const var->constant_initializer = this->constant_initializer->clone(mem_ctx, ht); + var->interface_type = this->interface_type; + if (ht) { hash_table_insert(ht, var, (void *)const_cast(this)); } @@ -131,13 +125,13 @@ ir_if::clone(void *mem_ctx, struct hash_table *ht) const { ir_if *new_if = new(mem_ctx) ir_if(this->condition->clone(mem_ctx, ht)); - foreach_iter(exec_list_iterator, iter, this->then_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->then_instructions) { + ir_instruction *ir = (ir_instruction *) n; new_if->then_instructions.push_tail(ir->clone(mem_ctx, ht)); } - foreach_iter(exec_list_iterator, iter, this->else_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->else_instructions) { + ir_instruction *ir = (ir_instruction *) n; new_if->else_instructions.push_tail(ir->clone(mem_ctx, ht)); } @@ -149,27 +143,11 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const { ir_loop *new_loop = new(mem_ctx) ir_loop(); - if (this->from) - new_loop->from = this->from->clone(mem_ctx, ht); - if (this->to) - new_loop->to = this->to->clone(mem_ctx, ht); - if (this->increment) - new_loop->increment = this->increment->clone(mem_ctx, ht); - - if (ht) { - new_loop->counter = (ir_variable *)hash_table_find(ht, this->counter); - if (!new_loop->counter) - new_loop->counter = this->counter; - } else { - new_loop->counter = this->counter; - } - - foreach_iter(exec_list_iterator, iter, this->body_instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->body_instructions) { + ir_instruction *ir = (ir_instruction *) n; new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht)); } - new_loop->cmp = this->cmp; return new_loop; } @@ -182,8 +160,8 @@ ir_call::clone(void *mem_ctx, struct hash_table *ht) const exec_list new_parameters; - foreach_iter(exec_list_iterator, iter, this->actual_parameters) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &this->actual_parameters) { + ir_instruction *ir = (ir_instruction *) n; new_parameters.push_tail(ir->clone(mem_ctx, ht)); } @@ -255,6 +233,8 @@ ir_texture::clone(void *mem_ctx, struct hash_table *ht) const switch (this->op) { case ir_tex: + case ir_lod: + case ir_query_levels: break; case ir_txb: new_tex->lod_info.bias = this->lod_info.bias->clone(mem_ctx, ht); @@ -264,10 +244,16 @@ ir_texture::clone(void *mem_ctx, struct hash_table *ht) const case ir_txs: new_tex->lod_info.lod = this->lod_info.lod->clone(mem_ctx, ht); break; + case ir_txf_ms: + new_tex->lod_info.sample_index = this->lod_info.sample_index->clone(mem_ctx, ht); + break; case ir_txd: new_tex->lod_info.grad.dPdx = this->lod_info.grad.dPdx->clone(mem_ctx, ht); new_tex->lod_info.grad.dPdy = this->lod_info.grad.dPdy->clone(mem_ctx, ht); break; + case ir_tg4: + new_tex->lod_info.component = this->lod_info.component->clone(mem_ctx, ht); + break; } return new_tex; @@ -333,7 +319,7 @@ ir_function_signature::clone_prototype(void *mem_ctx, struct hash_table *ht) con new(mem_ctx) ir_function_signature(this->return_type, this->precision); copy->is_defined = false; - copy->is_builtin = this->is_builtin; + copy->builtin_avail = this->builtin_avail; copy->origin = this; /* Clone the parameter list, but NOT the body. @@ -388,10 +374,16 @@ ir_constant::clone(void *mem_ctx, struct hash_table *ht) const return c; } - default: + case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_ATOMIC_UINT: + case GLSL_TYPE_VOID: + case GLSL_TYPE_ERROR: + case GLSL_TYPE_INTERFACE: assert(!"Should not get here."); - return NULL; + break; } + + return NULL; } @@ -401,6 +393,12 @@ ir_precision_statement::clone(void *mem_ctx, struct hash_table *ht) const return new(mem_ctx) ir_precision_statement(this->precision_statement); } +ir_typedecl_statement * +ir_typedecl_statement::clone(void *mem_ctx, struct hash_table *ht) const +{ + return new(mem_ctx) ir_typedecl_statement(this->type_decl); +} + class fixup_ir_call_visitor : public ir_hierarchical_visitor { diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp index 3093fe4e6..b0fb1b4e0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_constant_expression.cpp @@ -40,24 +40,25 @@ #include "glsl_types.h" #include "program/hash_table.h" -/* Using C99 rounding functions for roundToEven() implementation is - * difficult, because round(), rint, and nearbyint() are affected by - * fesetenv(), which the application may have done for its own - * purposes. Mesa's IROUND macro is close to what we want, but it - * rounds away from 0 on n + 0.5. - */ -static int -round_to_even(float val) +#if defined(_MSC_VER) && (_MSC_VER < 1800) +static int isnormal(double x) { - int rounded = IROUND(val); - - if (val - floor(val) == 0.5) { - if (rounded % 2 != 0) - rounded += val > 0 ? -1 : 1; - } - - return rounded; + return _fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN; } +#elif defined(__SUNPRO_CC) +#include +static int isnormal(double x) +{ + return fpclass(x) == FP_NORMAL; +} +#endif + +#if defined(_MSC_VER) +static double copysign(double x, double y) +{ + return _copysign(x, y); +} +#endif static float dot(ir_constant *op0, ir_constant *op1) @@ -94,6 +95,297 @@ bitcast_f2u(float f) return u; } +/** + * Evaluate one component of a floating-point 4x8 unpacking function. + */ +typedef uint8_t +(*pack_1x8_func_t)(float); + +/** + * Evaluate one component of a floating-point 2x16 unpacking function. + */ +typedef uint16_t +(*pack_1x16_func_t)(float); + +/** + * Evaluate one component of a floating-point 4x8 unpacking function. + */ +typedef float +(*unpack_1x8_func_t)(uint8_t); + +/** + * Evaluate one component of a floating-point 2x16 unpacking function. + */ +typedef float +(*unpack_1x16_func_t)(uint16_t); + +/** + * Evaluate a 2x16 floating-point packing function. + */ +static uint32_t +pack_2x16(pack_1x16_func_t pack_1x16, + float x, float y) +{ + /* From section 8.4 of the GLSL ES 3.00 spec: + * + * packSnorm2x16 + * ------------- + * The first component of the vector will be written to the least + * significant bits of the output; the last component will be written to + * the most significant bits. + * + * The specifications for the other packing functions contain similar + * language. + */ + uint32_t u = 0; + u |= ((uint32_t) pack_1x16(x) << 0); + u |= ((uint32_t) pack_1x16(y) << 16); + return u; +} + +/** + * Evaluate a 4x8 floating-point packing function. + */ +static uint32_t +pack_4x8(pack_1x8_func_t pack_1x8, + float x, float y, float z, float w) +{ + /* From section 8.4 of the GLSL 4.30 spec: + * + * packSnorm4x8 + * ------------ + * The first component of the vector will be written to the least + * significant bits of the output; the last component will be written to + * the most significant bits. + * + * The specifications for the other packing functions contain similar + * language. + */ + uint32_t u = 0; + u |= ((uint32_t) pack_1x8(x) << 0); + u |= ((uint32_t) pack_1x8(y) << 8); + u |= ((uint32_t) pack_1x8(z) << 16); + u |= ((uint32_t) pack_1x8(w) << 24); + return u; +} + +/** + * Evaluate a 2x16 floating-point unpacking function. + */ +static void +unpack_2x16(unpack_1x16_func_t unpack_1x16, + uint32_t u, + float *x, float *y) +{ + /* From section 8.4 of the GLSL ES 3.00 spec: + * + * unpackSnorm2x16 + * --------------- + * The first component of the returned vector will be extracted from + * the least significant bits of the input; the last component will be + * extracted from the most significant bits. + * + * The specifications for the other unpacking functions contain similar + * language. + */ + *x = unpack_1x16((uint16_t) (u & 0xffff)); + *y = unpack_1x16((uint16_t) (u >> 16)); +} + +/** + * Evaluate a 4x8 floating-point unpacking function. + */ +static void +unpack_4x8(unpack_1x8_func_t unpack_1x8, uint32_t u, + float *x, float *y, float *z, float *w) +{ + /* From section 8.4 of the GLSL 4.30 spec: + * + * unpackSnorm4x8 + * -------------- + * The first component of the returned vector will be extracted from + * the least significant bits of the input; the last component will be + * extracted from the most significant bits. + * + * The specifications for the other unpacking functions contain similar + * language. + */ + *x = unpack_1x8((uint8_t) (u & 0xff)); + *y = unpack_1x8((uint8_t) (u >> 8)); + *z = unpack_1x8((uint8_t) (u >> 16)); + *w = unpack_1x8((uint8_t) (u >> 24)); +} + +/** + * Evaluate one component of packSnorm4x8. + */ +static uint8_t +pack_snorm_1x8(float x) +{ + /* From section 8.4 of the GLSL 4.30 spec: + * + * packSnorm4x8 + * ------------ + * The conversion for component c of v to fixed point is done as + * follows: + * + * packSnorm4x8: round(clamp(c, -1, +1) * 127.0) + * + * We must first cast the float to an int, because casting a negative + * float to a uint is undefined. + */ + return (uint8_t) (int8_t) + _mesa_round_to_even(CLAMP(x, -1.0f, +1.0f) * 127.0f); +} + +/** + * Evaluate one component of packSnorm2x16. + */ +static uint16_t +pack_snorm_1x16(float x) +{ + /* From section 8.4 of the GLSL ES 3.00 spec: + * + * packSnorm2x16 + * ------------- + * The conversion for component c of v to fixed point is done as + * follows: + * + * packSnorm2x16: round(clamp(c, -1, +1) * 32767.0) + * + * We must first cast the float to an int, because casting a negative + * float to a uint is undefined. + */ + return (uint16_t) (int16_t) + _mesa_round_to_even(CLAMP(x, -1.0f, +1.0f) * 32767.0f); +} + +/** + * Evaluate one component of unpackSnorm4x8. + */ +static float +unpack_snorm_1x8(uint8_t u) +{ + /* From section 8.4 of the GLSL 4.30 spec: + * + * unpackSnorm4x8 + * -------------- + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackSnorm4x8: clamp(f / 127.0, -1, +1) + */ + return CLAMP((int8_t) u / 127.0f, -1.0f, +1.0f); +} + +/** + * Evaluate one component of unpackSnorm2x16. + */ +static float +unpack_snorm_1x16(uint16_t u) +{ + /* From section 8.4 of the GLSL ES 3.00 spec: + * + * unpackSnorm2x16 + * --------------- + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackSnorm2x16: clamp(f / 32767.0, -1, +1) + */ + return CLAMP((int16_t) u / 32767.0f, -1.0f, +1.0f); +} + +/** + * Evaluate one component packUnorm4x8. + */ +static uint8_t +pack_unorm_1x8(float x) +{ + /* From section 8.4 of the GLSL 4.30 spec: + * + * packUnorm4x8 + * ------------ + * The conversion for component c of v to fixed point is done as + * follows: + * + * packUnorm4x8: round(clamp(c, 0, +1) * 255.0) + */ + return (uint8_t) _mesa_round_to_even(CLAMP(x, 0.0f, 1.0f) * 255.0f); +} + +/** + * Evaluate one component packUnorm2x16. + */ +static uint16_t +pack_unorm_1x16(float x) +{ + /* From section 8.4 of the GLSL ES 3.00 spec: + * + * packUnorm2x16 + * ------------- + * The conversion for component c of v to fixed point is done as + * follows: + * + * packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) + */ + return (uint16_t) _mesa_round_to_even(CLAMP(x, 0.0f, 1.0f) * 65535.0f); +} + +/** + * Evaluate one component of unpackUnorm4x8. + */ +static float +unpack_unorm_1x8(uint8_t u) +{ + /* From section 8.4 of the GLSL 4.30 spec: + * + * unpackUnorm4x8 + * -------------- + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackUnorm4x8: f / 255.0 + */ + return (float) u / 255.0f; +} + +/** + * Evaluate one component of unpackUnorm2x16. + */ +static float +unpack_unorm_1x16(uint16_t u) +{ + /* From section 8.4 of the GLSL ES 3.00 spec: + * + * unpackUnorm2x16 + * --------------- + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackUnorm2x16: f / 65535.0 + */ + return (float) u / 65535.0f; +} + +/** + * Evaluate one component of packHalf2x16. + */ +static uint16_t +pack_half_1x16(float x) +{ + return _mesa_float_to_half(x); +} + +/** + * Evaluate one component of unpackHalf2x16. + */ +static float +unpack_half_1x16(uint16_t u) +{ + return _mesa_half_to_float(u); +} + ir_constant * ir_rvalue::constant_expression_value(struct hash_table *variable_context) { @@ -119,9 +411,19 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) } if (op[1] != NULL) - assert(op[0]->type->base_type == op[1]->type->base_type || - this->operation == ir_binop_lshift || - this->operation == ir_binop_rshift); + switch (this->operation) { + case ir_binop_lshift: + case ir_binop_rshift: + case ir_binop_ldexp: + case ir_binop_vector_extract: + case ir_triop_csel: + case ir_triop_bitfield_extract: + break; + + default: + assert(op[0]->type->base_type == op[1]->type->base_type); + break; + } bool op0_scalar = op[0]->type->is_scalar(); bool op1_scalar = op[1] != NULL && op[1]->type->is_scalar(); @@ -279,7 +581,7 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) case ir_unop_round_even: assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); for (unsigned c = 0; c < op[0]->type->components(); c++) { - data.f[c] = (float)round_to_even(op[0]->value.f[c]); + data.f[c] = (float)_mesa_round_to_even(op[0]->value.f[c]); } break; @@ -297,6 +599,23 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) } break; + case ir_unop_normalize: + { + assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); + float mag2 = 0.0f; + for (unsigned c = 0; c < op[0]->type->components(); c++) { + mag2 += op[0]->value.f[c] * op[0]->value.f[c]; + } + // how would one express "vec3(nan)" in GLSL? no idea, so let's just not handle it + if (mag2 == 0.0f) + return NULL; + float mag = sqrtf(mag2); + for (unsigned c = 0; c < op[0]->type->components(); c++) { + data.f[c] = op[0]->value.f[c] / mag; + } + } + break; + case ir_unop_fract: for (unsigned c = 0; c < op[0]->type->components(); c++) { switch (this->type->base_type) { @@ -459,6 +778,70 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) } break; + case ir_unop_pack_snorm_2x16: + assert(op[0]->type == glsl_type::vec2_type); + data.u[0] = pack_2x16(pack_snorm_1x16, + op[0]->value.f[0], + op[0]->value.f[1]); + break; + case ir_unop_pack_snorm_4x8: + assert(op[0]->type == glsl_type::vec4_type); + data.u[0] = pack_4x8(pack_snorm_1x8, + op[0]->value.f[0], + op[0]->value.f[1], + op[0]->value.f[2], + op[0]->value.f[3]); + break; + case ir_unop_unpack_snorm_2x16: + assert(op[0]->type == glsl_type::uint_type); + unpack_2x16(unpack_snorm_1x16, + op[0]->value.u[0], + &data.f[0], &data.f[1]); + break; + case ir_unop_unpack_snorm_4x8: + assert(op[0]->type == glsl_type::uint_type); + unpack_4x8(unpack_snorm_1x8, + op[0]->value.u[0], + &data.f[0], &data.f[1], &data.f[2], &data.f[3]); + break; + case ir_unop_pack_unorm_2x16: + assert(op[0]->type == glsl_type::vec2_type); + data.u[0] = pack_2x16(pack_unorm_1x16, + op[0]->value.f[0], + op[0]->value.f[1]); + break; + case ir_unop_pack_unorm_4x8: + assert(op[0]->type == glsl_type::vec4_type); + data.u[0] = pack_4x8(pack_unorm_1x8, + op[0]->value.f[0], + op[0]->value.f[1], + op[0]->value.f[2], + op[0]->value.f[3]); + break; + case ir_unop_unpack_unorm_2x16: + assert(op[0]->type == glsl_type::uint_type); + unpack_2x16(unpack_unorm_1x16, + op[0]->value.u[0], + &data.f[0], &data.f[1]); + break; + case ir_unop_unpack_unorm_4x8: + assert(op[0]->type == glsl_type::uint_type); + unpack_4x8(unpack_unorm_1x8, + op[0]->value.u[0], + &data.f[0], &data.f[1], &data.f[2], &data.f[3]); + break; + case ir_unop_pack_half_2x16: + assert(op[0]->type == glsl_type::vec2_type); + data.u[0] = pack_2x16(pack_half_1x16, + op[0]->value.f[0], + op[0]->value.f[1]); + break; + case ir_unop_unpack_half_2x16: + assert(op[0]->type == glsl_type::uint_type); + unpack_2x16(unpack_half_1x16, + op[0]->value.u[0], + &data.f[0], &data.f[1]); + break; case ir_binop_pow: assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); for (unsigned c = 0; c < op[0]->type->components(); c++) { @@ -894,6 +1277,29 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) } break; + case ir_binop_vector_extract: { + const int c = CLAMP(op[1]->value.i[0], 0, + (int) op[0]->type->vector_elements - 1); + + switch (op[0]->type->base_type) { + case GLSL_TYPE_UINT: + data.u[0] = op[0]->value.u[c]; + break; + case GLSL_TYPE_INT: + data.i[0] = op[0]->value.i[c]; + break; + case GLSL_TYPE_FLOAT: + data.f[0] = op[0]->value.f[c]; + break; + case GLSL_TYPE_BOOL: + data.b[0] = op[0]->value.b[c]; + break; + default: + assert(0); + } + break; + } + case ir_binop_bit_xor: for (unsigned c = 0, c0 = 0, c1 = 0; c < components; @@ -912,6 +1318,211 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) } break; + case ir_unop_bitfield_reverse: + /* http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious */ + for (unsigned c = 0; c < components; c++) { + unsigned int v = op[0]->value.u[c]; // input bits to be reversed + unsigned int r = v; // r will be reversed bits of v; first get LSB of v + int s = sizeof(v) * CHAR_BIT - 1; // extra shift needed at end + + for (v >>= 1; v; v >>= 1) { + r <<= 1; + r |= v & 1; + s--; + } + r <<= s; // shift when v's highest bits are zero + + data.u[c] = r; + } + break; + + case ir_unop_bit_count: + for (unsigned c = 0; c < components; c++) { + unsigned count = 0; + unsigned v = op[0]->value.u[c]; + + for (; v; count++) { + v &= v - 1; + } + data.u[c] = count; + } + break; + + case ir_unop_find_msb: + for (unsigned c = 0; c < components; c++) { + int v = op[0]->value.i[c]; + + if (v == 0 || (op[0]->type->base_type == GLSL_TYPE_INT && v == -1)) + data.i[c] = -1; + else { + int count = 0; + int top_bit = op[0]->type->base_type == GLSL_TYPE_UINT + ? 0 : v & (1 << 31); + + while (((v & (1 << 31)) == top_bit) && count != 32) { + count++; + v <<= 1; + } + + data.i[c] = 31 - count; + } + } + break; + + case ir_unop_find_lsb: + for (unsigned c = 0; c < components; c++) { + if (op[0]->value.i[c] == 0) + data.i[c] = -1; + else { + unsigned pos = 0; + unsigned v = op[0]->value.u[c]; + + for (; !(v & 1); v >>= 1) { + pos++; + } + data.u[c] = pos; + } + } + break; + + case ir_triop_bitfield_extract: { + int offset = op[1]->value.i[0]; + int bits = op[2]->value.i[0]; + + for (unsigned c = 0; c < components; c++) { + if (bits == 0) + data.u[c] = 0; + else if (offset < 0 || bits < 0) + data.u[c] = 0; /* Undefined, per spec. */ + else if (offset + bits > 32) + data.u[c] = 0; /* Undefined, per spec. */ + else { + if (op[0]->type->base_type == GLSL_TYPE_INT) { + /* int so that the right shift will sign-extend. */ + int value = op[0]->value.i[c]; + value <<= 32 - bits - offset; + value >>= 32 - bits; + data.i[c] = value; + } else { + unsigned value = op[0]->value.u[c]; + value <<= 32 - bits - offset; + value >>= 32 - bits; + data.u[c] = value; + } + } + } + break; + } + + case ir_binop_bfm: { + int bits = op[0]->value.i[0]; + int offset = op[1]->value.i[0]; + + for (unsigned c = 0; c < components; c++) { + if (bits == 0) + data.u[c] = op[0]->value.u[c]; + else if (offset < 0 || bits < 0) + data.u[c] = 0; /* Undefined for bitfieldInsert, per spec. */ + else if (offset + bits > 32) + data.u[c] = 0; /* Undefined for bitfieldInsert, per spec. */ + else + data.u[c] = ((1 << bits) - 1) << offset; + } + break; + } + + case ir_binop_ldexp: + for (unsigned c = 0; c < components; c++) { + data.f[c] = ldexp(op[0]->value.f[c], op[1]->value.i[c]); + /* Flush subnormal values to zero. */ + if (!isnormal(data.f[c])) + data.f[c] = copysign(0.0f, op[0]->value.f[c]); + } + break; + + case ir_triop_fma: + assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(op[1]->type->base_type == GLSL_TYPE_FLOAT); + assert(op[2]->type->base_type == GLSL_TYPE_FLOAT); + + for (unsigned c = 0; c < components; c++) { + data.f[c] = op[0]->value.f[c] * op[1]->value.f[c] + + op[2]->value.f[c]; + } + break; + + case ir_triop_lrp: { + assert(op[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(op[1]->type->base_type == GLSL_TYPE_FLOAT); + assert(op[2]->type->base_type == GLSL_TYPE_FLOAT); + + unsigned c2_inc = op[2]->type->is_scalar() ? 0 : 1; + for (unsigned c = 0, c2 = 0; c < components; c2 += c2_inc, c++) { + data.f[c] = op[0]->value.f[c] * (1.0f - op[2]->value.f[c2]) + + (op[1]->value.f[c] * op[2]->value.f[c2]); + } + break; + } + + case ir_triop_csel: + for (unsigned c = 0; c < components; c++) { + data.u[c] = op[0]->value.b[c] ? op[1]->value.u[c] + : op[2]->value.u[c]; + } + break; + + case ir_triop_vector_insert: { + const unsigned idx = op[2]->value.u[0]; + + memcpy(&data, &op[0]->value, sizeof(data)); + + switch (this->type->base_type) { + case GLSL_TYPE_INT: + data.i[idx] = op[1]->value.i[0]; + break; + case GLSL_TYPE_UINT: + data.u[idx] = op[1]->value.u[0]; + break; + case GLSL_TYPE_FLOAT: + data.f[idx] = op[1]->value.f[0]; + break; + case GLSL_TYPE_BOOL: + data.b[idx] = op[1]->value.b[0]; + break; + default: + assert(!"Should not get here."); + break; + } + break; + } + + case ir_quadop_bitfield_insert: { + int offset = op[2]->value.i[0]; + int bits = op[3]->value.i[0]; + + for (unsigned c = 0; c < components; c++) { + if (bits == 0) + data.u[c] = op[0]->value.u[c]; + else if (offset < 0 || bits < 0) + data.u[c] = 0; /* Undefined, per spec. */ + else if (offset + bits > 32) + data.u[c] = 0; /* Undefined, per spec. */ + else { + unsigned insert_mask = ((1 << bits) - 1) << offset; + + unsigned insert = op[1]->value.u[c]; + insert <<= offset; + insert &= insert_mask; + + unsigned base = op[0]->value.u[c]; + base &= ~insert_mask; + + data.u[c] = base | insert; + } + } + break; + } + case ir_quadop_vector: for (unsigned c = 0; c < this->type->vector_elements; c++) { switch (this->type->base_type) { @@ -1006,7 +1617,7 @@ ir_dereference_variable::constant_expression_value(struct hash_table *variable_c /* The constant_value of a uniform variable is its initializer, * not the lifetime constant value of the uniform. */ - if (var->mode == ir_var_uniform) + if (var->data.mode == ir_var_uniform) return NULL; if (!var->constant_value) @@ -1049,7 +1660,7 @@ ir_dereference_array::constant_referenced(struct hash_table *variable_context, return; } - const glsl_type *vt = substore->type; + const glsl_type *vt = array->type; if (vt->is_array()) { store = substore->get_array_element(index); offset = 0; @@ -1301,7 +1912,7 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s * "Function calls to user-defined functions (non-built-in functions) * cannot be used to form constant expressions." */ - if (!this->is_builtin) + if (!this->is_builtin()) return NULL; /* diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp new file mode 100644 index 000000000..92001b745 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/ir_equals.cpp @@ -0,0 +1,202 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "ir.h" + +/** + * Helper for checking equality when one instruction might be NULL, since you + * can't access a's vtable in that case. + */ +static bool +possibly_null_equals(ir_instruction *a, ir_instruction *b, enum ir_node_type ignore) +{ + if (!a || !b) + return !a && !b; + + return a->equals(b, ignore); +} + +/** + * The base equality function: Return not equal for anything we don't know + * about. + */ +bool +ir_instruction::equals(ir_instruction *ir, enum ir_node_type) +{ + return false; +} + +bool +ir_constant::equals(ir_instruction *ir, enum ir_node_type ignore) +{ + const ir_constant *other = ir->as_constant(); + if (!other) + return false; + + if (type != other->type) + return false; + + for (unsigned i = 0; i < type->components(); i++) { + if (value.u[i] != other->value.u[i]) + return false; + } + + return true; +} + +bool +ir_dereference_variable::equals(ir_instruction *ir, enum ir_node_type ignore) +{ + const ir_dereference_variable *other = ir->as_dereference_variable(); + if (!other) + return false; + + return var == other->var; +} + +bool +ir_dereference_array::equals(ir_instruction *ir, enum ir_node_type ignore) +{ + const ir_dereference_array *other = ir->as_dereference_array(); + if (!other) + return false; + + if (type != other->type) + return false; + + if (!array->equals(other->array, ignore)) + return false; + + if (!array_index->equals(other->array_index, ignore)) + return false; + + return true; +} + +bool +ir_swizzle::equals(ir_instruction *ir, enum ir_node_type ignore) +{ + const ir_swizzle *other = ir->as_swizzle(); + if (!other) + return false; + + if (type != other->type) + return false; + + if (ignore != ir_type_swizzle) { + if (mask.x != other->mask.x || + mask.y != other->mask.y || + mask.z != other->mask.z || + mask.w != other->mask.w) { + return false; + } + } + + return val->equals(other->val, ignore); +} + +bool +ir_texture::equals(ir_instruction *ir, enum ir_node_type ignore) +{ + const ir_texture *other = ir->as_texture(); + if (!other) + return false; + + if (type != other->type) + return false; + + if (op != other->op) + return false; + + if (!possibly_null_equals(coordinate, other->coordinate, ignore)) + return false; + +#if 0 // Note: glsl optimizer removed projector & shadow_comparitor fields + if (!possibly_null_equals(projector, other->projector, ignore)) + return false; + + if (!possibly_null_equals(shadow_comparitor, other->shadow_comparitor, ignore)) + return false; +#endif + + if (!possibly_null_equals(offset, other->offset, ignore)) + return false; + + if (!sampler->equals(other->sampler, ignore)) + return false; + + switch (op) { + case ir_tex: + case ir_lod: + case ir_query_levels: + break; + case ir_txb: + if (!lod_info.bias->equals(other->lod_info.bias, ignore)) + return false; + break; + case ir_txl: + case ir_txf: + case ir_txs: + if (!lod_info.lod->equals(other->lod_info.lod, ignore)) + return false; + break; + case ir_txd: + if (!lod_info.grad.dPdx->equals(other->lod_info.grad.dPdx, ignore) || + !lod_info.grad.dPdy->equals(other->lod_info.grad.dPdy, ignore)) + return false; + break; + case ir_txf_ms: + if (!lod_info.sample_index->equals(other->lod_info.sample_index, ignore)) + return false; + break; + case ir_tg4: + if (!lod_info.component->equals(other->lod_info.component, ignore)) + return false; + break; + default: + assert(!"Unrecognized texture op"); + } + + return true; +} + +bool +ir_expression::equals(ir_instruction *ir, enum ir_node_type ignore) +{ + const ir_expression *other = ir->as_expression(); + if (!other) + return false; + + if (type != other->type) + return false; + + if (operation != other->operation) + return false; + + for (unsigned i = 0; i < get_num_operands(); i++) { + if (!operands[i]->equals(other->operands[i], ignore)) + return false; + } + + return true; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp index 77447f55a..87af2c970 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_expression_flattening.cpp @@ -59,8 +59,8 @@ do_expression_flattening(exec_list *instructions, { ir_expression_flattening_visitor v(predicate); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir->accept(&v); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp index a525693ed..40cf5894a 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_function.cpp @@ -66,7 +66,7 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b) /* Try to find an implicit conversion from actual to param. */ inexact_match = true; - switch ((enum ir_variable_mode)(param->mode)) { + switch ((enum ir_variable_mode)(param->data.mode)) { case ir_var_auto: case ir_var_uniform: case ir_var_temporary: @@ -78,17 +78,17 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b) return PARAMETER_LIST_NO_MATCH; case ir_var_const_in: - case ir_var_in: + case ir_var_function_in: if (!actual->type->can_implicitly_convert_to(param->type)) return PARAMETER_LIST_NO_MATCH; break; - case ir_var_out: + case ir_var_function_out: if (!param->type->can_implicitly_convert_to(actual->type)) return PARAMETER_LIST_NO_MATCH; break; - case ir_var_inout: + case ir_var_function_inout: /* Since there are no bi-directional automatic conversions (e.g., * there is int -> float but no float -> int), inout parameters must * be exact matches. @@ -116,14 +116,16 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b) ir_function_signature * -ir_function::matching_signature(const exec_list *actual_parameters) +ir_function::matching_signature(_mesa_glsl_parse_state *state, + const exec_list *actual_parameters) { bool is_exact; - return matching_signature(actual_parameters, &is_exact); + return matching_signature(state, actual_parameters, &is_exact); } ir_function_signature * -ir_function::matching_signature(const exec_list *actual_parameters, +ir_function::matching_signature(_mesa_glsl_parse_state *state, + const exec_list *actual_parameters, bool *is_exact) { ir_function_signature *match = NULL; @@ -139,9 +141,12 @@ ir_function::matching_signature(const exec_list *actual_parameters, * multiple ways to apply these conversions to the actual arguments of a * call such that the call can be made to match multiple signatures." */ - foreach_iter(exec_list_iterator, iter, signatures) { - ir_function_signature *const sig = - (ir_function_signature *) iter.get(); + foreach_list(n, &this->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; + + /* Skip over any built-ins that aren't available in this shader. */ + if (sig->is_builtin() && !sig->is_builtin_available(state)) + continue; switch (parameter_lists_match(& sig->parameters, actual_parameters)) { case PARAMETER_LIST_EXACT_MATCH: @@ -203,11 +208,15 @@ parameter_lists_match_exact(const exec_list *list_a, const exec_list *list_b) } ir_function_signature * -ir_function::exact_matching_signature(const exec_list *actual_parameters) +ir_function::exact_matching_signature(_mesa_glsl_parse_state *state, + const exec_list *actual_parameters) { - foreach_iter(exec_list_iterator, iter, signatures) { - ir_function_signature *const sig = - (ir_function_signature *) iter.get(); + foreach_list(n, &this->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; + + /* Skip over any built-ins that aren't available in this shader. */ + if (sig->is_builtin() && !sig->is_builtin_available(state)) + continue; if (parameter_lists_match_exact(&sig->parameters, actual_parameters)) return sig; 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 0a5e647cd..5813315b6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_function_detect_recursion.cpp @@ -127,6 +127,8 @@ #include "program/hash_table.h" #include "program.h" +namespace { + struct call_node : public exec_node { class function *func; }; @@ -139,25 +141,7 @@ public: /* empty */ } - - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *node; - - node = ralloc_size(ctx, size); - assert(node != NULL); - - return node; - } - - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. */ - static void operator delete(void *node) - { - ralloc_free(node); - } + DECLARE_RALLOC_CXX_OPERATORS(function) ir_function_signature *sig; @@ -173,6 +157,7 @@ public: has_recursion_visitor() : current(NULL) { + progress = false; this->mem_ctx = ralloc_context(NULL); this->function_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); @@ -239,6 +224,8 @@ public: bool progress; }; +} /* anonymous namespace */ + static void destroy_links(exec_list *list, function *f) { @@ -297,7 +284,7 @@ emit_errors_unlinked(const void *key, void *data, void *closure) memset(&loc, 0, sizeof(loc)); _mesa_glsl_error(&loc, state, - "function `%s' has static recursion.", + "function `%s' has static recursion", proto); ralloc_free(proto); } @@ -318,7 +305,6 @@ emit_errors_linked(const void *key, void *data, void *closure) linker_error(prog, "function `%s' has static recursion.\n", proto); ralloc_free(proto); - prog->LinkStatus = false; } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp index f4c378587..1968309dd 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.cpp @@ -77,6 +77,33 @@ ir_hierarchical_visitor::visit(ir_precision_statement *ir) return visit_continue; } +ir_visitor_status +ir_hierarchical_visitor::visit(ir_typedecl_statement *ir) +{ + if (this->callback != NULL) + this->callback(ir, this->data); + + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit(ir_emit_vertex *ir) +{ + if (this->callback != NULL) + this->callback(ir, this->data); + + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit(ir_end_primitive *ir) +{ + if (this->callback != NULL) + this->callback(ir, this->data); + + return visit_continue; +} + ir_visitor_status ir_hierarchical_visitor::visit(ir_dereference_variable *ir) { diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h index d507b3212..ac05fba00 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_hierarchical_visitor.h @@ -36,6 +36,7 @@ enum ir_visitor_status { }; +#ifdef __cplusplus /** * Base class of hierarchical visitors of IR instruction trees * @@ -87,6 +88,9 @@ public: virtual ir_visitor_status visit(class ir_constant *); virtual ir_visitor_status visit(class ir_loop_jump *); virtual ir_visitor_status visit(class ir_precision_statement *); + virtual ir_visitor_status visit(class ir_typedecl_statement *); + virtual ir_visitor_status visit(class ir_emit_vertex *); + virtual ir_visitor_status visit(class ir_end_primitive *); /** * ir_dereference_variable isn't technically a leaf, but it is treated as a @@ -182,5 +186,6 @@ void visit_tree(ir_instruction *ir, ir_visitor_status visit_list_elements(ir_hierarchical_visitor *v, exec_list *l, bool statement_list = true); +#endif /* __cplusplus */ #endif /* IR_HIERARCHICAL_VISITOR_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp index a828d8ac0..9b8cf9a6f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_hv_accept.cpp @@ -91,26 +91,6 @@ ir_loop::accept(ir_hierarchical_visitor *v) if (s == visit_stop) return s; - if (s != visit_continue_with_parent) { - if (this->from) { - s = this->from->accept(v); - if (s != visit_continue) - return (s == visit_continue_with_parent) ? visit_continue : s; - } - - if (this->to) { - s = this->to->accept(v); - if (s != visit_continue) - return (s == visit_continue_with_parent) ? visit_continue : s; - } - - if (this->increment) { - s = this->increment->accept(v); - if (s != visit_continue) - return (s == visit_continue_with_parent) ? visit_continue : s; - } - } - return v->visit_leave(this); } @@ -201,6 +181,8 @@ ir_texture::accept(ir_hierarchical_visitor *v) switch (this->op) { case ir_tex: + case ir_lod: + case ir_query_levels: break; case ir_txb: s = this->lod_info.bias->accept(v); @@ -214,6 +196,11 @@ ir_texture::accept(ir_hierarchical_visitor *v) if (s != visit_continue) return (s == visit_continue_with_parent) ? visit_continue : s; break; + case ir_txf_ms: + s = this->lod_info.sample_index->accept(v); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + break; case ir_txd: s = this->lod_info.grad.dPdx->accept(v); if (s != visit_continue) @@ -223,6 +210,11 @@ ir_texture::accept(ir_hierarchical_visitor *v) if (s != visit_continue) return (s == visit_continue_with_parent) ? visit_continue : s; break; + case ir_tg4: + s = this->lod_info.component->accept(v); + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + break; } return (s == visit_stop) ? s : v->visit_leave(this); @@ -403,3 +395,21 @@ ir_precision_statement::accept(ir_hierarchical_visitor *v) { return v->visit(this); } + +ir_visitor_status +ir_typedecl_statement::accept(ir_hierarchical_visitor *v) +{ + return v->visit(this); +} + +ir_visitor_status +ir_emit_vertex::accept(ir_hierarchical_visitor *v) +{ + return v->visit(this); +} + +ir_visitor_status +ir_end_primitive::accept(ir_hierarchical_visitor *v) +{ + return v->visit(this); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_import_prototypes.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_import_prototypes.cpp index 3585bf6b2..b0429fbc3 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_import_prototypes.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_import_prototypes.cpp @@ -30,6 +30,8 @@ #include "ir.h" #include "glsl_symbol_table.h" +namespace { + /** * Visitor used to import function prototypes * @@ -99,6 +101,7 @@ private: void *mem_ctx; }; +} /* anonymous namespace */ /** * Import function prototypes from one IR tree into another diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h b/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h index cd0fc2c1b..e0416dfc9 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_optimization.h @@ -36,10 +36,39 @@ #define LOG_TO_LOG2 0x10 #define MOD_TO_FRACT 0x20 #define INT_DIV_TO_MUL_RCP 0x40 +#define LRP_TO_ARITH 0x80 +#define BITFIELD_INSERT_TO_BFM_BFI 0x100 +#define LDEXP_TO_ARITH 0x200 + +/** + * \see class lower_packing_builtins_visitor + */ +enum lower_packing_builtins_op { + LOWER_PACK_UNPACK_NONE = 0x0000, + + LOWER_PACK_SNORM_2x16 = 0x0001, + LOWER_UNPACK_SNORM_2x16 = 0x0002, + + LOWER_PACK_UNORM_2x16 = 0x0004, + LOWER_UNPACK_UNORM_2x16 = 0x0008, + + LOWER_PACK_HALF_2x16 = 0x0010, + LOWER_UNPACK_HALF_2x16 = 0x0020, + + LOWER_PACK_HALF_2x16_TO_SPLIT = 0x0040, + LOWER_UNPACK_HALF_2x16_TO_SPLIT = 0x0080, + + LOWER_PACK_SNORM_4x8 = 0x0100, + LOWER_UNPACK_SNORM_4x8 = 0x0200, + + LOWER_PACK_UNORM_4x8 = 0x0400, + LOWER_UNPACK_UNORM_4x8 = 0x0800 +}; bool do_common_optimization(exec_list *ir, bool linked, bool uniform_locations_assigned, - unsigned max_unroll_iterations); + unsigned max_unroll_iterations, + const struct gl_shader_compiler_options *options); bool do_algebraic(exec_list *instructions); bool do_constant_folding(exec_list *instructions); @@ -48,19 +77,27 @@ bool do_constant_variable_unlinked(exec_list *instructions); bool do_copy_propagation(exec_list *instructions); bool do_copy_propagation_elements(exec_list *instructions); bool do_constant_propagation(exec_list *instructions); +bool do_cse(exec_list *instructions); +void do_dead_builtin_varyings(struct gl_context *ctx, + gl_shader *producer, gl_shader *consumer, + unsigned num_tfeedback_decls, + class tfeedback_decl *tfeedback_decls); bool do_dead_code(exec_list *instructions, bool uniform_locations_assigned); bool do_dead_code_local(exec_list *instructions); bool do_dead_code_unlinked(exec_list *instructions); bool do_dead_functions(exec_list *instructions); +bool opt_flip_matrices(exec_list *instructions); bool do_function_inlining(exec_list *instructions); bool do_lower_jumps(exec_list *instructions, bool pull_out_jumps = true, bool lower_sub_return = true, bool lower_main_return = false, bool lower_continue = false, bool lower_break = false); bool do_if_simplification(exec_list *instructions); +bool opt_flatten_nested_if_blocks(exec_list *instructions); bool do_discard_simplification(exec_list *instructions); bool lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth = 0); bool do_mat_op_to_vec(exec_list *instructions); bool do_noop_swizzle(exec_list *instructions); bool do_structure_splitting(exec_list *instructions); bool do_swizzle_swizzle(exec_list *instructions); +bool do_vectorize(exec_list *instructions); bool do_tree_grafting(exec_list *instructions); bool do_vec_index_to_cond_assign(exec_list *instructions); bool do_vec_index_to_swizzle(exec_list *instructions); @@ -71,9 +108,15 @@ bool lower_noise(exec_list *instructions); bool lower_variable_index_to_cond_assign(exec_list *instructions, bool lower_input, bool lower_output, bool lower_temp, bool lower_uniform); bool lower_quadop_vector(exec_list *instructions, bool dont_lower_swz); -bool lower_clip_distance(exec_list *instructions); +bool lower_clip_distance(gl_shader *shader); void lower_output_reads(exec_list *instructions); +bool lower_packing_builtins(exec_list *instructions, int op_mask); void lower_ubo_reference(struct gl_shader *shader, exec_list *instructions); +void lower_packed_varyings(void *mem_ctx, unsigned location_base, + unsigned locations_used, ir_variable_mode mode, + unsigned gs_input_vertices, gl_shader *shader); +bool lower_vector_insert(exec_list *instructions, bool lower_nonconstant_index); +void lower_named_interface_blocks(void *mem_ctx, gl_shader *shader); bool optimize_redundant_jumps(exec_list *instructions); bool optimize_split_arrays(exec_list *instructions, bool linked); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp index 614bb3498..2d5accb44 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp @@ -26,11 +26,70 @@ #include "glsl_types.h" #include "glsl_parser_extras.h" #include "ir_unused_structs.h" +#include "loop_analysis.h" #include "program/hash_table.h" #include -static char* print_type(char* buffer, const glsl_type *t, bool arraySize); -static char* print_type_post(char* buffer, const glsl_type *t, bool arraySize); + +class string_buffer +{ +public: + string_buffer(void* mem_ctx) + { + m_Capacity = 512; + m_Ptr = (char*)ralloc_size(mem_ctx, m_Capacity); + m_Size = 0; + m_Ptr[0] = 0; + } + + ~string_buffer() + { + ralloc_free(m_Ptr); + } + + const char* c_str() const { return m_Ptr; } + + void asprintf_append(const char *fmt, ...) PRINTFLIKE(2, 3) + { + va_list args; + va_start(args, fmt); + vasprintf_append(fmt, args); + va_end(args); + } + + void vasprintf_append(const char *fmt, va_list args) + { + assert (m_Ptr != NULL); + vasprintf_rewrite_tail (&m_Size, fmt, args); + } + + void vasprintf_rewrite_tail (size_t *start, const char *fmt, va_list args) + { + assert (m_Ptr != NULL); + + size_t new_length = printf_length(fmt, args); + size_t needed_length = m_Size + new_length + 1; + + if (m_Capacity < needed_length) + { + m_Capacity = MAX2 (m_Capacity + m_Capacity/2, needed_length); + m_Ptr = (char*)reralloc_size(ralloc_parent(m_Ptr), m_Ptr, m_Capacity); + } + + vsnprintf(m_Ptr + m_Size, new_length+1, fmt, args); + m_Size += new_length; + assert (m_Capacity >= m_Size); + } + +private: + char* m_Ptr; + size_t m_Size; + size_t m_Capacity; +}; + + +static void print_type(string_buffer& buffer, const glsl_type *t, bool arraySize); +static void print_type_post(string_buffer& buffer, const glsl_type *t, bool arraySize); static inline const char* get_precision_string (glsl_precision p) { @@ -77,10 +136,15 @@ struct global_print_tracker { class ir_print_glsl_visitor : public ir_visitor { public: - ir_print_glsl_visitor(char* buf, global_print_tracker* globals_, PrintGlslMode mode_, bool use_precision_, const _mesa_glsl_parse_state* state_) + ir_print_glsl_visitor(string_buffer& buf, global_print_tracker* globals_, PrintGlslMode mode_, bool use_precision_, const _mesa_glsl_parse_state* state_) + : buffer(buf) + , loopstate(NULL) + , inside_loop_body(false) + , skipped_this_ir(false) + , previous_skipped(false) { indentation = 0; - buffer = buf; + expression_depth = 0; globals = globals_; mode = mode_; use_precision = use_precision_; @@ -93,6 +157,9 @@ public: void indent(void); + void newline_indent(); + void end_statement_line(); + void newline_deindent(); void print_var_name (ir_variable* v); void print_precision (ir_instruction* ir, const glsl_type* type); @@ -114,13 +181,25 @@ public: virtual void visit(ir_loop *); virtual void visit(ir_loop_jump *); virtual void visit(ir_precision_statement *); + virtual void visit(ir_typedecl_statement *); + virtual void visit(ir_emit_vertex *); + virtual void visit(ir_end_primitive *); + + void emit_assignment_part (ir_dereference* lhs, ir_rvalue* rhs, unsigned write_mask, ir_rvalue* dstIndex); + bool emit_canonical_for (ir_loop* ir); + bool try_print_array_assignment (ir_dereference* lhs, ir_rvalue* rhs); int indentation; - char* buffer; + int expression_depth; + string_buffer& buffer; global_print_tracker* globals; const _mesa_glsl_parse_state* state; PrintGlslMode mode; + loop_state* loopstate; bool use_precision; + bool inside_loop_body; + bool skipped_this_ir; + bool previous_skipped; }; @@ -129,93 +208,117 @@ _mesa_print_ir_glsl(exec_list *instructions, struct _mesa_glsl_parse_state *state, char* buffer, PrintGlslMode mode) { + string_buffer str(buffer); + + // print version & extensions if (state) { - if (state->version_string) - ralloc_asprintf_append (&buffer, "#version %i\n", state->language_version); + if (state->had_version_string) + { + str.asprintf_append ("#version %i", state->language_version); + if (state->es_shader && state->language_version >= 300) + str.asprintf_append (" es"); + str.asprintf_append ("\n"); + } if (state->ARB_shader_texture_lod_enable) - ralloc_strcat (&buffer, "#extension GL_ARB_shader_texture_lod : enable\n"); + str.asprintf_append ("#extension GL_ARB_shader_texture_lod : enable\n"); if (state->EXT_shader_texture_lod_enable) - ralloc_strcat (&buffer, "#extension GL_EXT_shader_texture_lod : enable\n"); + str.asprintf_append ("#extension GL_EXT_shader_texture_lod : enable\n"); if (state->OES_standard_derivatives_enable) - ralloc_strcat (&buffer, "#extension GL_OES_standard_derivatives : enable\n"); + str.asprintf_append ("#extension GL_OES_standard_derivatives : enable\n"); if (state->EXT_shadow_samplers_enable) - ralloc_strcat (&buffer, "#extension GL_EXT_shadow_samplers : enable\n"); + str.asprintf_append ("#extension GL_EXT_shadow_samplers : enable\n"); if (state->EXT_frag_depth_enable) - ralloc_strcat (&buffer, "#extension GL_EXT_frag_depth : enable\n"); + str.asprintf_append ("#extension GL_EXT_frag_depth : enable\n"); } - if (state) { - ir_struct_usage_visitor v; - v.run (instructions); - - for (unsigned i = 0; i < state->num_user_structures; i++) { - const glsl_type *const s = state->user_structures[i]; - - if (!v.has_struct_entry(s)) - continue; - - ralloc_asprintf_append (&buffer, "struct %s {\n", - s->name); - - for (unsigned j = 0; j < s->length; j++) { - ralloc_asprintf_append (&buffer, " "); - if (state->es_shader) - ralloc_asprintf_append (&buffer, "%s", get_precision_string(s->fields.structure[j].precision)); - buffer = print_type(buffer, s->fields.structure[j].type, false); - ralloc_asprintf_append (&buffer, " %s", s->fields.structure[j].name); - buffer = print_type_post(buffer, s->fields.structure[j].type, false); - ralloc_asprintf_append (&buffer, ";\n"); - } - - ralloc_asprintf_append (&buffer, "};\n"); - } - } + + // remove unused struct declarations + do_remove_unused_typedecls(instructions); global_print_tracker gtracker; + + loop_state* ls = analyze_loop_variables(instructions); + if (ls->loop_found) + set_loop_controls(instructions, ls); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); - if (ir->ir_type == ir_type_variable) { - ir_variable *var = static_cast(ir); - if ((strstr(var->name, "gl_") == var->name) - && !var->invariant) - continue; - } + foreach_list(node, instructions) + { + ir_instruction *ir = (ir_instruction *)node; + if (ir->ir_type == ir_type_variable) { + ir_variable *var = static_cast(ir); + if ((strstr(var->name, "gl_") == var->name) + && !var->data.invariant) + continue; + } - ir_print_glsl_visitor v (buffer, >racker, mode, state->es_shader, state); - ir->accept(&v); - buffer = v.buffer; - if (ir->ir_type != ir_type_function) - ralloc_asprintf_append (&buffer, ";\n"); - } + ir_print_glsl_visitor v (str, >racker, mode, state->es_shader, state); + v.loopstate = ls; - return buffer; + ir->accept(&v); + if (ir->ir_type != ir_type_function && !v.skipped_this_ir) + str.asprintf_append (";\n"); + } + + delete ls; + + return ralloc_strdup(buffer, str.c_str()); } void ir_print_glsl_visitor::indent(void) { - for (int i = 0; i < indentation; i++) - ralloc_asprintf_append (&buffer, " "); + if (previous_skipped) + return; + previous_skipped = false; + for (int i = 0; i < indentation; i++) + buffer.asprintf_append (" "); } +void ir_print_glsl_visitor::end_statement_line() +{ + if (!skipped_this_ir) + buffer.asprintf_append(";\n"); + previous_skipped = skipped_this_ir; + skipped_this_ir = false; +} + +void ir_print_glsl_visitor::newline_indent() +{ + if (expression_depth % 4 == 0) + { + ++indentation; + buffer.asprintf_append ("\n"); + indent(); + } +} +void ir_print_glsl_visitor::newline_deindent() +{ + if (expression_depth % 4 == 0) + { + --indentation; + buffer.asprintf_append ("\n"); + indent(); + } +} + + void ir_print_glsl_visitor::print_var_name (ir_variable* v) { long id = (long)hash_table_find (globals->var_hash, v); - if (!id && v->mode == ir_var_temporary) + if (!id && v->data.mode == ir_var_temporary) { id = ++globals->var_counter; hash_table_insert (globals->var_hash, (void*)id, v); } if (id) { - if (v->mode == ir_var_temporary) - ralloc_asprintf_append (&buffer, "tmpvar_%d", id); + if (v->data.mode == ir_var_temporary) + buffer.asprintf_append ("tmpvar_%d", (int)id); else - ralloc_asprintf_append (&buffer, "%s_%d", v->name, id); + buffer.asprintf_append ("%s_%d", v->name, (int)id); } else { - ralloc_asprintf_append (&buffer, "%s", v->name); + buffer.asprintf_append ("%s", v->name); } } @@ -233,8 +336,10 @@ void ir_print_glsl_visitor::print_precision (ir_instruction* ir, const glsl_type } glsl_precision prec = precision_from_ir(ir); - // skip precision for samplers that end up being lowp (default anyway) or undefined - if (type && type->is_sampler()) + // skip precision for samplers that end up being lowp (default anyway) or undefined; + // except always emit it for shadowmap samplers (some drivers don't implement + // default EXT_shadow_samplers precision) + if (type && type->is_sampler() && !type->sampler_shadow) { if (prec == glsl_precision_low || prec == glsl_precision_undefined) return; @@ -245,48 +350,52 @@ void ir_print_glsl_visitor::print_precision (ir_instruction* ir, const glsl_type if (ir->ir_type == ir_type_function_signature) return; } - ralloc_asprintf_append (&buffer, "%s", get_precision_string(prec)); + buffer.asprintf_append ("%s", get_precision_string(prec)); } -static char* -print_type(char* buffer, const glsl_type *t, bool arraySize) +static void print_type(string_buffer& buffer, const glsl_type *t, bool arraySize) { - if (t->base_type == GLSL_TYPE_ARRAY) { - buffer = print_type(buffer, t->fields.array, true); - if (arraySize) - ralloc_asprintf_append (&buffer, "[%u]", t->length); - } else if ((t->base_type == GLSL_TYPE_STRUCT) - && (strncmp("gl_", t->name, 3) != 0)) { - ralloc_asprintf_append (&buffer, "%s", t->name); - } else { - ralloc_asprintf_append (&buffer, "%s", t->name); - } - return buffer; + if (t->base_type == GLSL_TYPE_ARRAY) { + print_type(buffer, t->fields.array, true); + if (arraySize) + buffer.asprintf_append ("[%u]", t->length); + } else if ((t->base_type == GLSL_TYPE_STRUCT) + && (strncmp("gl_", t->name, 3) != 0)) { + buffer.asprintf_append ("%s", t->name); + } else { + buffer.asprintf_append ("%s", t->name); + } } -static char* -print_type_post(char* buffer, const glsl_type *t, bool arraySize) +static void print_type_post(string_buffer& buffer, const glsl_type *t, bool arraySize) { if (t->base_type == GLSL_TYPE_ARRAY) { if (!arraySize) - ralloc_asprintf_append (&buffer, "[%u]", t->length); + buffer.asprintf_append ("[%u]", t->length); } - return buffer; } void ir_print_glsl_visitor::visit(ir_variable *ir) { - const char *const cent = (ir->centroid) ? "centroid " : ""; - const char *const inv = (ir->invariant) ? "invariant " : ""; - const char *const mode[3][8] = - { - { "", "uniform ", "in ", "out ", "inout ", "", "", "" }, - { "", "uniform ", "attribute ", "varying ", "inout ", "", "", "" }, - { "", "uniform ", "varying ", "out ", "inout ", "", "", "" }, - }; - const char *const interp[] = { "", "smooth ", "flat ", "noperspective " }; + const char *const cent = (ir->data.centroid) ? "centroid " : ""; + const char *const inv = (ir->data.invariant) ? "invariant " : ""; + const char *const mode[3][ir_var_mode_count] = + { + { "", "uniform ", "in ", "out ", "in ", "out ", "inout ", "", "", "" }, + { "", "uniform ", "attribute ", "varying ", "in ", "out ", "inout ", "", "", "" }, + { "", "uniform ", "varying ", "out ", "in ", "out ", "inout ", "", "", "" }, + }; + + const char *const interp[] = { "", "smooth ", "flat ", "noperspective " }; + + if (this->state->language_version >= 300 && ir->data.explicit_location) + { + const int binding_base = (this->state->stage == MESA_SHADER_VERTEX ? (int)VERT_ATTRIB_GENERIC0 : (int)FRAG_RESULT_DATA0); + const int location = ir->data.location - binding_base; + buffer.asprintf_append ("layout(location=%d) ", location); + } int decormode = this->mode; // GLSL 1.30 and up use "in" and "out" for everything @@ -294,36 +403,53 @@ void ir_print_glsl_visitor::visit(ir_variable *ir) { decormode = 0; } - - // give an id to any variable defined in a function that is not an uniform - if ((this->mode == kPrintGlslNone && ir->mode != ir_var_uniform)) - { - long id = (long)hash_table_find (globals->var_hash, ir); - if (id == 0) - { - id = ++globals->var_counter; - hash_table_insert (globals->var_hash, (void*)id, ir); - } - } - - // keep invariant declaration for builtin variables - if (strstr(ir->name, "gl_") == ir->name) { - ralloc_asprintf_append (&buffer, "%s", inv); - print_var_name (ir); - return; - } - ralloc_asprintf_append (&buffer, "%s%s%s%s", - cent, inv, interp[ir->interpolation], mode[decormode][ir->mode]); - print_precision (ir, ir->type); - buffer = print_type(buffer, ir->type, false); - ralloc_asprintf_append (&buffer, " "); - print_var_name (ir); - buffer = print_type_post(buffer, ir->type, false); - - if (ir->constant_value && ir->mode != ir_var_in && ir->mode != ir_var_out && ir->mode != ir_var_inout) + // give an id to any variable defined in a function that is not an uniform + if ((this->mode == kPrintGlslNone && ir->data.mode != ir_var_uniform)) { - ralloc_asprintf_append (&buffer, " = "); + long id = (long)hash_table_find (globals->var_hash, ir); + if (id == 0) + { + id = ++globals->var_counter; + hash_table_insert (globals->var_hash, (void*)id, ir); + } + } + + // if this is a loop induction variable, do not print it + // (will be printed inside loop body) + if (!inside_loop_body) + { + loop_variable_state* inductor_state = loopstate->get_for_inductor(ir); + if (inductor_state && inductor_state->private_induction_variable_count == 1) + { + skipped_this_ir = true; + return; + } + } + + // keep invariant declaration for builtin variables + if (strstr(ir->name, "gl_") == ir->name) { + buffer.asprintf_append ("%s", inv); + print_var_name (ir); + return; + } + + buffer.asprintf_append ("%s%s%s%s", + cent, inv, interp[ir->data.interpolation], mode[decormode][ir->data.mode]); + print_precision (ir, ir->type); + print_type(buffer, ir->type, false); + buffer.asprintf_append (" "); + print_var_name (ir); + print_type_post(buffer, ir->type, false); + + if (ir->constant_value && + ir->data.mode != ir_var_shader_in && + ir->data.mode != ir_var_shader_out && + ir->data.mode != ir_var_function_in && + ir->data.mode != ir_var_function_out && + ir->data.mode != ir_var_function_inout) + { + buffer.asprintf_append (" = "); visit (ir->constant_value); } } @@ -332,75 +458,74 @@ void ir_print_glsl_visitor::visit(ir_variable *ir) void ir_print_glsl_visitor::visit(ir_function_signature *ir) { print_precision (ir, ir->return_type); - buffer = print_type(buffer, ir->return_type, true); - ralloc_asprintf_append (&buffer, " %s (", ir->function_name()); + print_type(buffer, ir->return_type, true); + buffer.asprintf_append (" %s (", ir->function_name()); if (!ir->parameters.is_empty()) { - ralloc_asprintf_append (&buffer, "\n"); + buffer.asprintf_append ("\n"); - indentation++; + indentation++; previous_skipped = false; bool first = true; - foreach_iter(exec_list_iterator, iter, ir->parameters) { - ir_variable *const inst = (ir_variable *) iter.get(); + foreach_list(node, &ir->parameters) { + ir_variable *const inst = (ir_variable *)node; if (!first) - ralloc_asprintf_append (&buffer, ",\n"); + buffer.asprintf_append (",\n"); indent(); inst->accept(this); first = false; } indentation--; - ralloc_asprintf_append (&buffer, "\n"); + buffer.asprintf_append ("\n"); indent(); } if (ir->body.is_empty()) { - ralloc_asprintf_append (&buffer, ");\n"); + buffer.asprintf_append (");\n"); return; } - ralloc_asprintf_append (&buffer, ")\n"); + buffer.asprintf_append (")\n"); indent(); - ralloc_asprintf_append (&buffer, "{\n"); - indentation++; + buffer.asprintf_append ("{\n"); + indentation++; previous_skipped = false; // insert postponed global assigments if (strcmp(ir->function()->name, "main") == 0) { assert (!globals->main_function_done); globals->main_function_done = true; - foreach_iter(exec_list_iterator, it, globals->global_assignements) + foreach_list(node, &globals->global_assignements) { - ir_instruction* as = ((ga_entry *)it.get())->ir; + ir_instruction* as = ((ga_entry *)node)->ir; as->accept(this); - ralloc_asprintf_append(&buffer, ";\n"); + buffer.asprintf_append(";\n"); } } - foreach_iter(exec_list_iterator, iter, ir->body) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(node, &ir->body) { + ir_instruction *const inst = (ir_instruction *)node; indent(); inst->accept(this); - ralloc_asprintf_append (&buffer, ";\n"); + end_statement_line(); } indentation--; indent(); - ralloc_asprintf_append (&buffer, "}\n"); + buffer.asprintf_append ("}\n"); } - void ir_print_glsl_visitor::visit(ir_function *ir) { bool found_non_builtin_proto = false; - foreach_iter(exec_list_iterator, iter, *ir) { - ir_function_signature *const sig = (ir_function_signature *) iter.get(); - if (!sig->is_builtin) + foreach_list(node, &ir->signatures) { + ir_function_signature *const sig = (ir_function_signature *)node; + if (!sig->is_builtin()) found_non_builtin_proto = true; } if (!found_non_builtin_proto) @@ -409,12 +534,12 @@ void ir_print_glsl_visitor::visit(ir_function *ir) PrintGlslMode oldMode = this->mode; this->mode = kPrintGlslNone; - foreach_iter(exec_list_iterator, iter, *ir) { - ir_function_signature *const sig = (ir_function_signature *) iter.get(); + foreach_list(node, &ir->signatures) { + ir_function_signature *const sig = (ir_function_signature *)node; indent(); sig->accept(this); - ralloc_asprintf_append (&buffer, "\n"); + buffer.asprintf_append ("\n"); } this->mode = oldMode; @@ -463,11 +588,30 @@ static const char *const operator_glsl_strs[] = { "cos", // reduced "dFdx", "dFdy", + "packSnorm2x16", + "packSnorm4x8", + "packUnorm2x16", + "packUnorm4x8", + "packHalf2x16", + "unpackSnorm2x16", + "unpackSnorm4x8", + "unpackUnorm2x16", + "unpackUnorm4x8", + "unpackHalf2x16", + "unpackHalf2x16_splitX_TODO", + "unpackHalf2x16_splitY_TODO", + "bitfieldReverse", + "bitCount", + "findMSB", + "findLSB", "noise", "+", "-", "*", + "*_imul_high_TODO", "/", + "carry_TODO", + "borrow_TODO", "mod", "<", ">", @@ -489,9 +633,19 @@ static const char *const operator_glsl_strs[] = { "min", "max", "pow", + "packHalf2x16_split_TODO", + "bfm_TODO", "uboloadTODO", + "ldexp_TODO", + "vectorExtract_TODO", + "fma", "clamp", "mix", + "csel_TODO", + "bfi_TODO", + "bitfield_extract_TODO", + "vector_insert_TODO", + "bitfield_insert_TODO", "vectorTODO", }; @@ -521,81 +675,97 @@ static bool is_binop_func_like(ir_expression_operation op, const glsl_type* type void ir_print_glsl_visitor::visit(ir_expression *ir) { + ++this->expression_depth; + newline_indent(); + if (ir->get_num_operands() == 1) { if (ir->operation >= ir_unop_f2i && ir->operation < ir_unop_any) { - buffer = print_type(buffer, ir->type, true); - ralloc_asprintf_append(&buffer, "("); + print_type(buffer, ir->type, true); + buffer.asprintf_append ("("); } else if (ir->operation == ir_unop_rcp) { - ralloc_asprintf_append (&buffer, "(1.0/("); + buffer.asprintf_append ("(1.0/("); } else { - ralloc_asprintf_append (&buffer, "%s(", operator_glsl_strs[ir->operation]); + buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]); } if (ir->operands[0]) ir->operands[0]->accept(this); - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); if (ir->operation == ir_unop_rcp) { - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } } + else if (ir->operation == ir_binop_vector_extract) + { + // a[b] + + if (ir->operands[0]) + ir->operands[0]->accept(this); + buffer.asprintf_append ("["); + if (ir->operands[1]) + ir->operands[1]->accept(this); + buffer.asprintf_append ("]"); + } else if (is_binop_func_like(ir->operation, ir->type)) { if (ir->operation == ir_binop_mod) { - ralloc_asprintf_append (&buffer, "("); - buffer = print_type(buffer, ir->type, true); - ralloc_asprintf_append (&buffer, "("); + buffer.asprintf_append ("("); + print_type(buffer, ir->type, true); + buffer.asprintf_append ("("); } if (ir->type->is_vector() && (ir->operation >= ir_binop_less && ir->operation <= ir_binop_nequal)) - ralloc_asprintf_append (&buffer, "%s (", operator_vec_glsl_strs[ir->operation-ir_binop_less]); + buffer.asprintf_append ("%s (", operator_vec_glsl_strs[ir->operation-ir_binop_less]); else - ralloc_asprintf_append (&buffer, "%s (", operator_glsl_strs[ir->operation]); + buffer.asprintf_append ("%s (", operator_glsl_strs[ir->operation]); if (ir->operands[0]) ir->operands[0]->accept(this); - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); if (ir->operands[1]) ir->operands[1]->accept(this); - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); if (ir->operation == ir_binop_mod) - ralloc_asprintf_append (&buffer, "))"); + buffer.asprintf_append ("))"); } else if (ir->get_num_operands() == 2) { - ralloc_asprintf_append (&buffer, "("); + buffer.asprintf_append ("("); if (ir->operands[0]) ir->operands[0]->accept(this); - ralloc_asprintf_append (&buffer, " %s ", operator_glsl_strs[ir->operation]); + buffer.asprintf_append (" %s ", operator_glsl_strs[ir->operation]); if (ir->operands[1]) ir->operands[1]->accept(this); - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } else { // ternary op - ralloc_asprintf_append (&buffer, "%s (", operator_glsl_strs[ir->operation]); + buffer.asprintf_append ("%s (", operator_glsl_strs[ir->operation]); if (ir->operands[0]) ir->operands[0]->accept(this); - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); if (ir->operands[1]) ir->operands[1]->accept(this); - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); if (ir->operands[2]) ir->operands[2]->accept(this); - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } + + newline_deindent(); + --this->expression_depth; } // [glsl_sampler_dim] static const char* tex_sampler_dim_name[] = { - "1D", "2D", "3D", "Cube", "Rect", "Buf", + "1D", "2D", "3D", "Cube", "Rect", "Buf", "External", }; static int tex_sampler_dim_size[] = { - 1, 2, 3, 3, 2, 2, + 1, 2, 3, 3, 2, 2, 2, }; - void ir_print_glsl_visitor::visit(ir_texture *ir) { glsl_sampler_dim sampler_dim = (glsl_sampler_dim)ir->sampler->type->sampler_dimensionality; @@ -604,40 +774,55 @@ void ir_print_glsl_visitor::visit(ir_texture *ir) const int uv_dim = uv_type->vector_elements; int sampler_uv_dim = tex_sampler_dim_size[sampler_dim]; if (is_shadow) - sampler_uv_dim = 3; + sampler_uv_dim += 1; const bool is_proj = (uv_dim > sampler_uv_dim); // texture function name //ACS: shadow lookups and lookups with dimensionality included in the name were deprecated in 130 if(state->language_version<130) { - ralloc_asprintf_append (&buffer, "%s", is_shadow ? "shadow" : "texture"); - ralloc_asprintf_append (&buffer, "%s", tex_sampler_dim_name[sampler_dim]); + buffer.asprintf_append ("%s", is_shadow ? "shadow" : "texture"); + buffer.asprintf_append ("%s", tex_sampler_dim_name[sampler_dim]); } else { - ralloc_asprintf_append (&buffer, "texture"); + if (ir->op == ir_txf) + buffer.asprintf_append ("texelFetch"); + else + buffer.asprintf_append ("texture"); } if (is_proj) - ralloc_asprintf_append (&buffer, "Proj"); + buffer.asprintf_append ("Proj"); if (ir->op == ir_txl) - ralloc_asprintf_append (&buffer, "Lod"); + buffer.asprintf_append ("Lod"); + if (ir->op == ir_txd) + buffer.asprintf_append ("Grad"); + if (ir->offset != NULL) + buffer.asprintf_append ("Offset"); if (state->es_shader) { if ( (is_shadow && state->EXT_shadow_samplers_enable) || (ir->op == ir_txl && state->EXT_shader_texture_lod_enable) ) { - ralloc_asprintf_append (&buffer, "EXT"); + buffer.asprintf_append ("EXT"); } } - ralloc_asprintf_append (&buffer, " ("); + if(ir->op == ir_txd) + { + if(state->es_shader && state->EXT_shader_texture_lod_enable) + buffer.asprintf_append ("EXT"); + else if(!state->es_shader && state->ARB_shader_texture_lod_enable) + buffer.asprintf_append ("ARB"); + } + + buffer.asprintf_append (" ("); // sampler ir->sampler->accept(this); - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); // texture coordinate ir->coordinate->accept(this); @@ -645,38 +830,48 @@ void ir_print_glsl_visitor::visit(ir_texture *ir) // lod bias if (ir->op == ir_txb) { - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); ir->lod_info.bias->accept(this); } // lod - if (ir->op == ir_txl) + if (ir->op == ir_txl || ir->op == ir_txf) { - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); ir->lod_info.lod->accept(this); } - /* + // grad + if (ir->op == ir_txd) + { + buffer.asprintf_append (", "); + ir->lod_info.grad.dPdx->accept(this); + buffer.asprintf_append (", "); + ir->lod_info.grad.dPdy->accept(this); + } if (ir->offset != NULL) { + buffer.asprintf_append (", "); ir->offset->accept(this); } + /* + if (ir->op != ir_txf) { if (ir->projector) ir->projector->accept(this); else - ralloc_asprintf_append (&buffer, "1"); + buffer.asprintf_append ("1"); if (ir->shadow_comparitor) { - ralloc_asprintf_append (&buffer, " "); + buffer.asprintf_append (" "); ir->shadow_comparitor->accept(this); } else { - ralloc_asprintf_append (&buffer, " ()"); + buffer.asprintf_append (" ()"); } } - ralloc_asprintf_append (&buffer, " "); + buffer.asprintf_append (" "); switch (ir->op) { case ir_tex: @@ -689,15 +884,15 @@ void ir_print_glsl_visitor::visit(ir_texture *ir) ir->lod_info.lod->accept(this); break; case ir_txd: - ralloc_asprintf_append (&buffer, "("); + buffer.asprintf_append ("("); ir->lod_info.grad.dPdx->accept(this); - ralloc_asprintf_append (&buffer, " "); + buffer.asprintf_append (" "); ir->lod_info.grad.dPdy->accept(this); - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); break; }; */ - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } @@ -714,8 +909,8 @@ void ir_print_glsl_visitor::visit(ir_swizzle *ir) { if (ir->mask.num_components != 1) { - buffer = print_type(buffer, ir->type, true); - ralloc_asprintf_append (&buffer, "("); + print_type(buffer, ir->type, true); + buffer.asprintf_append ("("); } } @@ -725,14 +920,14 @@ void ir_print_glsl_visitor::visit(ir_swizzle *ir) { if (ir->mask.num_components != 1) { - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } return; } - ralloc_asprintf_append (&buffer, "."); + buffer.asprintf_append ("."); for (unsigned i = 0; i < ir->mask.num_components; i++) { - ralloc_asprintf_append (&buffer, "%c", "xyzw"[swiz[i]]); + buffer.asprintf_append ("%c", "xyzw"[swiz[i]]); } } @@ -747,82 +942,239 @@ void ir_print_glsl_visitor::visit(ir_dereference_variable *ir) void ir_print_glsl_visitor::visit(ir_dereference_array *ir) { ir->array->accept(this); - ralloc_asprintf_append (&buffer, "["); + buffer.asprintf_append ("["); ir->array_index->accept(this); - ralloc_asprintf_append (&buffer, "]"); + buffer.asprintf_append ("]"); } void ir_print_glsl_visitor::visit(ir_dereference_record *ir) { ir->record->accept(this); - ralloc_asprintf_append (&buffer, ".%s", ir->field); + buffer.asprintf_append (".%s", ir->field); } + +bool ir_print_glsl_visitor::try_print_array_assignment (ir_dereference* lhs, ir_rvalue* rhs) +{ + if (this->state->language_version >= 120) + return false; + ir_dereference_variable* rhsarr = rhs->as_dereference_variable(); + if (rhsarr == NULL) + return false; + const glsl_type* lhstype = lhs->type; + const glsl_type* rhstype = rhsarr->type; + if (!lhstype->is_array() || !rhstype->is_array()) + return false; + if (lhstype->array_size() != rhstype->array_size()) + return false; + if (lhstype->base_type != rhstype->base_type) + return false; + + const unsigned size = rhstype->array_size(); + for (unsigned i = 0; i < size; i++) + { + lhs->accept(this); + buffer.asprintf_append ("[%d]=", i); + rhs->accept(this); + buffer.asprintf_append ("[%d]", i); + if (i != size-1) + buffer.asprintf_append (";"); + } + return true; +} + +void ir_print_glsl_visitor::emit_assignment_part (ir_dereference* lhs, ir_rvalue* rhs, unsigned write_mask, ir_rvalue* dstIndex) +{ + lhs->accept(this); + + if (dstIndex) + { + // if dst index is a constant, then emit a swizzle + ir_constant* dstConst = dstIndex->as_constant(); + if (dstConst) + { + const char* comps = "xyzw"; + char comp = comps[dstConst->get_int_component(0)]; + buffer.asprintf_append (".%c", comp); + } + else + { + buffer.asprintf_append ("["); + dstIndex->accept(this); + buffer.asprintf_append ("]"); + } + } + + char mask[5]; + unsigned j = 0; + const glsl_type* lhsType = lhs->type; + const glsl_type* rhsType = rhs->type; + if (!dstIndex && lhsType->matrix_columns <= 1 && lhsType->vector_elements > 1 && write_mask != (1<vector_elements)-1) + { + for (unsigned i = 0; i < 4; i++) { + if ((write_mask & (1 << i)) != 0) { + mask[j] = "xyzw"[i]; + j++; + } + } + lhsType = glsl_type::get_instance(lhsType->base_type, j, 1); + } + mask[j] = '\0'; + bool hasWriteMask = false; + if (mask[0]) + { + buffer.asprintf_append (".%s", mask); + hasWriteMask = true; + } + + buffer.asprintf_append (" = "); + + bool typeMismatch = !dstIndex && (lhsType != rhsType); + const bool addSwizzle = hasWriteMask && typeMismatch; + if (typeMismatch) + { + if (!addSwizzle) + print_type(buffer, lhsType, true); + buffer.asprintf_append ("("); + } + + rhs->accept(this); + + if (typeMismatch) + { + buffer.asprintf_append (")"); + if (addSwizzle) + buffer.asprintf_append (".%s", mask); + } +} + + +// Try to print (X = X + const) as (X += const), mostly to satisfy +// OpenGL ES 2.0 loop syntax restrictions. +static bool try_print_increment (ir_print_glsl_visitor* vis, ir_assignment* ir) +{ + if (ir->condition) + return false; + + // Needs to be + on rhs + ir_expression* rhsOp = ir->rhs->as_expression(); + if (!rhsOp || rhsOp->operation != ir_binop_add) + return false; + + // Needs to write to whole variable + ir_variable* lhsVar = ir->whole_variable_written(); + if (lhsVar == NULL) + return false; + + // Types must match + if (ir->lhs->type != ir->rhs->type) + return false; + + // Type must be scalar + if (!ir->lhs->type->is_scalar()) + return false; + + // rhs0 must be variable deref, same one as lhs + ir_dereference_variable* rhsDeref = rhsOp->operands[0]->as_dereference_variable(); + if (rhsDeref == NULL) + return false; + if (lhsVar != rhsDeref->var) + return false; + + // rhs1 must be a constant + ir_constant* rhsConst = rhsOp->operands[1]->as_constant(); + if (!rhsConst) + return false; + + // print variable name + ir->lhs->accept (vis); + + // print ++ or +=const + if (ir->lhs->type->base_type <= GLSL_TYPE_INT && rhsConst->is_one()) + { + vis->buffer.asprintf_append ("++"); + } + else + { + vis->buffer.asprintf_append(" += "); + rhsConst->accept (vis); + } + + return true; +} + + void ir_print_glsl_visitor::visit(ir_assignment *ir) { + // if this is a loop induction variable initial assignment, and we aren't inside loop body: + // do not print it (will be printed when inside loop body) + if (!inside_loop_body) + { + ir_variable* whole_var = ir->whole_variable_written(); + if (!ir->condition && whole_var) + { + loop_variable_state* inductor_state = loopstate->get_for_inductor(whole_var); + if (inductor_state && inductor_state->private_induction_variable_count == 1) + { + skipped_this_ir = true; + return; + } + } + } + // assignments in global scope are postponed to main function if (this->mode != kPrintGlslNone) { assert (!this->globals->main_function_done); this->globals->global_assignements.push_tail (new(this->globals->mem_ctx) ga_entry(ir)); - ralloc_asprintf_append(&buffer, "//"); // for the ; that will follow (ugly, I know) + buffer.asprintf_append ("//"); // for the ; that will follow (ugly, I know) return; } + // if RHS is ir_triop_vector_insert, then we have to do some special dance. If source expression is: + // dst = vector_insert (a, b, idx) + // then emit it like: + // dst = a; + // dst.idx = b; + ir_expression* rhsOp = ir->rhs->as_expression(); + if (rhsOp && rhsOp->operation == ir_triop_vector_insert) + { + // skip assignment if lhs and rhs would be the same + bool skip_assign = false; + ir_dereference_variable* lhsDeref = ir->lhs->as_dereference_variable(); + ir_dereference_variable* rhsDeref = rhsOp->operands[0]->as_dereference_variable(); + if (lhsDeref && rhsDeref) + { + if (lhsDeref->var == rhsDeref->var) + skip_assign = true; + } + + if (!skip_assign) + { + emit_assignment_part(ir->lhs, rhsOp->operands[0], ir->write_mask, NULL); + buffer.asprintf_append ("; "); + } + emit_assignment_part(ir->lhs, rhsOp->operands[1], ir->write_mask, rhsOp->operands[2]); + return; + } + + if (try_print_increment (this, ir)) + return; + + if (try_print_array_assignment (ir->lhs, ir->rhs)) + return; + if (ir->condition) { ir->condition->accept(this); - ralloc_asprintf_append (&buffer, " "); + buffer.asprintf_append (" "); } - - ir->lhs->accept(this); - - char mask[5]; - unsigned j = 0; - const glsl_type* lhsType = ir->lhs->type; - const glsl_type* rhsType = ir->rhs->type; - if (ir->lhs->type->vector_elements > 1 && ir->write_mask != (1<lhs->type->vector_elements)-1) - { - for (unsigned i = 0; i < 4; i++) { - if ((ir->write_mask & (1 << i)) != 0) { - mask[j] = "xyzw"[i]; - j++; - } - } - lhsType = glsl_type::get_instance(lhsType->base_type, j, 1); - } - mask[j] = '\0'; - bool hasWriteMask = false; - if (mask[0]) - { - ralloc_asprintf_append (&buffer, ".%s", mask); - hasWriteMask = true; - } - - ralloc_asprintf_append (&buffer, " = "); - - bool typeMismatch = (lhsType != rhsType); - const bool addSwizzle = hasWriteMask && typeMismatch; - if (typeMismatch) - { - if (!addSwizzle) - buffer = print_type(buffer, lhsType, true); - ralloc_asprintf_append (&buffer, "("); - } - - ir->rhs->accept(this); - - if (typeMismatch) - { - ralloc_asprintf_append (&buffer, ")"); - if (addSwizzle) - ralloc_asprintf_append (&buffer, ".%s", mask); - } - + + emit_assignment_part (ir->lhs, ir->rhs, ir->write_mask, NULL); } -static char* print_float (char* buffer, float f) +static void print_float (string_buffer& buffer, float f) { // Kind of roundabout way, but this is to satisfy two things: // * MSVC and gcc-based compilers differ a bit in how they treat float @@ -855,12 +1207,11 @@ static char* print_float (char* buffer, float f) } #endif - ralloc_strcat (&buffer, tmp); + buffer.asprintf_append ("%s", tmp); // need to append ".0"? if (!strchr(tmp,'.') && (posE == NULL)) - ralloc_strcat(&buffer, ".0"); - return buffer; + buffer.asprintf_append(".0"); } void ir_print_glsl_visitor::visit(ir_constant *ir) @@ -869,48 +1220,57 @@ void ir_print_glsl_visitor::visit(ir_constant *ir) if (type == glsl_type::float_type) { - buffer = print_float (buffer, ir->value.f[0]); + print_float (buffer, ir->value.f[0]); return; } else if (type == glsl_type::int_type) { - ralloc_asprintf_append (&buffer, "%d", ir->value.i[0]); + buffer.asprintf_append ("%d", ir->value.i[0]); return; } else if (type == glsl_type::uint_type) { - ralloc_asprintf_append (&buffer, "%u", ir->value.u[0]); + buffer.asprintf_append ("%u", ir->value.u[0]); return; } const glsl_type *const base_type = ir->type->get_base_type(); - buffer = print_type(buffer, type, true); - ralloc_asprintf_append (&buffer, "("); + print_type(buffer, type, true); + buffer.asprintf_append ("("); if (ir->type->is_array()) { for (unsigned i = 0; i < ir->type->length; i++) { if (i != 0) - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); ir->get_array_element(i)->accept(this); } - } else { + } else if (ir->type->is_record()) { + bool first = true; + foreach_list(n, &ir->components) { + if (!first) + buffer.asprintf_append (", "); + first = false; + ir_constant* inst = (ir_constant*)n; + inst->accept(this); + } + }else { bool first = true; for (unsigned i = 0; i < ir->type->components(); i++) { if (!first) - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); first = false; switch (base_type->base_type) { - case GLSL_TYPE_UINT: ralloc_asprintf_append (&buffer, "%u", ir->value.u[i]); break; - case GLSL_TYPE_INT: ralloc_asprintf_append (&buffer, "%d", ir->value.i[i]); break; - case GLSL_TYPE_FLOAT: buffer = print_float(buffer, ir->value.f[i]); break; - case GLSL_TYPE_BOOL: ralloc_asprintf_append (&buffer, "%d", ir->value.b[i]); break; + case GLSL_TYPE_UINT: buffer.asprintf_append ("%u", ir->value.u[i]); break; + case GLSL_TYPE_INT: buffer.asprintf_append ("%d", ir->value.i[i]); break; + case GLSL_TYPE_FLOAT: print_float(buffer, ir->value.f[i]); break; + case GLSL_TYPE_BOOL: buffer.asprintf_append ("%d", ir->value.b[i]); break; default: assert(0); } } } - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } @@ -922,37 +1282,37 @@ ir_print_glsl_visitor::visit(ir_call *ir) { assert (!this->globals->main_function_done); this->globals->global_assignements.push_tail (new(this->globals->mem_ctx) ga_entry(ir)); - ralloc_asprintf_append(&buffer, "//"); // for the ; that will follow (ugly, I know) + buffer.asprintf_append ("//"); // for the ; that will follow (ugly, I know) return; } if (ir->return_deref) { visit(ir->return_deref); - ralloc_asprintf_append (&buffer, " = "); + buffer.asprintf_append (" = "); } - ralloc_asprintf_append (&buffer, "%s (", ir->callee_name()); + buffer.asprintf_append ("%s (", ir->callee_name()); bool first = true; - foreach_iter(exec_list_iterator, iter, *ir) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(node, &ir->actual_parameters) { + ir_instruction *const inst = (ir_instruction *)node; if (!first) - ralloc_asprintf_append (&buffer, ", "); + buffer.asprintf_append (", "); inst->accept(this); first = false; } - ralloc_asprintf_append (&buffer, ")"); + buffer.asprintf_append (")"); } void ir_print_glsl_visitor::visit(ir_return *ir) { - ralloc_asprintf_append (&buffer, "return"); + buffer.asprintf_append ("return"); ir_rvalue *const value = ir->get_value(); if (value) { - ralloc_asprintf_append (&buffer, " "); + buffer.asprintf_append (" "); value->accept(this); } } @@ -961,10 +1321,10 @@ ir_print_glsl_visitor::visit(ir_return *ir) void ir_print_glsl_visitor::visit(ir_discard *ir) { - ralloc_asprintf_append (&buffer, "discard"); + buffer.asprintf_append ("discard"); if (ir->condition != NULL) { - ralloc_asprintf_append (&buffer, " TODO "); + buffer.asprintf_append (" TODO "); ir->condition->accept(this); } } @@ -973,145 +1333,248 @@ ir_print_glsl_visitor::visit(ir_discard *ir) void ir_print_glsl_visitor::visit(ir_if *ir) { - ralloc_asprintf_append (&buffer, "if ("); + buffer.asprintf_append ("if ("); ir->condition->accept(this); - ralloc_asprintf_append (&buffer, ") {\n"); - indentation++; + buffer.asprintf_append (") {\n"); + indentation++; previous_skipped = false; - foreach_iter(exec_list_iterator, iter, ir->then_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + + foreach_list(n, &ir->then_instructions) { + ir_instruction *const inst = (ir_instruction *)n; indent(); inst->accept(this); - ralloc_asprintf_append (&buffer, ";\n"); + end_statement_line(); } indentation--; indent(); - ralloc_asprintf_append (&buffer, "}"); + buffer.asprintf_append ("}"); if (!ir->else_instructions.is_empty()) { - ralloc_asprintf_append (&buffer, " else {\n"); - indentation++; + buffer.asprintf_append (" else {\n"); + indentation++; previous_skipped = false; - foreach_iter(exec_list_iterator, iter, ir->else_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->else_instructions) { + ir_instruction *const inst = (ir_instruction *)n; indent(); inst->accept(this); - ralloc_asprintf_append (&buffer, ";\n"); + end_statement_line(); } indentation--; indent(); - ralloc_asprintf_append (&buffer, "}"); + buffer.asprintf_append ("}"); } } +bool ir_print_glsl_visitor::emit_canonical_for (ir_loop* ir) +{ + loop_variable_state* const ls = this->loopstate->get(ir); + if (ls == NULL) + return false; + + if (ls->induction_variables.is_empty()) + return false; + + if (ls->terminators.is_empty()) + return false; + + // only support for loops with one terminator condition + int terminatorCount = 0; + foreach_list(node, &ls->terminators) { + ++terminatorCount; + } + if (terminatorCount != 1) + return false; + + hash_table* terminator_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + hash_table* induction_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + + buffer.asprintf_append("for ("); + inside_loop_body = true; + + // emit loop induction variable declarations. + // only for loops with single induction variable, to avoid cases of different types of them + if (ls->private_induction_variable_count == 1) + { + foreach_list(node, &ls->induction_variables) + { + loop_variable* indvar = (loop_variable *) node; + if (!this->loopstate->get_for_inductor(indvar->var)) + continue; + + ir_variable* var = indvar->var; + print_precision (var, var->type); + print_type(buffer, var->type, false); + buffer.asprintf_append (" "); + print_var_name (var); + print_type_post(buffer, var->type, false); + if (indvar->initial_value) + { + buffer.asprintf_append (" = "); + indvar->initial_value->accept(this); + } + } + } + buffer.asprintf_append("; "); + + // emit loop terminating conditions + foreach_list(node, &ls->terminators) + { + loop_terminator* term = (loop_terminator *) node; + hash_table_insert(terminator_hash, term, term->ir); + + // IR has conditions in the form of "if (x) break", + // whereas for loop needs them negated, in the form + // if "while (x) continue the loop". + // See if we can print them using syntax that reads nice. + bool handled = false; + ir_expression* term_expr = term->ir->condition->as_expression(); + if (term_expr) + { + // Binary comparison conditions + const char* termOp = NULL; + switch (term_expr->operation) + { + case ir_binop_less: termOp = ">="; break; + case ir_binop_greater: termOp = "<="; break; + case ir_binop_lequal: termOp = ">"; break; + case ir_binop_gequal: termOp = "<"; break; + case ir_binop_equal: termOp = "!="; break; + case ir_binop_nequal: termOp = "=="; break; + default: break; + } + if (termOp != NULL) + { + term_expr->operands[0]->accept(this); + buffer.asprintf_append(" %s ", termOp); + term_expr->operands[1]->accept(this); + handled = true; + } + + // Unary logic not + if (!handled && term_expr->operation == ir_unop_logic_not) + { + term_expr->operands[0]->accept(this); + handled = true; + } + } + + // More complex condition, print as "!(x)" + if (!handled) + { + buffer.asprintf_append("!("); + term->ir->condition->accept(this); + buffer.asprintf_append(")"); + } + } + buffer.asprintf_append("; "); + + // emit loop induction variable updates + bool first = true; + foreach_list(node, &ls->induction_variables) + { + loop_variable* indvar = (loop_variable *) node; + hash_table_insert(induction_hash, indvar, indvar->first_assignment); + if (!first) + buffer.asprintf_append(", "); + visit(indvar->first_assignment); + first = false; + } + buffer.asprintf_append(") {\n"); + + inside_loop_body = false; + + // emit loop body + indentation++; previous_skipped = false; + foreach_list(node, &ir->body_instructions) { + ir_instruction *const inst = (ir_instruction *)node; + + // skip termination & induction statements, + // they are part of "for" clause + if (hash_table_find(terminator_hash, inst)) + continue; + if (hash_table_find(induction_hash, inst)) + continue; + + indent(); + inst->accept(this); + end_statement_line(); + } + indentation--; + + indent(); + buffer.asprintf_append("}"); + + hash_table_dtor (terminator_hash); + hash_table_dtor (induction_hash); + + return true; +} + + void ir_print_glsl_visitor::visit(ir_loop *ir) { - bool noData = (ir->counter == NULL && ir->from == NULL && ir->to == NULL && ir->increment == NULL); - if (noData) { - ralloc_asprintf_append (&buffer, "while (true) {\n"); - indentation++; - foreach_iter(exec_list_iterator, iter, ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); - indent(); - inst->accept(this); - ralloc_asprintf_append (&buffer, ";\n"); - } - indentation--; - indent(); - ralloc_asprintf_append (&buffer, "}"); + if (emit_canonical_for(ir)) return; - } - - bool canonicalFor = (ir->counter && ir->from && ir->to && ir->increment); - if (canonicalFor) - { - ralloc_asprintf_append (&buffer, "for ("); - ir->counter->accept (this); - ralloc_asprintf_append (&buffer, " = "); - ir->from->accept (this); - ralloc_asprintf_append (&buffer, "; "); - print_var_name (ir->counter); - - // IR cmp operator is when to terminate loop; whereas GLSL for loop syntax - // is while to continue the loop. Invert the meaning of operator when outputting. - const char* termOp = NULL; - switch (ir->cmp) { - case ir_binop_less: termOp = ">="; break; - case ir_binop_greater: termOp = "<="; break; - case ir_binop_lequal: termOp = ">"; break; - case ir_binop_gequal: termOp = "<"; break; - case ir_binop_equal: termOp = "!="; break; - case ir_binop_nequal: termOp = "=="; break; - default: assert(false); - } - ralloc_asprintf_append (&buffer, " %s ", termOp); - ir->to->accept (this); - ralloc_asprintf_append (&buffer, "; "); - // IR already has instructions that modify the loop counter in the body - //print_var_name (ir->counter); - //ralloc_asprintf_append (&buffer, " = "); - //print_var_name (ir->counter); - //ralloc_asprintf_append (&buffer, "+("); - //ir->increment->accept (this); - //ralloc_asprintf_append (&buffer, ")"); - ralloc_asprintf_append (&buffer, ") {\n"); - indentation++; - foreach_iter(exec_list_iterator, iter, ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); - indent(); - inst->accept(this); - ralloc_asprintf_append (&buffer, ";\n"); - } - indentation--; + + buffer.asprintf_append ("while (true) {\n"); + indentation++; previous_skipped = false; + foreach_list(n, &ir->body_instructions) { + ir_instruction *const inst = (ir_instruction *)n; indent(); - ralloc_asprintf_append (&buffer, "}"); - return; + inst->accept(this); + end_statement_line(); } - - - ralloc_asprintf_append (&buffer, "( TODO loop ("); - if (ir->counter != NULL) - ir->counter->accept(this); - ralloc_asprintf_append (&buffer, ") ("); - if (ir->from != NULL) - ir->from->accept(this); - ralloc_asprintf_append (&buffer, ") ("); - if (ir->to != NULL) - ir->to->accept(this); - ralloc_asprintf_append (&buffer, ") ("); - if (ir->increment != NULL) - ir->increment->accept(this); - ralloc_asprintf_append (&buffer, ") (\n"); - indentation++; - - foreach_iter(exec_list_iterator, iter, ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); - - indent(); - inst->accept(this); - ralloc_asprintf_append (&buffer, ";\n"); - } - indentation--; - indent(); - ralloc_asprintf_append (&buffer, "))\n"); + indentation--; + indent(); + buffer.asprintf_append ("}"); } void ir_print_glsl_visitor::visit(ir_loop_jump *ir) { - ralloc_asprintf_append (&buffer, "%s", ir->is_break() ? "break" : "continue"); + buffer.asprintf_append ("%s", ir->is_break() ? "break" : "continue"); } void ir_print_glsl_visitor::visit(ir_precision_statement *ir) { - ralloc_asprintf_append (&buffer, "%s", ir->precision_statement); + buffer.asprintf_append ("%s", ir->precision_statement); +} + +void +ir_print_glsl_visitor::visit(ir_typedecl_statement *ir) +{ + const glsl_type *const s = ir->type_decl; + buffer.asprintf_append ("struct %s {\n", s->name); + + for (unsigned j = 0; j < s->length; j++) { + buffer.asprintf_append (" "); + if (state->es_shader) + buffer.asprintf_append ("%s", get_precision_string(s->fields.structure[j].precision)); + print_type(buffer, s->fields.structure[j].type, false); + buffer.asprintf_append (" %s", s->fields.structure[j].name); + print_type_post(buffer, s->fields.structure[j].type, false); + buffer.asprintf_append (";\n"); + } + buffer.asprintf_append ("}"); +} + +void +ir_print_glsl_visitor::visit(ir_emit_vertex *ir) +{ + buffer.asprintf_append ("emit-vertex-TODO"); +} + +void +ir_print_glsl_visitor::visit(ir_end_primitive *ir) +{ + buffer.asprintf_append ("end-primitive-TODO"); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp index 40f094103..cc85db467 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.cpp @@ -24,6 +24,7 @@ #include "ir_print_visitor.h" #include "glsl_types.h" #include "glsl_parser_extras.h" +#include "main/macros.h" #include "program/hash_table.h" static void print_type(const glsl_type *t); @@ -37,6 +38,7 @@ ir_instruction::print(void) const deconsted->accept(&v); } +extern "C" { void _mesa_print_ir(exec_list *instructions, struct _mesa_glsl_parse_state *state) @@ -59,8 +61,8 @@ _mesa_print_ir(exec_list *instructions, } printf("(\n"); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir->print(); if (ir->ir_type != ir_type_function) printf("\n"); @@ -68,6 +70,8 @@ _mesa_print_ir(exec_list *instructions, printf("\n)"); } +} /* extern "C" */ + ir_print_visitor::ir_print_visitor() { indentation = 0; @@ -144,14 +148,18 @@ void ir_print_visitor::visit(ir_variable *ir) { printf("(declare "); - const char *const cent = (ir->centroid) ? "centroid " : ""; - const char *const inv = (ir->invariant) ? "invariant " : ""; - const char *const mode[] = { "", "uniform ", "in ", "out ", "inout ", + const char *const cent = (ir->data.centroid) ? "centroid " : ""; + const char *const samp = (ir->data.sample) ? "sample " : ""; + const char *const inv = (ir->data.invariant) ? "invariant " : ""; + const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ", + "in ", "out ", "inout ", "const_in ", "sys ", "temporary " }; - const char *const interp[] = { "", "smooth ", "flat ", "noperspective " }; + STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count); + const char *const interp[] = { "", "smooth", "flat", "noperspective" }; + STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT); - printf("(%s%s%s%s) ", - cent, inv, mode[ir->mode], interp[ir->interpolation]); + printf("(%s%s%s%s%s) ", + cent, samp, inv, mode[ir->data.mode], interp[ir->data.interpolation]); print_type(ir->type); printf(" %s)", unique_name(ir)); @@ -171,8 +179,8 @@ void ir_print_visitor::visit(ir_function_signature *ir) printf("(parameters\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->parameters) { - ir_variable *const inst = (ir_variable *) iter.get(); + foreach_list(n, &ir->parameters) { + ir_variable *const inst = (ir_variable *) n; indent(); inst->accept(this); @@ -188,8 +196,8 @@ void ir_print_visitor::visit(ir_function_signature *ir) printf("(\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->body) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->body) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -207,8 +215,8 @@ void ir_print_visitor::visit(ir_function *ir) { printf("(function %s\n", ir->name); indentation++; - foreach_iter(exec_list_iterator, iter, *ir) { - ir_function_signature *const sig = (ir_function_signature *) iter.get(); + foreach_list(n, &ir->signatures) { + ir_function_signature *const sig = (ir_function_signature *) n; indent(); sig->accept(this); printf("\n"); @@ -245,7 +253,7 @@ void ir_print_visitor::visit(ir_texture *ir) ir->sampler->accept(this); printf(" "); - if (ir->op != ir_txs) { + if (ir->op != ir_txs && ir->op != ir_query_levels) { ir->coordinate->accept(this); printf(" "); @@ -263,6 +271,8 @@ void ir_print_visitor::visit(ir_texture *ir) switch (ir->op) { case ir_tex: + case ir_lod: + case ir_query_levels: break; case ir_txb: ir->lod_info.bias->accept(this); @@ -272,6 +282,9 @@ void ir_print_visitor::visit(ir_texture *ir) case ir_txs: ir->lod_info.lod->accept(this); break; + case ir_txf_ms: + ir->lod_info.sample_index->accept(this); + break; case ir_txd: printf("("); ir->lod_info.grad.dPdx->accept(this); @@ -279,6 +292,9 @@ void ir_print_visitor::visit(ir_texture *ir) ir->lod_info.grad.dPdy->accept(this); printf(")"); break; + case ir_tg4: + ir->lod_info.component->accept(this); + break; }; printf(")"); } @@ -381,7 +397,17 @@ void ir_print_visitor::visit(ir_constant *ir) switch (ir->type->base_type) { case GLSL_TYPE_UINT: printf("%u", ir->value.u[i]); break; case GLSL_TYPE_INT: printf("%d", ir->value.i[i]); break; - case GLSL_TYPE_FLOAT: printf("%f", ir->value.f[i]); break; + case GLSL_TYPE_FLOAT: + if (ir->value.f[i] == 0.0f) + /* 0.0 == -0.0, so print with %f to get the proper sign. */ + printf("%.1f", ir->value.f[i]); + else if (fabs(ir->value.f[i]) < 0.000001f) + printf("%a", ir->value.f[i]); + else if (fabs(ir->value.f[i]) > 1000000.0f) + printf("%e", ir->value.f[i]); + else + printf("%f", ir->value.f[i]); + break; case GLSL_TYPE_BOOL: printf("%d", ir->value.b[i]); break; default: assert(0); } @@ -398,10 +424,10 @@ ir_print_visitor::visit(ir_call *ir) if (ir->return_deref) ir->return_deref->accept(this); printf(" ("); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->actual_parameters) { + ir_rvalue *const param = (ir_rvalue *) n; - inst->accept(this); + param->accept(this); } printf("))\n"); } @@ -445,8 +471,8 @@ ir_print_visitor::visit(ir_if *ir) printf("(\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->then_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->then_instructions) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -462,8 +488,8 @@ ir_print_visitor::visit(ir_if *ir) printf("(\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->else_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->else_instructions) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -481,23 +507,11 @@ ir_print_visitor::visit(ir_if *ir) void ir_print_visitor::visit(ir_loop *ir) { - printf("(loop ("); - if (ir->counter != NULL) - ir->counter->accept(this); - printf(") ("); - if (ir->from != NULL) - ir->from->accept(this); - printf(") ("); - if (ir->to != NULL) - ir->to->accept(this); - printf(") ("); - if (ir->increment != NULL) - ir->increment->accept(this); - printf(") (\n"); + printf("(loop (\n"); indentation++; - foreach_iter(exec_list_iterator, iter, ir->body_instructions) { - ir_instruction *const inst = (ir_instruction *) iter.get(); + foreach_list(n, &ir->body_instructions) { + ir_instruction *const inst = (ir_instruction *) n; indent(); inst->accept(this); @@ -518,5 +532,22 @@ ir_print_visitor::visit(ir_loop_jump *ir) void ir_print_visitor::visit(ir_precision_statement *ir) { - printf("%s", ir->precision_statement); + //printf("%s", ir->precision_statement); +} + +void +ir_print_visitor::visit(ir_typedecl_statement *ir) +{ +} + +void +ir_print_visitor::visit(ir_emit_vertex *ir) +{ + printf("(emit-vertex)"); +} + +void +ir_print_visitor::visit(ir_end_primitive *ir) +{ + printf("(end-primitive)"); } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h index dfdf293c4..5e4b93b9d 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_print_visitor.h @@ -33,9 +33,6 @@ extern "C" { #include "program/symbol_table.h" } -extern void _mesa_print_ir(exec_list *instructions, - struct _mesa_glsl_parse_state *state); - /** * Abstract base class of visitors of IR instruction trees */ @@ -73,6 +70,9 @@ public: virtual void visit(ir_loop *); virtual void visit(ir_loop_jump *); virtual void visit(ir_precision_statement *); + virtual void visit(ir_typedecl_statement *); + virtual void visit(ir_emit_vertex *); + virtual void visit(ir_end_primitive *); /*@}*/ private: diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_reader.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_reader.cpp deleted file mode 100644 index ebce15694..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/ir_reader.cpp +++ /dev/null @@ -1,1045 +0,0 @@ -/* - * Copyright © 2010 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include "ir_reader.h" -#include "glsl_parser_extras.h" -#include "glsl_types.h" -#include "s_expression.h" - -const static bool debug = false; - -class ir_reader { -public: - ir_reader(_mesa_glsl_parse_state *); - - void read(exec_list *instructions, const char *src, bool scan_for_protos); - -private: - void *mem_ctx; - _mesa_glsl_parse_state *state; - - void ir_read_error(s_expression *, const char *fmt, ...); - - const glsl_type *read_type(s_expression *); - - void scan_for_prototypes(exec_list *, s_expression *); - ir_function *read_function(s_expression *, bool skip_body); - void read_function_sig(ir_function *, s_expression *, bool skip_body); - - void read_instructions(exec_list *, s_expression *, ir_loop *); - ir_instruction *read_instruction(s_expression *, ir_loop *); - ir_variable *read_declaration(s_expression *); - ir_if *read_if(s_expression *, ir_loop *); - ir_loop *read_loop(s_expression *); - ir_call *read_call(s_expression *); - ir_return *read_return(s_expression *); - ir_rvalue *read_rvalue(s_expression *); - ir_assignment *read_assignment(s_expression *); - ir_expression *read_expression(s_expression *); - ir_swizzle *read_swizzle(s_expression *); - ir_constant *read_constant(s_expression *); - ir_texture *read_texture(s_expression *); - - ir_dereference *read_dereference(s_expression *); - ir_dereference_variable *read_var_ref(s_expression *); -}; - -ir_reader::ir_reader(_mesa_glsl_parse_state *state) : state(state) -{ - this->mem_ctx = state; -} - -void -_mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, - const char *src, bool scan_for_protos) -{ - ir_reader r(state); - r.read(instructions, src, scan_for_protos); -} - -void -ir_reader::read(exec_list *instructions, const char *src, bool scan_for_protos) -{ - void *sx_mem_ctx = ralloc_context(NULL); - s_expression *expr = s_expression::read_expression(sx_mem_ctx, src); - if (expr == NULL) { - ir_read_error(NULL, "couldn't parse S-Expression."); - return; - } - - if (scan_for_protos) { - scan_for_prototypes(instructions, expr); - if (state->error) - return; - } - - read_instructions(instructions, expr, NULL); - ralloc_free(sx_mem_ctx); - - if (debug) - validate_ir_tree(instructions); -} - -void -ir_reader::ir_read_error(s_expression *expr, const char *fmt, ...) -{ - va_list ap; - - state->error = true; - - if (state->current_function != NULL) - ralloc_asprintf_append(&state->info_log, "In function %s:\n", - state->current_function->function_name()); - ralloc_strcat(&state->info_log, "error: "); - - va_start(ap, fmt); - ralloc_vasprintf_append(&state->info_log, fmt, ap); - va_end(ap); - ralloc_strcat(&state->info_log, "\n"); - - if (expr != NULL) { - ralloc_strcat(&state->info_log, "...in this context:\n "); - expr->print(); - ralloc_strcat(&state->info_log, "\n\n"); - } -} - -const glsl_type * -ir_reader::read_type(s_expression *expr) -{ - s_expression *s_base_type; - s_int *s_size; - - s_pattern pat[] = { "array", s_base_type, s_size }; - if (MATCH(expr, pat)) { - const glsl_type *base_type = read_type(s_base_type); - if (base_type == NULL) { - ir_read_error(NULL, "when reading base type of array type"); - return NULL; - } - - return glsl_type::get_array_instance(base_type, s_size->value()); - } - - s_symbol *type_sym = SX_AS_SYMBOL(expr); - if (type_sym == NULL) { - ir_read_error(expr, "expected "); - return NULL; - } - - const glsl_type *type = state->symbols->get_type(type_sym->value()); - if (type == NULL) - ir_read_error(expr, "invalid type: %s", type_sym->value()); - - return type; -} - - -void -ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr) -{ - s_list *list = SX_AS_LIST(expr); - if (list == NULL) { - ir_read_error(expr, "Expected ( ...); found an atom."); - return; - } - - foreach_iter(exec_list_iterator, it, list->subexpressions) { - s_list *sub = SX_AS_LIST(it.get()); - if (sub == NULL) - continue; // not a (function ...); ignore it. - - s_symbol *tag = SX_AS_SYMBOL(sub->subexpressions.get_head()); - if (tag == NULL || strcmp(tag->value(), "function") != 0) - continue; // not a (function ...); ignore it. - - ir_function *f = read_function(sub, true); - if (f == NULL) - return; - instructions->push_tail(f); - } -} - -ir_function * -ir_reader::read_function(s_expression *expr, bool skip_body) -{ - bool added = false; - s_symbol *name; - - s_pattern pat[] = { "function", name }; - if (!PARTIAL_MATCH(expr, pat)) { - ir_read_error(expr, "Expected (function (signature ...) ...)"); - return NULL; - } - - ir_function *f = state->symbols->get_function(name->value()); - if (f == NULL) { - f = new(mem_ctx) ir_function(name->value()); - added = state->symbols->add_function(f); - assert(added); - } - - exec_list_iterator it = ((s_list *) expr)->subexpressions.iterator(); - it.next(); // skip "function" tag - it.next(); // skip function name - for (/* nothing */; it.has_next(); it.next()) { - s_expression *s_sig = (s_expression *) it.get(); - read_function_sig(f, s_sig, skip_body); - } - return added ? f : NULL; -} - -void -ir_reader::read_function_sig(ir_function *f, s_expression *expr, bool skip_body) -{ - s_expression *type_expr; - s_list *paramlist; - s_list *body_list; - - s_pattern pat[] = { "signature", type_expr, paramlist, body_list }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "Expected (signature (parameters ...) " - "( ...))"); - return; - } - - const glsl_type *return_type = read_type(type_expr); - if (return_type == NULL) - return; - - s_symbol *paramtag = SX_AS_SYMBOL(paramlist->subexpressions.get_head()); - if (paramtag == NULL || strcmp(paramtag->value(), "parameters") != 0) { - ir_read_error(paramlist, "Expected (parameters ...)"); - return; - } - - // Read the parameters list into a temporary place. - exec_list hir_parameters; - state->symbols->push_scope(); - - exec_list_iterator it = paramlist->subexpressions.iterator(); - for (it.next() /* skip "parameters" */; it.has_next(); it.next()) { - ir_variable *var = read_declaration((s_expression *) it.get()); - if (var == NULL) - return; - - hir_parameters.push_tail(var); - } - - ir_function_signature *sig = f->exact_matching_signature(&hir_parameters); - if (sig == NULL && skip_body) { - /* If scanning for prototypes, generate a new signature. */ - sig = new(mem_ctx) ir_function_signature(return_type, glsl_precision_undefined); - sig->is_builtin = true; - f->add_signature(sig); - } else if (sig != NULL) { - const char *badvar = sig->qualifiers_match(&hir_parameters); - if (badvar != NULL) { - ir_read_error(expr, "function `%s' parameter `%s' qualifiers " - "don't match prototype", f->name, badvar); - return; - } - - if (sig->return_type != return_type) { - ir_read_error(expr, "function `%s' return type doesn't " - "match prototype", f->name); - return; - } - } else { - /* No prototype for this body exists - skip it. */ - state->symbols->pop_scope(); - return; - } - assert(sig != NULL); - - sig->replace_parameters(&hir_parameters); - - if (!skip_body && !body_list->subexpressions.is_empty()) { - if (sig->is_defined) { - ir_read_error(expr, "function %s redefined", f->name); - return; - } - state->current_function = sig; - read_instructions(&sig->body, body_list, NULL); - state->current_function = NULL; - sig->is_defined = true; - } - - state->symbols->pop_scope(); -} - -void -ir_reader::read_instructions(exec_list *instructions, s_expression *expr, - ir_loop *loop_ctx) -{ - // Read in a list of instructions - s_list *list = SX_AS_LIST(expr); - if (list == NULL) { - ir_read_error(expr, "Expected ( ...); found an atom."); - return; - } - - foreach_iter(exec_list_iterator, it, list->subexpressions) { - s_expression *sub = (s_expression*) it.get(); - ir_instruction *ir = read_instruction(sub, loop_ctx); - if (ir != NULL) { - /* Global variable declarations should be moved to the top, before - * any functions that might use them. Functions are added to the - * instruction stream when scanning for prototypes, so without this - * hack, they always appear before variable declarations. - */ - if (state->current_function == NULL && ir->as_variable() != NULL) - instructions->push_head(ir); - else - instructions->push_tail(ir); - } - } -} - - -ir_instruction * -ir_reader::read_instruction(s_expression *expr, ir_loop *loop_ctx) -{ - s_symbol *symbol = SX_AS_SYMBOL(expr); - if (symbol != NULL) { - if (strcmp(symbol->value(), "break") == 0 && loop_ctx != NULL) - return new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_break); - if (strcmp(symbol->value(), "continue") == 0 && loop_ctx != NULL) - return new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue); - } - - s_list *list = SX_AS_LIST(expr); - if (list == NULL || list->subexpressions.is_empty()) { - ir_read_error(expr, "Invalid instruction.\n"); - return NULL; - } - - s_symbol *tag = SX_AS_SYMBOL(list->subexpressions.get_head()); - if (tag == NULL) { - ir_read_error(expr, "expected instruction tag"); - return NULL; - } - - ir_instruction *inst = NULL; - if (strcmp(tag->value(), "declare") == 0) { - inst = read_declaration(list); - } else if (strcmp(tag->value(), "assign") == 0) { - inst = read_assignment(list); - } else if (strcmp(tag->value(), "if") == 0) { - inst = read_if(list, loop_ctx); - } else if (strcmp(tag->value(), "loop") == 0) { - inst = read_loop(list); - } else if (strcmp(tag->value(), "call") == 0) { - inst = read_call(list); - } else if (strcmp(tag->value(), "return") == 0) { - inst = read_return(list); - } else if (strcmp(tag->value(), "function") == 0) { - inst = read_function(list, false); - } else { - inst = read_rvalue(list); - if (inst == NULL) - ir_read_error(NULL, "when reading instruction"); - } - return inst; -} - -ir_variable * -ir_reader::read_declaration(s_expression *expr) -{ - s_list *s_quals; - s_expression *s_type; - s_symbol *s_name; - - s_pattern pat[] = { "declare", s_quals, s_type, s_name }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "expected (declare () )"); - return NULL; - } - - const glsl_type *type = read_type(s_type); - if (type == NULL) - return NULL; - - ir_variable *var = new(mem_ctx) ir_variable(type, s_name->value(), - ir_var_auto, glsl_precision_undefined); - - foreach_iter(exec_list_iterator, it, s_quals->subexpressions) { - s_symbol *qualifier = SX_AS_SYMBOL(it.get()); - if (qualifier == NULL) { - ir_read_error(expr, "qualifier list must contain only symbols"); - return NULL; - } - - // FINISHME: Check for duplicate/conflicting qualifiers. - if (strcmp(qualifier->value(), "centroid") == 0) { - var->centroid = 1; - } else if (strcmp(qualifier->value(), "invariant") == 0) { - var->invariant = 1; - } else if (strcmp(qualifier->value(), "uniform") == 0) { - var->mode = ir_var_uniform; - } else if (strcmp(qualifier->value(), "auto") == 0) { - var->mode = ir_var_auto; - } else if (strcmp(qualifier->value(), "in") == 0) { - var->mode = ir_var_in; - } else if (strcmp(qualifier->value(), "const_in") == 0) { - var->mode = ir_var_const_in; - } else if (strcmp(qualifier->value(), "out") == 0) { - var->mode = ir_var_out; - } else if (strcmp(qualifier->value(), "inout") == 0) { - var->mode = ir_var_inout; - } else if (strcmp(qualifier->value(), "temporary") == 0) { - var->mode = ir_var_temporary; - } else if (strcmp(qualifier->value(), "smooth") == 0) { - var->interpolation = INTERP_QUALIFIER_SMOOTH; - } else if (strcmp(qualifier->value(), "flat") == 0) { - var->interpolation = INTERP_QUALIFIER_FLAT; - } else if (strcmp(qualifier->value(), "noperspective") == 0) { - var->interpolation = INTERP_QUALIFIER_NOPERSPECTIVE; - } else { - ir_read_error(expr, "unknown qualifier: %s", qualifier->value()); - return NULL; - } - } - - // Add the variable to the symbol table - state->symbols->add_variable(var); - - return var; -} - - -ir_if * -ir_reader::read_if(s_expression *expr, ir_loop *loop_ctx) -{ - s_expression *s_cond; - s_expression *s_then; - s_expression *s_else; - - s_pattern pat[] = { "if", s_cond, s_then, s_else }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "expected (if (...) (...))"); - return NULL; - } - - ir_rvalue *condition = read_rvalue(s_cond); - if (condition == NULL) { - ir_read_error(NULL, "when reading condition of (if ...)"); - return NULL; - } - - ir_if *iff = new(mem_ctx) ir_if(condition); - - read_instructions(&iff->then_instructions, s_then, loop_ctx); - read_instructions(&iff->else_instructions, s_else, loop_ctx); - if (state->error) { - delete iff; - iff = NULL; - } - return iff; -} - - -ir_loop * -ir_reader::read_loop(s_expression *expr) -{ - s_expression *s_counter, *s_from, *s_to, *s_inc, *s_body; - - s_pattern pat[] = { "loop", s_counter, s_from, s_to, s_inc, s_body }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "expected (loop " - " )"); - return NULL; - } - - // FINISHME: actually read the count/from/to fields. - - ir_loop *loop = new(mem_ctx) ir_loop; - read_instructions(&loop->body_instructions, s_body, loop); - if (state->error) { - delete loop; - loop = NULL; - } - return loop; -} - - -ir_return * -ir_reader::read_return(s_expression *expr) -{ - s_expression *s_retval; - - s_pattern return_value_pat[] = { "return", s_retval}; - s_pattern return_void_pat[] = { "return" }; - if (MATCH(expr, return_value_pat)) { - ir_rvalue *retval = read_rvalue(s_retval); - if (retval == NULL) { - ir_read_error(NULL, "when reading return value"); - return NULL; - } - return new(mem_ctx) ir_return(retval); - } else if (MATCH(expr, return_void_pat)) { - return new(mem_ctx) ir_return; - } else { - ir_read_error(expr, "expected (return ) or (return)"); - return NULL; - } -} - - -ir_rvalue * -ir_reader::read_rvalue(s_expression *expr) -{ - s_list *list = SX_AS_LIST(expr); - if (list == NULL || list->subexpressions.is_empty()) - return NULL; - - s_symbol *tag = SX_AS_SYMBOL(list->subexpressions.get_head()); - if (tag == NULL) { - ir_read_error(expr, "expected rvalue tag"); - return NULL; - } - - ir_rvalue *rvalue = read_dereference(list); - if (rvalue != NULL || state->error) - return rvalue; - else if (strcmp(tag->value(), "swiz") == 0) { - rvalue = read_swizzle(list); - } else if (strcmp(tag->value(), "expression") == 0) { - rvalue = read_expression(list); - } else if (strcmp(tag->value(), "constant") == 0) { - rvalue = read_constant(list); - } else { - rvalue = read_texture(list); - if (rvalue == NULL && !state->error) - ir_read_error(expr, "unrecognized rvalue tag: %s", tag->value()); - } - - return rvalue; -} - -ir_assignment * -ir_reader::read_assignment(s_expression *expr) -{ - s_expression *cond_expr = NULL; - s_expression *lhs_expr, *rhs_expr; - s_list *mask_list; - - s_pattern pat4[] = { "assign", mask_list, lhs_expr, rhs_expr }; - s_pattern pat5[] = { "assign", cond_expr, mask_list, lhs_expr, rhs_expr }; - if (!MATCH(expr, pat4) && !MATCH(expr, pat5)) { - ir_read_error(expr, "expected (assign [] () " - " )"); - return NULL; - } - - ir_rvalue *condition = NULL; - if (cond_expr != NULL) { - condition = read_rvalue(cond_expr); - if (condition == NULL) { - ir_read_error(NULL, "when reading condition of assignment"); - return NULL; - } - } - - unsigned mask = 0; - - s_symbol *mask_symbol; - s_pattern mask_pat[] = { mask_symbol }; - if (MATCH(mask_list, mask_pat)) { - const char *mask_str = mask_symbol->value(); - unsigned mask_length = (unsigned)strlen(mask_str); - if (mask_length > 4) { - ir_read_error(expr, "invalid write mask: %s", mask_str); - return NULL; - } - - const unsigned idx_map[] = { 3, 0, 1, 2 }; /* w=bit 3, x=0, y=1, z=2 */ - - for (unsigned i = 0; i < mask_length; i++) { - if (mask_str[i] < 'w' || mask_str[i] > 'z') { - ir_read_error(expr, "write mask contains invalid character: %c", - mask_str[i]); - return NULL; - } - mask |= 1 << idx_map[mask_str[i] - 'w']; - } - } else if (!mask_list->subexpressions.is_empty()) { - ir_read_error(mask_list, "expected () or ()"); - return NULL; - } - - ir_dereference *lhs = read_dereference(lhs_expr); - if (lhs == NULL) { - ir_read_error(NULL, "when reading left-hand side of assignment"); - return NULL; - } - - ir_rvalue *rhs = read_rvalue(rhs_expr); - if (rhs == NULL) { - ir_read_error(NULL, "when reading right-hand side of assignment"); - return NULL; - } - - if (mask == 0 && (lhs->type->is_vector() || lhs->type->is_scalar())) { - ir_read_error(expr, "non-zero write mask required."); - return NULL; - } - - return new(mem_ctx) ir_assignment(lhs, rhs, condition, mask); -} - -ir_call * -ir_reader::read_call(s_expression *expr) -{ - s_symbol *name; - s_list *params; - s_list *s_return = NULL; - - ir_dereference_variable *return_deref = NULL; - - s_pattern void_pat[] = { "call", name, params }; - s_pattern non_void_pat[] = { "call", name, s_return, params }; - if (MATCH(expr, non_void_pat)) { - return_deref = read_var_ref(s_return); - if (return_deref == NULL) { - ir_read_error(s_return, "when reading a call's return storage"); - return NULL; - } - } else if (!MATCH(expr, void_pat)) { - ir_read_error(expr, "expected (call [] ( ...))"); - return NULL; - } - - exec_list parameters; - - foreach_iter(exec_list_iterator, it, params->subexpressions) { - s_expression *expr = (s_expression*) it.get(); - ir_rvalue *param = read_rvalue(expr); - if (param == NULL) { - ir_read_error(expr, "when reading parameter to function call"); - return NULL; - } - parameters.push_tail(param); - } - - ir_function *f = state->symbols->get_function(name->value()); - if (f == NULL) { - ir_read_error(expr, "found call to undefined function %s", - name->value()); - return NULL; - } - - ir_function_signature *callee = f->matching_signature(¶meters); - if (callee == NULL) { - ir_read_error(expr, "couldn't find matching signature for function " - "%s", name->value()); - return NULL; - } - - if (callee->return_type == glsl_type::void_type && return_deref) { - ir_read_error(expr, "call has return value storage but void type"); - return NULL; - } else if (callee->return_type != glsl_type::void_type && !return_deref) { - ir_read_error(expr, "call has non-void type but no return value storage"); - return NULL; - } - - return new(mem_ctx) ir_call(callee, return_deref, ¶meters); -} - -ir_expression * -ir_reader::read_expression(s_expression *expr) -{ - s_expression *s_type; - s_symbol *s_op; - s_expression *s_arg1; - - s_pattern pat[] = { "expression", s_type, s_op, s_arg1 }; - if (!PARTIAL_MATCH(expr, pat)) { - ir_read_error(expr, "expected (expression " - " [])"); - return NULL; - } - s_expression *s_arg2 = (s_expression *) s_arg1->next; // may be tail sentinel - s_expression *s_arg3 = s_arg2->is_tail_sentinel() ? s_arg2 : (s_expression*)s_arg2->next; // may be tail sentinel - - const glsl_type *type = read_type(s_type); - if (type == NULL) - return NULL; - - /* Read the operator */ - ir_expression_operation op = ir_expression::get_operator(s_op->value()); - if (op == (ir_expression_operation) -1) { - ir_read_error(expr, "invalid operator: %s", s_op->value()); - return NULL; - } - - unsigned num_operands = ir_expression::get_num_operands(op); - if (num_operands == 1 && !s_arg1->next->is_tail_sentinel()) { - ir_read_error(expr, "expected (expression %s )", - s_op->value()); - return NULL; - } - - ir_rvalue *arg1 = read_rvalue(s_arg1); - ir_rvalue *arg2 = NULL; - ir_rvalue *arg3 = NULL; - if (arg1 == NULL) { - ir_read_error(NULL, "when reading first operand of %s", s_op->value()); - return NULL; - } - - if (num_operands == 2) { - if (s_arg2->is_tail_sentinel() || !s_arg2->next->is_tail_sentinel()) { - ir_read_error(expr, "expected (expression %s " - ")", s_op->value()); - return NULL; - } - arg2 = read_rvalue(s_arg2); - if (arg2 == NULL) { - ir_read_error(NULL, "when reading second operand of %s", - s_op->value()); - return NULL; - } - } - - if (num_operands == 3) { - if (s_arg2->is_tail_sentinel() || s_arg3->is_tail_sentinel() || !s_arg3->next->is_tail_sentinel()) { - ir_read_error(expr, "expected (expression %s " - " )", s_op->value()); - return NULL; - } - arg2 = read_rvalue(s_arg2); - if (arg2 == NULL) { - ir_read_error(NULL, "when reading second operand of %s", - s_op->value()); - return NULL; - } - arg3 = read_rvalue(s_arg3); - if (arg3 == NULL) { - ir_read_error(NULL, "when reading third operand of %s", - s_op->value()); - return NULL; - } - } - - return new(mem_ctx) ir_expression(op, type, arg1, arg2, arg3); -} - -ir_swizzle * -ir_reader::read_swizzle(s_expression *expr) -{ - s_symbol *swiz; - s_expression *sub; - - s_pattern pat[] = { "swiz", swiz, sub }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "expected (swiz )"); - return NULL; - } - - if (strlen(swiz->value()) > 4) { - ir_read_error(expr, "expected a valid swizzle; found %s", swiz->value()); - return NULL; - } - - ir_rvalue *rvalue = read_rvalue(sub); - if (rvalue == NULL) - return NULL; - - ir_swizzle *ir = ir_swizzle::create(rvalue, swiz->value(), - rvalue->type->vector_elements); - if (ir == NULL) - ir_read_error(expr, "invalid swizzle"); - - return ir; -} - -ir_constant * -ir_reader::read_constant(s_expression *expr) -{ - s_expression *type_expr; - s_list *values; - - s_pattern pat[] = { "constant", type_expr, values }; - if (!MATCH(expr, pat)) { - ir_read_error(expr, "expected (constant (...))"); - return NULL; - } - - const glsl_type *type = read_type(type_expr); - if (type == NULL) - return NULL; - - if (values == NULL) { - ir_read_error(expr, "expected (constant (...))"); - return NULL; - } - - if (type->is_array()) { - unsigned elements_supplied = 0; - exec_list elements; - foreach_iter(exec_list_iterator, it, values->subexpressions) { - s_expression *elt = (s_expression *) it.get(); - ir_constant *ir_elt = read_constant(elt); - if (ir_elt == NULL) - return NULL; - elements.push_tail(ir_elt); - elements_supplied++; - } - - if (elements_supplied != type->length) { - ir_read_error(values, "expected exactly %u array elements, " - "given %u", type->length, elements_supplied); - return NULL; - } - return new(mem_ctx) ir_constant(type, &elements); - } - - ir_constant_data data = { { 0 } }; - - // Read in list of values (at most 16). - unsigned k = 0; - foreach_iter(exec_list_iterator, it, values->subexpressions) { - if (k >= 16) { - ir_read_error(values, "expected at most 16 numbers"); - return NULL; - } - - s_expression *expr = (s_expression*) it.get(); - - if (type->base_type == GLSL_TYPE_FLOAT) { - s_number *value = SX_AS_NUMBER(expr); - if (value == NULL) { - ir_read_error(values, "expected numbers"); - return NULL; - } - data.f[k] = value->fvalue(); - } else { - s_int *value = SX_AS_INT(expr); - if (value == NULL) { - ir_read_error(values, "expected integers"); - return NULL; - } - - switch (type->base_type) { - case GLSL_TYPE_UINT: { - data.u[k] = value->value(); - break; - } - case GLSL_TYPE_INT: { - data.i[k] = value->value(); - break; - } - case GLSL_TYPE_BOOL: { - data.b[k] = !!value->value(); - break; - } - default: - ir_read_error(values, "unsupported constant type"); - return NULL; - } - } - ++k; - } - if (k != type->components()) { - ir_read_error(values, "expected %u constant values, found %u", - type->components(), k); - return NULL; - } - - return new(mem_ctx) ir_constant(type, &data); -} - -ir_dereference_variable * -ir_reader::read_var_ref(s_expression *expr) -{ - s_symbol *s_var; - s_pattern var_pat[] = { "var_ref", s_var }; - - if (MATCH(expr, var_pat)) { - ir_variable *var = state->symbols->get_variable(s_var->value()); - if (var == NULL) { - ir_read_error(expr, "undeclared variable: %s", s_var->value()); - return NULL; - } - return new(mem_ctx) ir_dereference_variable(var); - } - return NULL; -} - -ir_dereference * -ir_reader::read_dereference(s_expression *expr) -{ - s_expression *s_subject; - s_expression *s_index; - s_symbol *s_field; - - s_pattern array_pat[] = { "array_ref", s_subject, s_index }; - s_pattern record_pat[] = { "record_ref", s_subject, s_field }; - - ir_dereference_variable *var_ref = read_var_ref(expr); - if (var_ref != NULL) { - return var_ref; - } else if (MATCH(expr, array_pat)) { - ir_rvalue *subject = read_rvalue(s_subject); - if (subject == NULL) { - ir_read_error(NULL, "when reading the subject of an array_ref"); - return NULL; - } - - ir_rvalue *idx = read_rvalue(s_index); - if (subject == NULL) { - ir_read_error(NULL, "when reading the index of an array_ref"); - return NULL; - } - return new(mem_ctx) ir_dereference_array(subject, idx); - } else if (MATCH(expr, record_pat)) { - ir_rvalue *subject = read_rvalue(s_subject); - if (subject == NULL) { - ir_read_error(NULL, "when reading the subject of a record_ref"); - return NULL; - } - return new(mem_ctx) ir_dereference_record(subject, s_field->value()); - } - return NULL; -} - -ir_texture * -ir_reader::read_texture(s_expression *expr) -{ - s_symbol *tag = NULL; - s_expression *s_type = NULL; - s_expression *s_sampler = NULL; - s_expression *s_coord = NULL; - s_expression *s_offset = NULL; - s_expression *s_lod = NULL; - - ir_texture_opcode op = ir_tex; /* silence warning */ - - s_pattern tex_pattern[] = - { "tex", s_type, s_sampler, s_coord, s_offset }; - s_pattern txf_pattern[] = - { "txf", s_type, s_sampler, s_coord, s_offset, s_lod }; - s_pattern txs_pattern[] = - { "txs", s_type, s_sampler, s_lod }; - s_pattern other_pattern[] = - { tag, s_type, s_sampler, s_coord, s_offset, s_lod }; - - if (MATCH(expr, tex_pattern)) { - op = ir_tex; - } else if (MATCH(expr, txf_pattern)) { - op = ir_txf; - } else if (MATCH(expr, txs_pattern)) { - op = ir_txs; - } else if (MATCH(expr, other_pattern)) { - op = ir_texture::get_opcode(tag->value()); - if (op == -1) - return NULL; - } else { - ir_read_error(NULL, "unexpected texture pattern"); - return NULL; - } - - ir_texture *tex = new(mem_ctx) ir_texture(op); - - // Read return type - const glsl_type *type = read_type(s_type); - if (type == NULL) { - ir_read_error(NULL, "when reading type in (%s ...)", - tex->opcode_string()); - return NULL; - } - - // Read sampler (must be a deref) - ir_dereference *sampler = read_dereference(s_sampler); - if (sampler == NULL) { - ir_read_error(NULL, "when reading sampler in (%s ...)", - tex->opcode_string()); - return NULL; - } - tex->set_sampler(sampler, type); - - if (op != ir_txs) { - // Read coordinate (any rvalue) - tex->coordinate = read_rvalue(s_coord); - if (tex->coordinate == NULL) { - ir_read_error(NULL, "when reading coordinate in (%s ...)", - tex->opcode_string()); - return NULL; - } - - // Read texel offset - either 0 or an rvalue. - s_int *si_offset = SX_AS_INT(s_offset); - if (si_offset == NULL || si_offset->value() != 0) { - tex->offset = read_rvalue(s_offset); - if (tex->offset == NULL) { - ir_read_error(s_offset, "expected 0 or an expression"); - return NULL; - } - } - } - - switch (op) { - case ir_txb: - tex->lod_info.bias = read_rvalue(s_lod); - if (tex->lod_info.bias == NULL) { - ir_read_error(NULL, "when reading LOD bias in (txb ...)"); - return NULL; - } - break; - case ir_txl: - case ir_txf: - case ir_txs: - tex->lod_info.lod = read_rvalue(s_lod); - if (tex->lod_info.lod == NULL) { - ir_read_error(NULL, "when reading LOD in (%s ...)", - tex->opcode_string()); - return NULL; - } - break; - case ir_txd: { - s_expression *s_dx, *s_dy; - s_pattern dxdy_pat[] = { s_dx, s_dy }; - if (!MATCH(s_lod, dxdy_pat)) { - ir_read_error(s_lod, "expected (dPdx dPdy) in (txd ...)"); - return NULL; - } - tex->lod_info.grad.dPdx = read_rvalue(s_dx); - if (tex->lod_info.grad.dPdx == NULL) { - ir_read_error(NULL, "when reading dPdx in (txd ...)"); - return NULL; - } - tex->lod_info.grad.dPdy = read_rvalue(s_dy); - if (tex->lod_info.grad.dPdy == NULL) { - ir_read_error(NULL, "when reading dPdy in (txd ...)"); - return NULL; - } - break; - } - default: - // tex doesn't have any extra parameters. - break; - }; - return tex; -} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp index 91feab567..93efa21b1 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_rvalue_visitor.cpp @@ -32,7 +32,6 @@ #include "ir.h" #include "ir_visitor.h" #include "ir_rvalue_visitor.h" -#include "ir_print_visitor.h" #include "glsl_types.h" ir_visitor_status @@ -55,6 +54,8 @@ ir_rvalue_base_visitor::rvalue_visit(ir_texture *ir) switch (ir->op) { case ir_tex: + case ir_lod: + case ir_query_levels: break; case ir_txb: handle_rvalue(&ir->lod_info.bias); @@ -64,10 +65,16 @@ ir_rvalue_base_visitor::rvalue_visit(ir_texture *ir) case ir_txs: handle_rvalue(&ir->lod_info.lod); break; + case ir_txf_ms: + handle_rvalue(&ir->lod_info.sample_index); + break; case ir_txd: handle_rvalue(&ir->lod_info.grad.dPdx); handle_rvalue(&ir->lod_info.grad.dPdy); break; + case ir_tg4: + handle_rvalue(&ir->lod_info.component); + break; } return visit_continue; @@ -114,8 +121,8 @@ ir_rvalue_base_visitor::rvalue_visit(ir_assignment *ir) ir_visitor_status ir_rvalue_base_visitor::rvalue_visit(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; ir_rvalue *new_param = param; handle_rvalue(&new_param); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_stats.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_stats.cpp new file mode 100644 index 000000000..ecd0b1b2e --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/ir_stats.cpp @@ -0,0 +1,64 @@ +#include "ir.h" +#include "ir_visitor.h" +#include "ir_unused_structs.h" +#include "glsl_types.h" + +struct ir_stats_counter_visitor : public ir_hierarchical_visitor { + ir_stats_counter_visitor() + : math(0), tex(0), flow(0) + { + } + + virtual ir_visitor_status visit_leave(class ir_loop *) + { + ++flow; + return visit_continue; + } + virtual ir_visitor_status visit_leave(class ir_expression *) + { + ++math; + return visit_continue; + } + virtual ir_visitor_status visit_leave(class ir_texture *) + { + ++tex; + return visit_continue; + } + virtual ir_visitor_status visit_leave(ir_assignment *ir) + { + if (ir && ir->rhs) + { + if (ir->rhs->as_constant()) + ++math; + } + return visit_continue; + } + virtual ir_visitor_status visit_leave(class ir_return *) + { + ++flow; + return visit_continue; + } + virtual ir_visitor_status visit_leave(class ir_discard *) + { + ++tex; + return visit_continue; + } + virtual ir_visitor_status visit_leave(class ir_if *) + { + ++flow; + return visit_continue; + } + + int math; + int tex; + int flow; +}; + +void calculate_shader_stats(exec_list* instructions, int* outMath, int* outTex, int* outFlow) +{ + ir_stats_counter_visitor v; + v.run (instructions); + *outMath = v.math; + *outTex = v.tex; + *outFlow = v.flow; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_stats.h b/3rdparty/glsl-optimizer/src/glsl/ir_stats.h new file mode 100644 index 000000000..4b6da7c47 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/ir_stats.h @@ -0,0 +1,3 @@ +#include "ir.h" + +void calculate_shader_stats(exec_list* instructions, int* outMath, int* outTex, int* outFlow); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h b/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h index 913c53773..f678c2c5c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_uniform.h @@ -80,6 +80,10 @@ struct gl_uniform_driver_storage { struct gl_uniform_storage { char *name; + /** Type of this uniform data stored. + * + * In the case of an array, it's the type of a single array element. + */ const struct glsl_type *type; /** @@ -95,15 +99,24 @@ struct gl_uniform_storage { */ bool initialized; - /** - * Base sampler index - * - * If \c ::base_type is \c GLSL_TYPE_SAMPLER, this represents the index of - * this sampler. If \c ::array_elements is not zero, the array will use - * sampler indexes \c ::sampler through \c ::sampler + \c ::array_elements - * - 1, inclusive. - */ - uint8_t sampler; + struct { + /** + * Base sampler index + * + * If \c ::base_type is \c GLSL_TYPE_SAMPLER, this represents the index + * of this sampler. If \c ::array_elements is not zero, the array will + * use sampler indices \c ::sampler through \c ::sampler + + * \c ::array_elements - 1, inclusive. + * + * Note that the index may be different in each shader stage. + */ + uint8_t index; + + /** + * Whether this sampler is used in this shader stage. + */ + bool active; + } sampler[MESA_SHADER_STAGES]; /** * Storage used by the driver for the uniform @@ -153,6 +166,13 @@ struct gl_uniform_storage { bool row_major; /** @} */ + + /** + * Index within gl_shader_program::AtomicBuffers[] of the atomic + * counter buffer this uniform is stored in, or -1 if this is not + * an atomic counter. + */ + int atomic_buffer_index; }; #ifdef __cplusplus diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp index 53abb85f1..38deea15f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.cpp @@ -26,6 +26,40 @@ #include "ir_unused_structs.h" #include "glsl_types.h" + +class ir_struct_usage_visitor : public ir_hierarchical_visitor { +public: + ir_struct_usage_visitor(); + ~ir_struct_usage_visitor(void); + + virtual ir_visitor_status visit(ir_dereference_variable *); + + bool has_struct_entry(const glsl_type *t) const; + + exec_list struct_list; + void *mem_ctx; +}; + +class ir_decl_removal_visitor : public ir_hierarchical_visitor { +public: + ir_decl_removal_visitor(ir_struct_usage_visitor* used_structs) + : used_structs(used_structs) + { + } + + virtual ir_visitor_status visit(ir_typedecl_statement* ir) + { + if (!used_structs->has_struct_entry(ir->type_decl)) + { + ir->remove(); + } + return visit_continue; + } + + ir_struct_usage_visitor* used_structs; +}; + + struct struct_entry : public exec_node { struct_entry(const glsl_type *type_) : type(type_) { } @@ -37,8 +71,8 @@ bool ir_struct_usage_visitor::has_struct_entry(const glsl_type *t) const { assert(t); - foreach_iter(exec_list_iterator, iter, this->struct_list) { - struct_entry *entry = (struct_entry *)iter.get(); + foreach_list(node, &this->struct_list) { + struct_entry *entry = (struct_entry *)node; if (entry->type == t) return true; } @@ -68,6 +102,8 @@ static void visit_variable (ir_instruction* ir, void* data) return; ir_struct_usage_visitor* self = reinterpret_cast(data); const glsl_type* t = var->type; + if (t->base_type == GLSL_TYPE_ARRAY) + t = t->fields.array; // handle array of structs case if (t->base_type == GLSL_TYPE_STRUCT) { if (!self->has_struct_entry (t)) @@ -91,3 +127,14 @@ ir_struct_usage_visitor::~ir_struct_usage_visitor(void) { ralloc_free(mem_ctx); } + + + +void do_remove_unused_typedecls(exec_list* instructions) +{ + ir_struct_usage_visitor v; + v.run (instructions); + + ir_decl_removal_visitor v2(&v); + v2.run (instructions); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.h b/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.h index 217dd4615..3c1bb5ec6 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_unused_structs.h @@ -22,17 +22,5 @@ */ #include "ir.h" -#include "ir_visitor.h" -class ir_struct_usage_visitor : public ir_hierarchical_visitor { -public: - ir_struct_usage_visitor(); - ~ir_struct_usage_visitor(void); - - virtual ir_visitor_status visit(ir_dereference_variable *); - - bool has_struct_entry(const glsl_type *t) const; - - exec_list struct_list; - void *mem_ctx; -}; +void do_remove_unused_typedecls(exec_list* instructions); diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp index dd9ccdeab..743f38708 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_validate.cpp @@ -38,6 +38,8 @@ #include "program/hash_table.h" #include "glsl_types.h" +namespace { + class ir_validate : public ir_hierarchical_visitor { public: ir_validate() @@ -61,7 +63,6 @@ public: virtual ir_visitor_status visit_enter(ir_if *ir); - virtual ir_visitor_status visit_leave(ir_loop *ir); virtual ir_visitor_status visit_enter(ir_function *ir); virtual ir_visitor_status visit_leave(ir_function *ir); virtual ir_visitor_status visit_enter(ir_function_signature *ir); @@ -69,6 +70,8 @@ public: virtual ir_visitor_status visit_leave(ir_expression *ir); virtual ir_visitor_status visit_leave(ir_swizzle *ir); + virtual ir_visitor_status visit_enter(class ir_dereference_array *); + virtual ir_visitor_status visit_enter(ir_assignment *ir); virtual ir_visitor_status visit_enter(ir_call *ir); @@ -79,6 +82,7 @@ public: struct hash_table *ht; }; +} /* anonymous namespace */ ir_visitor_status ir_validate::visit(ir_dereference_variable *ir) @@ -101,6 +105,33 @@ ir_validate::visit(ir_dereference_variable *ir) return visit_continue; } +ir_visitor_status +ir_validate::visit_enter(class ir_dereference_array *ir) +{ + if (!ir->array->type->is_array() && !ir->array->type->is_matrix()) { + printf("ir_dereference_array @ %p does not specify an array or a " + "matrix\n", + (void *) ir); + ir->print(); + printf("\n"); + abort(); + } + + if (!ir->array_index->type->is_scalar()) { + printf("ir_dereference_array @ %p does not have scalar index: %s\n", + (void *) ir, ir->array_index->type->name); + abort(); + } + + if (!ir->array_index->type->is_integer()) { + printf("ir_dereference_array @ %p does not have integer index: %s\n", + (void *) ir, ir->array_index->type->name); + abort(); + } + + return visit_continue; +} + ir_visitor_status ir_validate::visit_enter(ir_if *ir) { @@ -116,42 +147,6 @@ ir_validate::visit_enter(ir_if *ir) } -ir_visitor_status -ir_validate::visit_leave(ir_loop *ir) -{ - if (ir->counter != NULL) { - if ((ir->from == NULL) || (ir->from == NULL) || (ir->increment == NULL)) { - printf("ir_loop has invalid loop controls:\n" - " counter: %p\n" - " from: %p\n" - " to: %p\n" - " increment: %p\n", - (void *) ir->counter, (void *) ir->from, (void *) ir->to, - (void *) ir->increment); - abort(); - } - - if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) { - printf("ir_loop has invalid comparitor %d\n", ir->cmp); - abort(); - } - } else { - if ((ir->from != NULL) || (ir->from != NULL) || (ir->increment != NULL)) { - printf("ir_loop has invalid loop controls:\n" - " counter: %p\n" - " from: %p\n" - " to: %p\n" - " increment: %p\n", - (void *) ir->counter, (void *) ir->from, (void *) ir->to, - (void *) ir->increment); - abort(); - } - } - - return visit_continue; -} - - ir_visitor_status ir_validate::visit_enter(ir_function *ir) { @@ -227,8 +222,7 @@ ir_visitor_status ir_validate::visit_leave(ir_expression *ir) { switch (ir->operation) { - case ir_ternop_clamp: - case ir_ternop_mix: + case ir_triop_clamp: break; case ir_unop_bit_not: assert(ir->operands[0]->type == ir->type); @@ -333,6 +327,51 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[0]->type == ir->type); break; + case ir_unop_pack_snorm_2x16: + case ir_unop_pack_unorm_2x16: + case ir_unop_pack_half_2x16: + assert(ir->type == glsl_type::uint_type); + assert(ir->operands[0]->type == glsl_type::vec2_type); + break; + + case ir_unop_pack_snorm_4x8: + case ir_unop_pack_unorm_4x8: + assert(ir->type == glsl_type::uint_type); + assert(ir->operands[0]->type == glsl_type::vec4_type); + break; + + case ir_unop_unpack_snorm_2x16: + case ir_unop_unpack_unorm_2x16: + case ir_unop_unpack_half_2x16: + assert(ir->type == glsl_type::vec2_type); + assert(ir->operands[0]->type == glsl_type::uint_type); + break; + + case ir_unop_unpack_snorm_4x8: + case ir_unop_unpack_unorm_4x8: + assert(ir->type == glsl_type::vec4_type); + assert(ir->operands[0]->type == glsl_type::uint_type); + break; + + case ir_unop_unpack_half_2x16_split_x: + case ir_unop_unpack_half_2x16_split_y: + assert(ir->type == glsl_type::float_type); + assert(ir->operands[0]->type == glsl_type::uint_type); + break; + + case ir_unop_bitfield_reverse: + assert(ir->operands[0]->type == ir->type); + assert(ir->type->is_integer()); + break; + + case ir_unop_bit_count: + case ir_unop_find_msb: + case ir_unop_find_lsb: + assert(ir->operands[0]->type->vector_elements == ir->type->vector_elements); + assert(ir->operands[0]->type->is_integer()); + assert(ir->type->base_type == GLSL_TYPE_INT); + break; + case ir_unop_noise: /* XXX what can we assert here? */ break; @@ -356,6 +395,19 @@ ir_validate::visit_leave(ir_expression *ir) } break; + case ir_binop_imul_high: + assert(ir->type == ir->operands[0]->type); + assert(ir->type == ir->operands[1]->type); + assert(ir->type->is_integer()); + break; + + case ir_binop_carry: + case ir_binop_borrow: + assert(ir->type == ir->operands[0]->type); + assert(ir->type == ir->operands[1]->type); + assert(ir->type->base_type == GLSL_TYPE_UINT); + break; + case ir_binop_less: case ir_binop_greater: case ir_binop_lequal: @@ -427,6 +479,18 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[0]->type == ir->operands[1]->type); break; + case ir_binop_pack_half_2x16_split: + assert(ir->type == glsl_type::uint_type); + assert(ir->operands[0]->type == glsl_type::float_type); + assert(ir->operands[1]->type == glsl_type::float_type); + break; + + case ir_binop_bfm: + assert(ir->type->is_integer()); + assert(ir->operands[0]->type->is_integer()); + assert(ir->operands[1]->type->is_integer()); + break; + case ir_binop_ubo_load: assert(ir->operands[0]->as_constant()); assert(ir->operands[0]->type == glsl_type::uint_type); @@ -434,6 +498,68 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[1]->type == glsl_type::uint_type); break; + case ir_binop_ldexp: + assert(ir->operands[0]->type == ir->type); + assert(ir->operands[0]->type->is_float()); + assert(ir->operands[1]->type->base_type == GLSL_TYPE_INT); + assert(ir->operands[0]->type->components() == + ir->operands[1]->type->components()); + break; + + case ir_binop_vector_extract: + assert(ir->operands[0]->type->is_vector()); + assert(ir->operands[1]->type->is_scalar() + && ir->operands[1]->type->is_integer()); + break; + + case ir_triop_fma: + assert(ir->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->type == ir->operands[0]->type); + assert(ir->type == ir->operands[1]->type); + assert(ir->type == ir->operands[2]->type); + break; + + case ir_triop_lrp: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->operands[0]->type == ir->operands[1]->type); + assert(ir->operands[2]->type == ir->operands[0]->type || ir->operands[2]->type == glsl_type::float_type); + break; + + case ir_triop_csel: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL); + assert(ir->type->vector_elements == ir->operands[0]->type->vector_elements); + assert(ir->type == ir->operands[1]->type); + assert(ir->type == ir->operands[2]->type); + break; + + case ir_triop_bfi: + assert(ir->operands[0]->type->is_integer()); + assert(ir->operands[1]->type == ir->operands[2]->type); + assert(ir->operands[1]->type == ir->type); + break; + + case ir_triop_bitfield_extract: + assert(ir->operands[0]->type == ir->type); + assert(ir->operands[1]->type == glsl_type::int_type); + assert(ir->operands[2]->type == glsl_type::int_type); + break; + + case ir_triop_vector_insert: + assert(ir->operands[0]->type->is_vector()); + assert(ir->operands[1]->type->is_scalar()); + assert(ir->operands[0]->type->base_type == ir->operands[1]->type->base_type); + assert(ir->operands[2]->type->is_scalar() + && ir->operands[2]->type->is_integer()); + assert(ir->type == ir->operands[0]->type); + break; + + case ir_quadop_bitfield_insert: + assert(ir->operands[0]->type == ir->type); + assert(ir->operands[1]->type == ir->type); + assert(ir->operands[2]->type == glsl_type::int_type); + assert(ir->operands[3]->type == glsl_type::int_type); + break; + case ir_quadop_vector: /* The vector operator collects some number of scalars and generates a * vector from them. @@ -519,15 +645,35 @@ ir_validate::visit(ir_variable *ir) * to be out of bounds. */ if (ir->type->array_size() > 0) { - if (ir->max_array_access >= ir->type->length) { + if (ir->data.max_array_access >= ir->type->length) { printf("ir_variable has maximum access out of bounds (%d vs %d)\n", - ir->max_array_access, ir->type->length - 1); + ir->data.max_array_access, ir->type->length - 1); ir->print(); abort(); } } - if (ir->constant_initializer != NULL && !ir->has_initializer) { + /* If a variable is an interface block (or an array of interface blocks), + * verify that the maximum array index for each interface member is in + * bounds. + */ + if (ir->is_interface_instance()) { + const glsl_struct_field *fields = + ir->get_interface_type()->fields.structure; + for (unsigned i = 0; i < ir->get_interface_type()->length; i++) { + if (fields[i].type->array_size() > 0) { + if (ir->max_ifc_array_access[i] >= fields[i].type->length) { + printf("ir_variable has maximum access out of bounds for " + "field %s (%d vs %d)\n", fields[i].name, + ir->max_ifc_array_access[i], fields[i].type->length); + ir->print(); + abort(); + } + } + } + } + + if (ir->constant_initializer != NULL && !ir->data.has_initializer) { printf("ir_variable didn't have an initializer, but has a constant " "initializer value.\n"); ir->print(); @@ -609,8 +755,8 @@ ir_validate::visit_enter(ir_call *ir) printf("ir_call parameter type mismatch:\n"); goto dump_ir; } - if (formal_param->mode == ir_var_out - || formal_param->mode == ir_var_inout) { + if (formal_param->data.mode == ir_var_function_out + || formal_param->data.mode == ir_var_function_inout) { if (!actual_param->is_lvalue()) { printf("ir_call out/inout parameters must be lvalues:\n"); goto dump_ir; @@ -661,13 +807,19 @@ check_node_type(ir_instruction *ir, void *data) void validate_ir_tree(exec_list *instructions) { + /* We shouldn't have any reason to validate IR in a release build, + * and it's half composed of assert()s anyway which wouldn't do + * anything. + */ +#ifdef DEBUG ir_validate v; v.run(instructions); - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; visit_tree(ir, check_node_type, NULL); } +#endif } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp index d971f0142..951682c13 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.cpp @@ -33,7 +33,26 @@ #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" +#include "main/hash_table.h" +ir_variable_refcount_visitor::ir_variable_refcount_visitor() +{ + this->mem_ctx = ralloc_context(NULL); + this->ht = _mesa_hash_table_create(NULL, _mesa_key_pointer_equal); +} + +static void +free_entry(struct hash_entry *entry) +{ + ir_variable_refcount_entry *ivre = (ir_variable_refcount_entry *) entry->data; + delete ivre; +} + +ir_variable_refcount_visitor::~ir_variable_refcount_visitor() +{ + ralloc_free(this->mem_ctx); + _mesa_hash_table_destroy(this->ht, free_entry); +} // constructor ir_variable_refcount_entry::ir_variable_refcount_entry(ir_variable *var) @@ -50,15 +69,17 @@ ir_variable_refcount_entry * ir_variable_refcount_visitor::get_variable_entry(ir_variable *var) { assert(var); - foreach_iter(exec_list_iterator, iter, this->variable_list) { - ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)iter.get(); - if (entry->var == var) - return entry; - } - ir_variable_refcount_entry *entry = new(mem_ctx) ir_variable_refcount_entry(var); + struct hash_entry *e = _mesa_hash_table_search(this->ht, + _mesa_hash_pointer(var), + var); + if (e) + return (ir_variable_refcount_entry *)e->data; + + ir_variable_refcount_entry *entry = new ir_variable_refcount_entry(var); assert(entry->referenced_count == 0); - this->variable_list.push_tail(entry); + _mesa_hash_table_insert(this->ht, _mesa_hash_pointer(var), var, entry); + return entry; } @@ -66,11 +87,12 @@ ir_variable_refcount_entry * ir_variable_refcount_visitor::find_variable_entry(ir_variable *var) { assert(var); - foreach_iter(exec_list_iterator, iter, this->variable_list) { - ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)iter.get(); - if (entry->var == var) - return entry; - } + struct hash_entry *e = _mesa_hash_table_search(this->ht, + _mesa_hash_pointer(var), + var); + if (e) + return (ir_variable_refcount_entry *)e->data; + return NULL; } diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h index acde7484f..fbb776945 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_variable_refcount.h @@ -33,7 +33,7 @@ #include "ir_visitor.h" #include "glsl_types.h" -class ir_variable_refcount_entry : public exec_node +class ir_variable_refcount_entry { public: ir_variable_refcount_entry(ir_variable *var); @@ -52,16 +52,8 @@ public: class ir_variable_refcount_visitor : public ir_hierarchical_visitor { public: - ir_variable_refcount_visitor(void) - { - this->mem_ctx = ralloc_context(NULL); - this->variable_list.make_empty(); - } - - ~ir_variable_refcount_visitor(void) - { - ralloc_free(this->mem_ctx); - } + ir_variable_refcount_visitor(void); + ~ir_variable_refcount_visitor(void); virtual ir_visitor_status visit(ir_variable *); virtual ir_visitor_status visit(ir_dereference_variable *); @@ -72,8 +64,7 @@ public: ir_variable_refcount_entry *get_variable_entry(ir_variable *var); ir_variable_refcount_entry *find_variable_entry(ir_variable *var); - /* List of ir_variable_refcount_entry */ - exec_list variable_list; + struct hash_table *ht; void *mem_ctx; }; diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_visitor.h b/3rdparty/glsl-optimizer/src/glsl/ir_visitor.h index 24aabe74e..dc31797e2 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_visitor.h +++ b/3rdparty/glsl-optimizer/src/glsl/ir_visitor.h @@ -26,6 +26,7 @@ #ifndef IR_VISITOR_H #define IR_VISITOR_H +#ifdef __cplusplus /** * Abstract base class of visitors of IR instruction trees */ @@ -63,6 +64,9 @@ public: virtual void visit(class ir_loop *) = 0; virtual void visit(class ir_loop_jump *) = 0; virtual void visit(class ir_precision_statement *) = 0; + virtual void visit(class ir_typedecl_statement *) = 0; + virtual void visit(class ir_emit_vertex *) = 0; + virtual void visit(class ir_end_primitive *) = 0; /*@}*/ }; @@ -81,6 +85,9 @@ public: virtual void visit(class ir_assignment *) {} virtual void visit(class ir_constant *) {} virtual void visit(class ir_call *) {} + virtual void visit(class ir_emit_vertex *) {} + virtual void visit(class ir_end_primitive *) {} }; +#endif /* __cplusplus */ #endif /* IR_VISITOR_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp b/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp new file mode 100644 index 000000000..d92cdb117 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/link_atomics.cpp @@ -0,0 +1,265 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "glsl_parser_extras.h" +#include "ir.h" +#include "ir_uniform.h" +#include "linker.h" +#include "program/hash_table.h" +#include "main/macros.h" + +namespace { + /* + * Atomic counter as seen by the program. + */ + struct active_atomic_counter { + unsigned id; + ir_variable *var; + }; + + /* + * Atomic counter buffer referenced by the program. There is a one + * to one correspondence between these and the objects that can be + * queried using glGetActiveAtomicCounterBufferiv(). + */ + struct active_atomic_buffer { + active_atomic_buffer() + : counters(0), num_counters(0), stage_references(), size(0) + {} + + ~active_atomic_buffer() + { + free(counters); + } + + void push_back(unsigned id, ir_variable *var) + { + counters = (active_atomic_counter *) + realloc(counters, sizeof(active_atomic_counter) * (num_counters + 1)); + + counters[num_counters].id = id; + counters[num_counters].var = var; + num_counters++; + } + + active_atomic_counter *counters; + unsigned num_counters; + unsigned stage_references[MESA_SHADER_STAGES]; + unsigned size; + }; + + int + cmp_actives(const void *a, const void *b) + { + const active_atomic_counter *const first = (active_atomic_counter *) a; + const active_atomic_counter *const second = (active_atomic_counter *) b; + + return int(first->var->data.atomic.offset) - int(second->var->data.atomic.offset); + } + + bool + check_atomic_counters_overlap(const ir_variable *x, const ir_variable *y) + { + return ((x->data.atomic.offset >= y->data.atomic.offset && + x->data.atomic.offset < y->data.atomic.offset + y->type->atomic_size()) || + (y->data.atomic.offset >= x->data.atomic.offset && + y->data.atomic.offset < x->data.atomic.offset + x->type->atomic_size())); + } + + active_atomic_buffer * + find_active_atomic_counters(struct gl_context *ctx, + struct gl_shader_program *prog, + unsigned *num_buffers) + { + active_atomic_buffer *const buffers = + new active_atomic_buffer[ctx->Const.MaxAtomicBufferBindings]; + + *num_buffers = 0; + + for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) { + struct gl_shader *sh = prog->_LinkedShaders[i]; + if (sh == NULL) + continue; + + foreach_list(node, sh->ir) { + ir_variable *var = ((ir_instruction *)node)->as_variable(); + + if (var && var->type->contains_atomic()) { + unsigned id = 0; + bool found = prog->UniformHash->get(id, var->name); + assert(found); + (void) found; + active_atomic_buffer *buf = &buffers[var->data.binding]; + + /* If this is the first time the buffer is used, increment + * the counter of buffers used. + */ + if (buf->size == 0) + (*num_buffers)++; + + buf->push_back(id, var); + + buf->stage_references[i]++; + buf->size = MAX2(buf->size, var->data.atomic.offset + + var->type->atomic_size()); + } + } + } + + for (unsigned i = 0; i < ctx->Const.MaxAtomicBufferBindings; i++) { + if (buffers[i].size == 0) + continue; + + qsort(buffers[i].counters, buffers[i].num_counters, + sizeof(active_atomic_counter), + cmp_actives); + + for (unsigned j = 1; j < buffers[i].num_counters; j++) { + /* If an overlapping counter found, it must be a reference to the + * same counter from a different shader stage. + */ + if (check_atomic_counters_overlap(buffers[i].counters[j-1].var, + buffers[i].counters[j].var) + && strcmp(buffers[i].counters[j-1].var->name, + buffers[i].counters[j].var->name) != 0) { + linker_error(prog, "Atomic counter %s declared at offset %d " + "which is already in use.", + buffers[i].counters[j].var->name, + buffers[i].counters[j].var->data.atomic.offset); + } + } + } + return buffers; + } +} + +void +link_assign_atomic_counter_resources(struct gl_context *ctx, + struct gl_shader_program *prog) +{ + unsigned num_buffers; + active_atomic_buffer *abs = + find_active_atomic_counters(ctx, prog, &num_buffers); + + prog->AtomicBuffers = rzalloc_array(prog, gl_active_atomic_buffer, + num_buffers); + prog->NumAtomicBuffers = num_buffers; + + unsigned i = 0; + for (unsigned binding = 0; + binding < ctx->Const.MaxAtomicBufferBindings; + binding++) { + + /* If the binding was not used, skip. + */ + if (abs[binding].size == 0) + continue; + + active_atomic_buffer &ab = abs[binding]; + gl_active_atomic_buffer &mab = prog->AtomicBuffers[i]; + + /* Assign buffer-specific fields. */ + mab.Binding = binding; + mab.MinimumSize = ab.size; + mab.Uniforms = rzalloc_array(prog->AtomicBuffers, GLuint, + ab.num_counters); + mab.NumUniforms = ab.num_counters; + + /* Assign counter-specific fields. */ + for (unsigned j = 0; j < ab.num_counters; j++) { + ir_variable *const var = ab.counters[j].var; + const unsigned id = ab.counters[j].id; + gl_uniform_storage *const storage = &prog->UniformStorage[id]; + + mab.Uniforms[j] = id; + var->data.atomic.buffer_index = i; + storage->atomic_buffer_index = i; + storage->offset = var->data.atomic.offset; + storage->array_stride = (var->type->is_array() ? + var->type->element_type()->atomic_size() : 0); + } + + /* Assign stage-specific fields. */ + for (unsigned j = 0; j < MESA_SHADER_STAGES; ++j) + mab.StageReferences[j] = + (ab.stage_references[j] ? GL_TRUE : GL_FALSE); + + i++; + } + + delete [] abs; + assert(i == num_buffers); +} + +void +link_check_atomic_counter_resources(struct gl_context *ctx, + struct gl_shader_program *prog) +{ + unsigned num_buffers; + active_atomic_buffer *const abs = + find_active_atomic_counters(ctx, prog, &num_buffers); + unsigned atomic_counters[MESA_SHADER_STAGES] = {}; + unsigned atomic_buffers[MESA_SHADER_STAGES] = {}; + unsigned total_atomic_counters = 0; + unsigned total_atomic_buffers = 0; + + /* Sum the required resources. Note that this counts buffers and + * counters referenced by several shader stages multiple times + * against the combined limit -- That's the behavior the spec + * requires. + */ + for (unsigned i = 0; i < ctx->Const.MaxAtomicBufferBindings; i++) { + if (abs[i].size == 0) + continue; + + for (unsigned j = 0; j < MESA_SHADER_STAGES; ++j) { + const unsigned n = abs[i].stage_references[j]; + + if (n) { + atomic_counters[j] += n; + total_atomic_counters += n; + atomic_buffers[j]++; + total_atomic_buffers++; + } + } + } + + /* Check that they are within the supported limits. */ + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + if (atomic_counters[i] > ctx->Const.Program[i].MaxAtomicCounters) + linker_error(prog, "Too many %s shader atomic counters", + _mesa_shader_stage_to_string(i)); + + if (atomic_buffers[i] > ctx->Const.Program[i].MaxAtomicBuffers) + linker_error(prog, "Too many %s shader atomic counter buffers", + _mesa_shader_stage_to_string(i)); + } + + if (total_atomic_counters > ctx->Const.MaxCombinedAtomicCounters) + linker_error(prog, "Too many combined atomic counters"); + + if (total_atomic_buffers > ctx->Const.MaxCombinedAtomicBuffers) + linker_error(prog, "Too many combined atomic buffers"); + + delete [] abs; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp b/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp index 8f577625c..b7dfef948 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_functions.cpp @@ -34,6 +34,8 @@ find_matching_signature(const char *name, const exec_list *actual_parameters, gl_shader **shader_list, unsigned num_shaders, bool use_builtin); +namespace { + class call_link_visitor : public ir_hierarchical_visitor { public: call_link_visitor(gl_shader_program *prog, gl_shader *linked, @@ -113,10 +115,10 @@ public: } ir_function_signature *linked_sig = - f->exact_matching_signature(&callee->parameters); + f->exact_matching_signature(NULL, &callee->parameters); if ((linked_sig == NULL) || ((linked_sig != NULL) - && (linked_sig->is_builtin != ir->use_builtin))) { + && (linked_sig->is_builtin() != ir->use_builtin))) { linked_sig = new(linked) ir_function_signature(callee->return_type, callee->precision); f->add_signature(linked_sig); } @@ -153,14 +155,17 @@ public: linked_sig->replace_parameters(&formal_parameters); - foreach_list_const(node, &sig->body) { - const ir_instruction *const original = (ir_instruction *) node; + if (sig->is_defined) { + foreach_list_const(node, &sig->body) { + const ir_instruction *const original = (ir_instruction *) node; - ir_instruction *copy = original->clone(linked, ht); - linked_sig->body.push_tail(copy); + ir_instruction *copy = original->clone(linked, ht); + linked_sig->body.push_tail(copy); + } + + linked_sig->is_defined = true; } - linked_sig->is_defined = true; hash_table_dtor(ht); /* Patch references inside the function to things outside the function @@ -173,6 +178,39 @@ public: return visit_continue; } + virtual ir_visitor_status visit_leave(ir_call *ir) + { + /* Traverse list of function parameters, and for array parameters + * propagate max_array_access. Otherwise arrays that are only referenced + * from inside functions via function parameters will be incorrectly + * optimized. This will lead to incorrect code being generated (or worse). + * Do it when leaving the node so the children would propagate their + * array accesses first. + */ + + const exec_node *formal_param_node = ir->callee->parameters.get_head(); + if (formal_param_node) { + const exec_node *actual_param_node = ir->actual_parameters.get_head(); + while (!actual_param_node->is_tail_sentinel()) { + ir_variable *formal_param = (ir_variable *) formal_param_node; + ir_rvalue *actual_param = (ir_rvalue *) actual_param_node; + + formal_param_node = formal_param_node->get_next(); + actual_param_node = actual_param_node->get_next(); + + if (formal_param->type->is_array()) { + ir_dereference_variable *deref = actual_param->as_dereference_variable(); + if (deref && deref->var && deref->var->type->is_array()) { + deref->var->data.max_array_access = + MAX2(formal_param->data.max_array_access, + deref->var->data.max_array_access); + } + } + } + } + return visit_continue; + } + virtual ir_visitor_status visit(ir_dereference_variable *ir) { if (hash_table_find(locals, ir->var) == NULL) { @@ -189,18 +227,32 @@ public: var = ir->var->clone(linked, NULL); linked->symbols->add_variable(var); linked->ir->push_head(var); - } else if (var->type->is_array()) { - /* It is possible to have a global array declared in multiple - * shaders without a size. The array is implicitly sized by the - * maximal access to it in *any* shader. Because of this, we - * need to track the maximal access to the array as linking pulls - * more functions in that access the array. - */ - var->max_array_access = - MAX2(var->max_array_access, ir->var->max_array_access); + } else { + if (var->type->is_array()) { + /* It is possible to have a global array declared in multiple + * shaders without a size. The array is implicitly sized by + * the maximal access to it in *any* shader. Because of this, + * we need to track the maximal access to the array as linking + * pulls more functions in that access the array. + */ + var->data.max_array_access = + MAX2(var->data.max_array_access, + ir->var->data.max_array_access); - if (var->type->length == 0 && ir->var->type->length != 0) - var->type = ir->var->type; + if (var->type->length == 0 && ir->var->type->length != 0) + var->type = ir->var->type; + } + if (var->is_interface_instance()) { + /* Similarly, we need implicit sizes of arrays within interface + * blocks to be sized by the maximal access in *any* shader. + */ + for (unsigned i = 0; i < var->get_interface_type()->length; + i++) { + var->max_ifc_array_access[i] = + MAX2(var->max_ifc_array_access[i], + ir->var->max_ifc_array_access[i]); + } + } } ir->var = var; @@ -241,6 +293,7 @@ private: hash_table *locals; }; +} /* anonymous namespace */ /** * Searches a list of shaders for a particular function definition @@ -256,16 +309,18 @@ find_matching_signature(const char *name, const exec_list *actual_parameters, if (f == NULL) continue; - ir_function_signature *sig = f->matching_signature(actual_parameters); + ir_function_signature *sig = + f->matching_signature(NULL, actual_parameters); - if ((sig == NULL) || !sig->is_defined) + if ((sig == NULL) || + (!sig->is_defined && !sig->is_intrinsic)) continue; /* If this function expects to bind to a built-in function and the * signature that we found isn't a built-in, keep looking. Also keep * looking if we expect a non-built-in but found a built-in. */ - if (use_builtin != sig->is_builtin) + if (use_builtin != sig->is_builtin()) continue; return sig; diff --git a/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp new file mode 100644 index 000000000..52552cc68 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/link_interface_blocks.cpp @@ -0,0 +1,385 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file link_interface_blocks.cpp + * Linker support for GLSL's interface blocks. + */ + +#include "ir.h" +#include "glsl_symbol_table.h" +#include "linker.h" +#include "main/macros.h" +#include "program/hash_table.h" + + +namespace { + +/** + * Information about a single interface block definition that we need to keep + * track of in order to check linkage rules. + * + * Note: this class is expected to be short lived, so it doesn't make copies + * of the strings it references; it simply borrows the pointers from the + * ir_variable class. + */ +struct interface_block_definition +{ + /** + * Extract an interface block definition from an ir_variable that + * represents either the interface instance (for named interfaces), or a + * member of the interface (for unnamed interfaces). + */ + explicit interface_block_definition(const ir_variable *var) + : type(var->get_interface_type()), + instance_name(NULL), + array_size(-1) + { + if (var->is_interface_instance()) { + instance_name = var->name; + if (var->type->is_array()) + array_size = var->type->length; + } + explicitly_declared = (var->data.how_declared != ir_var_declared_implicitly); + } + + /** + * Interface block type + */ + const glsl_type *type; + + /** + * For a named interface block, the instance name. Otherwise NULL. + */ + const char *instance_name; + + /** + * For an interface block array, the array size (or 0 if unsized). + * Otherwise -1. + */ + int array_size; + + /** + * True if this interface block was explicitly declared in the shader; + * false if it was an implicitly declared built-in interface block. + */ + bool explicitly_declared; +}; + + +/** + * Check if two interfaces match, according to intrastage interface matching + * rules. If they do, and the first interface uses an unsized array, it will + * be updated to reflect the array size declared in the second interface. + */ +bool +intrastage_match(interface_block_definition *a, + const interface_block_definition *b, + ir_variable_mode mode) +{ + /* Types must match. */ + if (a->type != b->type) { + /* Exception: if both the interface blocks are implicitly declared, + * don't force their types to match. They might mismatch due to the two + * shaders using different GLSL versions, and that's ok. + */ + if (a->explicitly_declared || b->explicitly_declared) + return false; + } + + /* Presence/absence of interface names must match. */ + if ((a->instance_name == NULL) != (b->instance_name == NULL)) + return false; + + /* For uniforms, instance names need not match. For shader ins/outs, + * it's not clear from the spec whether they need to match, but + * Mesa's implementation relies on them matching. + */ + if (a->instance_name != NULL && mode != ir_var_uniform && + strcmp(a->instance_name, b->instance_name) != 0) { + return false; + } + + /* Array vs. nonarray must be consistent, and sizes must be + * consistent, with the exception that unsized arrays match sized + * arrays. + */ + if ((a->array_size == -1) != (b->array_size == -1)) + return false; + if (b->array_size != 0) { + if (a->array_size == 0) + a->array_size = b->array_size; + else if (a->array_size != b->array_size) + return false; + } + + return true; +} + + +/** + * Check if two interfaces match, according to interstage (in/out) interface + * matching rules. + * + * If \c extra_array_level is true, then vertex-to-geometry shader matching + * rules are enforced (i.e. a successful match requires the consumer interface + * to be an array and the producer interface to be a non-array). + */ +bool +interstage_match(const interface_block_definition *producer, + const interface_block_definition *consumer, + bool extra_array_level) +{ + /* Unsized arrays should not occur during interstage linking. They + * should have all been assigned a size by link_intrastage_shaders. + */ + assert(consumer->array_size != 0); + assert(producer->array_size != 0); + + /* Types must match. */ + if (consumer->type != producer->type) { + /* Exception: if both the interface blocks are implicitly declared, + * don't force their types to match. They might mismatch due to the two + * shaders using different GLSL versions, and that's ok. + */ + if (consumer->explicitly_declared || producer->explicitly_declared) + return false; + } + if (extra_array_level) { + /* Consumer must be an array, and producer must not. */ + if (consumer->array_size == -1) + return false; + if (producer->array_size != -1) + return false; + } else { + /* Array vs. nonarray must be consistent, and sizes must be consistent. + * Since unsized arrays have been ruled out, we can check this by just + * making sure the sizes are equal. + */ + if (consumer->array_size != producer->array_size) + return false; + } + return true; +} + + +/** + * This class keeps track of a mapping from an interface block name to the + * necessary information about that interface block to determine whether to + * generate a link error. + * + * Note: this class is expected to be short lived, so it doesn't make copies + * of the strings it references; it simply borrows the pointers from the + * ir_variable class. + */ +class interface_block_definitions +{ +public: + interface_block_definitions() + : mem_ctx(ralloc_context(NULL)), + ht(hash_table_ctor(0, hash_table_string_hash, + hash_table_string_compare)) + { + } + + ~interface_block_definitions() + { + hash_table_dtor(ht); + ralloc_free(mem_ctx); + } + + /** + * Lookup the interface definition having the given block name. Return + * NULL if none is found. + */ + interface_block_definition *lookup(const char *block_name) + { + return (interface_block_definition *) hash_table_find(ht, block_name); + } + + /** + * Add a new interface definition. + */ + void store(const interface_block_definition &def) + { + interface_block_definition *hash_entry = + rzalloc(mem_ctx, interface_block_definition); + *hash_entry = def; + hash_table_insert(ht, hash_entry, def.type->name); + } + +private: + /** + * Ralloc context for data structures allocated by this class. + */ + void *mem_ctx; + + /** + * Hash table mapping interface block name to an \c + * interface_block_definition struct. interface_block_definition structs + * are allocated using \c mem_ctx. + */ + hash_table *ht; +}; + + +}; /* anonymous namespace */ + + +void +validate_intrastage_interface_blocks(struct gl_shader_program *prog, + const gl_shader **shader_list, + unsigned num_shaders) +{ + interface_block_definitions in_interfaces; + interface_block_definitions out_interfaces; + interface_block_definitions uniform_interfaces; + + for (unsigned int i = 0; i < num_shaders; i++) { + if (shader_list[i] == NULL) + continue; + + foreach_list(node, shader_list[i]->ir) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (!var) + continue; + + const glsl_type *iface_type = var->get_interface_type(); + + if (iface_type == NULL) + continue; + + interface_block_definitions *definitions; + switch (var->data.mode) { + case ir_var_shader_in: + definitions = &in_interfaces; + break; + case ir_var_shader_out: + definitions = &out_interfaces; + break; + case ir_var_uniform: + definitions = &uniform_interfaces; + break; + default: + /* Only in, out, and uniform interfaces are legal, so we should + * never get here. + */ + assert(!"illegal interface type"); + continue; + } + + const interface_block_definition def(var); + interface_block_definition *prev_def = + definitions->lookup(iface_type->name); + + if (prev_def == NULL) { + /* This is the first time we've seen the interface, so save + * it into the appropriate data structure. + */ + definitions->store(def); + } else if (!intrastage_match(prev_def, &def, + (ir_variable_mode) var->data.mode)) { + linker_error(prog, "definitions of interface block `%s' do not" + " match\n", iface_type->name); + return; + } + } + } +} + +void +validate_interstage_inout_blocks(struct gl_shader_program *prog, + const gl_shader *producer, + const gl_shader *consumer) +{ + interface_block_definitions definitions; + const bool extra_array_level = consumer->Stage == MESA_SHADER_GEOMETRY; + + /* Add input interfaces from the consumer to the symbol table. */ + foreach_list(node, consumer->ir) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_in) + continue; + + definitions.store(interface_block_definition(var)); + } + + /* Verify that the producer's output interfaces match. */ + foreach_list(node, producer->ir) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (!var || !var->get_interface_type() || var->data.mode != ir_var_shader_out) + continue; + + interface_block_definition *consumer_def = + definitions.lookup(var->get_interface_type()->name); + + /* The consumer doesn't use this output block. Ignore it. */ + if (consumer_def == NULL) + continue; + + const interface_block_definition producer_def(var); + + if (!interstage_match(&producer_def, consumer_def, extra_array_level)) { + linker_error(prog, "definitions of interface block `%s' do not " + "match\n", var->get_interface_type()->name); + return; + } + } +} + + +void +validate_interstage_uniform_blocks(struct gl_shader_program *prog, + gl_shader **stages, int num_stages) +{ + interface_block_definitions definitions; + + for (int i = 0; i < num_stages; i++) { + if (stages[i] == NULL) + continue; + + const gl_shader *stage = stages[i]; + foreach_list(node, stage->ir) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (!var || !var->get_interface_type() || var->data.mode != ir_var_uniform) + continue; + + interface_block_definition *old_def = + definitions.lookup(var->get_interface_type()->name); + const interface_block_definition new_def(var); + if (old_def == NULL) { + definitions.store(new_def); + } else { + /* Interstage uniform matching rules are the same as intrastage + * uniform matchin rules (for uniforms, it is as though all + * shaders are in the same shader stage). + */ + if (!intrastage_match(old_def, &new_def, ir_var_uniform)) { + linker_error(prog, "definitions of interface block `%s' do not " + "match\n", var->get_interface_type()->name); + return; + } + } + } + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp new file mode 100644 index 000000000..f2f46a211 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.cpp @@ -0,0 +1,162 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "link_uniform_block_active_visitor.h" +#include "program.h" + +link_uniform_block_active * +process_block(void *mem_ctx, struct hash_table *ht, ir_variable *var) +{ + const uint32_t h = _mesa_hash_string(var->get_interface_type()->name); + const hash_entry *const existing_block = + _mesa_hash_table_search(ht, h, var->get_interface_type()->name); + + const glsl_type *const block_type = var->is_interface_instance() + ? var->type : var->get_interface_type(); + + + /* If a block with this block-name has not previously been seen, add it. + * If a block with this block-name has been seen, it must be identical to + * the block currently being examined. + */ + if (existing_block == NULL) { + link_uniform_block_active *const b = + rzalloc(mem_ctx, struct link_uniform_block_active); + + b->type = block_type; + b->has_instance_name = var->is_interface_instance(); + + _mesa_hash_table_insert(ht, h, var->get_interface_type()->name, + (void *) b); + return b; + } else { + link_uniform_block_active *const b = + (link_uniform_block_active *) existing_block->data; + + if (b->type != block_type + || b->has_instance_name != var->is_interface_instance()) + return NULL; + else + return b; + } + + assert(!"Should not get here."); + return NULL; +} + +ir_visitor_status +link_uniform_block_active_visitor::visit_enter(ir_dereference_array *ir) +{ + ir_dereference_variable *const d = ir->array->as_dereference_variable(); + ir_variable *const var = (d == NULL) ? NULL : d->var; + + /* If the r-value being dereferenced is not a variable (e.g., a field of a + * structure) or is not a uniform block instance, continue. + * + * WARNING: It is not enough for the variable to be part of uniform block. + * It must represent the entire block. Arrays (or matrices) inside blocks + * that lack an instance name are handled by the ir_dereference_variable + * function. + */ + if (var == NULL + || !var->is_in_uniform_block() + || !var->is_interface_instance()) + return visit_continue; + + /* Process the block. Bail if there was an error. + */ + link_uniform_block_active *const b = + process_block(this->mem_ctx, this->ht, var); + if (b == NULL) { + linker_error(prog, + "uniform block `%s' has mismatching definitions", + var->get_interface_type()->name); + this->success = false; + return visit_stop; + } + + /* Block arrays must be declared with an instance name. + */ + assert(b->has_instance_name); + assert((b->num_array_elements == 0) == (b->array_elements == NULL)); + assert(b->type != NULL); + + /* Determine whether or not this array index has already been added to the + * list of active array indices. At this point all constant folding must + * have occured, and the array index must be a constant. + */ + ir_constant *c = ir->array_index->as_constant(); + assert(c != NULL); + + const unsigned idx = c->get_uint_component(0); + + unsigned i; + for (i = 0; i < b->num_array_elements; i++) { + if (b->array_elements[i] == idx) + break; + } + + assert(i <= b->num_array_elements); + + if (i == b->num_array_elements) { + b->array_elements = reralloc(this->mem_ctx, + b->array_elements, + unsigned, + b->num_array_elements + 1); + + b->array_elements[b->num_array_elements] = idx; + + b->num_array_elements++; + } + + return visit_continue_with_parent; +} + +ir_visitor_status +link_uniform_block_active_visitor::visit(ir_dereference_variable *ir) +{ + ir_variable *var = ir->var; + + if (!var->is_in_uniform_block()) + return visit_continue; + + assert(!var->is_interface_instance() || !var->type->is_array()); + + /* Process the block. Bail if there was an error. + */ + link_uniform_block_active *const b = + process_block(this->mem_ctx, this->ht, var); + if (b == NULL) { + linker_error(this->prog, + "uniform block `%s' has mismatching definitions", + var->get_interface_type()->name); + this->success = false; + return visit_stop; + } + + assert(b->num_array_elements == 0); + assert(b->array_elements == NULL); + assert(b->type != NULL); + + return visit_continue; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/ir_reader.h b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h similarity index 55% rename from 3rdparty/glsl-optimizer/src/glsl/ir_reader.h rename to 3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h index aef2ca23b..fba628a8f 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ir_reader.h +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_block_active_visitor.h @@ -1,6 +1,5 @@ -/* -*- c++ -*- */ /* - * Copyright © 2010 Intel Corporation + * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -23,12 +22,41 @@ */ #pragma once -#ifndef IR_READER_H -#define IR_READER_H +#ifndef LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H +#define LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H #include "ir.h" +#include "ir_visitor.h" +#include "glsl_types.h" +#include "main/hash_table.h" -void _mesa_glsl_read_ir(_mesa_glsl_parse_state *state, exec_list *instructions, - const char *src, bool scan_for_prototypes); +struct link_uniform_block_active { + const glsl_type *type; -#endif /* IR_READER_H */ + unsigned *array_elements; + unsigned num_array_elements; + + bool has_instance_name; +}; + +class link_uniform_block_active_visitor : public ir_hierarchical_visitor { +public: + link_uniform_block_active_visitor(void *mem_ctx, struct hash_table *ht, + struct gl_shader_program *prog) + : success(true), prog(prog), ht(ht), mem_ctx(mem_ctx) + { + /* empty */ + } + + virtual ir_visitor_status visit_enter(ir_dereference_array *); + virtual ir_visitor_status visit(ir_dereference_variable *); + + bool success; + +private: + struct gl_shader_program *prog; + struct hash_table *ht; + void *mem_ctx; +}; + +#endif /* LINK_UNIFORM_BLOCK_ACTIVE_VISITOR_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp new file mode 100644 index 000000000..a922ad5e4 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_blocks.cpp @@ -0,0 +1,332 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "main/core.h" +#include "ir.h" +#include "linker.h" +#include "ir_uniform.h" +#include "link_uniform_block_active_visitor.h" +#include "main/hash_table.h" +#include "program.h" + +namespace { + +class ubo_visitor : public program_resource_visitor { +public: + ubo_visitor(void *mem_ctx, gl_uniform_buffer_variable *variables, + unsigned num_variables) + : index(0), offset(0), buffer_size(0), variables(variables), + num_variables(num_variables), mem_ctx(mem_ctx), is_array_instance(false) + { + /* empty */ + } + + void process(const glsl_type *type, const char *name) + { + this->offset = 0; + this->buffer_size = 0; + this->is_array_instance = strchr(name, ']') != NULL; + this->program_resource_visitor::process(type, name); + } + + unsigned index; + unsigned offset; + unsigned buffer_size; + gl_uniform_buffer_variable *variables; + unsigned num_variables; + void *mem_ctx; + bool is_array_instance; + +private: + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major) + { + (void) type; + (void) name; + (void) row_major; + assert(!"Should not get here."); + } + + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major, const glsl_type *record_type) + { + assert(this->index < this->num_variables); + + gl_uniform_buffer_variable *v = &this->variables[this->index++]; + + v->Name = ralloc_strdup(mem_ctx, name); + v->Type = type; + v->RowMajor = row_major; + + if (this->is_array_instance) { + v->IndexName = ralloc_strdup(mem_ctx, name); + + char *open_bracket = strchr(v->IndexName, '['); + assert(open_bracket != NULL); + + char *close_bracket = strchr(open_bracket, ']'); + assert(close_bracket != NULL); + + /* Length of the tail without the ']' but with the NUL. + */ + unsigned len = strlen(close_bracket + 1) + 1; + + memmove(open_bracket, close_bracket + 1, len); + } else { + v->IndexName = v->Name; + } + + const unsigned alignment = record_type + ? record_type->std140_base_alignment(!!v->RowMajor) + : type->std140_base_alignment(!!v->RowMajor); + unsigned size = type->std140_size(!!v->RowMajor); + + this->offset = glsl_align(this->offset, alignment); + v->Offset = this->offset; + this->offset += size; + + /* From the GL_ARB_uniform_buffer_object spec: + * + * "For uniform blocks laid out according to [std140] rules, the + * minimum buffer object size returned by the + * UNIFORM_BLOCK_DATA_SIZE query is derived by taking the offset of + * the last basic machine unit consumed by the last uniform of the + * uniform block (including any end-of-array or end-of-structure + * padding), adding one, and rounding up to the next multiple of + * the base alignment required for a vec4." + */ + this->buffer_size = glsl_align(this->offset, 16); + } + + virtual void visit_field(const glsl_struct_field *field) + { + /* FINISHME: When support for doubles (dvec4, etc.) is added to the + * FINISHME: compiler, this may be incorrect for a structure in a UBO + * FINISHME: like struct s { struct { float f } s1; dvec4 v; };. + */ + this->offset = glsl_align(this->offset, + field->type->std140_base_alignment(false)); + } +}; + +class count_block_size : public program_resource_visitor { +public: + count_block_size() : num_active_uniforms(0) + { + /* empty */ + } + + unsigned num_active_uniforms; + +private: + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major) + { + (void) type; + (void) name; + (void) row_major; + this->num_active_uniforms++; + } +}; + +} /* anonymous namespace */ + +struct block { + const glsl_type *type; + bool has_instance_name; +}; + +unsigned +link_uniform_blocks(void *mem_ctx, + struct gl_shader_program *prog, + struct gl_shader **shader_list, + unsigned num_shaders, + struct gl_uniform_block **blocks_ret) +{ + /* This hash table will track all of the uniform blocks that have been + * encountered. Since blocks with the same block-name must be the same, + * the hash is organized by block-name. + */ + struct hash_table *block_hash = + _mesa_hash_table_create(mem_ctx, _mesa_key_string_equal); + + /* Determine which uniform blocks are active. + */ + link_uniform_block_active_visitor v(mem_ctx, block_hash, prog); + for (unsigned i = 0; i < num_shaders; i++) { + visit_list_elements(&v, shader_list[i]->ir); + } + + /* Count the number of active uniform blocks. Count the total number of + * active slots in those uniform blocks. + */ + unsigned num_blocks = 0; + unsigned num_variables = 0; + count_block_size block_size; + struct hash_entry *entry; + + hash_table_foreach (block_hash, entry) { + const struct link_uniform_block_active *const b = + (const struct link_uniform_block_active *) entry->data; + + const glsl_type *const block_type = + b->type->is_array() ? b->type->fields.array : b->type; + + assert((b->num_array_elements > 0) == b->type->is_array()); + + block_size.num_active_uniforms = 0; + block_size.process(block_type, ""); + + if (b->num_array_elements > 0) { + num_blocks += b->num_array_elements; + num_variables += b->num_array_elements + * block_size.num_active_uniforms; + } else { + num_blocks++; + num_variables += block_size.num_active_uniforms; + } + + } + + if (num_blocks == 0) { + assert(num_variables == 0); + _mesa_hash_table_destroy(block_hash, NULL); + return 0; + } + + assert(num_variables != 0); + + /* Allocate storage to hold all of the informatation related to uniform + * blocks that can be queried through the API. + */ + gl_uniform_block *blocks = + ralloc_array(mem_ctx, gl_uniform_block, num_blocks); + gl_uniform_buffer_variable *variables = + ralloc_array(blocks, gl_uniform_buffer_variable, num_variables); + + /* Add each variable from each uniform block to the API tracking + * structures. + */ + unsigned i = 0; + ubo_visitor parcel(blocks, variables, num_variables); + + STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_STD140) + == unsigned(ubo_packing_std140)); + STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_SHARED) + == unsigned(ubo_packing_shared)); + STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_PACKED) + == unsigned(ubo_packing_packed)); + + + hash_table_foreach (block_hash, entry) { + const struct link_uniform_block_active *const b = + (const struct link_uniform_block_active *) entry->data; + const glsl_type *block_type = b->type; + + if (b->num_array_elements > 0) { + const char *const name = block_type->fields.array->name; + + assert(b->has_instance_name); + for (unsigned j = 0; j < b->num_array_elements; j++) { + blocks[i].Name = ralloc_asprintf(blocks, "%s[%u]", name, + b->array_elements[j]); + blocks[i].Uniforms = &variables[parcel.index]; + blocks[i].Binding = 0; + blocks[i].UniformBufferSize = 0; + blocks[i]._Packing = + gl_uniform_block_packing(block_type->interface_packing); + + parcel.process(block_type->fields.array, + blocks[i].Name); + + blocks[i].UniformBufferSize = parcel.buffer_size; + + blocks[i].NumUniforms = + (unsigned)(ptrdiff_t)(&variables[parcel.index] - blocks[i].Uniforms); + + i++; + } + } else { + blocks[i].Name = ralloc_strdup(blocks, block_type->name); + blocks[i].Uniforms = &variables[parcel.index]; + blocks[i].Binding = 0; + blocks[i].UniformBufferSize = 0; + blocks[i]._Packing = + gl_uniform_block_packing(block_type->interface_packing); + + parcel.process(block_type, + b->has_instance_name ? block_type->name : ""); + + blocks[i].UniformBufferSize = parcel.buffer_size; + + blocks[i].NumUniforms = + (unsigned)(ptrdiff_t)(&variables[parcel.index] - blocks[i].Uniforms); + + i++; + } + } + + assert(parcel.index == num_variables); + + _mesa_hash_table_destroy(block_hash, NULL); + + *blocks_ret = blocks; + return num_blocks; +} + +bool +link_uniform_blocks_are_compatible(const gl_uniform_block *a, + const gl_uniform_block *b) +{ + assert(strcmp(a->Name, b->Name) == 0); + + /* Page 35 (page 42 of the PDF) in section 4.3.7 of the GLSL 1.50 spec says: + * + * "Matched block names within an interface (as defined above) must + * match in terms of having the same number of declarations with the + * same sequence of types and the same sequence of member names, as + * well as having the same member-wise layout qualification....if a + * matching block is declared as an array, then the array sizes must + * also match... Any mismatch will generate a link error." + * + * Arrays are not yet supported, so there is no check for that. + */ + if (a->NumUniforms != b->NumUniforms) + return false; + + if (a->_Packing != b->_Packing) + return false; + + for (unsigned i = 0; i < a->NumUniforms; i++) { + if (strcmp(a->Uniforms[i].Name, b->Uniforms[i].Name) != 0) + return false; + + if (a->Uniforms[i].Type != b->Uniforms[i].Type) + return false; + + if (a->Uniforms[i].RowMajor != b->Uniforms[i].RowMajor) + return false; + } + + return true; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp index 849e08097..7d5c1472d 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniform_initializers.cpp @@ -67,7 +67,12 @@ copy_constant_to_storage(union gl_constant_value *storage, case GLSL_TYPE_BOOL: storage[i].b = int(val->value.b[i]); break; - default: + case GLSL_TYPE_ARRAY: + case GLSL_TYPE_STRUCT: + case GLSL_TYPE_ATOMIC_UINT: + case GLSL_TYPE_INTERFACE: + case GLSL_TYPE_VOID: + case GLSL_TYPE_ERROR: /* All other types should have already been filtered by other * paths in the caller. */ @@ -77,6 +82,56 @@ copy_constant_to_storage(union gl_constant_value *storage, } } +void +set_uniform_binding(void *mem_ctx, gl_shader_program *prog, + const char *name, const glsl_type *type, int binding) +{ + struct gl_uniform_storage *const storage = + get_storage(prog->UniformStorage, prog->NumUserUniformStorage, name); + + if (storage == NULL) { + assert(storage != NULL); + return; + } + + if (storage->type->is_sampler()) { + unsigned elements = MAX2(storage->array_elements, 1); + + /* From section 4.4.4 of the GLSL 4.20 specification: + * "If the binding identifier is used with an array, the first element + * of the array takes the specified unit and each subsequent element + * takes the next consecutive unit." + */ + for (unsigned int i = 0; i < elements; i++) { + storage->storage[i].i = binding + i; + } + + for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { + gl_shader *shader = prog->_LinkedShaders[sh]; + + if (shader && storage->sampler[sh].active) { + for (unsigned i = 0; i < elements; i++) { + unsigned index = storage->sampler[sh].index + i; + + shader->SamplerUnits[index] = storage->storage[i].i; + } + } + } + } else if (storage->block_index != -1) { + /* This is a field of a UBO. val is the binding index. */ + for (int i = 0; i < MESA_SHADER_STAGES; i++) { + int stage_index = prog->UniformBlockStageIndex[i][storage->block_index]; + + if (stage_index != -1) { + struct gl_shader *sh = prog->_LinkedShaders[i]; + sh->UniformBlocks[stage_index].Binding = binding; + } + } + } + + storage->initialized = true; +} + void set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, const char *name, const glsl_type *type, @@ -132,20 +187,23 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, idx += elements; } - - if (base_type == GLSL_TYPE_SAMPLER) { - for (unsigned int i = 0; i < storage->array_elements; i++) { - prog->SamplerUnits[storage->sampler + i] = storage->storage[i].i; - } - } } else { copy_constant_to_storage(storage->storage, val, val->type->base_type, val->type->components()); - if (storage->type->is_sampler()) - prog->SamplerUnits[storage->sampler] = storage->storage[0].i; + if (storage->type->is_sampler()) { + for (int sh = 0; sh < MESA_SHADER_STAGES; sh++) { + gl_shader *shader = prog->_LinkedShaders[sh]; + + if (shader && storage->sampler[sh].active) { + unsigned index = storage->sampler[sh].index; + + shader->SamplerUnits[index] = storage->storage[0].i; + } + } + } } storage->initialized = true; @@ -157,7 +215,7 @@ link_set_uniform_initializers(struct gl_shader_program *prog) { void *mem_ctx = NULL; - for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *shader = prog->_LinkedShaders[i]; if (shader == NULL) @@ -166,14 +224,19 @@ link_set_uniform_initializers(struct gl_shader_program *prog) foreach_list(node, shader->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (!var || var->mode != ir_var_uniform || !var->constant_value) + if (!var || var->data.mode != ir_var_uniform) continue; if (!mem_ctx) mem_ctx = ralloc_context(NULL); - linker::set_uniform_initializer(mem_ctx, prog, var->name, - var->type, var->constant_value); + if (var->data.explicit_binding) { + linker::set_uniform_binding(mem_ctx, prog, var->name, + var->type, var->data.binding); + } else if (var->constant_value) { + linker::set_uniform_initializer(mem_ctx, prog, var->name, + var->type, var->constant_value); + } } } diff --git a/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp b/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp index 046a68c96..af621ac43 100644 --- a/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/link_uniforms.cpp @@ -29,12 +29,6 @@ #include "program/hash_table.h" #include "program.h" -static inline unsigned int -align(unsigned int a, unsigned int align) -{ - return (a + align - 1) / align * align; -} - /** * \file link_uniforms.cpp * Assign locations for GLSL uniforms. @@ -58,23 +52,106 @@ values_for_type(const glsl_type *type) } void -uniform_field_visitor::process(ir_variable *var) +program_resource_visitor::process(const glsl_type *type, const char *name) +{ + assert(type->is_record() + || (type->is_array() && type->fields.array->is_record()) + || type->is_interface() + || (type->is_array() && type->fields.array->is_interface())); + + char *name_copy = ralloc_strdup(NULL, name); + recursion(type, &name_copy, strlen(name), false, NULL); + ralloc_free(name_copy); +} + +void +program_resource_visitor::process(ir_variable *var) { const glsl_type *t = var->type; + /* false is always passed for the row_major parameter to the other + * processing functions because no information is available to do + * otherwise. See the warning in linker.h. + */ + /* Only strdup the name if we actually will need to modify it. */ - if (t->is_record() || (t->is_array() && t->fields.array->is_record())) { + if (var->data.from_named_ifc_block_array) { + /* lower_named_interface_blocks created this variable by lowering an + * interface block array to an array variable. For example if the + * original source code was: + * + * out Blk { vec4 bar } foo[3]; + * + * Then the variable is now: + * + * out vec4 bar[3]; + * + * We need to visit each array element using the names constructed like + * so: + * + * Blk[0].bar + * Blk[1].bar + * Blk[2].bar + */ + assert(t->is_array()); + const glsl_type *ifc_type = var->get_interface_type(); + char *name = ralloc_strdup(NULL, ifc_type->name); + size_t name_length = strlen(name); + for (unsigned i = 0; i < t->length; i++) { + size_t new_length = name_length; + ralloc_asprintf_rewrite_tail(&name, &new_length, "[%u].%s", i, + var->name); + /* Note: row_major is only meaningful for uniform blocks, and + * lowering is only applied to non-uniform interface blocks, so we + * can safely pass false for row_major. + */ + recursion(var->type, &name, new_length, false, NULL); + } + ralloc_free(name); + } else if (var->data.from_named_ifc_block_nonarray) { + /* lower_named_interface_blocks created this variable by lowering a + * named interface block (non-array) to an ordinary variable. For + * example if the original source code was: + * + * out Blk { vec4 bar } foo; + * + * Then the variable is now: + * + * out vec4 bar; + * + * We need to visit this variable using the name: + * + * Blk.bar + */ + const glsl_type *ifc_type = var->get_interface_type(); + char *name = ralloc_asprintf(NULL, "%s.%s", ifc_type->name, var->name); + /* Note: row_major is only meaningful for uniform blocks, and lowering + * is only applied to non-uniform interface blocks, so we can safely + * pass false for row_major. + */ + recursion(var->type, &name, strlen(name), false, NULL); + ralloc_free(name); + } else if (t->is_record() || (t->is_array() && t->fields.array->is_record())) { char *name = ralloc_strdup(NULL, var->name); - recursion(var->type, &name, strlen(name)); + recursion(var->type, &name, strlen(name), false, NULL); + ralloc_free(name); + } else if (t->is_interface()) { + char *name = ralloc_strdup(NULL, var->type->name); + recursion(var->type, &name, strlen(name), false, NULL); + ralloc_free(name); + } else if (t->is_array() && t->fields.array->is_interface()) { + char *name = ralloc_strdup(NULL, var->type->fields.array->name); + recursion(var->type, &name, strlen(name), false, NULL); ralloc_free(name); } else { - this->visit_field(t, var->name); + this->visit_field(t, var->name, false, NULL); } } void -uniform_field_visitor::recursion(const glsl_type *t, char **name, - size_t name_length) +program_resource_visitor::recursion(const glsl_type *t, char **name, + size_t name_length, bool row_major, + const glsl_type *record_type) { /* Records need to have each field processed individually. * @@ -82,30 +159,73 @@ uniform_field_visitor::recursion(const glsl_type *t, char **name, * individually, then each field of the resulting array elements processed * individually. */ - if (t->is_record()) { + if (t->is_record() || t->is_interface()) { + if (record_type == NULL && t->is_record()) + record_type = t; + for (unsigned i = 0; i < t->length; i++) { const char *field = t->fields.structure[i].name; size_t new_length = name_length; - /* Append '.field' to the current uniform name. */ - ralloc_asprintf_rewrite_tail(name, &new_length, ".%s", field); + if (t->fields.structure[i].type->is_record()) + this->visit_field(&t->fields.structure[i]); - recursion(t->fields.structure[i].type, name, new_length); + /* Append '.field' to the current variable name. */ + if (name_length == 0) { + ralloc_asprintf_rewrite_tail(name, &new_length, "%s", field); + } else { + ralloc_asprintf_rewrite_tail(name, &new_length, ".%s", field); + } + + recursion(t->fields.structure[i].type, name, new_length, + t->fields.structure[i].row_major, record_type); + + /* Only the first leaf-field of the record gets called with the + * record type pointer. + */ + record_type = NULL; } - } else if (t->is_array() && t->fields.array->is_record()) { + } else if (t->is_array() && (t->fields.array->is_record() + || t->fields.array->is_interface())) { + if (record_type == NULL && t->fields.array->is_record()) + record_type = t->fields.array; + for (unsigned i = 0; i < t->length; i++) { size_t new_length = name_length; - /* Append the subscript to the current uniform name */ + /* Append the subscript to the current variable name */ ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i); - recursion(t->fields.array, name, new_length); + recursion(t->fields.array, name, new_length, row_major, + record_type); + + /* Only the first leaf-field of the record gets called with the + * record type pointer. + */ + record_type = NULL; } } else { - this->visit_field(t, *name); + this->visit_field(t, *name, row_major, record_type); } } +void +program_resource_visitor::visit_field(const glsl_type *type, const char *name, + bool row_major, + const glsl_type *record_type) +{ + visit_field(type, name, row_major); +} + +void +program_resource_visitor::visit_field(const glsl_struct_field *field) +{ + (void) field; + /* empty */ +} + +namespace { + /** * Class to help calculate the storage requirements for a set of uniforms * @@ -116,11 +236,11 @@ uniform_field_visitor::recursion(const glsl_type *t, char **name, * If the same uniform is added multiple times (i.e., once for each shader * target), it will only be accounted once. */ -class count_uniform_size : public uniform_field_visitor { +class count_uniform_size : public program_resource_visitor { public: count_uniform_size(struct string_to_uint_map *map) : num_active_uniforms(0), num_values(0), num_shader_samplers(0), - num_shader_uniform_components(0), map(map) + num_shader_uniform_components(0), is_ubo_var(false), map(map) { /* empty */ } @@ -131,6 +251,16 @@ public: this->num_shader_uniform_components = 0; } + void process(ir_variable *var) + { + this->is_ubo_var = var->is_in_uniform_block(); + if (var->is_interface_instance()) + program_resource_visitor::process(var->get_interface_type(), + var->get_interface_type()->name); + else + program_resource_visitor::process(var); + } + /** * Total number of active uniforms counted */ @@ -151,11 +281,18 @@ public: */ unsigned num_shader_uniform_components; + bool is_ubo_var; + private: - virtual void visit_field(const glsl_type *type, const char *name) + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major) { assert(!type->is_record()); assert(!(type->is_array() && type->fields.array->is_record())); + assert(!type->is_interface()); + assert(!(type->is_array() && type->fields.array->is_interface())); + + (void) row_major; /* Count the number of samplers regardless of whether the uniform is * already in the hash table. The hash table prevents adding the same @@ -171,7 +308,8 @@ private: * Note that samplers do not count against this limit because they * don't use any storage on current hardware. */ - this->num_shader_uniform_components += values; + if (!is_ubo_var) + this->num_shader_uniform_components += values; } /* If the uniform is already in the map, there's nothing more to do. @@ -192,6 +330,8 @@ private: struct string_to_uint_map *map; }; +} /* anonymous namespace */ + /** * Class to help parcel out pieces of backing storage to uniforms * @@ -207,59 +347,137 @@ private: * the \c gl_uniform_storage and \c gl_constant_value arrays are "big * enough." */ -class parcel_out_uniform_storage : public uniform_field_visitor { +class parcel_out_uniform_storage : public program_resource_visitor { public: parcel_out_uniform_storage(struct string_to_uint_map *map, struct gl_uniform_storage *uniforms, union gl_constant_value *values) - : map(map), uniforms(uniforms), next_sampler(0), values(values) + : map(map), uniforms(uniforms), values(values) { + } + + void start_shader(gl_shader_stage shader_type) + { + assert(shader_type < MESA_SHADER_STAGES); + this->shader_type = shader_type; + + this->shader_samplers_used = 0; + this->shader_shadow_samplers = 0; + this->next_sampler = 0; memset(this->targets, 0, sizeof(this->targets)); } - void start_shader() - { - this->shader_samplers_used = 0; - this->shader_shadow_samplers = 0; - } - void set_and_process(struct gl_shader_program *prog, - struct gl_shader *shader, ir_variable *var) { - ubo_var = NULL; - if (var->uniform_block != -1) { - struct gl_uniform_block *block = - &shader->UniformBlocks[var->uniform_block]; + ubo_block_index = -1; + if (var->is_in_uniform_block()) { + if (var->is_interface_instance() && var->type->is_array()) { + unsigned l = strlen(var->get_interface_type()->name); - ubo_block_index = -1; - for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { - if (!strcmp(prog->UniformBlocks[i].Name, - shader->UniformBlocks[var->uniform_block].Name)) { - ubo_block_index = i; - break; + for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { + if (strncmp(var->get_interface_type()->name, + prog->UniformBlocks[i].Name, + l) == 0 + && prog->UniformBlocks[i].Name[l] == '[') { + ubo_block_index = i; + break; + } + } + } else { + for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { + if (strcmp(var->get_interface_type()->name, + prog->UniformBlocks[i].Name) == 0) { + ubo_block_index = i; + break; + } } } assert(ubo_block_index != -1); - ubo_var_index = var->location; - ubo_var = &block->Uniforms[var->location]; - ubo_byte_offset = ubo_var->Offset; - } + /* Uniform blocks that were specified with an instance name must be + * handled a little bit differently. The name of the variable is the + * name used to reference the uniform block instead of being the name + * of a variable within the block. Therefore, searching for the name + * within the block will fail. + */ + if (var->is_interface_instance()) { + ubo_byte_offset = 0; + ubo_row_major = false; + } else { + const struct gl_uniform_block *const block = + &prog->UniformBlocks[ubo_block_index]; - process(var); + assert(var->data.location != -1); + + const struct gl_uniform_buffer_variable *const ubo_var = + &block->Uniforms[var->data.location]; + + ubo_row_major = !!ubo_var->RowMajor; + ubo_byte_offset = ubo_var->Offset; + } + + if (var->is_interface_instance()) + process(var->get_interface_type(), + var->get_interface_type()->name); + else + process(var); + } else + process(var); } - struct gl_uniform_buffer_variable *ubo_var; int ubo_block_index; - int ubo_var_index; int ubo_byte_offset; + bool ubo_row_major; + gl_shader_stage shader_type; private: - virtual void visit_field(const glsl_type *type, const char *name) + void handle_samplers(const glsl_type *base_type, + struct gl_uniform_storage *uniform) + { + if (base_type->is_sampler()) { + uniform->sampler[shader_type].index = this->next_sampler; + uniform->sampler[shader_type].active = true; + + /* Increment the sampler by 1 for non-arrays and by the number of + * array elements for arrays. + */ + this->next_sampler += + MAX2(1, uniform->array_elements); + + const gl_texture_index target = base_type->sampler_index(); + const unsigned shadow = base_type->sampler_shadow; + for (unsigned i = uniform->sampler[shader_type].index; + i < MIN2(this->next_sampler, MAX_SAMPLERS); + i++) { + this->targets[i] = target; + this->shader_samplers_used |= 1U << i; + this->shader_shadow_samplers |= shadow << i; + } + } else { + uniform->sampler[shader_type].index = ~0; + uniform->sampler[shader_type].active = false; + } + } + + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major) + { + (void) type; + (void) name; + (void) row_major; + assert(!"Should not get here."); + } + + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major, const glsl_type *record_type) { assert(!type->is_record()); assert(!(type->is_array() && type->fields.array->is_record())); + assert(!type->is_interface()); + assert(!(type->is_array() && type->fields.array->is_interface())); + + (void) row_major; unsigned id; bool found = this->map->get(id, name); @@ -268,31 +486,6 @@ private: if (!found) return; - /* If there is already storage associated with this uniform, it means - * that it was set while processing an earlier shader stage. For - * example, we may be processing the uniform in the fragment shader, but - * the uniform was already processed in the vertex shader. - */ - if (this->uniforms[id].storage != NULL) { - /* If the uniform already has storage set from another shader stage, - * mark the samplers used for this shader stage. - */ - if (type->contains_sampler()) { - const unsigned count = MAX2(1, this->uniforms[id].array_elements); - const unsigned shadow = (type->is_array()) - ? type->fields.array->sampler_shadow : type->sampler_shadow; - - for (unsigned i = 0; i < count; i++) { - const unsigned s = this->uniforms[id].sampler + i; - - this->shader_samplers_used |= 1U << s; - this->shader_shadow_samplers |= shadow << s; - } - } - - return; - } - const glsl_type *base_type; if (type->is_array()) { this->uniforms[id].array_elements = type->length; @@ -302,26 +495,16 @@ private: base_type = type; } - if (base_type->is_sampler()) { - this->uniforms[id].sampler = this->next_sampler; + /* This assigns sampler uniforms to sampler units. */ + handle_samplers(base_type, &this->uniforms[id]); - /* Increment the sampler by 1 for non-arrays and by the number of - * array elements for arrays. - */ - this->next_sampler += MAX2(1, this->uniforms[id].array_elements); - - const gl_texture_index target = base_type->sampler_index(); - const unsigned shadow = base_type->sampler_shadow; - for (unsigned i = this->uniforms[id].sampler - ; i < MIN2(this->next_sampler, MAX_SAMPLERS) - ; i++) { - this->targets[i] = target; - this->shader_samplers_used |= 1U << i; - this->shader_shadow_samplers |= shadow << i; - } - - } else { - this->uniforms[id].sampler = ~0; + /* If there is already storage associated with this uniform, it means + * that it was set while processing an earlier shader stage. For + * example, we may be processing the uniform in the fragment shader, but + * the uniform was already processed in the vertex shader. + */ + if (this->uniforms[id].storage != NULL) { + return; } this->uniforms[id].name = ralloc_strdup(this->uniforms, name); @@ -330,17 +513,20 @@ private: this->uniforms[id].num_driver_storage = 0; this->uniforms[id].driver_storage = NULL; this->uniforms[id].storage = this->values; - if (this->ubo_var) { + this->uniforms[id].atomic_buffer_index = -1; + if (this->ubo_block_index != -1) { this->uniforms[id].block_index = this->ubo_block_index; - unsigned alignment = type->std140_base_alignment(!!ubo_var->RowMajor); - this->ubo_byte_offset = align(this->ubo_byte_offset, alignment); + const unsigned alignment = record_type + ? record_type->std140_base_alignment(ubo_row_major) + : type->std140_base_alignment(ubo_row_major); + this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, alignment); this->uniforms[id].offset = this->ubo_byte_offset; - this->ubo_byte_offset += type->std140_size(!!ubo_var->RowMajor); + this->ubo_byte_offset += type->std140_size(ubo_row_major); if (type->is_array()) { this->uniforms[id].array_stride = - align(type->fields.array->std140_size(!!ubo_var->RowMajor), 16); + glsl_align(type->fields.array->std140_size(ubo_row_major), 16); } else { this->uniforms[id].array_stride = 0; } @@ -348,7 +534,7 @@ private: if (type->is_matrix() || (type->is_array() && type->fields.array->is_matrix())) { this->uniforms[id].matrix_stride = 16; - this->uniforms[id].row_major = !!ubo_var->RowMajor; + this->uniforms[id].row_major = ubo_row_major; } else { this->uniforms[id].matrix_stride = 0; this->uniforms[id].row_major = false; @@ -399,26 +585,10 @@ link_cross_validate_uniform_block(void *mem_ctx, { for (unsigned int i = 0; i < *num_linked_blocks; i++) { struct gl_uniform_block *old_block = &(*linked_blocks)[i]; - if (strcmp(old_block->Name, new_block->Name) == 0) { - if (old_block->NumUniforms != new_block->NumUniforms) { - return -1; - } - for (unsigned j = 0; j < old_block->NumUniforms; j++) { - if (strcmp(old_block->Uniforms[j].Name, - new_block->Uniforms[j].Name) != 0) - return -1; - - if (old_block->Uniforms[j].Offset != - new_block->Uniforms[j].Offset) - return -1; - - if (old_block->Uniforms[j].RowMajor != - new_block->Uniforms[j].RowMajor) - return -1; - } - return i; - } + if (strcmp(old_block->Name, new_block->Name) == 0) + return link_uniform_blocks_are_compatible(old_block, new_block) + ? i : -1; } *linked_blocks = reralloc(mem_ctx, *linked_blocks, @@ -440,7 +610,13 @@ link_cross_validate_uniform_block(void *mem_ctx, struct gl_uniform_buffer_variable *ubo_var = &linked_block->Uniforms[i]; - ubo_var->Name = ralloc_strdup(*linked_blocks, ubo_var->Name); + if (ubo_var->Name == ubo_var->IndexName) { + ubo_var->Name = ralloc_strdup(*linked_blocks, ubo_var->Name); + ubo_var->IndexName = ubo_var->Name; + } else { + ubo_var->Name = ralloc_strdup(*linked_blocks, ubo_var->Name); + ubo_var->IndexName = ralloc_strdup(*linked_blocks, ubo_var->IndexName); + } } return linked_block_index; @@ -452,24 +628,54 @@ link_cross_validate_uniform_block(void *mem_ctx, * would point at the uniform block list in one of the pre-linked * shaders). */ -static bool +static void link_update_uniform_buffer_variables(struct gl_shader *shader) { foreach_list(node, shader->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->uniform_block == -1)) + if ((var == NULL) || !var->is_in_uniform_block()) continue; - assert(var->mode == ir_var_uniform); + assert(var->data.mode == ir_var_uniform); + + if (var->is_interface_instance()) { + var->data.location = 0; + continue; + } bool found = false; + char sentinel = '\0'; + + if (var->type->is_record()) { + sentinel = '.'; + } else if (var->type->is_array() + && var->type->fields.array->is_record()) { + sentinel = '['; + } + + const unsigned l = strlen(var->name); for (unsigned i = 0; i < shader->NumUniformBlocks; i++) { for (unsigned j = 0; j < shader->UniformBlocks[i].NumUniforms; j++) { - if (!strcmp(var->name, shader->UniformBlocks[i].Uniforms[j].Name)) { + if (sentinel) { + const char *begin = shader->UniformBlocks[i].Uniforms[j].Name; + const char *end = strchr(begin, sentinel); + + if (end == NULL) + continue; + + if (l != (end - begin)) + continue; + + if (strncmp(var->name, begin, l) == 0) { + found = true; + var->data.location = j; + break; + } + } else if (!strcmp(var->name, + shader->UniformBlocks[i].Uniforms[j].Name)) { found = true; - var->uniform_block = i; - var->location = j; + var->data.location = j; break; } } @@ -478,8 +684,6 @@ link_update_uniform_buffer_variables(struct gl_shader *shader) } assert(found); } - - return true; } void @@ -496,7 +700,7 @@ link_assign_uniform_block_offsets(struct gl_shader *shader) unsigned alignment = type->std140_base_alignment(!!ubo_var->RowMajor); unsigned size = type->std140_size(!!ubo_var->RowMajor); - offset = align(offset, alignment); + offset = glsl_align(offset, alignment); ubo_var->Offset = offset; offset += size; } @@ -512,7 +716,7 @@ link_assign_uniform_block_offsets(struct gl_shader *shader) * and rounding up to the next multiple of the base * alignment required for a vec4." */ - block->UniformBufferSize = align(offset, 16); + block->UniformBufferSize = glsl_align(offset, 16); } } @@ -529,25 +733,6 @@ link_assign_uniform_locations(struct gl_shader_program *prog) prog->UniformHash = new string_to_uint_map; } - /* Uniforms that lack an initializer in the shader code have an initial - * value of zero. This includes sampler uniforms. - * - * Page 24 (page 30 of the PDF) of the GLSL 1.20 spec says: - * - * "The link time initial value is either the value of the variable's - * initializer, if present, or 0 if no initializer is present. Sampler - * types cannot have initializers." - */ - memset(prog->SamplerUnits, 0, sizeof(prog->SamplerUnits)); - - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { - if (prog->_LinkedShaders[i] == NULL) - continue; - - if (!link_update_uniform_buffer_variables(prog->_LinkedShaders[i])) - return; - } - /* First pass: Count the uniform resources used by the user-defined * uniforms. While this happens, each active uniform will have an index * assigned to it. @@ -556,18 +741,33 @@ link_assign_uniform_locations(struct gl_shader_program *prog) * glGetUniformLocation. */ count_uniform_size uniform_size(prog->UniformHash); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { - if (prog->_LinkedShaders[i] == NULL) + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + struct gl_shader *sh = prog->_LinkedShaders[i]; + + if (sh == NULL) continue; + /* Uniforms that lack an initializer in the shader code have an initial + * value of zero. This includes sampler uniforms. + * + * Page 24 (page 30 of the PDF) of the GLSL 1.20 spec says: + * + * "The link time initial value is either the value of the variable's + * initializer, if present, or 0 if no initializer is present. Sampler + * types cannot have initializers." + */ + memset(sh->SamplerUnits, 0, sizeof(sh->SamplerUnits)); + + link_update_uniform_buffer_variables(sh); + /* Reset various per-shader target counts. */ uniform_size.start_shader(); - foreach_list(node, prog->_LinkedShaders[i]->ir) { + foreach_list(node, sh->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform)) + if ((var == NULL) || (var->data.mode != ir_var_uniform)) continue; /* FINISHME: Update code to process built-in uniforms! @@ -581,9 +781,14 @@ link_assign_uniform_locations(struct gl_shader_program *prog) uniform_size.process(var); } - prog->_LinkedShaders[i]->num_samplers = uniform_size.num_shader_samplers; - prog->_LinkedShaders[i]->num_uniform_components = - uniform_size.num_shader_uniform_components; + sh->num_samplers = uniform_size.num_shader_samplers; + sh->num_uniform_components = uniform_size.num_shader_uniform_components; + + sh->num_combined_uniform_components = sh->num_uniform_components; + for (unsigned i = 0; i < sh->NumUniformBlocks; i++) { + sh->num_combined_uniform_components += + sh->UniformBlocks[i].UniformBufferSize / 4; + } } const unsigned num_user_uniforms = uniform_size.num_active_uniforms; @@ -604,18 +809,16 @@ link_assign_uniform_locations(struct gl_shader_program *prog) parcel_out_uniform_storage parcel(prog->UniformHash, uniforms, data); - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; - /* Reset various per-shader target counts. - */ - parcel.start_shader(); + parcel.start_shader((gl_shader_stage)i); foreach_list(node, prog->_LinkedShaders[i]->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform)) + if ((var == NULL) || (var->data.mode != ir_var_uniform)) continue; /* FINISHME: Update code to process built-in uniforms! @@ -623,15 +826,30 @@ link_assign_uniform_locations(struct gl_shader_program *prog) if (strncmp("gl_", var->name, 3) == 0) continue; - parcel.set_and_process(prog, prog->_LinkedShaders[i], var); + parcel.set_and_process(prog, var); } prog->_LinkedShaders[i]->active_samplers = parcel.shader_samplers_used; prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers; + + STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->SamplerTargets) == sizeof(parcel.targets)); + memcpy(prog->_LinkedShaders[i]->SamplerTargets, parcel.targets, + sizeof(prog->_LinkedShaders[i]->SamplerTargets)); } - assert(sizeof(prog->SamplerTargets) == sizeof(parcel.targets)); - memcpy(prog->SamplerTargets, parcel.targets, sizeof(prog->SamplerTargets)); + /* Determine the size of the largest uniform array queryable via + * glGetUniformLocation. Using this as the location scale guarantees that + * there is enough "room" for the array index to be stored in the low order + * part of the uniform location. It also makes the locations be more + * tightly packed. + */ + unsigned max_array_size = 1; + for (unsigned i = 0; i < num_user_uniforms; i++) { + if (uniforms[i].array_elements > max_array_size) + max_array_size = uniforms[i].array_elements; + } + + prog->UniformLocationBaseScale = max_array_size; #ifndef NDEBUG for (unsigned i = 0; i < num_user_uniforms; i++) { diff --git a/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp b/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp new file mode 100644 index 000000000..4f4aa89b4 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/link_varyings.cpp @@ -0,0 +1,1312 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file link_varyings.cpp + * + * Linker functions related specifically to linking varyings between shader + * stages. + */ + + +#include "main/mtypes.h" +#include "glsl_symbol_table.h" +#include "glsl_parser_extras.h" +#include "ir_optimization.h" +#include "linker.h" +#include "link_varyings.h" +#include "main/macros.h" +#include "program/hash_table.h" +#include "program.h" + + +/** + * Validate the types and qualifiers of an output from one stage against the + * matching input to another stage. + */ +static void +cross_validate_types_and_qualifiers(struct gl_shader_program *prog, + const ir_variable *input, + const ir_variable *output, + gl_shader_stage consumer_stage, + gl_shader_stage producer_stage) +{ + /* Check that the types match between stages. + */ + const glsl_type *type_to_match = input->type; + if (consumer_stage == MESA_SHADER_GEOMETRY) { + assert(type_to_match->is_array()); /* Enforced by ast_to_hir */ + type_to_match = type_to_match->element_type(); + } + if (type_to_match != output->type) { + /* There is a bit of a special case for gl_TexCoord. This + * built-in is unsized by default. Applications that variable + * access it must redeclare it with a size. There is some + * language in the GLSL spec that implies the fragment shader + * and vertex shader do not have to agree on this size. Other + * driver behave this way, and one or two applications seem to + * rely on it. + * + * Neither declaration needs to be modified here because the array + * sizes are fixed later when update_array_sizes is called. + * + * From page 48 (page 54 of the PDF) of the GLSL 1.10 spec: + * + * "Unlike user-defined varying variables, the built-in + * varying variables don't have a strict one-to-one + * correspondence between the vertex language and the + * fragment language." + */ + if (!output->type->is_array() + || (strncmp("gl_", output->name, 3) != 0)) { + linker_error(prog, + "%s shader output `%s' declared as type `%s', " + "but %s shader input declared as type `%s'\n", + _mesa_shader_stage_to_string(producer_stage), + output->name, + output->type->name, + _mesa_shader_stage_to_string(consumer_stage), + input->type->name); + return; + } + } + + /* Check that all of the qualifiers match between stages. + */ + if (input->data.centroid != output->data.centroid) { + linker_error(prog, + "%s shader output `%s' %s centroid qualifier, " + "but %s shader input %s centroid qualifier\n", + _mesa_shader_stage_to_string(producer_stage), + output->name, + (output->data.centroid) ? "has" : "lacks", + _mesa_shader_stage_to_string(consumer_stage), + (input->data.centroid) ? "has" : "lacks"); + return; + } + + if (input->data.sample != output->data.sample) { + linker_error(prog, + "%s shader output `%s' %s sample qualifier, " + "but %s shader input %s sample qualifier\n", + _mesa_shader_stage_to_string(producer_stage), + output->name, + (output->data.sample) ? "has" : "lacks", + _mesa_shader_stage_to_string(consumer_stage), + (input->data.sample) ? "has" : "lacks"); + return; + } + + if (input->data.invariant != output->data.invariant) { + linker_error(prog, + "%s shader output `%s' %s invariant qualifier, " + "but %s shader input %s invariant qualifier\n", + _mesa_shader_stage_to_string(producer_stage), + output->name, + (output->data.invariant) ? "has" : "lacks", + _mesa_shader_stage_to_string(consumer_stage), + (input->data.invariant) ? "has" : "lacks"); + return; + } + + if (input->data.interpolation != output->data.interpolation) { + linker_error(prog, + "%s shader output `%s' specifies %s " + "interpolation qualifier, " + "but %s shader input specifies %s " + "interpolation qualifier\n", + _mesa_shader_stage_to_string(producer_stage), + output->name, + interpolation_string(output->data.interpolation), + _mesa_shader_stage_to_string(consumer_stage), + interpolation_string(input->data.interpolation)); + return; + } +} + +/** + * Validate front and back color outputs against single color input + */ +static void +cross_validate_front_and_back_color(struct gl_shader_program *prog, + const ir_variable *input, + const ir_variable *front_color, + const ir_variable *back_color, + gl_shader_stage consumer_stage, + gl_shader_stage producer_stage) +{ + if (front_color != NULL && front_color->data.assigned) + cross_validate_types_and_qualifiers(prog, input, front_color, + consumer_stage, producer_stage); + + if (back_color != NULL && back_color->data.assigned) + cross_validate_types_and_qualifiers(prog, input, back_color, + consumer_stage, producer_stage); +} + +/** + * Validate that outputs from one stage match inputs of another + */ +void +cross_validate_outputs_to_inputs(struct gl_shader_program *prog, + gl_shader *producer, gl_shader *consumer) +{ + glsl_symbol_table parameters; + + /* Find all shader outputs in the "producer" stage. + */ + foreach_list(node, producer->ir) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if ((var == NULL) || (var->data.mode != ir_var_shader_out)) + continue; + + parameters.add_variable(var); + } + + + /* Find all shader inputs in the "consumer" stage. Any variables that have + * matching outputs already in the symbol table must have the same type and + * qualifiers. + * + * Exception: if the consumer is the geometry shader, then the inputs + * should be arrays and the type of the array element should match the type + * of the corresponding producer output. + */ + foreach_list(node, consumer->ir) { + ir_variable *const input = ((ir_instruction *) node)->as_variable(); + + if ((input == NULL) || (input->data.mode != ir_var_shader_in)) + continue; + + if (strcmp(input->name, "gl_Color") == 0 && input->data.used) { + const ir_variable *const front_color = + parameters.get_variable("gl_FrontColor"); + + const ir_variable *const back_color = + parameters.get_variable("gl_BackColor"); + + cross_validate_front_and_back_color(prog, input, + front_color, back_color, + consumer->Stage, producer->Stage); + } else if (strcmp(input->name, "gl_SecondaryColor") == 0 && input->data.used) { + const ir_variable *const front_color = + parameters.get_variable("gl_FrontSecondaryColor"); + + const ir_variable *const back_color = + parameters.get_variable("gl_BackSecondaryColor"); + + cross_validate_front_and_back_color(prog, input, + front_color, back_color, + consumer->Stage, producer->Stage); + } else { + ir_variable *const output = parameters.get_variable(input->name); + if (output != NULL) { + cross_validate_types_and_qualifiers(prog, input, output, + consumer->Stage, producer->Stage); + } + } + } +} + + +/** + * Initialize this object based on a string that was passed to + * glTransformFeedbackVaryings. + * + * If the input is mal-formed, this call still succeeds, but it sets + * this->var_name to a mal-formed input, so tfeedback_decl::find_output_var() + * will fail to find any matching variable. + */ +void +tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, + const char *input) +{ + /* We don't have to be pedantic about what is a valid GLSL variable name, + * because any variable with an invalid name can't exist in the IR anyway. + */ + + this->location = -1; + this->orig_name = input; + this->is_clip_distance_mesa = false; + this->skip_components = 0; + this->next_buffer_separator = false; + this->matched_candidate = NULL; + + if (ctx->Extensions.ARB_transform_feedback3) { + /* Parse gl_NextBuffer. */ + if (strcmp(input, "gl_NextBuffer") == 0) { + this->next_buffer_separator = true; + return; + } + + /* Parse gl_SkipComponents. */ + if (strcmp(input, "gl_SkipComponents1") == 0) + this->skip_components = 1; + else if (strcmp(input, "gl_SkipComponents2") == 0) + this->skip_components = 2; + else if (strcmp(input, "gl_SkipComponents3") == 0) + this->skip_components = 3; + else if (strcmp(input, "gl_SkipComponents4") == 0) + this->skip_components = 4; + + if (this->skip_components) + return; + } + + /* Parse a declaration. */ + const char *base_name_end; + long subscript = parse_program_resource_name(input, &base_name_end); + this->var_name = ralloc_strndup(mem_ctx, input, base_name_end - input); + if (subscript >= 0) { + this->array_subscript = subscript; + this->is_subscripted = true; + } else { + this->is_subscripted = false; + } + + /* For drivers that lower gl_ClipDistance to gl_ClipDistanceMESA, this + * class must behave specially to account for the fact that gl_ClipDistance + * is converted from a float[8] to a vec4[2]. + */ + if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance && + strcmp(this->var_name, "gl_ClipDistance") == 0) { + this->is_clip_distance_mesa = true; + } +} + + +/** + * Determine whether two tfeedback_decl objects refer to the same variable and + * array index (if applicable). + */ +bool +tfeedback_decl::is_same(const tfeedback_decl &x, const tfeedback_decl &y) +{ + assert(x.is_varying() && y.is_varying()); + + if (strcmp(x.var_name, y.var_name) != 0) + return false; + if (x.is_subscripted != y.is_subscripted) + return false; + if (x.is_subscripted && x.array_subscript != y.array_subscript) + return false; + return true; +} + + +/** + * Assign a location for this tfeedback_decl object based on the transform + * feedback candidate found by find_candidate. + * + * If an error occurs, the error is reported through linker_error() and false + * is returned. + */ +bool +tfeedback_decl::assign_location(struct gl_context *ctx, + struct gl_shader_program *prog) +{ + assert(this->is_varying()); + + unsigned fine_location + = this->matched_candidate->toplevel_var->data.location * 4 + + this->matched_candidate->toplevel_var->data.location_frac + + this->matched_candidate->offset; + + if (this->matched_candidate->type->is_array()) { + /* Array variable */ + const unsigned matrix_cols = + this->matched_candidate->type->fields.array->matrix_columns; + const unsigned vector_elements = + this->matched_candidate->type->fields.array->vector_elements; + unsigned actual_array_size = this->is_clip_distance_mesa ? + prog->LastClipDistanceArraySize : + this->matched_candidate->type->array_size(); + + if (this->is_subscripted) { + /* Check array bounds. */ + if (this->array_subscript >= actual_array_size) { + linker_error(prog, "Transform feedback varying %s has index " + "%i, but the array size is %u.", + this->orig_name, this->array_subscript, + actual_array_size); + return false; + } + unsigned array_elem_size = this->is_clip_distance_mesa ? + 1 : vector_elements * matrix_cols; + fine_location += array_elem_size * this->array_subscript; + this->size = 1; + } else { + this->size = actual_array_size; + } + this->vector_elements = vector_elements; + this->matrix_columns = matrix_cols; + if (this->is_clip_distance_mesa) + this->type = GL_FLOAT; + else + this->type = this->matched_candidate->type->fields.array->gl_type; + } else { + /* Regular variable (scalar, vector, or matrix) */ + if (this->is_subscripted) { + linker_error(prog, "Transform feedback varying %s requested, " + "but %s is not an array.", + this->orig_name, this->var_name); + return false; + } + this->size = 1; + this->vector_elements = this->matched_candidate->type->vector_elements; + this->matrix_columns = this->matched_candidate->type->matrix_columns; + this->type = this->matched_candidate->type->gl_type; + } + this->location = fine_location / 4; + this->location_frac = fine_location % 4; + + /* From GL_EXT_transform_feedback: + * A program will fail to link if: + * + * * the total number of components to capture in any varying + * variable in is greater than the constant + * MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT and the + * buffer mode is SEPARATE_ATTRIBS_EXT; + */ + if (prog->TransformFeedback.BufferMode == GL_SEPARATE_ATTRIBS && + this->num_components() > + ctx->Const.MaxTransformFeedbackSeparateComponents) { + linker_error(prog, "Transform feedback varying %s exceeds " + "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS.", + this->orig_name); + return false; + } + + return true; +} + + +unsigned +tfeedback_decl::get_num_outputs() const +{ + if (!this->is_varying()) { + return 0; + } + + return (this->num_components() + this->location_frac + 3)/4; +} + + +/** + * Update gl_transform_feedback_info to reflect this tfeedback_decl. + * + * If an error occurs, the error is reported through linker_error() and false + * is returned. + */ +bool +tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, + struct gl_transform_feedback_info *info, + unsigned buffer, const unsigned max_outputs) const +{ + assert(!this->next_buffer_separator); + + /* Handle gl_SkipComponents. */ + if (this->skip_components) { + info->BufferStride[buffer] += this->skip_components; + return true; + } + + /* From GL_EXT_transform_feedback: + * A program will fail to link if: + * + * * the total number of components to capture is greater than + * the constant MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT + * and the buffer mode is INTERLEAVED_ATTRIBS_EXT. + */ + if (prog->TransformFeedback.BufferMode == GL_INTERLEAVED_ATTRIBS && + info->BufferStride[buffer] + this->num_components() > + ctx->Const.MaxTransformFeedbackInterleavedComponents) { + linker_error(prog, "The MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS " + "limit has been exceeded."); + return false; + } + + unsigned location = this->location; + unsigned location_frac = this->location_frac; + unsigned num_components = this->num_components(); + while (num_components > 0) { + unsigned output_size = MIN2(num_components, 4 - location_frac); + assert(info->NumOutputs < max_outputs); + info->Outputs[info->NumOutputs].ComponentOffset = location_frac; + info->Outputs[info->NumOutputs].OutputRegister = location; + info->Outputs[info->NumOutputs].NumComponents = output_size; + info->Outputs[info->NumOutputs].OutputBuffer = buffer; + info->Outputs[info->NumOutputs].DstOffset = info->BufferStride[buffer]; + ++info->NumOutputs; + info->BufferStride[buffer] += output_size; + num_components -= output_size; + location++; + location_frac = 0; + } + + info->Varyings[info->NumVarying].Name = ralloc_strdup(prog, this->orig_name); + info->Varyings[info->NumVarying].Type = this->type; + info->Varyings[info->NumVarying].Size = this->size; + info->NumVarying++; + + return true; +} + + +const tfeedback_candidate * +tfeedback_decl::find_candidate(gl_shader_program *prog, + hash_table *tfeedback_candidates) +{ + const char *name = this->is_clip_distance_mesa + ? "gl_ClipDistanceMESA" : this->var_name; + this->matched_candidate = (const tfeedback_candidate *) + hash_table_find(tfeedback_candidates, name); + if (!this->matched_candidate) { + /* From GL_EXT_transform_feedback: + * A program will fail to link if: + * + * * any variable name specified in the array is not + * declared as an output in the geometry shader (if present) or + * the vertex shader (if no geometry shader is present); + */ + linker_error(prog, "Transform feedback varying %s undeclared.", + this->orig_name); + } + return this->matched_candidate; +} + + +/** + * Parse all the transform feedback declarations that were passed to + * glTransformFeedbackVaryings() and store them in tfeedback_decl objects. + * + * If an error occurs, the error is reported through linker_error() and false + * is returned. + */ +bool +parse_tfeedback_decls(struct gl_context *ctx, struct gl_shader_program *prog, + const void *mem_ctx, unsigned num_names, + char **varying_names, tfeedback_decl *decls) +{ + for (unsigned i = 0; i < num_names; ++i) { + decls[i].init(ctx, mem_ctx, varying_names[i]); + + if (!decls[i].is_varying()) + continue; + + /* From GL_EXT_transform_feedback: + * A program will fail to link if: + * + * * any two entries in the array specify the same varying + * variable; + * + * We interpret this to mean "any two entries in the array + * specify the same varying variable and array index", since transform + * feedback of arrays would be useless otherwise. + */ + for (unsigned j = 0; j < i; ++j) { + if (!decls[j].is_varying()) + continue; + + if (tfeedback_decl::is_same(decls[i], decls[j])) { + linker_error(prog, "Transform feedback varying %s specified " + "more than once.", varying_names[i]); + return false; + } + } + } + return true; +} + + +/** + * Store transform feedback location assignments into + * prog->LinkedTransformFeedback based on the data stored in tfeedback_decls. + * + * If an error occurs, the error is reported through linker_error() and false + * is returned. + */ +bool +store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, + unsigned num_tfeedback_decls, + tfeedback_decl *tfeedback_decls) +{ + bool separate_attribs_mode = + prog->TransformFeedback.BufferMode == GL_SEPARATE_ATTRIBS; + + ralloc_free(prog->LinkedTransformFeedback.Varyings); + ralloc_free(prog->LinkedTransformFeedback.Outputs); + + memset(&prog->LinkedTransformFeedback, 0, + sizeof(prog->LinkedTransformFeedback)); + + prog->LinkedTransformFeedback.Varyings = + rzalloc_array(prog, + struct gl_transform_feedback_varying_info, + num_tfeedback_decls); + + unsigned num_outputs = 0; + for (unsigned i = 0; i < num_tfeedback_decls; ++i) + num_outputs += tfeedback_decls[i].get_num_outputs(); + + prog->LinkedTransformFeedback.Outputs = + rzalloc_array(prog, + struct gl_transform_feedback_output, + num_outputs); + + unsigned num_buffers = 0; + + if (separate_attribs_mode) { + /* GL_SEPARATE_ATTRIBS */ + for (unsigned i = 0; i < num_tfeedback_decls; ++i) { + if (!tfeedback_decls[i].store(ctx, prog, &prog->LinkedTransformFeedback, + num_buffers, num_outputs)) + return false; + + num_buffers++; + } + } + else { + /* GL_INVERLEAVED_ATTRIBS */ + for (unsigned i = 0; i < num_tfeedback_decls; ++i) { + if (tfeedback_decls[i].is_next_buffer_separator()) { + num_buffers++; + continue; + } + + if (!tfeedback_decls[i].store(ctx, prog, + &prog->LinkedTransformFeedback, + num_buffers, num_outputs)) + return false; + } + num_buffers++; + } + + assert(prog->LinkedTransformFeedback.NumOutputs == num_outputs); + + prog->LinkedTransformFeedback.NumBuffers = num_buffers; + return true; +} + +namespace { + +/** + * Data structure recording the relationship between outputs of one shader + * stage (the "producer") and inputs of another (the "consumer"). + */ +class varying_matches +{ +public: + varying_matches(bool disable_varying_packing, bool consumer_is_fs); + ~varying_matches(); + void record(ir_variable *producer_var, ir_variable *consumer_var); + unsigned assign_locations(); + void store_locations(unsigned producer_base, unsigned consumer_base) const; + +private: + /** + * If true, this driver disables varying packing, so all varyings need to + * be aligned on slot boundaries, and take up a number of slots equal to + * their number of matrix columns times their array size. + */ + const bool disable_varying_packing; + + /** + * Enum representing the order in which varyings are packed within a + * packing class. + * + * Currently we pack vec4's first, then vec2's, then scalar values, then + * vec3's. This order ensures that the only vectors that are at risk of + * having to be "double parked" (split between two adjacent varying slots) + * are the vec3's. + */ + enum packing_order_enum { + PACKING_ORDER_VEC4, + PACKING_ORDER_VEC2, + PACKING_ORDER_SCALAR, + PACKING_ORDER_VEC3, + }; + + static unsigned compute_packing_class(ir_variable *var); + static packing_order_enum compute_packing_order(ir_variable *var); + static int match_comparator(const void *x_generic, const void *y_generic); + + /** + * Structure recording the relationship between a single producer output + * and a single consumer input. + */ + struct match { + /** + * Packing class for this varying, computed by compute_packing_class(). + */ + unsigned packing_class; + + /** + * Packing order for this varying, computed by compute_packing_order(). + */ + packing_order_enum packing_order; + unsigned num_components; + + /** + * The output variable in the producer stage. + */ + ir_variable *producer_var; + + /** + * The input variable in the consumer stage. + */ + ir_variable *consumer_var; + + /** + * The location which has been assigned for this varying. This is + * expressed in multiples of a float, with the first generic varying + * (i.e. the one referred to by VARYING_SLOT_VAR0) represented by the + * value 0. + */ + unsigned generic_location; + } *matches; + + /** + * The number of elements in the \c matches array that are currently in + * use. + */ + unsigned num_matches; + + /** + * The number of elements that were set aside for the \c matches array when + * it was allocated. + */ + unsigned matches_capacity; + + const bool consumer_is_fs; +}; + +} /* anonymous namespace */ + +varying_matches::varying_matches(bool disable_varying_packing, + bool consumer_is_fs) + : disable_varying_packing(disable_varying_packing), + consumer_is_fs(consumer_is_fs) +{ + /* Note: this initial capacity is rather arbitrarily chosen to be large + * enough for many cases without wasting an unreasonable amount of space. + * varying_matches::record() will resize the array if there are more than + * this number of varyings. + */ + this->matches_capacity = 8; + this->matches = (match *) + malloc(sizeof(*this->matches) * this->matches_capacity); + this->num_matches = 0; +} + + +varying_matches::~varying_matches() +{ + free(this->matches); +} + + +/** + * Record the given producer/consumer variable pair in the list of variables + * that should later be assigned locations. + * + * It is permissible for \c consumer_var to be NULL (this happens if a + * variable is output by the producer and consumed by transform feedback, but + * not consumed by the consumer). + * + * If \c producer_var has already been paired up with a consumer_var, or + * producer_var is part of fixed pipeline functionality (and hence already has + * a location assigned), this function has no effect. + * + * Note: as a side effect this function may change the interpolation type of + * \c producer_var, but only when the change couldn't possibly affect + * rendering. + */ +void +varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) +{ + if (!producer_var->data.is_unmatched_generic_inout) { + /* Either a location already exists for this variable (since it is part + * of fixed functionality), or it has already been recorded as part of a + * previous match. + */ + return; + } + + if ((consumer_var == NULL && producer_var->type->contains_integer()) || + !consumer_is_fs) { + /* Since this varying is not being consumed by the fragment shader, its + * interpolation type varying cannot possibly affect rendering. Also, + * this variable is non-flat and is (or contains) an integer. + * + * lower_packed_varyings requires all integer varyings to flat, + * regardless of where they appear. We can trivially satisfy that + * requirement by changing the interpolation type to flat here. + */ + producer_var->data.centroid = false; + producer_var->data.sample = false; + producer_var->data.interpolation = INTERP_QUALIFIER_FLAT; + + if (consumer_var) { + consumer_var->data.centroid = false; + consumer_var->data.sample = false; + consumer_var->data.interpolation = INTERP_QUALIFIER_FLAT; + } + } + + if (this->num_matches == this->matches_capacity) { + this->matches_capacity *= 2; + this->matches = (match *) + realloc(this->matches, + sizeof(*this->matches) * this->matches_capacity); + } + this->matches[this->num_matches].packing_class + = this->compute_packing_class(producer_var); + this->matches[this->num_matches].packing_order + = this->compute_packing_order(producer_var); + if (this->disable_varying_packing) { + unsigned slots = producer_var->type->is_array() + ? (producer_var->type->length + * producer_var->type->fields.array->matrix_columns) + : producer_var->type->matrix_columns; + this->matches[this->num_matches].num_components = 4 * slots; + } else { + this->matches[this->num_matches].num_components + = producer_var->type->component_slots(); + } + this->matches[this->num_matches].producer_var = producer_var; + this->matches[this->num_matches].consumer_var = consumer_var; + this->num_matches++; + producer_var->data.is_unmatched_generic_inout = 0; + if (consumer_var) + consumer_var->data.is_unmatched_generic_inout = 0; +} + + +/** + * Choose locations for all of the variable matches that were previously + * passed to varying_matches::record(). + */ +unsigned +varying_matches::assign_locations() +{ + /* Sort varying matches into an order that makes them easy to pack. */ + qsort(this->matches, this->num_matches, sizeof(*this->matches), + &varying_matches::match_comparator); + + unsigned generic_location = 0; + + for (unsigned i = 0; i < this->num_matches; i++) { + /* Advance to the next slot if this varying has a different packing + * class than the previous one, and we're not already on a slot + * boundary. + */ + if (i > 0 && + this->matches[i - 1].packing_class + != this->matches[i].packing_class) { + generic_location = ALIGN(generic_location, 4); + } + + this->matches[i].generic_location = generic_location; + + generic_location += this->matches[i].num_components; + } + + return (generic_location + 3) / 4; +} + + +/** + * Update the producer and consumer shaders to reflect the locations + * assignments that were made by varying_matches::assign_locations(). + */ +void +varying_matches::store_locations(unsigned producer_base, + unsigned consumer_base) const +{ + for (unsigned i = 0; i < this->num_matches; i++) { + ir_variable *producer_var = this->matches[i].producer_var; + ir_variable *consumer_var = this->matches[i].consumer_var; + unsigned generic_location = this->matches[i].generic_location; + unsigned slot = generic_location / 4; + unsigned offset = generic_location % 4; + + producer_var->data.location = producer_base + slot; + producer_var->data.location_frac = offset; + if (consumer_var) { + assert(consumer_var->data.location == -1); + consumer_var->data.location = consumer_base + slot; + consumer_var->data.location_frac = offset; + } + } +} + + +/** + * Compute the "packing class" of the given varying. This is an unsigned + * integer with the property that two variables in the same packing class can + * be safely backed into the same vec4. + */ +unsigned +varying_matches::compute_packing_class(ir_variable *var) +{ + /* Without help from the back-end, there is no way to pack together + * variables with different interpolation types, because + * lower_packed_varyings must choose exactly one interpolation type for + * each packed varying it creates. + * + * However, we can safely pack together floats, ints, and uints, because: + * + * - varyings of base type "int" and "uint" must use the "flat" + * interpolation type, which can only occur in GLSL 1.30 and above. + * + * - On platforms that support GLSL 1.30 and above, lower_packed_varyings + * can store flat floats as ints without losing any information (using + * the ir_unop_bitcast_* opcodes). + * + * Therefore, the packing class depends only on the interpolation type. + */ + unsigned packing_class = var->data.centroid | (var->data.sample << 1); + packing_class *= 4; + packing_class += var->data.interpolation; + return packing_class; +} + + +/** + * Compute the "packing order" of the given varying. This is a sort key we + * use to determine when to attempt to pack the given varying relative to + * other varyings in the same packing class. + */ +varying_matches::packing_order_enum +varying_matches::compute_packing_order(ir_variable *var) +{ + const glsl_type *element_type = var->type; + + while (element_type->base_type == GLSL_TYPE_ARRAY) { + element_type = element_type->fields.array; + } + + switch (element_type->component_slots() % 4) { + case 1: return PACKING_ORDER_SCALAR; + case 2: return PACKING_ORDER_VEC2; + case 3: return PACKING_ORDER_VEC3; + case 0: return PACKING_ORDER_VEC4; + default: + assert(!"Unexpected value of vector_elements"); + return PACKING_ORDER_VEC4; + } +} + + +/** + * Comparison function passed to qsort() to sort varyings by packing_class and + * then by packing_order. + */ +int +varying_matches::match_comparator(const void *x_generic, const void *y_generic) +{ + const match *x = (const match *) x_generic; + const match *y = (const match *) y_generic; + + if (x->packing_class != y->packing_class) + return x->packing_class - y->packing_class; + return x->packing_order - y->packing_order; +} + + +/** + * Is the given variable a varying variable to be counted against the + * limit in ctx->Const.MaxVarying? + * This includes variables such as texcoords, colors and generic + * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord. + */ +static bool +is_varying_var(gl_shader_stage stage, const ir_variable *var) +{ + /* Only fragment shaders will take a varying variable as an input */ + if (stage == MESA_SHADER_FRAGMENT && + var->data.mode == ir_var_shader_in) { + switch (var->data.location) { + case VARYING_SLOT_POS: + case VARYING_SLOT_FACE: + case VARYING_SLOT_PNTC: + return false; + default: + return true; + } + } + return false; +} + + +/** + * Visitor class that generates tfeedback_candidate structs describing all + * possible targets of transform feedback. + * + * tfeedback_candidate structs are stored in the hash table + * tfeedback_candidates, which is passed to the constructor. This hash table + * maps varying names to instances of the tfeedback_candidate struct. + */ +class tfeedback_candidate_generator : public program_resource_visitor +{ +public: + tfeedback_candidate_generator(void *mem_ctx, + hash_table *tfeedback_candidates) + : mem_ctx(mem_ctx), + tfeedback_candidates(tfeedback_candidates), + toplevel_var(NULL), + varying_floats(0) + { + } + + void process(ir_variable *var) + { + this->toplevel_var = var; + this->varying_floats = 0; + if (var->is_interface_instance()) + program_resource_visitor::process(var->get_interface_type(), + var->get_interface_type()->name); + else + program_resource_visitor::process(var); + } + +private: + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major) + { + assert(!type->is_record()); + assert(!(type->is_array() && type->fields.array->is_record())); + assert(!type->is_interface()); + assert(!(type->is_array() && type->fields.array->is_interface())); + + (void) row_major; + + tfeedback_candidate *candidate + = rzalloc(this->mem_ctx, tfeedback_candidate); + candidate->toplevel_var = this->toplevel_var; + candidate->type = type; + candidate->offset = this->varying_floats; + hash_table_insert(this->tfeedback_candidates, candidate, + ralloc_strdup(this->mem_ctx, name)); + this->varying_floats += type->component_slots(); + } + + /** + * Memory context used to allocate hash table keys and values. + */ + void * const mem_ctx; + + /** + * Hash table in which tfeedback_candidate objects should be stored. + */ + hash_table * const tfeedback_candidates; + + /** + * Pointer to the toplevel variable that is being traversed. + */ + ir_variable *toplevel_var; + + /** + * Total number of varying floats that have been visited so far. This is + * used to determine the offset to each varying within the toplevel + * variable. + */ + unsigned varying_floats; +}; + + +/** + * Assign locations for all variables that are produced in one pipeline stage + * (the "producer") and consumed in the next stage (the "consumer"). + * + * Variables produced by the producer may also be consumed by transform + * feedback. + * + * \param num_tfeedback_decls is the number of declarations indicating + * variables that may be consumed by transform feedback. + * + * \param tfeedback_decls is a pointer to an array of tfeedback_decl objects + * representing the result of parsing the strings passed to + * glTransformFeedbackVaryings(). assign_location() will be called for + * each of these objects that matches one of the outputs of the + * producer. + * + * \param gs_input_vertices: if \c consumer is a geometry shader, this is the + * number of input vertices it accepts. Otherwise zero. + * + * When num_tfeedback_decls is nonzero, it is permissible for the consumer to + * be NULL. In this case, varying locations are assigned solely based on the + * requirements of transform feedback. + */ +bool +assign_varying_locations(struct gl_context *ctx, + void *mem_ctx, + struct gl_shader_program *prog, + gl_shader *producer, gl_shader *consumer, + unsigned num_tfeedback_decls, + tfeedback_decl *tfeedback_decls, + unsigned gs_input_vertices) +{ + const unsigned producer_base = VARYING_SLOT_VAR0; + const unsigned consumer_base = VARYING_SLOT_VAR0; + varying_matches matches(!!ctx->Const.DisableVaryingPacking, + consumer && consumer->Stage == MESA_SHADER_FRAGMENT); + hash_table *tfeedback_candidates + = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); + hash_table *consumer_inputs + = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); + hash_table *consumer_interface_inputs + = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); + + /* Operate in a total of three passes. + * + * 1. Assign locations for any matching inputs and outputs. + * + * 2. Mark output variables in the producer that do not have locations as + * not being outputs. This lets the optimizer eliminate them. + * + * 3. Mark input variables in the consumer that do not have locations as + * not being inputs. This lets the optimizer eliminate them. + */ + + if (consumer) { + foreach_list(node, consumer->ir) { + ir_variable *const input_var = + ((ir_instruction *) node)->as_variable(); + + if ((input_var != NULL) && (input_var->data.mode == ir_var_shader_in)) { + if (input_var->get_interface_type() != NULL) { + char *const iface_field_name = + ralloc_asprintf(mem_ctx, "%s.%s", + input_var->get_interface_type()->name, + input_var->name); + hash_table_insert(consumer_interface_inputs, input_var, + iface_field_name); + } else { + hash_table_insert(consumer_inputs, input_var, + ralloc_strdup(mem_ctx, input_var->name)); + } + } + } + } + + foreach_list(node, producer->ir) { + ir_variable *const output_var = ((ir_instruction *) node)->as_variable(); + + if ((output_var == NULL) || (output_var->data.mode != ir_var_shader_out)) + continue; + + tfeedback_candidate_generator g(mem_ctx, tfeedback_candidates); + g.process(output_var); + + ir_variable *input_var; + if (output_var->get_interface_type() != NULL) { + char *const iface_field_name = + ralloc_asprintf(mem_ctx, "%s.%s", + output_var->get_interface_type()->name, + output_var->name); + input_var = + (ir_variable *) hash_table_find(consumer_interface_inputs, + iface_field_name); + } else { + input_var = + (ir_variable *) hash_table_find(consumer_inputs, output_var->name); + } + + if (input_var && input_var->data.mode != ir_var_shader_in) + input_var = NULL; + + if (input_var) { + matches.record(output_var, input_var); + } + } + + for (unsigned i = 0; i < num_tfeedback_decls; ++i) { + if (!tfeedback_decls[i].is_varying()) + continue; + + const tfeedback_candidate *matched_candidate + = tfeedback_decls[i].find_candidate(prog, tfeedback_candidates); + + if (matched_candidate == NULL) { + hash_table_dtor(tfeedback_candidates); + hash_table_dtor(consumer_inputs); + hash_table_dtor(consumer_interface_inputs); + return false; + } + + if (matched_candidate->toplevel_var->data.is_unmatched_generic_inout) + matches.record(matched_candidate->toplevel_var, NULL); + } + + const unsigned slots_used = matches.assign_locations(); + matches.store_locations(producer_base, consumer_base); + + for (unsigned i = 0; i < num_tfeedback_decls; ++i) { + if (!tfeedback_decls[i].is_varying()) + continue; + + if (!tfeedback_decls[i].assign_location(ctx, prog)) { + hash_table_dtor(tfeedback_candidates); + hash_table_dtor(consumer_inputs); + hash_table_dtor(consumer_interface_inputs); + return false; + } + } + + hash_table_dtor(tfeedback_candidates); + hash_table_dtor(consumer_inputs); + hash_table_dtor(consumer_interface_inputs); + + if (ctx->Const.DisableVaryingPacking) { + /* Transform feedback code assumes varyings are packed, so if the driver + * has disabled varying packing, make sure it does not support transform + * feedback. + */ + assert(!ctx->Extensions.EXT_transform_feedback); + } else { + lower_packed_varyings(mem_ctx, producer_base, slots_used, + ir_var_shader_out, 0, producer); + if (consumer) { + lower_packed_varyings(mem_ctx, consumer_base, slots_used, + ir_var_shader_in, gs_input_vertices, consumer); + } + } + + if (consumer) { + foreach_list(node, consumer->ir) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if (var && var->data.mode == ir_var_shader_in && + var->data.is_unmatched_generic_inout) { + if (prog->Version <= 120) { + /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec: + * + * Only those varying variables used (i.e. read) in + * the fragment shader executable must be written to + * by the vertex shader executable; declaring + * superfluous varying variables in a vertex shader is + * permissible. + * + * We interpret this text as meaning that the VS must + * write the variable for the FS to read it. See + * "glsl1-varying read but not written" in piglit. + */ + + linker_error(prog, "%s shader varying %s not written " + "by %s shader\n.", + _mesa_shader_stage_to_string(consumer->Stage), + var->name, + _mesa_shader_stage_to_string(producer->Stage)); + } + + /* An 'in' variable is only really a shader input if its + * value is written by the previous stage. + */ + var->data.mode = ir_var_auto; + } + } + } + + return true; +} + +bool +check_against_output_limit(struct gl_context *ctx, + struct gl_shader_program *prog, + gl_shader *producer) +{ + unsigned output_vectors = 0; + + foreach_list(node, producer->ir) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if (var && var->data.mode == ir_var_shader_out && + is_varying_var(producer->Stage, var)) { + output_vectors += var->type->count_attribute_slots(); + } + } + + assert(producer->Stage != MESA_SHADER_FRAGMENT); + unsigned max_output_components = + ctx->Const.Program[producer->Stage].MaxOutputComponents; + + const unsigned output_components = output_vectors * 4; + if (output_components > max_output_components) { + if (ctx->API == API_OPENGLES2 || prog->IsES) + linker_error(prog, "shader uses too many output vectors " + "(%u > %u)\n", + output_vectors, + max_output_components / 4); + else + linker_error(prog, "shader uses too many output components " + "(%u > %u)\n", + output_components, + max_output_components); + + return false; + } + + return true; +} + +bool +check_against_input_limit(struct gl_context *ctx, + struct gl_shader_program *prog, + gl_shader *consumer) +{ + unsigned input_vectors = 0; + + foreach_list(node, consumer->ir) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if (var && var->data.mode == ir_var_shader_in && + is_varying_var(consumer->Stage, var)) { + input_vectors += var->type->count_attribute_slots(); + } + } + + assert(consumer->Stage != MESA_SHADER_VERTEX); + unsigned max_input_components = + ctx->Const.Program[consumer->Stage].MaxInputComponents; + + const unsigned input_components = input_vectors * 4; + if (input_components > max_input_components) { + if (ctx->API == API_OPENGLES2 || prog->IsES) + linker_error(prog, "shader uses too many input vectors " + "(%u > %u)\n", + input_vectors, + max_input_components / 4); + else + linker_error(prog, "shader uses too many input components " + "(%u > %u)\n", + input_components, + max_input_components); + + return false; + } + + return true; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/link_varyings.h b/3rdparty/glsl-optimizer/src/glsl/link_varyings.h new file mode 100644 index 000000000..6fa268176 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/link_varyings.h @@ -0,0 +1,249 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#pragma once +#ifndef GLSL_LINK_VARYINGS_H +#define GLSL_LINK_VARYINGS_H + +/** + * \file link_varyings.h + * + * Linker functions related specifically to linking varyings between shader + * stages. + */ + + +#include "main/glheader.h" + + +struct gl_shader_program; +struct gl_shader; +class ir_variable; + + +/** + * Data structure describing a varying which is available for use in transform + * feedback. + * + * For example, if the vertex shader contains: + * + * struct S { + * vec4 foo; + * float[3] bar; + * }; + * + * varying S[2] v; + * + * Then there would be tfeedback_candidate objects corresponding to the + * following varyings: + * + * v[0].foo + * v[0].bar + * v[1].foo + * v[1].bar + */ +struct tfeedback_candidate +{ + /** + * Toplevel variable containing this varying. In the above example, this + * would point to the declaration of the varying v. + */ + ir_variable *toplevel_var; + + /** + * Type of this varying. In the above example, this would point to the + * glsl_type for "vec4" or "float[3]". + */ + const glsl_type *type; + + /** + * Offset within the toplevel variable where this varying occurs (counted + * in multiples of the size of a float). + */ + unsigned offset; +}; + + +/** + * Data structure tracking information about a transform feedback declaration + * during linking. + */ +class tfeedback_decl +{ +public: + void init(struct gl_context *ctx, const void *mem_ctx, const char *input); + static bool is_same(const tfeedback_decl &x, const tfeedback_decl &y); + bool assign_location(struct gl_context *ctx, + struct gl_shader_program *prog); + unsigned get_num_outputs() const; + bool store(struct gl_context *ctx, struct gl_shader_program *prog, + struct gl_transform_feedback_info *info, unsigned buffer, + const unsigned max_outputs) const; + const tfeedback_candidate *find_candidate(gl_shader_program *prog, + hash_table *tfeedback_candidates); + + bool is_next_buffer_separator() const + { + return this->next_buffer_separator; + } + + bool is_varying() const + { + return !this->next_buffer_separator && !this->skip_components; + } + + /** + * The total number of varying components taken up by this variable. Only + * valid if assign_location() has been called. + */ + unsigned num_components() const + { + if (this->is_clip_distance_mesa) + return this->size; + else + return this->vector_elements * this->matrix_columns * this->size; + } + + unsigned get_location() const { + return this->location; + } + +private: + /** + * The name that was supplied to glTransformFeedbackVaryings. Used for + * error reporting and glGetTransformFeedbackVarying(). + */ + const char *orig_name; + + /** + * The name of the variable, parsed from orig_name. + */ + const char *var_name; + + /** + * True if the declaration in orig_name represents an array. + */ + bool is_subscripted; + + /** + * If is_subscripted is true, the subscript that was specified in orig_name. + */ + unsigned array_subscript; + + /** + * True if the variable is gl_ClipDistance and the driver lowers + * gl_ClipDistance to gl_ClipDistanceMESA. + */ + bool is_clip_distance_mesa; + + /** + * The vertex shader output location that the linker assigned for this + * variable. -1 if a location hasn't been assigned yet. + */ + int location; + + /** + * If non-zero, then this variable may be packed along with other variables + * into a single varying slot, so this offset should be applied when + * accessing components. For example, an offset of 1 means that the x + * component of this variable is actually stored in component y of the + * location specified by \c location. + * + * Only valid if location != -1. + */ + unsigned location_frac; + + /** + * If location != -1, the number of vector elements in this variable, or 1 + * if this variable is a scalar. + */ + unsigned vector_elements; + + /** + * If location != -1, the number of matrix columns in this variable, or 1 + * if this variable is not a matrix. + */ + unsigned matrix_columns; + + /** Type of the varying returned by glGetTransformFeedbackVarying() */ + GLenum type; + + /** + * If location != -1, the size that should be returned by + * glGetTransformFeedbackVarying(). + */ + unsigned size; + + /** + * How many components to skip. If non-zero, this is + * gl_SkipComponents{1,2,3,4} from ARB_transform_feedback3. + */ + unsigned skip_components; + + /** + * Whether this is gl_NextBuffer from ARB_transform_feedback3. + */ + bool next_buffer_separator; + + /** + * If find_candidate() has been called, pointer to the tfeedback_candidate + * data structure that was found. Otherwise NULL. + */ + const tfeedback_candidate *matched_candidate; +}; + + +void +cross_validate_outputs_to_inputs(struct gl_shader_program *prog, + gl_shader *producer, gl_shader *consumer); + +bool +parse_tfeedback_decls(struct gl_context *ctx, struct gl_shader_program *prog, + const void *mem_ctx, unsigned num_names, + char **varying_names, tfeedback_decl *decls); + +bool +store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, + unsigned num_tfeedback_decls, + tfeedback_decl *tfeedback_decls); + +bool +assign_varying_locations(struct gl_context *ctx, + void *mem_ctx, + struct gl_shader_program *prog, + gl_shader *producer, gl_shader *consumer, + unsigned num_tfeedback_decls, + tfeedback_decl *tfeedback_decls, + unsigned gs_input_vertices); + +bool +check_against_output_limit(struct gl_context *ctx, + struct gl_shader_program *prog, + gl_shader *producer); + +bool +check_against_input_limit(struct gl_context *ctx, + struct gl_shader_program *prog, + gl_shader *consumer); + +#endif /* GLSL_LINK_VARYINGS_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/linker.cpp b/3rdparty/glsl-optimizer/src/glsl/linker.cpp index 59e612b02..a60c0d3ea 100644 --- a/3rdparty/glsl-optimizer/src/glsl/linker.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/linker.cpp @@ -66,16 +66,23 @@ #include "main/core.h" #include "glsl_symbol_table.h" +#include "glsl_parser_extras.h" #include "ir.h" #include "program.h" #include "program/hash_table.h" #include "linker.h" +#include "link_varyings.h" #include "ir_optimization.h" +#include "ir_rvalue_visitor.h" extern "C" { #include "standalone_scaffolding.h" } +void linker_error(gl_shader_program *, const char *, ...); + +namespace { + /** * Visitor that determines whether or not a variable is ever written. */ @@ -101,20 +108,19 @@ public: virtual ir_visitor_status visit_enter(ir_call *ir) { - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *sig_param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *sig_param = (ir_variable *) formal_node; - if (sig_param->mode == ir_var_out || - sig_param->mode == ir_var_inout) { + if (sig_param->data.mode == ir_var_function_out || + sig_param->data.mode == ir_var_function_inout) { ir_variable *var = param_rval->variable_referenced(); if (var && strcmp(name, var->name) == 0) { found = true; return visit_stop; } } - sig_iter.next(); } if (ir->return_deref != NULL) { @@ -172,6 +178,105 @@ private: }; +class geom_array_resize_visitor : public ir_hierarchical_visitor { +public: + unsigned num_vertices; + gl_shader_program *prog; + + geom_array_resize_visitor(unsigned num_vertices, gl_shader_program *prog) + { + this->num_vertices = num_vertices; + this->prog = prog; + } + + virtual ~geom_array_resize_visitor() + { + /* empty */ + } + + virtual ir_visitor_status visit(ir_variable *var) + { + if (!var->type->is_array() || var->data.mode != ir_var_shader_in) + return visit_continue; + + unsigned size = var->type->length; + + /* Generate a link error if the shader has declared this array with an + * incorrect size. + */ + if (size && size != this->num_vertices) { + linker_error(this->prog, "size of array %s declared as %u, " + "but number of input vertices is %u\n", + var->name, size, this->num_vertices); + return visit_continue; + } + + /* Generate a link error if the shader attempts to access an input + * array using an index too large for its actual size assigned at link + * time. + */ + if (var->data.max_array_access >= this->num_vertices) { + linker_error(this->prog, "geometry shader accesses element %i of " + "%s, but only %i input vertices\n", + var->data.max_array_access, var->name, this->num_vertices); + return visit_continue; + } + + var->type = glsl_type::get_array_instance(var->type->element_type(), + this->num_vertices); + var->data.max_array_access = this->num_vertices - 1; + + return visit_continue; + } + + /* Dereferences of input variables need to be updated so that their type + * matches the newly assigned type of the variable they are accessing. */ + virtual ir_visitor_status visit(ir_dereference_variable *ir) + { + ir->type = ir->var->type; + return visit_continue; + } + + /* Dereferences of 2D input arrays need to be updated so that their type + * matches the newly assigned type of the array they are accessing. */ + virtual ir_visitor_status visit_leave(ir_dereference_array *ir) + { + const glsl_type *const vt = ir->array->type; + if (vt->is_array()) + ir->type = vt->element_type(); + return visit_continue; + } +}; + + +/** + * Visitor that determines whether or not a shader uses ir_end_primitive. + */ +class find_end_primitive_visitor : public ir_hierarchical_visitor { +public: + find_end_primitive_visitor() + : found(false) + { + /* empty */ + } + + virtual ir_visitor_status visit(ir_end_primitive *) + { + found = true; + return visit_stop; + } + + bool end_primitive_found() + { + return found; + } + +private: + bool found; +}; + +} /* anonymous namespace */ + void linker_error(gl_shader_program *prog, const char *fmt, ...) { @@ -199,56 +304,149 @@ linker_warning(gl_shader_program *prog, const char *fmt, ...) } -void -link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode, - int generic_base) +/** + * Given a string identifying a program resource, break it into a base name + * and an optional array index in square brackets. + * + * If an array index is present, \c out_base_name_end is set to point to the + * "[" that precedes the array index, and the array index itself is returned + * as a long. + * + * If no array index is present (or if the array index is negative or + * mal-formed), \c out_base_name_end, is set to point to the null terminator + * at the end of the input string, and -1 is returned. + * + * Only the final array index is parsed; if the string contains other array + * indices (or structure field accesses), they are left in the base name. + * + * No attempt is made to check that the base name is properly formed; + * typically the caller will look up the base name in a hash table, so + * ill-formed base names simply turn into hash table lookup failures. + */ +long +parse_program_resource_name(const GLchar *name, + const GLchar **out_base_name_end) { - foreach_list(node, sh->ir) { + /* Section 7.3.1 ("Program Interfaces") of the OpenGL 4.3 spec says: + * + * "When an integer array element or block instance number is part of + * the name string, it will be specified in decimal form without a "+" + * or "-" sign or any extra leading zeroes. Additionally, the name + * string will not include white space anywhere in the string." + */ + + const size_t len = strlen(name); + *out_base_name_end = name + len; + + if (len == 0 || name[len-1] != ']') + return -1; + + /* Walk backwards over the string looking for a non-digit character. This + * had better be the opening bracket for an array index. + * + * Initially, i specifies the location of the ']'. Since the string may + * contain only the ']' charcater, walk backwards very carefully. + */ + unsigned i; + for (i = len - 1; (i > 0) && isdigit(name[i-1]); --i) + /* empty */ ; + + if ((i == 0) || name[i-1] != '[') + return -1; + + long array_index = strtol(&name[i], NULL, 10); + if (array_index < 0) + return -1; + + *out_base_name_end = name + (i - 1); + return array_index; +} + + +void +link_invalidate_variable_locations(exec_list *ir) +{ + foreach_list(node, ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != (unsigned) mode)) - continue; + if (var == NULL) + continue; - /* Only assign locations for generic attributes / varyings / etc. + /* Only assign locations for variables that lack an explicit location. + * Explicit locations are set for all built-in variables, generic vertex + * shader inputs (via layout(location=...)), and generic fragment shader + * outputs (also via layout(location=...)). */ - if ((var->location >= generic_base) && !var->explicit_location) - var->location = -1; + if (!var->data.explicit_location) { + var->data.location = -1; + var->data.location_frac = 0; + } + + /* ir_variable::is_unmatched_generic_inout is used by the linker while + * connecting outputs from one stage to inputs of the next stage. + * + * There are two implicit assumptions here. First, we assume that any + * built-in variable (i.e., non-generic in or out) will have + * explicit_location set. Second, we assume that any generic in or out + * will not have explicit_location set. + * + * This second assumption will only be valid until + * GL_ARB_separate_shader_objects is supported. When that extension is + * implemented, this function will need some modifications. + */ + if (!var->data.explicit_location) { + var->data.is_unmatched_generic_inout = 1; + } else { + var->data.is_unmatched_generic_inout = 0; + } } } /** - * Determine the number of attribute slots required for a particular type + * Set UsesClipDistance and ClipDistanceArraySize based on the given shader. * - * This code is here because it implements the language rules of a specific - * GLSL version. Since it's a property of the language and not a property of - * types in general, it doesn't really belong in glsl_type. + * Also check for errors based on incorrect usage of gl_ClipVertex and + * gl_ClipDistance. + * + * Return false if an error was reported. */ -unsigned -count_attribute_slots(const glsl_type *t) +static void +analyze_clip_usage(struct gl_shader_program *prog, + struct gl_shader *shader, GLboolean *UsesClipDistance, + GLuint *ClipDistanceArraySize) { - /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: - * - * "A scalar input counts the same amount against this limit as a vec4, - * so applications may want to consider packing groups of four - * unrelated float inputs together into a vector to better utilize the - * capabilities of the underlying hardware. A matrix input will use up - * multiple locations. The number of locations used will equal the - * number of columns in the matrix." - * - * The spec does not explicitly say how arrays are counted. However, it - * should be safe to assume the total number of slots consumed by an array - * is the number of entries in the array multiplied by the number of slots - * consumed by a single element of the array. - */ + *ClipDistanceArraySize = 0; - if (t->is_array()) - return t->array_size() * count_attribute_slots(t->element_type()); + if (!prog->IsES && prog->Version >= 130) { + /* From section 7.1 (Vertex Shader Special Variables) of the + * GLSL 1.30 spec: + * + * "It is an error for a shader to statically write both + * gl_ClipVertex and gl_ClipDistance." + * + * This does not apply to GLSL ES shaders, since GLSL ES defines neither + * gl_ClipVertex nor gl_ClipDistance. + */ + find_assignment_visitor clip_vertex("gl_ClipVertex"); + find_assignment_visitor clip_distance("gl_ClipDistance"); - if (t->is_matrix()) - return t->matrix_columns; - - return 1; + clip_vertex.run(shader->ir); + clip_distance.run(shader->ir); + if (clip_vertex.variable_found() && clip_distance.variable_found()) { + linker_error(prog, "%s shader writes to both `gl_ClipVertex' " + "and `gl_ClipDistance'\n", + _mesa_shader_stage_to_string(shader->Stage)); + return; + } + *UsesClipDistance = clip_distance.variable_found(); + ir_variable *clip_distance_var = + shader->symbols->get_variable("gl_ClipDistance"); + if (clip_distance_var) + *ClipDistanceArraySize = clip_distance_var->type->length; + } else { + *UsesClipDistance = false; + } } @@ -260,12 +458,12 @@ count_attribute_slots(const glsl_type *t) * * \param shader Vertex shader executable to be verified */ -bool +void validate_vertex_shader_executable(struct gl_shader_program *prog, struct gl_shader *shader) { if (shader == NULL) - return true; + return; /* From the GLSL 1.10 spec, page 48: * @@ -289,43 +487,21 @@ validate_vertex_shader_executable(struct gl_shader_program *prog, * operations, if present, that operate on primitives after * vertex processing has occurred. Its value is undefined if * the vertex shader executable does not write gl_Position." + * + * GLSL ES 3.00 is similar to GLSL 1.40--failing to write to gl_Position is + * not an error. */ - if (prog->Version < 140) { + if (prog->Version < (prog->IsES ? 300U : 140U)) { find_assignment_visitor find("gl_Position"); find.run(shader->ir); if (!find.variable_found()) { linker_error(prog, "vertex shader does not write to `gl_Position'\n"); - return false; + return; } } - prog->Vert.ClipDistanceArraySize = 0; - - if (prog->Version >= 130) { - /* From section 7.1 (Vertex Shader Special Variables) of the - * GLSL 1.30 spec: - * - * "It is an error for a shader to statically write both - * gl_ClipVertex and gl_ClipDistance." - */ - find_assignment_visitor clip_vertex("gl_ClipVertex"); - find_assignment_visitor clip_distance("gl_ClipDistance"); - - clip_vertex.run(shader->ir); - clip_distance.run(shader->ir); - if (clip_vertex.variable_found() && clip_distance.variable_found()) { - linker_error(prog, "vertex shader writes to both `gl_ClipVertex' " - "and `gl_ClipDistance'\n"); - return false; - } - prog->Vert.UsesClipDistance = clip_distance.variable_found(); - ir_variable *clip_distance_var = - shader->symbols->get_variable("gl_ClipDistance"); - if (clip_distance_var) - prog->Vert.ClipDistanceArraySize = clip_distance_var->type->length; - } - - return true; + analyze_clip_usage(prog, shader, &prog->Vert.UsesClipDistance, + &prog->Vert.ClipDistanceArraySize); } @@ -334,12 +510,12 @@ validate_vertex_shader_executable(struct gl_shader_program *prog, * * \param shader Fragment shader executable to be verified */ -bool +void validate_fragment_shader_executable(struct gl_shader_program *prog, struct gl_shader *shader) { if (shader == NULL) - return true; + return; find_assignment_visitor frag_color("gl_FragColor"); find_assignment_visitor frag_data("gl_FragData"); @@ -350,41 +526,40 @@ validate_fragment_shader_executable(struct gl_shader_program *prog, if (frag_color.variable_found() && frag_data.variable_found()) { linker_error(prog, "fragment shader writes to both " "`gl_FragColor' and `gl_FragData'\n"); - return false; } - - return true; } - /** - * Generate a string describing the mode of a variable + * Verify that a geometry shader executable meets all semantic requirements + * + * Also sets prog->Geom.VerticesIn, prog->Geom.UsesClipDistance, and + * prog->Geom.ClipDistanceArraySize as a side effect. + * + * \param shader Geometry shader executable to be verified */ -static const char * -mode_string(const ir_variable *var) +void +validate_geometry_shader_executable(struct gl_shader_program *prog, + struct gl_shader *shader) { - switch (var->mode) { - case ir_var_auto: - return (var->read_only) ? "global constant" : "global variable"; + if (shader == NULL) + return; - case ir_var_uniform: return "uniform"; - case ir_var_in: return "shader input"; - case ir_var_out: return "shader output"; - case ir_var_inout: return "shader inout"; + unsigned num_vertices = vertices_per_prim(prog->Geom.InputType); + prog->Geom.VerticesIn = num_vertices; - case ir_var_const_in: - case ir_var_temporary: - default: - assert(!"Should not get here."); - return "invalid variable"; - } + analyze_clip_usage(prog, shader, &prog->Geom.UsesClipDistance, + &prog->Geom.ClipDistanceArraySize); + + find_end_primitive_visitor end_primitive; + end_primitive.run(shader->ir); + prog->Geom.UsesEndPrimitive = end_primitive.end_primitive_found(); } /** * Perform validation of global variables used across multiple shaders */ -bool +void cross_validate_globals(struct gl_shader_program *prog, struct gl_shader **shader_list, unsigned num_shaders, @@ -404,13 +579,13 @@ cross_validate_globals(struct gl_shader_program *prog, if (var == NULL) continue; - if (uniforms_only && (var->mode != ir_var_uniform)) + if (uniforms_only && (var->data.mode != ir_var_uniform)) continue; /* Don't cross validate temporaries that are at global scope. These * will eventually get pulled into the shaders 'main'. */ - if (var->mode == ir_var_temporary) + if (var->data.mode == ir_var_temporary) continue; /* If a global with this name has already been seen, verify that the @@ -433,29 +608,60 @@ cross_validate_globals(struct gl_shader_program *prog, if (var->type->length != 0) { existing->type = var->type; } + } else if (var->type->is_record() + && existing->type->is_record() + && existing->type->record_compare(var->type)) { + existing->type = var->type; } else { linker_error(prog, "%s `%s' declared as type " "`%s' and type `%s'\n", mode_string(var), var->name, var->type->name, existing->type->name); - return false; + return; } } - if (var->explicit_location) { - if (existing->explicit_location - && (var->location != existing->location)) { + if (var->data.explicit_location) { + if (existing->data.explicit_location + && (var->data.location != existing->data.location)) { linker_error(prog, "explicit locations for %s " "`%s' have differing values\n", mode_string(var), var->name); - return false; + return; } - existing->location = var->location; - existing->explicit_location = true; + existing->data.location = var->data.location; + existing->data.explicit_location = true; } + /* From the GLSL 4.20 specification: + * "A link error will result if two compilation units in a program + * specify different integer-constant bindings for the same + * opaque-uniform name. However, it is not an error to specify a + * binding on some but not all declarations for the same name" + */ + if (var->data.explicit_binding) { + if (existing->data.explicit_binding && + var->data.binding != existing->data.binding) { + linker_error(prog, "explicit bindings for %s " + "`%s' have differing values\n", + mode_string(var), var->name); + return; + } + + existing->data.binding = var->data.binding; + existing->data.explicit_binding = true; + } + + if (var->type->contains_atomic() && + var->data.atomic.offset != existing->data.atomic.offset) { + linker_error(prog, "offset specifications for %s " + "`%s' have differing values\n", + mode_string(var), var->name); + return; + } + /* Validate layout qualifiers for gl_FragDepth. * * From the AMD/ARB_conservative_depth specs: @@ -468,9 +674,9 @@ cross_validate_globals(struct gl_shader_program *prog, * of qualifiers." */ if (strcmp(var->name, "gl_FragDepth") == 0) { - bool layout_declared = var->depth_layout != ir_depth_layout_none; + bool layout_declared = var->data.depth_layout != ir_depth_layout_none; bool layout_differs = - var->depth_layout != existing->depth_layout; + var->data.depth_layout != existing->data.depth_layout; if (layout_declared && layout_differs) { linker_error(prog, @@ -479,7 +685,7 @@ cross_validate_globals(struct gl_shader_program *prog, "the same set of qualifiers."); } - if (var->used && layout_differs) { + if (var->data.used && layout_differs) { linker_error(prog, "If gl_FragDepth is redeclared with a layout " "qualifier in any fragment shader, it must be " @@ -510,7 +716,7 @@ cross_validate_globals(struct gl_shader_program *prog, linker_error(prog, "initializers for %s " "`%s' have differing values\n", mode_string(var), var->name); - return false; + return; } } else { /* If the first-seen instance of a particular uniform did not @@ -531,15 +737,15 @@ cross_validate_globals(struct gl_shader_program *prog, } } - if (var->has_initializer) { - if (existing->has_initializer + if (var->data.has_initializer) { + if (existing->data.has_initializer && (var->constant_initializer == NULL || existing->constant_initializer == NULL)) { linker_error(prog, "shared global variable `%s' has multiple " "non-constant initializers.\n", var->name); - return false; + return; } /* Some instance had an initializer, so keep track of that. In @@ -547,38 +753,42 @@ cross_validate_globals(struct gl_shader_program *prog, * otherwise) will propagate the existence to the variable * stored in the symbol table. */ - existing->has_initializer = true; + existing->data.has_initializer = true; } - if (existing->invariant != var->invariant) { + if (existing->data.invariant != var->data.invariant) { linker_error(prog, "declarations for %s `%s' have " "mismatching invariant qualifiers\n", mode_string(var), var->name); - return false; + return; } - if (existing->centroid != var->centroid) { + if (existing->data.centroid != var->data.centroid) { linker_error(prog, "declarations for %s `%s' have " "mismatching centroid qualifiers\n", mode_string(var), var->name); - return false; + return; + } + if (existing->data.sample != var->data.sample) { + linker_error(prog, "declarations for %s `%s` have " + "mismatching sample qualifiers\n", + mode_string(var), var->name); + return; } } else variables.add_variable(var); } } - - return true; } /** * Perform validation of uniforms used across multiple shader stages */ -bool +void cross_validate_uniforms(struct gl_shader_program *prog) { - return cross_validate_globals(prog, prog->_LinkedShaders, - MESA_SHADER_TYPES, true); + cross_validate_globals(prog, prog->_LinkedShaders, + MESA_SHADER_STAGES, true); } /** @@ -589,12 +799,12 @@ static bool interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog) { unsigned max_num_uniform_blocks = 0; - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i]) max_num_uniform_blocks += prog->_LinkedShaders[i]->NumUniformBlocks; } - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *sh = prog->_LinkedShaders[i]; prog->UniformBlockStageIndex[i] = ralloc_array(prog, int, @@ -624,126 +834,6 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog) return true; } -/** - * Validate that outputs from one stage match inputs of another - */ -bool -cross_validate_outputs_to_inputs(struct gl_shader_program *prog, - gl_shader *producer, gl_shader *consumer) -{ - glsl_symbol_table parameters; - /* FINISHME: Figure these out dynamically. */ - const char *const producer_stage = "vertex"; - const char *const consumer_stage = "fragment"; - - /* Find all shader outputs in the "producer" stage. - */ - foreach_list(node, producer->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); - - /* FINISHME: For geometry shaders, this should also look for inout - * FINISHME: variables. - */ - if ((var == NULL) || (var->mode != ir_var_out)) - continue; - - parameters.add_variable(var); - } - - - /* Find all shader inputs in the "consumer" stage. Any variables that have - * matching outputs already in the symbol table must have the same type and - * qualifiers. - */ - foreach_list(node, consumer->ir) { - ir_variable *const input = ((ir_instruction *) node)->as_variable(); - - /* FINISHME: For geometry shaders, this should also look for inout - * FINISHME: variables. - */ - if ((input == NULL) || (input->mode != ir_var_in)) - continue; - - ir_variable *const output = parameters.get_variable(input->name); - if (output != NULL) { - /* Check that the types match between stages. - */ - if (input->type != output->type) { - /* There is a bit of a special case for gl_TexCoord. This - * built-in is unsized by default. Applications that variable - * access it must redeclare it with a size. There is some - * language in the GLSL spec that implies the fragment shader - * and vertex shader do not have to agree on this size. Other - * driver behave this way, and one or two applications seem to - * rely on it. - * - * Neither declaration needs to be modified here because the array - * sizes are fixed later when update_array_sizes is called. - * - * From page 48 (page 54 of the PDF) of the GLSL 1.10 spec: - * - * "Unlike user-defined varying variables, the built-in - * varying variables don't have a strict one-to-one - * correspondence between the vertex language and the - * fragment language." - */ - if (!output->type->is_array() - || (strncmp("gl_", output->name, 3) != 0)) { - linker_error(prog, - "%s shader output `%s' declared as type `%s', " - "but %s shader input declared as type `%s'\n", - producer_stage, output->name, - output->type->name, - consumer_stage, input->type->name); - return false; - } - } - - /* Check that all of the qualifiers match between stages. - */ - if (input->centroid != output->centroid) { - linker_error(prog, - "%s shader output `%s' %s centroid qualifier, " - "but %s shader input %s centroid qualifier\n", - producer_stage, - output->name, - (output->centroid) ? "has" : "lacks", - consumer_stage, - (input->centroid) ? "has" : "lacks"); - return false; - } - - if (input->invariant != output->invariant) { - linker_error(prog, - "%s shader output `%s' %s invariant qualifier, " - "but %s shader input %s invariant qualifier\n", - producer_stage, - output->name, - (output->invariant) ? "has" : "lacks", - consumer_stage, - (input->invariant) ? "has" : "lacks"); - return false; - } - - if (input->interpolation != output->interpolation) { - linker_error(prog, - "%s shader output `%s' specifies %s " - "interpolation qualifier, " - "but %s shader input specifies %s " - "interpolation qualifier\n", - producer_stage, - output->name, - output->interpolation_string(), - consumer_stage, - input->interpolation_string()); - return false; - } - } - } - - return true; -} - /** * Populates a shaders symbol table with all global declarations @@ -803,7 +893,7 @@ remap_variables(ir_instruction *inst, struct gl_shader *target, virtual ir_visitor_status visit(ir_dereference_variable *ir) { - if (ir->var->mode == ir_var_temporary) { + if (ir->var->data.mode == ir_var_temporary) { ir_variable *var = (ir_variable *) hash_table_find(temps, ir->var); assert(var != NULL); @@ -878,14 +968,17 @@ move_non_declarations(exec_list *instructions, exec_node *last, if (inst->ir_type == ir_type_precision) continue; + if (inst->ir_type == ir_type_typedecl) + continue; ir_variable *var = inst->as_variable(); - if ((var != NULL) && (var->mode != ir_var_temporary)) + if ((var != NULL) && (var->data.mode != ir_var_temporary)) continue; assert(inst->as_assignment() || inst->as_call() - || ((var != NULL) && (var->mode == ir_var_temporary))); + || inst->as_if() /* for initializers with the ?: operator */ + || ((var != NULL) && (var->data.mode == ir_var_temporary))); if (make_copies) { inst = inst->clone(target, NULL); @@ -925,7 +1018,7 @@ get_main_function_signature(gl_shader *sh) * We don't have to check for multiple definitions of main (in multiple * shaders) because that would have already been caught above. */ - ir_function_signature *sig = f->matching_signature(&void_parameters); + ir_function_signature *sig = f->matching_signature(NULL, &void_parameters); if ((sig != NULL) && sig->is_defined) { return sig; } @@ -942,19 +1035,262 @@ get_main_function_signature(gl_shader *sh) */ class array_sizing_visitor : public ir_hierarchical_visitor { public: + array_sizing_visitor() + : mem_ctx(ralloc_context(NULL)), + unnamed_interfaces(hash_table_ctor(0, hash_table_pointer_hash, + hash_table_pointer_compare)) + { + } + + ~array_sizing_visitor() + { + hash_table_dtor(this->unnamed_interfaces); + ralloc_free(this->mem_ctx); + } + virtual ir_visitor_status visit(ir_variable *var) { - if (var->type->is_array() && (var->type->length == 0)) { - const glsl_type *type = - glsl_type::get_array_instance(var->type->fields.array, - var->max_array_access + 1); - assert(type != NULL); - var->type = type; + fixup_type(&var->type, var->data.max_array_access); + if (var->type->is_interface()) { + if (interface_contains_unsized_arrays(var->type)) { + const glsl_type *new_type = + resize_interface_members(var->type, var->max_ifc_array_access); + var->type = new_type; + var->change_interface_type(new_type); + } + } else if (var->type->is_array() && + var->type->fields.array->is_interface()) { + if (interface_contains_unsized_arrays(var->type->fields.array)) { + const glsl_type *new_type = + resize_interface_members(var->type->fields.array, + var->max_ifc_array_access); + var->change_interface_type(new_type); + var->type = + glsl_type::get_array_instance(new_type, var->type->length); + } + } else if (const glsl_type *ifc_type = var->get_interface_type()) { + /* Store a pointer to the variable in the unnamed_interfaces + * hashtable. + */ + ir_variable **interface_vars = (ir_variable **) + hash_table_find(this->unnamed_interfaces, ifc_type); + if (interface_vars == NULL) { + interface_vars = rzalloc_array(mem_ctx, ir_variable *, + ifc_type->length); + hash_table_insert(this->unnamed_interfaces, interface_vars, + ifc_type); + } + unsigned index = ifc_type->field_index(var->name); + assert(index < ifc_type->length); + assert(interface_vars[index] == NULL); + interface_vars[index] = var; } return visit_continue; } + + /** + * For each unnamed interface block that was discovered while running the + * visitor, adjust the interface type to reflect the newly assigned array + * sizes, and fix up the ir_variable nodes to point to the new interface + * type. + */ + void fixup_unnamed_interface_types() + { + hash_table_call_foreach(this->unnamed_interfaces, + fixup_unnamed_interface_type, NULL); + } + +private: + /** + * If the type pointed to by \c type represents an unsized array, replace + * it with a sized array whose size is determined by max_array_access. + */ + static void fixup_type(const glsl_type **type, unsigned max_array_access) + { + if ((*type)->is_unsized_array()) { + *type = glsl_type::get_array_instance((*type)->fields.array, + max_array_access + 1); + assert(*type != NULL); + } + } + + /** + * Determine whether the given interface type contains unsized arrays (if + * it doesn't, array_sizing_visitor doesn't need to process it). + */ + static bool interface_contains_unsized_arrays(const glsl_type *type) + { + for (unsigned i = 0; i < type->length; i++) { + const glsl_type *elem_type = type->fields.structure[i].type; + if (elem_type->is_unsized_array()) + return true; + } + return false; + } + + /** + * Create a new interface type based on the given type, with unsized arrays + * replaced by sized arrays whose size is determined by + * max_ifc_array_access. + */ + static const glsl_type * + resize_interface_members(const glsl_type *type, + const unsigned *max_ifc_array_access) + { + unsigned num_fields = type->length; + glsl_struct_field *fields = new glsl_struct_field[num_fields]; + memcpy(fields, type->fields.structure, + num_fields * sizeof(*fields)); + for (unsigned i = 0; i < num_fields; i++) { + fixup_type(&fields[i].type, max_ifc_array_access[i]); + } + glsl_interface_packing packing = + (glsl_interface_packing) type->interface_packing; + const glsl_type *new_ifc_type = + glsl_type::get_interface_instance(fields, num_fields, + packing, type->name); + delete [] fields; + return new_ifc_type; + } + + static void fixup_unnamed_interface_type(const void *key, void *data, + void *) + { + const glsl_type *ifc_type = (const glsl_type *) key; + ir_variable **interface_vars = (ir_variable **) data; + unsigned num_fields = ifc_type->length; + glsl_struct_field *fields = new glsl_struct_field[num_fields]; + memcpy(fields, ifc_type->fields.structure, + num_fields * sizeof(*fields)); + bool interface_type_changed = false; + for (unsigned i = 0; i < num_fields; i++) { + if (interface_vars[i] != NULL && + fields[i].type != interface_vars[i]->type) { + fields[i].type = interface_vars[i]->type; + interface_type_changed = true; + } + } + if (!interface_type_changed) { + delete [] fields; + return; + } + glsl_interface_packing packing = + (glsl_interface_packing) ifc_type->interface_packing; + const glsl_type *new_ifc_type = + glsl_type::get_interface_instance(fields, num_fields, packing, + ifc_type->name); + delete [] fields; + for (unsigned i = 0; i < num_fields; i++) { + if (interface_vars[i] != NULL) + interface_vars[i]->change_interface_type(new_ifc_type); + } + } + + /** + * Memory context used to allocate the data in \c unnamed_interfaces. + */ + void *mem_ctx; + + /** + * Hash table from const glsl_type * to an array of ir_variable *'s + * pointing to the ir_variables constituting each unnamed interface block. + */ + hash_table *unnamed_interfaces; }; +/** + * Performs the cross-validation of geometry shader max_vertices and + * primitive type layout qualifiers for the attached geometry shaders, + * and propagates them to the linked GS and linked shader program. + */ +static void +link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, + struct gl_shader *linked_shader, + struct gl_shader **shader_list, + unsigned num_shaders) +{ + linked_shader->Geom.VerticesOut = 0; + linked_shader->Geom.InputType = PRIM_UNKNOWN; + linked_shader->Geom.OutputType = PRIM_UNKNOWN; + + /* No in/out qualifiers defined for anything but GLSL 1.50+ + * geometry shaders so far. + */ + if (linked_shader->Stage != MESA_SHADER_GEOMETRY || prog->Version < 150) + return; + + /* From the GLSL 1.50 spec, page 46: + * + * "All geometry shader output layout declarations in a program + * must declare the same layout and same value for + * max_vertices. There must be at least one geometry output + * layout declaration somewhere in a program, but not all + * geometry shaders (compilation units) are required to + * declare it." + */ + + for (unsigned i = 0; i < num_shaders; i++) { + struct gl_shader *shader = shader_list[i]; + + if (shader->Geom.InputType != PRIM_UNKNOWN) { + if (linked_shader->Geom.InputType != PRIM_UNKNOWN && + linked_shader->Geom.InputType != shader->Geom.InputType) { + linker_error(prog, "geometry shader defined with conflicting " + "input types\n"); + return; + } + linked_shader->Geom.InputType = shader->Geom.InputType; + } + + if (shader->Geom.OutputType != PRIM_UNKNOWN) { + if (linked_shader->Geom.OutputType != PRIM_UNKNOWN && + linked_shader->Geom.OutputType != shader->Geom.OutputType) { + linker_error(prog, "geometry shader defined with conflicting " + "output types\n"); + return; + } + linked_shader->Geom.OutputType = shader->Geom.OutputType; + } + + if (shader->Geom.VerticesOut != 0) { + if (linked_shader->Geom.VerticesOut != 0 && + linked_shader->Geom.VerticesOut != shader->Geom.VerticesOut) { + linker_error(prog, "geometry shader defined with conflicting " + "output vertex count (%d and %d)\n", + linked_shader->Geom.VerticesOut, + shader->Geom.VerticesOut); + return; + } + linked_shader->Geom.VerticesOut = shader->Geom.VerticesOut; + } + } + + /* Just do the intrastage -> interstage propagation right now, + * since we already know we're in the right type of shader program + * for doing it. + */ + if (linked_shader->Geom.InputType == PRIM_UNKNOWN) { + linker_error(prog, + "geometry shader didn't declare primitive input type\n"); + return; + } + prog->Geom.InputType = linked_shader->Geom.InputType; + + if (linked_shader->Geom.OutputType == PRIM_UNKNOWN) { + linker_error(prog, + "geometry shader didn't declare primitive output type\n"); + return; + } + prog->Geom.OutputType = linked_shader->Geom.OutputType; + + if (linked_shader->Geom.VerticesOut == 0) { + linker_error(prog, + "geometry shader didn't declare max_vertices\n"); + return; + } + prog->Geom.VerticesOut = linked_shader->Geom.VerticesOut; +} + /** * Combine a group of shaders for a single stage to generate a linked shader * @@ -970,31 +1306,24 @@ link_intrastage_shaders(void *mem_ctx, unsigned num_shaders) { struct gl_uniform_block *uniform_blocks = NULL; - unsigned num_uniform_blocks = 0; /* Check that global variables defined in multiple shaders are consistent. */ - if (!cross_validate_globals(prog, shader_list, num_shaders, false)) + cross_validate_globals(prog, shader_list, num_shaders, false); + if (!prog->LinkStatus) return NULL; - /* Check that uniform blocks between shaders for a stage agree. */ - for (unsigned i = 0; i < num_shaders; i++) { - struct gl_shader *sh = shader_list[i]; + /* Check that interface blocks defined in multiple shaders are consistent. + */ + validate_intrastage_interface_blocks(prog, (const gl_shader **)shader_list, + num_shaders); + if (!prog->LinkStatus) + return NULL; - for (unsigned j = 0; j < shader_list[i]->NumUniformBlocks; j++) { - link_assign_uniform_block_offsets(shader_list[i]); - - int index = link_cross_validate_uniform_block(mem_ctx, - &uniform_blocks, - &num_uniform_blocks, - &sh->UniformBlocks[j]); - if (index == -1) { - linker_error(prog, "uniform block `%s' has mismatching definitions", - sh->UniformBlocks[j].Name); - return NULL; - } - } - } + /* Link up uniform blocks defined within this stage. */ + const unsigned num_uniform_blocks = + link_uniform_blocks(mem_ctx, prog, shader_list, num_shaders, + &uniform_blocks); /* Check that there is only a single definition of each function signature * across all shaders. @@ -1016,18 +1345,17 @@ link_intrastage_shaders(void *mem_ctx, if (other == NULL) continue; - foreach_iter (exec_list_iterator, iter, *f) { - ir_function_signature *sig = - (ir_function_signature *) iter.get(); + foreach_list(n, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) n; - if (!sig->is_defined || sig->is_builtin) + if (!sig->is_defined || sig->is_builtin()) continue; ir_function_signature *other_sig = - other->exact_matching_signature(& sig->parameters); + other->exact_matching_signature(NULL, &sig->parameters); if ((other_sig != NULL) && other_sig->is_defined - && !other_sig->is_builtin) { + && !other_sig->is_builtin()) { linker_error(prog, "function `%s' is multiply defined", f->name); return NULL; @@ -1054,8 +1382,7 @@ link_intrastage_shaders(void *mem_ctx, if (main == NULL) { linker_error(prog, "%s shader lacks `main'\n", - (shader_list[0]->Type == GL_VERTEX_SHADER) - ? "vertex" : "fragment"); + _mesa_shader_stage_to_string(shader_list[0]->Stage)); return NULL; } @@ -1067,6 +1394,8 @@ link_intrastage_shaders(void *mem_ctx, linked->NumUniformBlocks = num_uniform_blocks; ralloc_steal(linked, linked->UniformBlocks); + link_gs_inout_layout_qualifiers(prog, linked, shader_list, num_shaders); + populate_symbol_table(linked); /* The a pointer to the main function in the final linked shader (i.e., the @@ -1089,52 +1418,60 @@ link_intrastage_shaders(void *mem_ctx, insertion_point, true, linked); } - /* Resolve initializers for global variables in the linked shader. - */ - unsigned num_linking_shaders = num_shaders; - for (unsigned i = 0; i < num_shaders; i++) - num_linking_shaders += shader_list[i]->num_builtins_to_link; - - gl_shader **linking_shaders = - (gl_shader **) calloc(num_linking_shaders, sizeof(gl_shader *)); - - memcpy(linking_shaders, shader_list, - sizeof(linking_shaders[0]) * num_shaders); - - unsigned idx = num_shaders; + /* Check if any shader needs built-in functions. */ + bool need_builtins = false; for (unsigned i = 0; i < num_shaders; i++) { - memcpy(&linking_shaders[idx], shader_list[i]->builtins_to_link, - sizeof(linking_shaders[0]) * shader_list[i]->num_builtins_to_link); - idx += shader_list[i]->num_builtins_to_link; + if (shader_list[i]->uses_builtin_functions) { + need_builtins = true; + break; + } } - assert(idx == num_linking_shaders); + bool ok; + if (need_builtins) { + /* Make a temporary array one larger than shader_list, which will hold + * the built-in function shader as well. + */ + gl_shader **linking_shaders = (gl_shader **) + calloc(num_shaders + 1, sizeof(gl_shader *)); + memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *)); + linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader(); - if (!link_function_calls(prog, linked, linking_shaders, - num_linking_shaders)) { + ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1); + + free(linking_shaders); + } else { + ok = link_function_calls(prog, linked, shader_list, num_shaders); + } + + + if (!ok) { ctx->Driver.DeleteShader(ctx, linked); - linked = NULL; + return NULL; } - free(linking_shaders); - -#ifdef DEBUG /* At this point linked should contain all of the linked IR, so * validate it to make sure nothing went wrong. */ - if (linked) - validate_ir_tree(linked->ir); -#endif + validate_ir_tree(linked->ir); + + /* Set the size of geometry shader input arrays */ + if (linked->Stage == MESA_SHADER_GEOMETRY) { + unsigned num_vertices = vertices_per_prim(prog->Geom.InputType); + geom_array_resize_visitor input_resize_visitor(num_vertices, prog); + foreach_list(n, linked->ir) { + ir_instruction *ir = (ir_instruction *) n; + ir->accept(&input_resize_visitor); + } + } /* Make a pass over all variable declarations to ensure that arrays with * unspecified sizes have a size specified. The size is inferred from the * max_array_access field. */ - if (linked != NULL) { - array_sizing_visitor v; - - v.run(linked->ir); - } + array_sizing_visitor v; + v.run(linked->ir); + v.fixup_unnamed_interface_types(); return linked; } @@ -1157,28 +1494,30 @@ link_intrastage_shaders(void *mem_ctx, static void update_array_sizes(struct gl_shader_program *prog) { - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; foreach_list(node, prog->_LinkedShaders[i]->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_uniform && - var->mode != ir_var_in && - var->mode != ir_var_out) || + if ((var == NULL) || (var->data.mode != ir_var_uniform) || !var->type->is_array()) continue; /* GL_ARB_uniform_buffer_object says that std140 uniforms * will not be eliminated. Since we always do std140, just * don't resize arrays in UBOs. + * + * Atomic counters are supposed to get deterministic + * locations assigned based on the declaration ordering and + * sizes, array compaction would mess that up. */ - if (var->uniform_block != -1) + if (var->is_in_uniform_block() || var->type->contains_atomic()) continue; - unsigned int size = var->max_array_access; - for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) { + unsigned int size = var->data.max_array_access; + for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) { if (prog->_LinkedShaders[j] == NULL) continue; @@ -1188,13 +1527,13 @@ update_array_sizes(struct gl_shader_program *prog) continue; if (strcmp(var->name, other_var->name) == 0 && - other_var->max_array_access > size) { - size = other_var->max_array_access; + other_var->data.max_array_access > size) { + size = other_var->data.max_array_access; } } } - if (size + 1 != var->type->fields.array->length) { + if (size + 1 != var->type->length) { /* If this is a built-in uniform (i.e., it's backed by some * fixed-function state), adjust the number of state slots to * match the new array size. The number of slots per array entry @@ -1302,11 +1641,10 @@ assign_attribute_or_color_locations(gl_shader_program *prog, ? (int) VERT_ATTRIB_GENERIC0 : (int) FRAG_RESULT_DATA0; const enum ir_variable_mode direction = - (target_index == MESA_SHADER_VERTEX) ? ir_var_in : ir_var_out; + (target_index == MESA_SHADER_VERTEX) + ? ir_var_shader_in : ir_var_shader_out; - link_invalidate_variable_locations(sh, direction, generic_base); - /* Temporary storage for the set of attributes that need locations assigned. */ struct temp_attr { @@ -1329,16 +1667,17 @@ assign_attribute_or_color_locations(gl_shader_program *prog, foreach_list(node, sh->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != (unsigned) direction)) + if ((var == NULL) || (var->data.mode != (unsigned) direction)) continue; - if (var->explicit_location) { - if ((var->location >= (int)(max_index + generic_base)) - || (var->location < 0)) { + if (var->data.explicit_location) { + if ((var->data.location >= (int)(max_index + generic_base)) + || (var->data.location < 0)) { linker_error(prog, "invalid explicit location %d specified for `%s'\n", - (var->location < 0) - ? var->location : var->location - generic_base, + (var->data.location < 0) + ? var->data.location + : var->data.location - generic_base, var->name); return false; } @@ -1347,7 +1686,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, if (prog->AttributeBindings->get(binding, var->name)) { assert(binding >= VERT_ATTRIB_GENERIC0); - var->location = binding; + var->data.location = binding; + var->data.is_unmatched_generic_inout = 0; } } else if (target_index == MESA_SHADER_FRAGMENT) { unsigned binding; @@ -1355,10 +1695,11 @@ assign_attribute_or_color_locations(gl_shader_program *prog, if (prog->FragDataBindings->get(binding, var->name)) { assert(binding >= FRAG_RESULT_DATA0); - var->location = binding; + var->data.location = binding; + var->data.is_unmatched_generic_inout = 0; if (prog->FragDataIndexBindings->get(index, var->name)) { - var->index = index; + var->data.index = index; } } } @@ -1368,9 +1709,9 @@ assign_attribute_or_color_locations(gl_shader_program *prog, * that it doesn't collide with other assigned locations. Otherwise, * add it to the list of variables that need linker-assigned locations. */ - const unsigned slots = count_attribute_slots(var->type); - if (var->location != -1) { - if (var->location >= generic_base && var->index < 1) { + const unsigned slots = var->type->count_attribute_slots(); + if (var->data.location != -1) { + if (var->data.location >= generic_base && var->data.index < 1) { /* From page 61 of the OpenGL 4.0 spec: * * "LinkProgram will fail if the attribute bindings assigned @@ -1404,7 +1745,7 @@ assign_attribute_or_color_locations(gl_shader_program *prog, /* Mask representing the contiguous slots that will be used by * this attribute. */ - const unsigned attr = var->location - generic_base; + const unsigned attr = var->data.location - generic_base; const unsigned use_mask = (1 << slots) - 1; /* Generate a link error if the set of bits requested for this @@ -1470,7 +1811,8 @@ assign_attribute_or_color_locations(gl_shader_program *prog, return false; } - to_assign[i].var->location = generic_base + location; + to_assign[i].var->data.location = generic_base + location; + to_assign[i].var->data.is_unmatched_generic_inout = 0; used_locations |= (use_mask << location); } @@ -1487,773 +1829,20 @@ demote_shader_inputs_and_outputs(gl_shader *sh, enum ir_variable_mode mode) foreach_list(node, sh->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != int(mode))) + if ((var == NULL) || (var->data.mode != int(mode))) continue; /* A shader 'in' or 'out' variable is only really an input or output if * its value is used by other shader stages. This will cause the variable * to have a location assigned. */ - if (var->location == -1) { - var->mode = ir_var_auto; + if (var->data.is_unmatched_generic_inout) { + var->data.mode = ir_var_auto; } } } -/** - * Data structure tracking information about a transform feedback declaration - * during linking. - */ -class tfeedback_decl -{ -public: - bool init(struct gl_context *ctx, struct gl_shader_program *prog, - const void *mem_ctx, const char *input); - static bool is_same(const tfeedback_decl &x, const tfeedback_decl &y); - bool assign_location(struct gl_context *ctx, struct gl_shader_program *prog, - ir_variable *output_var); - bool accumulate_num_outputs(struct gl_shader_program *prog, unsigned *count); - bool store(struct gl_context *ctx, struct gl_shader_program *prog, - struct gl_transform_feedback_info *info, unsigned buffer, - const unsigned max_outputs) const; - - /** - * True if assign_location() has been called for this object. - */ - bool is_assigned() const - { - return this->location != -1; - } - - bool is_next_buffer_separator() const - { - return this->next_buffer_separator; - } - - bool is_varying() const - { - return !this->next_buffer_separator && !this->skip_components; - } - - /** - * Determine whether this object refers to the variable var. - */ - bool matches_var(ir_variable *var) const - { - if (this->is_clip_distance_mesa) - return strcmp(var->name, "gl_ClipDistanceMESA") == 0; - else - return strcmp(var->name, this->var_name) == 0; - } - - /** - * The total number of varying components taken up by this variable. Only - * valid if is_assigned() is true. - */ - unsigned num_components() const - { - if (this->is_clip_distance_mesa) - return this->size; - else - return this->vector_elements * this->matrix_columns * this->size; - } - -private: - /** - * The name that was supplied to glTransformFeedbackVaryings. Used for - * error reporting and glGetTransformFeedbackVarying(). - */ - const char *orig_name; - - /** - * The name of the variable, parsed from orig_name. - */ - const char *var_name; - - /** - * True if the declaration in orig_name represents an array. - */ - bool is_subscripted; - - /** - * If is_subscripted is true, the subscript that was specified in orig_name. - */ - unsigned array_subscript; - - /** - * True if the variable is gl_ClipDistance and the driver lowers - * gl_ClipDistance to gl_ClipDistanceMESA. - */ - bool is_clip_distance_mesa; - - /** - * The vertex shader output location that the linker assigned for this - * variable. -1 if a location hasn't been assigned yet. - */ - int location; - - /** - * If location != -1, the number of vector elements in this variable, or 1 - * if this variable is a scalar. - */ - unsigned vector_elements; - - /** - * If location != -1, the number of matrix columns in this variable, or 1 - * if this variable is not a matrix. - */ - unsigned matrix_columns; - - /** Type of the varying returned by glGetTransformFeedbackVarying() */ - GLenum type; - - /** - * If location != -1, the size that should be returned by - * glGetTransformFeedbackVarying(). - */ - unsigned size; - - /** - * How many components to skip. If non-zero, this is - * gl_SkipComponents{1,2,3,4} from ARB_transform_feedback3. - */ - unsigned skip_components; - - /** - * Whether this is gl_NextBuffer from ARB_transform_feedback3. - */ - bool next_buffer_separator; -}; - - -/** - * Initialize this object based on a string that was passed to - * glTransformFeedbackVaryings. If there is a parse error, the error is - * reported using linker_error(), and false is returned. - */ -bool -tfeedback_decl::init(struct gl_context *ctx, struct gl_shader_program *prog, - const void *mem_ctx, const char *input) -{ - /* We don't have to be pedantic about what is a valid GLSL variable name, - * because any variable with an invalid name can't exist in the IR anyway. - */ - - this->location = -1; - this->orig_name = input; - this->is_clip_distance_mesa = false; - this->skip_components = 0; - this->next_buffer_separator = false; - - if (ctx->Extensions.ARB_transform_feedback3) { - /* Parse gl_NextBuffer. */ - if (strcmp(input, "gl_NextBuffer") == 0) { - this->next_buffer_separator = true; - return true; - } - - /* Parse gl_SkipComponents. */ - if (strcmp(input, "gl_SkipComponents1") == 0) - this->skip_components = 1; - else if (strcmp(input, "gl_SkipComponents2") == 0) - this->skip_components = 2; - else if (strcmp(input, "gl_SkipComponents3") == 0) - this->skip_components = 3; - else if (strcmp(input, "gl_SkipComponents4") == 0) - this->skip_components = 4; - - if (this->skip_components) - return true; - } - - /* Parse a declaration. */ - const char *bracket = strrchr(input, '['); - - if (bracket) { - this->var_name = ralloc_strndup(mem_ctx, input, bracket - input); - if (sscanf(bracket, "[%u]", &this->array_subscript) != 1) { - linker_error(prog, "Cannot parse transform feedback varying %s", input); - return false; - } - this->is_subscripted = true; - } else { - this->var_name = ralloc_strdup(mem_ctx, input); - this->is_subscripted = false; - } - - /* For drivers that lower gl_ClipDistance to gl_ClipDistanceMESA, this - * class must behave specially to account for the fact that gl_ClipDistance - * is converted from a float[8] to a vec4[2]. - */ - if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance && - strcmp(this->var_name, "gl_ClipDistance") == 0) { - this->is_clip_distance_mesa = true; - } - - return true; -} - - -/** - * Determine whether two tfeedback_decl objects refer to the same variable and - * array index (if applicable). - */ -bool -tfeedback_decl::is_same(const tfeedback_decl &x, const tfeedback_decl &y) -{ - assert(x.is_varying() && y.is_varying()); - - if (strcmp(x.var_name, y.var_name) != 0) - return false; - if (x.is_subscripted != y.is_subscripted) - return false; - if (x.is_subscripted && x.array_subscript != y.array_subscript) - return false; - return true; -} - - -/** - * Assign a location for this tfeedback_decl object based on the location - * assignment in output_var. - * - * If an error occurs, the error is reported through linker_error() and false - * is returned. - */ -bool -tfeedback_decl::assign_location(struct gl_context *ctx, - struct gl_shader_program *prog, - ir_variable *output_var) -{ - assert(this->is_varying()); - - if (output_var->type->is_array()) { - /* Array variable */ - const unsigned matrix_cols = - output_var->type->fields.array->matrix_columns; - unsigned actual_array_size = this->is_clip_distance_mesa ? - prog->Vert.ClipDistanceArraySize : output_var->type->array_size(); - - if (this->is_subscripted) { - /* Check array bounds. */ - if (this->array_subscript >= actual_array_size) { - linker_error(prog, "Transform feedback varying %s has index " - "%i, but the array size is %u.", - this->orig_name, this->array_subscript, - actual_array_size); - return false; - } - if (this->is_clip_distance_mesa) { - this->location = - output_var->location + this->array_subscript / 4; - } else { - this->location = - output_var->location + this->array_subscript * matrix_cols; - } - this->size = 1; - } else { - this->location = output_var->location; - this->size = actual_array_size; - } - this->vector_elements = output_var->type->fields.array->vector_elements; - this->matrix_columns = matrix_cols; - if (this->is_clip_distance_mesa) - this->type = GL_FLOAT; - else - this->type = output_var->type->fields.array->gl_type; - } else { - /* Regular variable (scalar, vector, or matrix) */ - if (this->is_subscripted) { - linker_error(prog, "Transform feedback varying %s requested, " - "but %s is not an array.", - this->orig_name, this->var_name); - return false; - } - this->location = output_var->location; - this->size = 1; - this->vector_elements = output_var->type->vector_elements; - this->matrix_columns = output_var->type->matrix_columns; - this->type = output_var->type->gl_type; - } - - /* From GL_EXT_transform_feedback: - * A program will fail to link if: - * - * * the total number of components to capture in any varying - * variable in is greater than the constant - * MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT and the - * buffer mode is SEPARATE_ATTRIBS_EXT; - */ - if (prog->TransformFeedback.BufferMode == GL_SEPARATE_ATTRIBS && - this->num_components() > - ctx->Const.MaxTransformFeedbackSeparateComponents) { - linker_error(prog, "Transform feedback varying %s exceeds " - "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS.", - this->orig_name); - return false; - } - - return true; -} - - -bool -tfeedback_decl::accumulate_num_outputs(struct gl_shader_program *prog, - unsigned *count) -{ - if (!this->is_varying()) { - return true; - } - - if (!this->is_assigned()) { - /* From GL_EXT_transform_feedback: - * A program will fail to link if: - * - * * any variable name specified in the array is not - * declared as an output in the geometry shader (if present) or - * the vertex shader (if no geometry shader is present); - */ - linker_error(prog, "Transform feedback varying %s undeclared.", - this->orig_name); - return false; - } - - unsigned translated_size = this->size; - if (this->is_clip_distance_mesa) - translated_size = (translated_size + 3) / 4; - - *count += translated_size * this->matrix_columns; - - return true; -} - - -/** - * Update gl_transform_feedback_info to reflect this tfeedback_decl. - * - * If an error occurs, the error is reported through linker_error() and false - * is returned. - */ -bool -tfeedback_decl::store(struct gl_context *ctx, struct gl_shader_program *prog, - struct gl_transform_feedback_info *info, - unsigned buffer, const unsigned max_outputs) const -{ - assert(!this->next_buffer_separator); - - /* Handle gl_SkipComponents. */ - if (this->skip_components) { - info->BufferStride[buffer] += this->skip_components; - return true; - } - - /* From GL_EXT_transform_feedback: - * A program will fail to link if: - * - * * the total number of components to capture is greater than - * the constant MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT - * and the buffer mode is INTERLEAVED_ATTRIBS_EXT. - */ - if (prog->TransformFeedback.BufferMode == GL_INTERLEAVED_ATTRIBS && - info->BufferStride[buffer] + this->num_components() > - ctx->Const.MaxTransformFeedbackInterleavedComponents) { - linker_error(prog, "The MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS " - "limit has been exceeded."); - return false; - } - - unsigned translated_size = this->size; - if (this->is_clip_distance_mesa) - translated_size = (translated_size + 3) / 4; - unsigned components_so_far = 0; - for (unsigned index = 0; index < translated_size; ++index) { - for (unsigned v = 0; v < this->matrix_columns; ++v) { - unsigned num_components = this->vector_elements; - assert(info->NumOutputs < max_outputs); - info->Outputs[info->NumOutputs].ComponentOffset = 0; - if (this->is_clip_distance_mesa) { - if (this->is_subscripted) { - num_components = 1; - info->Outputs[info->NumOutputs].ComponentOffset = - this->array_subscript % 4; - } else { - num_components = MIN2(4, this->size - components_so_far); - } - } - info->Outputs[info->NumOutputs].OutputRegister = - this->location + v + index * this->matrix_columns; - info->Outputs[info->NumOutputs].NumComponents = num_components; - info->Outputs[info->NumOutputs].OutputBuffer = buffer; - info->Outputs[info->NumOutputs].DstOffset = info->BufferStride[buffer]; - ++info->NumOutputs; - info->BufferStride[buffer] += num_components; - components_so_far += num_components; - } - } - assert(components_so_far == this->num_components()); - - info->Varyings[info->NumVarying].Name = ralloc_strdup(prog, this->orig_name); - info->Varyings[info->NumVarying].Type = this->type; - info->Varyings[info->NumVarying].Size = this->size; - info->NumVarying++; - - return true; -} - - -/** - * Parse all the transform feedback declarations that were passed to - * glTransformFeedbackVaryings() and store them in tfeedback_decl objects. - * - * If an error occurs, the error is reported through linker_error() and false - * is returned. - */ -static bool -parse_tfeedback_decls(struct gl_context *ctx, struct gl_shader_program *prog, - const void *mem_ctx, unsigned num_names, - char **varying_names, tfeedback_decl *decls) -{ - for (unsigned i = 0; i < num_names; ++i) { - if (!decls[i].init(ctx, prog, mem_ctx, varying_names[i])) - return false; - - if (!decls[i].is_varying()) - continue; - - /* From GL_EXT_transform_feedback: - * A program will fail to link if: - * - * * any two entries in the array specify the same varying - * variable; - * - * We interpret this to mean "any two entries in the array - * specify the same varying variable and array index", since transform - * feedback of arrays would be useless otherwise. - */ - for (unsigned j = 0; j < i; ++j) { - if (!decls[j].is_varying()) - continue; - - if (tfeedback_decl::is_same(decls[i], decls[j])) { - linker_error(prog, "Transform feedback varying %s specified " - "more than once.", varying_names[i]); - return false; - } - } - } - return true; -} - - -/** - * Assign a location for a variable that is produced in one pipeline stage - * (the "producer") and consumed in the next stage (the "consumer"). - * - * \param input_var is the input variable declaration in the consumer. - * - * \param output_var is the output variable declaration in the producer. - * - * \param input_index is the counter that keeps track of assigned input - * locations in the consumer. - * - * \param output_index is the counter that keeps track of assigned output - * locations in the producer. - * - * It is permissible for \c input_var to be NULL (this happens if a variable - * is output by the producer and consumed by transform feedback, but not - * consumed by the consumer). - * - * If the variable has already been assigned a location, this function has no - * effect. - */ -void -assign_varying_location(ir_variable *input_var, ir_variable *output_var, - unsigned *input_index, unsigned *output_index) -{ - if (output_var->location != -1) { - /* Location already assigned. */ - return; - } - - if (input_var) { - assert(input_var->location == -1); - input_var->location = *input_index; - } - - output_var->location = *output_index; - - /* FINISHME: Support for "varying" records in GLSL 1.50. */ - assert(!output_var->type->is_record()); - - if (output_var->type->is_array()) { - const unsigned slots = output_var->type->length - * output_var->type->fields.array->matrix_columns; - - *output_index += slots; - *input_index += slots; - } else { - const unsigned slots = output_var->type->matrix_columns; - - *output_index += slots; - *input_index += slots; - } -} - - -/** - * Is the given variable a varying variable to be counted against the - * limit in ctx->Const.MaxVarying? - * This includes variables such as texcoords, colors and generic - * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord. - */ -static bool -is_varying_var(GLenum shaderType, const ir_variable *var) -{ - /* Only fragment shaders will take a varying variable as an input */ - if (shaderType == GL_FRAGMENT_SHADER && - var->mode == ir_var_in && - var->explicit_location) { - switch (var->location) { - case FRAG_ATTRIB_WPOS: - case FRAG_ATTRIB_FACE: - case FRAG_ATTRIB_PNTC: - return false; - default: - return true; - } - } - return false; -} - - -/** - * Assign locations for all variables that are produced in one pipeline stage - * (the "producer") and consumed in the next stage (the "consumer"). - * - * Variables produced by the producer may also be consumed by transform - * feedback. - * - * \param num_tfeedback_decls is the number of declarations indicating - * variables that may be consumed by transform feedback. - * - * \param tfeedback_decls is a pointer to an array of tfeedback_decl objects - * representing the result of parsing the strings passed to - * glTransformFeedbackVaryings(). assign_location() will be called for - * each of these objects that matches one of the outputs of the - * producer. - * - * When num_tfeedback_decls is nonzero, it is permissible for the consumer to - * be NULL. In this case, varying locations are assigned solely based on the - * requirements of transform feedback. - */ -bool -assign_varying_locations(struct gl_context *ctx, - struct gl_shader_program *prog, - gl_shader *producer, gl_shader *consumer, - unsigned num_tfeedback_decls, - tfeedback_decl *tfeedback_decls) -{ - /* FINISHME: Set dynamically when geometry shader support is added. */ - unsigned output_index = VERT_RESULT_VAR0; - unsigned input_index = FRAG_ATTRIB_VAR0; - - /* Operate in a total of three passes. - * - * 1. Assign locations for any matching inputs and outputs. - * - * 2. Mark output variables in the producer that do not have locations as - * not being outputs. This lets the optimizer eliminate them. - * - * 3. Mark input variables in the consumer that do not have locations as - * not being inputs. This lets the optimizer eliminate them. - */ - - link_invalidate_variable_locations(producer, ir_var_out, VERT_RESULT_VAR0); - if (consumer) - link_invalidate_variable_locations(consumer, ir_var_in, FRAG_ATTRIB_VAR0); - - foreach_list(node, producer->ir) { - ir_variable *const output_var = ((ir_instruction *) node)->as_variable(); - - if ((output_var == NULL) || (output_var->mode != ir_var_out)) - continue; - - ir_variable *input_var = - consumer ? consumer->symbols->get_variable(output_var->name) : NULL; - - if (input_var && input_var->mode != ir_var_in) - input_var = NULL; - - if (input_var) { - assign_varying_location(input_var, output_var, &input_index, - &output_index); - } - - for (unsigned i = 0; i < num_tfeedback_decls; ++i) { - if (!tfeedback_decls[i].is_varying()) - continue; - - if (!tfeedback_decls[i].is_assigned() && - tfeedback_decls[i].matches_var(output_var)) { - if (output_var->location == -1) { - assign_varying_location(input_var, output_var, &input_index, - &output_index); - } - if (!tfeedback_decls[i].assign_location(ctx, prog, output_var)) - return false; - } - } - } - - unsigned varying_vectors = 0; - - if (consumer) { - foreach_list(node, consumer->ir) { - ir_variable *const var = ((ir_instruction *) node)->as_variable(); - - if ((var == NULL) || (var->mode != ir_var_in)) - continue; - - if (var->location == -1) { - if (prog->Version <= 120) { - /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec: - * - * Only those varying variables used (i.e. read) in - * the fragment shader executable must be written to - * by the vertex shader executable; declaring - * superfluous varying variables in a vertex shader is - * permissible. - * - * We interpret this text as meaning that the VS must - * write the variable for the FS to read it. See - * "glsl1-varying read but not written" in piglit. - */ - - linker_error(prog, "fragment shader varying %s not written " - "by vertex shader\n.", var->name); - } - - /* An 'in' variable is only really a shader input if its - * value is written by the previous stage. - */ - var->mode = ir_var_auto; - } else if (is_varying_var(consumer->Type, var)) { - /* The packing rules are used for vertex shader inputs are also - * used for fragment shader inputs. - */ - varying_vectors += count_attribute_slots(var->type); - } - } - } - - if (ctx->API == API_OPENGLES2 || prog->Version == 100) { - if (varying_vectors > ctx->Const.MaxVarying) { - if (ctx->Const.GLSLSkipStrictMaxVaryingLimitCheck) { - linker_warning(prog, "shader uses too many varying vectors " - "(%u > %u), but the driver will try to optimize " - "them out; this is non-portable out-of-spec " - "behavior\n", - varying_vectors, ctx->Const.MaxVarying); - } else { - linker_error(prog, "shader uses too many varying vectors " - "(%u > %u)\n", - varying_vectors, ctx->Const.MaxVarying); - return false; - } - } - } else { - const unsigned float_components = varying_vectors * 4; - if (float_components > ctx->Const.MaxVarying * 4) { - if (ctx->Const.GLSLSkipStrictMaxVaryingLimitCheck) { - linker_warning(prog, "shader uses too many varying components " - "(%u > %u), but the driver will try to optimize " - "them out; this is non-portable out-of-spec " - "behavior\n", - float_components, ctx->Const.MaxVarying * 4); - } else { - linker_error(prog, "shader uses too many varying components " - "(%u > %u)\n", - float_components, ctx->Const.MaxVarying * 4); - return false; - } - } - } - - return true; -} - - -/** - * Store transform feedback location assignments into - * prog->LinkedTransformFeedback based on the data stored in tfeedback_decls. - * - * If an error occurs, the error is reported through linker_error() and false - * is returned. - */ -static bool -store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog, - unsigned num_tfeedback_decls, - tfeedback_decl *tfeedback_decls) -{ - bool separate_attribs_mode = - prog->TransformFeedback.BufferMode == GL_SEPARATE_ATTRIBS; - - ralloc_free(prog->LinkedTransformFeedback.Varyings); - ralloc_free(prog->LinkedTransformFeedback.Outputs); - - memset(&prog->LinkedTransformFeedback, 0, - sizeof(prog->LinkedTransformFeedback)); - - prog->LinkedTransformFeedback.Varyings = - rzalloc_array(prog, - struct gl_transform_feedback_varying_info, - num_tfeedback_decls); - - unsigned num_outputs = 0; - for (unsigned i = 0; i < num_tfeedback_decls; ++i) - if (!tfeedback_decls[i].accumulate_num_outputs(prog, &num_outputs)) - return false; - - prog->LinkedTransformFeedback.Outputs = - rzalloc_array(prog, - struct gl_transform_feedback_output, - num_outputs); - - unsigned num_buffers = 0; - - if (separate_attribs_mode) { - /* GL_SEPARATE_ATTRIBS */ - for (unsigned i = 0; i < num_tfeedback_decls; ++i) { - if (!tfeedback_decls[i].store(ctx, prog, &prog->LinkedTransformFeedback, - num_buffers, num_outputs)) - return false; - - num_buffers++; - } - } - else { - /* GL_INVERLEAVED_ATTRIBS */ - for (unsigned i = 0; i < num_tfeedback_decls; ++i) { - if (tfeedback_decls[i].is_next_buffer_separator()) { - num_buffers++; - continue; - } - - if (!tfeedback_decls[i].store(ctx, prog, - &prog->LinkedTransformFeedback, - num_buffers, num_outputs)) - return false; - } - num_buffers++; - } - - assert(prog->LinkedTransformFeedback.NumOutputs == num_outputs); - - prog->LinkedTransformFeedback.NumBuffers = num_buffers; - return true; -} - /** * Store the gl_FragDepth layout in the gl_shader_program struct. */ @@ -2276,12 +1865,12 @@ store_fragdepth_layout(struct gl_shader_program *prog) foreach_list(node, ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if (var == NULL || var->mode != ir_var_out) { + if (var == NULL || var->data.mode != ir_var_shader_out) { continue; } if (strcmp(var->name, "gl_FragDepth") == 0) { - switch (var->depth_layout) { + switch (var->data.depth_layout) { case ir_depth_layout_none: prog->FragDepthLayout = FRAG_DEPTH_LAYOUT_NONE; return; @@ -2308,60 +1897,54 @@ store_fragdepth_layout(struct gl_shader_program *prog) /** * Validate the resources used by a program versus the implementation limits */ -static bool +static void check_resources(struct gl_context *ctx, struct gl_shader_program *prog) { - static const char *const shader_names[MESA_SHADER_TYPES] = { - "vertex", "fragment", "geometry" - }; - - const unsigned max_samplers[MESA_SHADER_TYPES] = { - ctx->Const.MaxVertexTextureImageUnits, - ctx->Const.MaxTextureImageUnits, - ctx->Const.MaxGeometryTextureImageUnits - }; - - const unsigned max_uniform_components[MESA_SHADER_TYPES] = { - ctx->Const.VertexProgram.MaxUniformComponents, - ctx->Const.FragmentProgram.MaxUniformComponents, - 0 /* FINISHME: Geometry shaders. */ - }; - - const unsigned max_uniform_blocks[MESA_SHADER_TYPES] = { - ctx->Const.VertexProgram.MaxUniformBlocks, - ctx->Const.FragmentProgram.MaxUniformBlocks, - ctx->Const.GeometryProgram.MaxUniformBlocks, - }; - - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { struct gl_shader *sh = prog->_LinkedShaders[i]; if (sh == NULL) continue; - if (sh->num_samplers > max_samplers[i]) { + if (sh->num_samplers > ctx->Const.Program[i].MaxTextureImageUnits) { linker_error(prog, "Too many %s shader texture samplers", - shader_names[i]); + _mesa_shader_stage_to_string(i)); } - if (sh->num_uniform_components > max_uniform_components[i]) { + if (sh->num_uniform_components > + ctx->Const.Program[i].MaxUniformComponents) { + if (ctx->Const.GLSLSkipStrictMaxUniformLimitCheck) { + linker_warning(prog, "Too many %s shader default uniform block " + "components, but the driver will try to optimize " + "them out; this is non-portable out-of-spec " + "behavior\n", + _mesa_shader_stage_to_string(i)); + } else { + linker_error(prog, "Too many %s shader default uniform block " + "components", + _mesa_shader_stage_to_string(i)); + } + } + + if (sh->num_combined_uniform_components > + ctx->Const.Program[i].MaxCombinedUniformComponents) { if (ctx->Const.GLSLSkipStrictMaxUniformLimitCheck) { linker_warning(prog, "Too many %s shader uniform components, " "but the driver will try to optimize them out; " "this is non-portable out-of-spec behavior\n", - shader_names[i]); + _mesa_shader_stage_to_string(i)); } else { linker_error(prog, "Too many %s shader uniform components", - shader_names[i]); + _mesa_shader_stage_to_string(i)); } } } - unsigned blocks[MESA_SHADER_TYPES] = {0}; + unsigned blocks[MESA_SHADER_STAGES] = {0}; unsigned total_uniform_blocks = 0; for (unsigned i = 0; i < prog->NumUniformBlocks; i++) { - for (unsigned j = 0; j < MESA_SHADER_TYPES; j++) { + for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) { if (prog->UniformBlockStageIndex[j][i] != -1) { blocks[j]++; total_uniform_blocks++; @@ -2373,19 +1956,19 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog) prog->NumUniformBlocks, ctx->Const.MaxCombinedUniformBlocks); } else { - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { - if (blocks[i] > max_uniform_blocks[i]) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + const unsigned max_uniform_blocks = + ctx->Const.Program[i].MaxUniformBlocks; + if (blocks[i] > max_uniform_blocks) { linker_error(prog, "Too many %s uniform blocks (%d/%d)", - shader_names[i], + _mesa_shader_stage_to_string(i), blocks[i], - max_uniform_blocks[i]); + max_uniform_blocks); break; } } } } - - return !!prog->LinkStatus; } void @@ -2396,7 +1979,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) void *mem_ctx = ralloc_context(NULL); // temporary linker context - prog->LinkStatus = false; + prog->LinkStatus = true; /* All error paths will set this to false */ prog->Validated = false; prog->_Used = false; @@ -2406,60 +1989,67 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) ralloc_free(prog->UniformBlocks); prog->UniformBlocks = NULL; prog->NumUniformBlocks = 0; - for (int i = 0; i < MESA_SHADER_TYPES; i++) { + for (int i = 0; i < MESA_SHADER_STAGES; i++) { ralloc_free(prog->UniformBlockStageIndex[i]); prog->UniformBlockStageIndex[i] = NULL; } + ralloc_free(prog->AtomicBuffers); + prog->AtomicBuffers = NULL; + prog->NumAtomicBuffers = 0; + /* Separate the shaders into groups based on their type. */ - struct gl_shader **vert_shader_list; - unsigned num_vert_shaders = 0; - struct gl_shader **frag_shader_list; - unsigned num_frag_shaders = 0; + struct gl_shader **shader_list[MESA_SHADER_STAGES]; + unsigned num_shaders[MESA_SHADER_STAGES]; - vert_shader_list = (struct gl_shader **) - calloc(2 * prog->NumShaders, sizeof(struct gl_shader *)); - frag_shader_list = &vert_shader_list[prog->NumShaders]; + for (int i = 0; i < MESA_SHADER_STAGES; i++) { + shader_list[i] = (struct gl_shader **) + calloc(prog->NumShaders, sizeof(struct gl_shader *)); + num_shaders[i] = 0; + } unsigned min_version = UINT_MAX; unsigned max_version = 0; + const bool is_es_prog = + (prog->NumShaders > 0 && prog->Shaders[0]->IsES) ? true : false; for (unsigned i = 0; i < prog->NumShaders; i++) { min_version = MIN2(min_version, prog->Shaders[i]->Version); max_version = MAX2(max_version, prog->Shaders[i]->Version); - switch (prog->Shaders[i]->Type) { - case GL_VERTEX_SHADER: - vert_shader_list[num_vert_shaders] = prog->Shaders[i]; - num_vert_shaders++; - break; - case GL_FRAGMENT_SHADER: - frag_shader_list[num_frag_shaders] = prog->Shaders[i]; - num_frag_shaders++; - break; - case GL_GEOMETRY_SHADER: - /* FINISHME: Support geometry shaders. */ - assert(prog->Shaders[i]->Type != GL_GEOMETRY_SHADER); - break; + if ((!!prog->Shaders[i]->IsES) != is_es_prog) { + linker_error(prog, "all shaders must use same shading " + "language version\n"); + goto done; } + + gl_shader_stage shader_type = prog->Shaders[i]->Stage; + shader_list[shader_type][num_shaders[shader_type]] = prog->Shaders[i]; + num_shaders[shader_type]++; } - /* Previous to GLSL version 1.30, different compilation units could mix and - * match shading language versions. With GLSL 1.30 and later, the versions - * of all shaders must match. + /* In desktop GLSL, different shader versions may be linked together. In + * GLSL ES, all shader versions must be the same. */ - assert(min_version >= 100); - assert(max_version <= 140); - if ((max_version >= 130 || min_version == 100) - && min_version != max_version) { + if (is_es_prog && min_version != max_version) { linker_error(prog, "all shaders must use same shading " "language version\n"); goto done; } prog->Version = max_version; + prog->IsES = is_es_prog; - for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) { + /* Geometry shaders have to be linked with vertex shaders. + */ + if (num_shaders[MESA_SHADER_GEOMETRY] > 0 && + num_shaders[MESA_SHADER_VERTEX] == 0) { + linker_error(prog, "Geometry shader must be linked with " + "vertex shader\n"); + goto done; + } + + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] != NULL) ctx->Driver.DeleteShader(ctx, prog->_LinkedShaders[i]); @@ -2468,71 +2058,94 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* Link all shaders for a particular stage and validate the result. */ - if (num_vert_shaders > 0) { - gl_shader *const sh = - link_intrastage_shaders(mem_ctx, ctx, prog, vert_shader_list, - num_vert_shaders); + for (int stage = 0; stage < MESA_SHADER_STAGES; stage++) { + if (num_shaders[stage] > 0) { + gl_shader *const sh = + link_intrastage_shaders(mem_ctx, ctx, prog, shader_list[stage], + num_shaders[stage]); - if (sh == NULL) - goto done; + if (!prog->LinkStatus) + goto done; - if (!validate_vertex_shader_executable(prog, sh)) - goto done; + switch (stage) { + case MESA_SHADER_VERTEX: + validate_vertex_shader_executable(prog, sh); + break; + case MESA_SHADER_GEOMETRY: + validate_geometry_shader_executable(prog, sh); + break; + case MESA_SHADER_FRAGMENT: + validate_fragment_shader_executable(prog, sh); + break; + } + if (!prog->LinkStatus) + goto done; - _mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_VERTEX], - sh); + _mesa_reference_shader(ctx, &prog->_LinkedShaders[stage], sh); + } } - if (num_frag_shaders > 0) { - gl_shader *const sh = - link_intrastage_shaders(mem_ctx, ctx, prog, frag_shader_list, - num_frag_shaders); - - if (sh == NULL) - goto done; - - if (!validate_fragment_shader_executable(prog, sh)) - goto done; - - _mesa_reference_shader(ctx, &prog->_LinkedShaders[MESA_SHADER_FRAGMENT], - sh); - } + if (num_shaders[MESA_SHADER_GEOMETRY] > 0) + prog->LastClipDistanceArraySize = prog->Geom.ClipDistanceArraySize; + else if (num_shaders[MESA_SHADER_VERTEX] > 0) + prog->LastClipDistanceArraySize = prog->Vert.ClipDistanceArraySize; + else + prog->LastClipDistanceArraySize = 0; /* Not used */ /* Here begins the inter-stage linking phase. Some initial validation is * performed, then locations are assigned for uniforms, attributes, and * varyings. */ - if (cross_validate_uniforms(prog)) { - unsigned prev; + cross_validate_uniforms(prog); + if (!prog->LinkStatus) + goto done; - for (prev = 0; prev < MESA_SHADER_TYPES; prev++) { - if (prog->_LinkedShaders[prev] != NULL) - break; - } + unsigned prev; - /* Validate the inputs of each stage with the output of the preceding - * stage. - */ - for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) { - if (prog->_LinkedShaders[i] == NULL) - continue; + for (prev = 0; prev < MESA_SHADER_STAGES; prev++) { + if (prog->_LinkedShaders[prev] != NULL) + break; + } - if (!cross_validate_outputs_to_inputs(prog, - prog->_LinkedShaders[prev], - prog->_LinkedShaders[i])) - goto done; + /* Validate the inputs of each stage with the output of the preceding + * stage. + */ + for (unsigned i = prev + 1; i < MESA_SHADER_STAGES; i++) { + if (prog->_LinkedShaders[i] == NULL) + continue; - prev = i; - } + validate_interstage_inout_blocks(prog, prog->_LinkedShaders[prev], + prog->_LinkedShaders[i]); + if (!prog->LinkStatus) + goto done; - prog->LinkStatus = true; + cross_validate_outputs_to_inputs(prog, + prog->_LinkedShaders[prev], + prog->_LinkedShaders[i]); + if (!prog->LinkStatus) + goto done; + + prev = i; + } + + /* Cross-validate uniform blocks between shader stages */ + validate_interstage_uniform_blocks(prog, prog->_LinkedShaders, + MESA_SHADER_STAGES); + if (!prog->LinkStatus) + goto done; + + for (unsigned int i = 0; i < MESA_SHADER_STAGES; i++) { + if (prog->_LinkedShaders[i] != NULL) + lower_named_interface_blocks(mem_ctx, prog->_LinkedShaders[i]); } /* Implement the GLSL 1.30+ rule for discard vs infinite loops Do * it before optimization because we want most of the checks to get * dropped thanks to constant propagation. + * + * This rule also applies to GLSL ES 3.00. */ - if (max_version >= 130) { + if (max_version >= (is_es_prog ? 300U : 130U)) { struct gl_shader *sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT]; if (sh) { lower_discard_flow(sh->ir); @@ -2546,7 +2159,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) * uniforms, and varyings. Later optimization could possibly make * some of that unused. */ - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { if (prog->_LinkedShaders[i] == NULL) continue; @@ -2554,15 +2167,30 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) if (!prog->LinkStatus) goto done; - if (ctx->ShaderCompilerOptions[i].LowerClipDistance) - lower_clip_distance(prog->_LinkedShaders[i]->ir); + if (ctx->ShaderCompilerOptions[i].LowerClipDistance) { + lower_clip_distance(prog->_LinkedShaders[i]); + } unsigned max_unroll = ctx->ShaderCompilerOptions[i].MaxUnrollIterations; - while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false, max_unroll)) + while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false, max_unroll, &ctx->ShaderCompilerOptions[i])) ; } + /* Mark all generic shader inputs and outputs as unpaired. */ + if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { + link_invalidate_variable_locations( + prog->_LinkedShaders[MESA_SHADER_VERTEX]->ir); + } + if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { + link_invalidate_variable_locations( + prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir); + } + if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { + link_invalidate_variable_locations( + prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir); + } + /* FINISHME: The value of the max_attribute_index parameter is * FINISHME: implementation dependent based on the value of * FINISHME: GL_MAX_VERTEX_ATTRIBS. GL_MAX_VERTEX_ATTRIBS must be @@ -2576,9 +2204,9 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } - unsigned prev; - for (prev = 0; prev < MESA_SHADER_TYPES; prev++) { - if (prog->_LinkedShaders[prev] != NULL) + unsigned first; + for (first = 0; first < MESA_SHADER_STAGES; first++) { + if (prog->_LinkedShaders[first] != NULL) break; } @@ -2590,7 +2218,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) * non-zero, but the program object has no vertex or geometry * shader; */ - if (prev >= MESA_SHADER_FRAGMENT) { + if (first == MESA_SHADER_FRAGMENT) { linker_error(prog, "Transform feedback varyings specified, but " "no vertex or geometry shader is present."); goto done; @@ -2604,83 +2232,112 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } - for (unsigned i = prev + 1; i < MESA_SHADER_TYPES; i++) { - if (prog->_LinkedShaders[i] == NULL) - continue; - - if (!assign_varying_locations( - ctx, prog, prog->_LinkedShaders[prev], prog->_LinkedShaders[i], - i == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0, - tfeedback_decls)) - goto done; - - prev = i; + /* Linking the stages in the opposite order (from fragment to vertex) + * ensures that inter-shader outputs written to in an earlier stage are + * eliminated if they are (transitively) not used in a later stage. + */ + int last, next; + for (last = MESA_SHADER_STAGES-1; last >= 0; last--) { + if (prog->_LinkedShaders[last] != NULL) + break; } - if (prev != MESA_SHADER_FRAGMENT && num_tfeedback_decls != 0) { - /* There was no fragment shader, but we still have to assign varying - * locations for use by transform feedback. + if (last >= 0 && last < MESA_SHADER_FRAGMENT) { + gl_shader *const sh = prog->_LinkedShaders[last]; + + if (num_tfeedback_decls != 0) { + /* There was no fragment shader, but we still have to assign varying + * locations for use by transform feedback. + */ + if (!assign_varying_locations(ctx, mem_ctx, prog, + sh, NULL, + num_tfeedback_decls, tfeedback_decls, + 0)) + goto done; + } + + do_dead_builtin_varyings(ctx, sh, NULL, + num_tfeedback_decls, tfeedback_decls); + + demote_shader_inputs_and_outputs(sh, ir_var_shader_out); + + /* Eliminate code that is now dead due to unused outputs being demoted. */ - if (!assign_varying_locations( - ctx, prog, prog->_LinkedShaders[prev], NULL, num_tfeedback_decls, - tfeedback_decls)) + while (do_dead_code(sh->ir, false)) + ; + } + else if (first == MESA_SHADER_FRAGMENT) { + /* If the program only contains a fragment shader... + */ + gl_shader *const sh = prog->_LinkedShaders[first]; + + do_dead_builtin_varyings(ctx, NULL, sh, + num_tfeedback_decls, tfeedback_decls); + + demote_shader_inputs_and_outputs(sh, ir_var_shader_in); + + while (do_dead_code(sh->ir, false)) + ; + } + + next = last; + for (int i = next - 1; i >= 0; i--) { + if (prog->_LinkedShaders[i] == NULL) + continue; + + gl_shader *const sh_i = prog->_LinkedShaders[i]; + gl_shader *const sh_next = prog->_LinkedShaders[next]; + unsigned gs_input_vertices = + next == MESA_SHADER_GEOMETRY ? prog->Geom.VerticesIn : 0; + + if (!assign_varying_locations(ctx, mem_ctx, prog, sh_i, sh_next, + next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0, + tfeedback_decls, gs_input_vertices)) goto done; + + do_dead_builtin_varyings(ctx, sh_i, sh_next, + next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0, + tfeedback_decls); + + demote_shader_inputs_and_outputs(sh_i, ir_var_shader_out); + demote_shader_inputs_and_outputs(sh_next, ir_var_shader_in); + + /* Eliminate code that is now dead due to unused outputs being demoted. + */ + while (do_dead_code(sh_i->ir, false)) + ; + while (do_dead_code(sh_next->ir, false)) + ; + + /* This must be done after all dead varyings are eliminated. */ + if (!check_against_output_limit(ctx, prog, sh_i)) + goto done; + if (!check_against_input_limit(ctx, prog, sh_next)) + goto done; + + next = i; } if (!store_tfeedback_info(ctx, prog, num_tfeedback_decls, tfeedback_decls)) goto done; - if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { - demote_shader_inputs_and_outputs(prog->_LinkedShaders[MESA_SHADER_VERTEX], - ir_var_out); - - /* Eliminate code that is now dead due to unused vertex outputs being - * demoted. - */ - while (do_dead_code(prog->_LinkedShaders[MESA_SHADER_VERTEX]->ir, false)) - ; - } - - if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { - gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_GEOMETRY]; - - demote_shader_inputs_and_outputs(sh, ir_var_in); - demote_shader_inputs_and_outputs(sh, ir_var_inout); - demote_shader_inputs_and_outputs(sh, ir_var_out); - - /* Eliminate code that is now dead due to unused geometry outputs being - * demoted. - */ - while (do_dead_code(prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir, false)) - ; - } - - if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { - gl_shader *const sh = prog->_LinkedShaders[MESA_SHADER_FRAGMENT]; - - demote_shader_inputs_and_outputs(sh, ir_var_in); - - /* Eliminate code that is now dead due to unused fragment inputs being - * demoted. This shouldn't actually do anything other than remove - * declarations of the (now unused) global variables. - */ - while (do_dead_code(prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir, false)) - ; - } - update_array_sizes(prog); link_assign_uniform_locations(prog); + link_assign_atomic_counter_resources(ctx, prog); store_fragdepth_layout(prog); - if (!check_resources(ctx, prog)) + check_resources(ctx, prog); + link_check_atomic_counter_resources(ctx, prog); + + if (!prog->LinkStatus) goto done; /* OpenGL ES requires that a vertex shader and a fragment shader both be - * present in a linked program. By checking for use of shading language - * version 1.00, we also catch the GL_ARB_ES2_compatibility case. + * present in a linked program. By checking prog->IsES, we also + * catch the GL_ARB_ES2_compatibility case. */ if (!prog->InternalSeparateShader && - (ctx->API == API_OPENGLES2 || prog->Version == 100)) { + (ctx->API == API_OPENGLES2 || prog->IsES)) { if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) { linker_error(prog, "program lacks a vertex shader\n"); } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) { @@ -2691,12 +2348,16 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* FINISHME: Assign fragment shader output locations. */ done: - free(vert_shader_list); - - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) { + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + free(shader_list[i]); if (prog->_LinkedShaders[i] == NULL) continue; + /* Do a final validation step to make sure that the IR wasn't + * invalidated by any modifications performed after intrastage linking. + */ + validate_ir_tree(prog->_LinkedShaders[i]->ir); + /* Retain any live IR, but trash the rest. */ reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir); diff --git a/3rdparty/glsl-optimizer/src/glsl/linker.h b/3rdparty/glsl-optimizer/src/glsl/linker.h index c98122f68..e9d9c4508 100644 --- a/3rdparty/glsl-optimizer/src/glsl/linker.h +++ b/3rdparty/glsl-optimizer/src/glsl/linker.h @@ -31,8 +31,7 @@ link_function_calls(gl_shader_program *prog, gl_shader *main, gl_shader **shader_list, unsigned num_shaders); extern void -link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode, - int generic_base); +link_invalidate_variable_locations(exec_list *ir); extern void link_assign_uniform_locations(struct gl_shader_program *prog); @@ -49,46 +48,129 @@ link_cross_validate_uniform_block(void *mem_ctx, void link_assign_uniform_block_offsets(struct gl_shader *shader); +extern bool +link_uniform_blocks_are_compatible(const gl_uniform_block *a, + const gl_uniform_block *b); + +extern unsigned +link_uniform_blocks(void *mem_ctx, + struct gl_shader_program *prog, + struct gl_shader **shader_list, + unsigned num_shaders, + struct gl_uniform_block **blocks_ret); + +void +validate_intrastage_interface_blocks(struct gl_shader_program *prog, + const gl_shader **shader_list, + unsigned num_shaders); + +void +validate_interstage_inout_blocks(struct gl_shader_program *prog, + const gl_shader *producer, + const gl_shader *consumer); + +void +validate_interstage_uniform_blocks(struct gl_shader_program *prog, + gl_shader **stages, int num_stages); + +extern void +link_assign_atomic_counter_resources(struct gl_context *ctx, + struct gl_shader_program *prog); + +extern void +link_check_atomic_counter_resources(struct gl_context *ctx, + struct gl_shader_program *prog); + /** - * Class for processing all of the leaf fields of an uniform + * Class for processing all of the leaf fields of a variable that corresponds + * to a program resource. * - * Leaves are, roughly speaking, the parts of the uniform that the application - * could query with \c glGetUniformLocation (or that could be returned by - * \c glGetActiveUniforms). + * The leaf fields are all the parts of the variable that the application + * could query using \c glGetProgramResourceIndex (or that could be returned + * by \c glGetProgramResourceName). * * Classes my derive from this class to implement specific functionality. * This class only provides the mechanism to iterate over the leaves. Derived * classes must implement \c ::visit_field and may override \c ::process. */ -class uniform_field_visitor { +class program_resource_visitor { public: /** - * Begin processing a uniform + * Begin processing a variable * * Classes that overload this function should call \c ::process from the - * base class to start the recursive processing of the uniform. + * base class to start the recursive processing of the variable. * - * \param var The uniform variable that is to be processed + * \param var The variable that is to be processed * - * Calls \c ::visit_field for each leaf of the uniform. + * Calls \c ::visit_field for each leaf of the variable. + * + * \warning + * When processing a uniform block, this entry should only be used in cases + * where the row / column ordering of matrices in the block does not + * matter. For example, enumerating the names of members of the block, but + * not for determining the offsets of members. */ void process(ir_variable *var); + /** + * Begin processing a variable of a structured type. + * + * This flavor of \c process should be used to handle structured types + * (i.e., structures, interfaces, or arrays there of) that need special + * name handling. A common usage is to handle cases where the block name + * (instead of the instance name) is used for an interface block. + * + * \param type Type that is to be processed, associated with \c name + * \param name Base name of the structured variable being processed + * + * \note + * \c type must be \c GLSL_TYPE_RECORD, \c GLSL_TYPE_INTERFACE, or an array + * there of. + */ + void process(const glsl_type *type, const char *name); + protected: /** - * Method invoked for each leaf of the uniform + * Method invoked for each leaf of the variable * * \param type Type of the field. * \param name Fully qualified name of the field. + * \param row_major For a matrix type, is it stored row-major. + * \param record_type Type of the record containing the field. + * + * The default implementation just calls the other \c visit_field method. */ - virtual void visit_field(const glsl_type *type, const char *name) = 0; + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major, const glsl_type *record_type); + + /** + * Method invoked for each leaf of the variable + * + * \param type Type of the field. + * \param name Fully qualified name of the field. + * \param row_major For a matrix type, is it stored row-major. + */ + virtual void visit_field(const glsl_type *type, const char *name, + bool row_major) = 0; + + /** + * Visit a record before visiting its fields + * + * For structures-of-structures or interfaces-of-structures, this visits + * the inner structure before visiting its fields. + * + * The default implementation does nothing. + */ + virtual void visit_field(const glsl_struct_field *field); private: /** * \param name_length Length of the current name \b not including the * terminating \c NUL character. */ - void recursion(const glsl_type *t, char **name, size_t name_length); + void recursion(const glsl_type *t, char **name, size_t name_length, + bool row_major, const glsl_type *record_type); }; extern struct gl_shader * @@ -98,5 +180,10 @@ link_intrastage_shaders(void *mem_ctx, struct gl_shader **shader_list, unsigned num_shaders); +void +linker_error(gl_shader_program *prog, const char *fmt, ...); + +void +linker_warning(gl_shader_program *prog, const char *fmt, ...); #endif /* GLSL_LINKER_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/list.h b/3rdparty/glsl-optimizer/src/glsl/list.h index 1d46365fa..694b686b0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/list.h +++ b/3rdparty/glsl-optimizer/src/glsl/list.h @@ -76,24 +76,7 @@ struct exec_node { struct exec_node *prev; #ifdef __cplusplus - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *node; - - node = ralloc_size(ctx, size); - assert(node != NULL); - - return node; - } - - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. */ - static void operator delete(void *node) - { - ralloc_free(node); - } + DECLARE_RALLOC_CXX_OPERATORS(exec_node) exec_node() : next(NULL), prev(NULL) { @@ -223,86 +206,15 @@ struct exec_node { #ifdef __cplusplus struct exec_node; - -class iterator { -public: - void next() - { - } - - void *get() - { - return NULL; - } - - bool has_next() const - { - return false; - } -}; - -class exec_list_iterator : public iterator { -public: - exec_list_iterator(exec_node *n) : node(n), _next(n->next) - { - /* empty */ - } - - void next() - { - node = _next; - _next = node->next; - } - - void remove() - { - node->remove(); - } - - exec_node *get() - { - return node; - } - - bool has_next() const - { - return _next != NULL; - } - -private: - exec_node *node; - exec_node *_next; -}; - -#define foreach_iter(iter_type, iter, container) \ - for (iter_type iter = (container) . iterator(); iter.has_next(); iter.next()) #endif - struct exec_list { struct exec_node *head; struct exec_node *tail; struct exec_node *tail_pred; #ifdef __cplusplus - /* Callers of this ralloc-based new need not call delete. It's - * easier to just ralloc_free 'ctx' (or any of its ancestors). */ - static void* operator new(size_t size, void *ctx) - { - void *node; - - node = ralloc_size(ctx, size); - assert(node != NULL); - - return node; - } - - /* If the user *does* call delete, that's OK, we will just - * ralloc_free in that case. */ - static void operator delete(void *node) - { - ralloc_free(node); - } + DECLARE_RALLOC_CXX_OPERATORS(exec_list) exec_list() { @@ -438,16 +350,6 @@ struct exec_list { */ source->make_empty(); } - - exec_list_iterator iterator() - { - return exec_list_iterator(head); - } - - exec_list_iterator iterator() const - { - return exec_list_iterator((exec_node *) head); - } #endif }; @@ -481,6 +383,22 @@ inline void exec_node::insert_before(exec_list *before) ; (__node)->next != NULL \ ; (__node) = (__node)->next) +/** + * Iterate through two lists at once. Stops at the end of the shorter list. + * + * This is safe against either current node being removed or replaced. + */ +#define foreach_two_lists(__node1, __list1, __node2, __list2) \ + for (exec_node * __node1 = (__list1)->head, \ + * __node2 = (__list2)->head, \ + * __next1 = __node1->next, \ + * __next2 = __node2->next \ + ; __next1 != NULL && __next2 != NULL \ + ; __node1 = __next1, \ + __node2 = __next2, \ + __next1 = __next1->next, \ + __next2 = __next2->next) + #define foreach_list_const(__node, __list) \ for (const exec_node * __node = (__list)->head \ ; (__node)->next != NULL \ diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp index 6a0e4da51..22ba10ac8 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.cpp @@ -24,6 +24,7 @@ #include "glsl_types.h" #include "loop_analysis.h" #include "ir_hierarchical_visitor.h" +#include "ir_variable_refcount.h" static bool is_loop_terminator(ir_if *ir); @@ -33,10 +34,52 @@ static bool all_expression_operands_are_loop_constant(ir_rvalue *, static ir_rvalue *get_basic_induction_increment(ir_assignment *, hash_table *); +/** + * Record the fact that the given loop variable was referenced inside the loop. + * + * \arg in_assignee is true if the reference was on the LHS of an assignment. + * + * \arg in_conditional_code_or_nested_loop is true if the reference occurred + * inside an if statement or a nested loop. + * + * \arg current_assignment is the ir_assignment node that the loop variable is + * on the LHS of, if any (ignored if \c in_assignee is false). + */ +void +loop_variable::record_reference(bool in_assignee, + bool in_conditional_code_or_nested_loop, + ir_assignment *current_assignment) +{ + if (in_assignee) { + assert(current_assignment != NULL); + + if (in_conditional_code_or_nested_loop || + current_assignment->condition != NULL) { + this->conditional_or_nested_assignment = true; + } + + if (this->first_assignment == NULL) { + assert(this->num_assignments == 0); + + this->first_assignment = current_assignment; + } + + this->num_assignments++; + } else if (this->first_assignment == current_assignment) { + /* This catches the case where the variable is used in the RHS of an + * assignment where it is also in the LHS. + */ + this->read_before_write = true; + } +} + + loop_state::loop_state() { this->ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + this->ht_inductors = hash_table_ctor(0, hash_table_pointer_hash, + hash_table_pointer_compare); this->mem_ctx = ralloc_context(NULL); this->loop_found = false; } @@ -45,6 +88,7 @@ loop_state::loop_state() loop_state::~loop_state() { hash_table_dtor(this->ht); + hash_table_dtor(this->ht_inductors); ralloc_free(this->mem_ctx); } @@ -67,6 +111,32 @@ loop_state::get(const ir_loop *ir) return (loop_variable_state *) hash_table_find(this->ht, ir); } +loop_variable_state * +loop_state::get_for_inductor(const ir_variable *ir) +{ + return (loop_variable_state *) hash_table_find(this->ht_inductors, ir); +} + +void +loop_state::insert_inductor(ir_variable* var, loop_variable_state* state, ir_loop* loop) +{ + // Check if this variable is used after the loop anywhere. If it is, it can't be a + // variable that's private to the loop. + ir_variable_refcount_visitor refs; + for (exec_node* node = loop->next; + !node->is_tail_sentinel(); + node = node->next) + { + ir_instruction *ir = (ir_instruction *) node; + ir->accept (&refs); + if (refs.find_variable_entry(var)) + return; + } + + state->private_induction_variable_count++; + hash_table_insert(this->ht_inductors, state, var); +} + loop_variable * loop_variable_state::get(const ir_variable *ir) @@ -94,7 +164,7 @@ loop_terminator * loop_variable_state::insert(ir_if *if_stmt) { void *mem_ctx = ralloc_parent(this); - loop_terminator *t = rzalloc(mem_ctx, loop_terminator); + loop_terminator *t = new(mem_ctx) loop_terminator(); t->ir = if_stmt; this->terminators.push_tail(t); @@ -103,9 +173,37 @@ loop_variable_state::insert(ir_if *if_stmt) } +/** + * If the given variable already is recorded in the state for this loop, + * return the corresponding loop_variable object that records information + * about it. + * + * Otherwise, create a new loop_variable object to record information about + * the variable, and set its \c read_before_write field appropriately based on + * \c in_assignee. + * + * \arg in_assignee is true if this variable was encountered on the LHS of an + * assignment. + */ +loop_variable * +loop_variable_state::get_or_insert(ir_variable *var, bool in_assignee) +{ + loop_variable *lv = this->get(var); + + if (lv == NULL) { + lv = this->insert(var); + lv->read_before_write = !in_assignee; + } + + return lv; +} + + +namespace { + class loop_analysis : public ir_hierarchical_visitor { public: - loop_analysis(); + loop_analysis(loop_state *loops); virtual ir_visitor_status visit(ir_loop_jump *); virtual ir_visitor_status visit(ir_dereference_variable *); @@ -128,13 +226,12 @@ public: exec_list state; }; +} /* anonymous namespace */ -loop_analysis::loop_analysis() +loop_analysis::loop_analysis(loop_state *loops) + : loops(loops), if_statement_depth(0), current_assignment(NULL) { - this->loops = new loop_state; - - this->if_statement_depth = 0; - this->current_assignment = NULL; + /* empty */ } @@ -157,14 +254,14 @@ loop_analysis::visit(ir_loop_jump *ir) ir_visitor_status loop_analysis::visit_enter(ir_call *ir) { - /* If we're not somewhere inside a loop, there's nothing to do. */ - if (this->state.is_empty()) - return visit_continue; + /* Mark every loop that we're currently analyzing as containing an ir_call + * (even those at outer nesting levels). + */ + foreach_list(node, &this->state) { + loop_variable_state *const ls = (loop_variable_state *) node; + ls->contains_calls = true; + } - loop_variable_state *const ls = - (loop_variable_state *) this->state.get_head(); - - ls->contains_calls = true; return visit_continue_with_parent; } @@ -177,35 +274,18 @@ loop_analysis::visit(ir_dereference_variable *ir) if (this->state.is_empty()) return visit_continue; - loop_variable_state *const ls = - (loop_variable_state *) this->state.get_head(); + bool nested = false; - ir_variable *var = ir->variable_referenced(); - loop_variable *lv = ls->get(var); + foreach_list(node, &this->state) { + loop_variable_state *const ls = (loop_variable_state *) node; - if (lv == NULL) { - lv = ls->insert(var); - lv->read_before_write = !this->in_assignee; - } + ir_variable *var = ir->variable_referenced(); + loop_variable *lv = ls->get_or_insert(var, this->in_assignee); - if (this->in_assignee) { - assert(this->current_assignment != NULL); - - lv->conditional_assignment = (this->if_statement_depth > 0) - || (this->current_assignment->condition != NULL); - - if (lv->first_assignment == NULL) { - assert(lv->num_assignments == 0); - - lv->first_assignment = this->current_assignment; - } - - lv->num_assignments++; - } else if (lv->first_assignment == this->current_assignment) { - /* This catches the case where the variable is used in the RHS of an - * assignment where it is also in the LHS. - */ - lv->read_before_write = true; + lv->record_reference(this->in_assignee, + nested || this->if_statement_depth > 0, + this->current_assignment); + nested = true; } return visit_continue; @@ -286,7 +366,7 @@ loop_analysis::visit_leave(ir_loop *ir) foreach_list_safe(node, &ls->variables) { loop_variable *lv = (loop_variable *) node; - if (lv->conditional_assignment || (lv->num_assignments > 1)) + if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1)) continue; /* Process the RHS of the assignment. If all of the variables @@ -326,9 +406,10 @@ loop_analysis::visit_leave(ir_loop *ir) assert(lv->num_assignments == 1); assert(lv->first_assignment != NULL); - /* The assignmnet to the variable in the loop must be unconditional. + /* The assignment to the variable in the loop must be unconditional and + * not inside a nested loop. */ - if (lv->conditional_assignment) + if (lv->conditional_or_nested_assignment) continue; /* Basic loop induction variables have a single assignment in the loop @@ -338,12 +419,81 @@ loop_analysis::visit_leave(ir_loop *ir) ir_rvalue *const inc = get_basic_induction_increment(lv->first_assignment, ls->var_hash); if (inc != NULL) { - lv->iv_scale = NULL; - lv->biv = lv->var; lv->increment = inc; lv->remove(); ls->induction_variables.push_tail(lv); + loops->insert_inductor(lv->var, ls, ir); + } + } + + /* Search the loop terminating conditions for those of the form 'i < c' + * where i is a loop induction variable, c is a constant, and < is any + * relative operator. From each of these we can infer an iteration count. + * Also figure out which terminator (if any) produces the smallest + * iteration count--this is the limiting terminator. + */ + foreach_list(node, &ls->terminators) { + loop_terminator *t = (loop_terminator *) node; + ir_if *if_stmt = t->ir; + + /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care + * about the former here. + */ + ir_expression *cond = if_stmt->condition->as_expression(); + if (cond == NULL) + continue; + + switch (cond->operation) { + case ir_binop_less: + case ir_binop_greater: + case ir_binop_lequal: + case ir_binop_gequal: { + /* The expressions that we care about will either be of the form + * 'counter < limit' or 'limit < counter'. Figure out which is + * which. + */ + ir_rvalue *counter = cond->operands[0]->as_dereference_variable(); + ir_constant *limit = cond->operands[1]->as_constant(); + enum ir_expression_operation cmp = cond->operation; + + if (limit == NULL) { + counter = cond->operands[1]->as_dereference_variable(); + limit = cond->operands[0]->as_constant(); + + switch (cmp) { + case ir_binop_less: cmp = ir_binop_greater; break; + case ir_binop_greater: cmp = ir_binop_less; break; + case ir_binop_lequal: cmp = ir_binop_gequal; break; + case ir_binop_gequal: cmp = ir_binop_lequal; break; + default: assert(!"Should not get here."); + } + } + + if ((counter == NULL) || (limit == NULL)) + break; + + ir_variable *var = counter->variable_referenced(); + + ir_rvalue *init = find_initial_value(ir, var); + + loop_variable *lv = ls->get(var); + if (lv != NULL && lv->is_induction_var()) { + lv->initial_value = init; + t->iterations = calculate_iterations(init, limit, lv->increment, + cmp); + + if (t->iterations >= 0 && + (ls->limiting_terminator == NULL || + t->iterations < ls->limiting_terminator->iterations)) { + ls->limiting_terminator = t; + } + } + break; + } + + default: + break; } } @@ -505,7 +655,8 @@ is_loop_terminator(ir_if *ir) ir_instruction *const inst = (ir_instruction *) ir->then_instructions.get_head(); - assert(inst != NULL); + if (inst == NULL) + return false; if (inst->ir_type != ir_type_loop_jump) return false; @@ -521,7 +672,8 @@ is_loop_terminator(ir_if *ir) loop_state * analyze_loop_variables(exec_list *instructions) { - loop_analysis v; + loop_state *loops = new loop_state; + loop_analysis v(loops); v.run(instructions); return v.loops; diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h index 05c982fc1..39561df88 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h +++ b/3rdparty/glsl-optimizer/src/glsl/loop_analysis.h @@ -39,16 +39,12 @@ analyze_loop_variables(exec_list *instructions); /** * Fill in loop control fields * - * Based on analysis of loop variables, this function tries to remove sequences - * in the loop of the form + * Based on analysis of loop variables, this function tries to remove + * redundant sequences in the loop of the form * * (if (expression bool ...) (break)) * - * and fill in the \c ir_loop::from, \c ir_loop::to, and \c ir_loop::counter - * fields of the \c ir_loop. - * - * In this process, some conditional break-statements may be eliminated - * altogether. For example, if it is provable that one loop exit condition will + * For example, if it is provable that one loop exit condition will * always be satisfied before another, the unnecessary exit condition will be * removed. */ @@ -59,6 +55,13 @@ set_loop_controls(exec_list *instructions, loop_state *ls); extern bool unroll_loops(exec_list *instructions, loop_state *ls, unsigned max_iterations); +ir_rvalue * +find_initial_value(ir_loop *loop, ir_variable *var); + +int +calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, + enum ir_expression_operation op); + /** * Tracking for all variables used in a loop @@ -67,14 +70,10 @@ class loop_variable_state : public exec_node { public: class loop_variable *get(const ir_variable *); class loop_variable *insert(ir_variable *); + class loop_variable *get_or_insert(ir_variable *, bool in_assignee); class loop_terminator *insert(ir_if *); - /** - * Loop whose variable state is being tracked by this structure - */ - ir_loop *loop; - /** * Variables that have not yet been classified */ @@ -93,6 +92,7 @@ public: * This list contains \c loop_variable objects. */ exec_list induction_variables; + int private_induction_variable_count; /** * Simple if-statements that lead to the termination of the loop @@ -103,20 +103,19 @@ public: */ exec_list terminators; + /** + * If any of the terminators in \c terminators leads to termination of the + * loop after a constant number of iterations, this is the terminator that + * leads to termination after the smallest number of iterations. Otherwise + * NULL. + */ + loop_terminator *limiting_terminator; + /** * Hash table containing all variables accessed in this loop */ hash_table *var_hash; - /** - * Maximum number of loop iterations. - * - * If this value is negative, then the loop may be infinite. This actually - * means that analysis was unable to determine an upper bound on the number - * of loop iterations. - */ - int max_iterations; - /** * Number of ir_loop_jump instructions that operate on this loop */ @@ -129,11 +128,11 @@ public: loop_variable_state() { - this->max_iterations = -1; this->num_loop_jumps = 0; this->contains_calls = false; this->var_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); + this->limiting_terminator = NULL; } ~loop_variable_state() @@ -171,37 +170,46 @@ public: /** Are all variables in the RHS of the assignment loop constants? */ bool rhs_clean; - /** Is there an assignment to the variable that is conditional? */ - bool conditional_assignment; + /** + * Is there an assignment to the variable that is conditional, or inside a + * nested loop? + */ + bool conditional_or_nested_assignment; /** Reference to the first assignment to the variable in the loop body. */ ir_assignment *first_assignment; + /** Reference to initial value outside of the loop. */ + ir_rvalue *initial_value; + /** Number of assignments to the variable in the loop body. */ unsigned num_assignments; /** - * Increment values for loop induction variables + * Increment value for a loop induction variable * - * Loop induction variables have a single increment of the form - * \c b * \c biv + \c c, where \c b and \c c are loop constants and \c i - * is a basic loop induction variable. + * If this is a loop induction variable, the amount by which the variable + * is incremented on each iteration through the loop. * - * If \c iv_scale is \c NULL, 1 is used. If \c biv is the same as \c var, - * then \c var is a basic loop induction variable. + * If this is not a loop induction variable, NULL. */ - /*@{*/ - ir_rvalue *iv_scale; - ir_variable *biv; ir_rvalue *increment; - /*@}*/ + + + inline bool is_induction_var() const + { + /* Induction variables always have a non-null increment, and vice + * versa. + */ + return this->increment != NULL; + } inline bool is_loop_constant() const { const bool is_const = (this->num_assignments == 0) || ((this->num_assignments == 1) - && !this->conditional_assignment + && !this->conditional_or_nested_assignment && !this->read_before_write && this->rhs_clean); @@ -213,16 +221,35 @@ public: /* Variables that are marked read-only *MUST* be loop constant. */ - assert(!this->var->read_only || (this->var->read_only && is_const)); + assert(!this->var->data.read_only + || (this->var->data.read_only && is_const)); return is_const; } + + void record_reference(bool in_assignee, + bool in_conditional_code_or_nested_loop, + ir_assignment *current_assignment); }; class loop_terminator : public exec_node { public: + loop_terminator() + : ir(NULL), iterations(-1) + { + } + + /** + * Statement which terminates the loop. + */ ir_if *ir; + + /** + * The number of iterations after which the terminator is known to + * terminate the loop (if that is a fixed value). Otherwise -1. + */ + int iterations; }; @@ -236,6 +263,9 @@ public: loop_variable_state *get(const ir_loop *); loop_variable_state *insert(ir_loop *ir); + + loop_variable_state* get_for_inductor (const ir_variable*); + void insert_inductor(ir_variable* var, loop_variable_state* state, ir_loop* loop); bool loop_found; @@ -246,10 +276,15 @@ private: * Hash table containing all loops that have been analyzed. */ hash_table *ht; + + /** + * Hash table from ir_variables to loop state, for induction variables. + */ + hash_table *ht_inductors; void *mem_ctx; - friend class loop_analysis; + friend loop_state *analyze_loop_variables(exec_list *instructions); }; #endif /* LOOP_ANALYSIS_H */ diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp b/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp index 2fd128f73..87844ea83 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/loop_controls.cpp @@ -158,6 +158,7 @@ calculate_iterations(ir_rvalue *from, ir_rvalue *to, ir_rvalue *increment, return (valid_loop) ? iter_value : -1; } +namespace { class loop_control_visitor : public ir_hierarchical_visitor { public: @@ -174,6 +175,7 @@ public: bool progress; }; +} /* anonymous namespace */ ir_visitor_status loop_control_visitor::visit_leave(ir_loop *ir) @@ -188,113 +190,40 @@ loop_control_visitor::visit_leave(ir_loop *ir) return visit_continue; } - /* Search the loop terminating conditions for one of the form 'i < c' where - * i is a loop induction variable, c is a constant, and < is any relative - * operator. - */ - int max_iterations = ls->max_iterations; - - if(ir->from && ir->to && ir->increment) - max_iterations = calculate_iterations(ir->from, ir->to, ir->increment, (ir_expression_operation)ir->cmp); - - if(max_iterations < 0) - max_iterations = INT_MAX; - - foreach_list(node, &ls->terminators) { - loop_terminator *t = (loop_terminator *) node; - ir_if *if_stmt = t->ir; - - /* If-statements can be either 'if (expr)' or 'if (deref)'. We only care - * about the former here. + if (ls->limiting_terminator != NULL) { + /* If the limiting terminator has an iteration count of zero, then we've + * proven that the loop cannot run, so delete it. */ - ir_expression *cond = if_stmt->condition->as_expression(); - if (cond == NULL) - continue; - - switch (cond->operation) { - case ir_binop_less: - case ir_binop_greater: - case ir_binop_lequal: - case ir_binop_gequal: { - /* The expressions that we care about will either be of the form - * 'counter < limit' or 'limit < counter'. Figure out which is - * which. - */ - ir_rvalue *counter = cond->operands[0]->as_dereference_variable(); - ir_constant *limit = cond->operands[1]->as_constant(); - enum ir_expression_operation cmp = cond->operation; - - if (limit == NULL) { - counter = cond->operands[1]->as_dereference_variable(); - limit = cond->operands[0]->as_constant(); - - switch (cmp) { - case ir_binop_less: cmp = ir_binop_gequal; break; - case ir_binop_greater: cmp = ir_binop_lequal; break; - case ir_binop_lequal: cmp = ir_binop_greater; break; - case ir_binop_gequal: cmp = ir_binop_less; break; - default: assert(!"Should not get here."); - } - } - - if ((counter == NULL) || (limit == NULL)) - break; - - ir_variable *var = counter->variable_referenced(); - - ir_rvalue *init = find_initial_value(ir, var); - - foreach_list(iv_node, &ls->induction_variables) { - loop_variable *lv = (loop_variable *) iv_node; - - if (lv->var == var) { - const int iterations = calculate_iterations(init, limit, - lv->increment, - cmp); - if (iterations >= 0) { - /* If the new iteration count is lower than the previously - * believed iteration count, update the loop control values. - */ - if (iterations < max_iterations) { - ir->from = init->clone(ir, NULL); - ir->to = limit->clone(ir, NULL); - ir->increment = lv->increment->clone(ir, NULL); - ir->counter = lv->var; - ir->cmp = cmp; - - max_iterations = iterations; - } - - /* Remove the conditional break statement. The loop - * controls are now set such that the exit condition will be - * satisfied. - */ - if_stmt->remove(); - - assert(ls->num_loop_jumps > 0); - ls->num_loop_jumps--; - - this->progress = true; - } - - break; - } - } - break; - } - - default: - break; + int iterations = ls->limiting_terminator->iterations; + if (iterations == 0) { + ir->remove(); + this->progress = true; + return visit_continue; } } - /* If we have proven the one of the loop exit conditions is satisifed before - * running the loop once, remove the loop. + /* Remove the conditional break statements associated with all terminators + * that are associated with a fixed iteration count, except for the one + * associated with the limiting terminator--that one needs to stay, since + * it terminates the loop. Exception: if the loop still has a normative + * bound, then that terminates the loop, so we don't even need the limiting + * terminator. */ - if (max_iterations == 0) - ir->remove(); - else - ls->max_iterations = max_iterations; + foreach_list(node, &ls->terminators) { + loop_terminator *t = (loop_terminator *) node; + + if (t->iterations < 0) + continue; + + if (t != ls->limiting_terminator) { + t->ir->remove(); + + assert(ls->num_loop_jumps > 0); + ls->num_loop_jumps--; + + this->progress = true; + } + } return visit_continue; } diff --git a/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp b/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp index 6e5f78841..658f12196 100644 --- a/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/loop_unroll.cpp @@ -25,6 +25,8 @@ #include "loop_analysis.h" #include "ir_hierarchical_visitor.h" +namespace { + class loop_unroll_visitor : public ir_hierarchical_visitor { public: loop_unroll_visitor(loop_state *state, unsigned max_iterations) @@ -35,6 +37,10 @@ public: } virtual ir_visitor_status visit_leave(ir_loop *ir); + void simple_unroll(ir_loop *ir, int iterations); + void complex_unroll(ir_loop *ir, int iterations, + bool continue_from_then_branch); + void splice_post_if_instructions(ir_if *ir_if, exec_list *splice_dest); loop_state *state; @@ -42,6 +48,7 @@ public: unsigned max_iterations; }; +} /* anonymous namespace */ static bool is_break(ir_instruction *ir) @@ -83,144 +90,19 @@ public: }; -ir_visitor_status -loop_unroll_visitor::visit_leave(ir_loop *ir) +/** + * Unroll a loop which does not contain any jumps. For example, if the input + * is: + * + * (loop (...) ...instrs...) + * + * And the iteration count is 3, the output will be: + * + * ...instrs... ...instrs... ...instrs... + */ +void +loop_unroll_visitor::simple_unroll(ir_loop *ir, int iterations) { - loop_variable_state *const ls = this->state->get(ir); - int iterations; - - /* If we've entered a loop that hasn't been analyzed, something really, - * really bad has happened. - */ - if (ls == NULL) { - assert(ls != NULL); - return visit_continue; - } - - iterations = ls->max_iterations; - - /* Don't try to unroll loops where the number of iterations is not known - * at compile-time. - */ - if (iterations < 0) - return visit_continue; - - /* Don't try to unroll loops that have zillions of iterations either. - */ - if (iterations > (int) max_iterations) - return visit_continue; - - /* Don't try to unroll nested loops and loops with a huge body. - */ - loop_unroll_count count(&ir->body_instructions); - - if (count.fail || count.nodes * iterations > (int)max_iterations * 15) - return visit_continue; - - if (ls->num_loop_jumps > 1) - return visit_continue; - else if (ls->num_loop_jumps) { - ir_instruction *last_ir = (ir_instruction *) ir->body_instructions.get_tail(); - assert(last_ir != NULL); - - if (is_break(last_ir)) { - /* If the only loop-jump is a break at the end of the loop, the loop - * will execute exactly once. Remove the break, set the iteration - * count, and fall through to the normal unroller. - */ - last_ir->remove(); - iterations = 1; - - this->progress = true; - } else { - ir_if *ir_if = NULL; - ir_instruction *break_ir = NULL; - bool continue_from_then_branch = false; - - foreach_list(node, &ir->body_instructions) { - /* recognize loops in the form produced by ir_lower_jumps */ - ir_instruction *cur_ir = (ir_instruction *) node; - - ir_if = cur_ir->as_if(); - if (ir_if != NULL) { - /* Determine which if-statement branch, if any, ends with a - * break. The branch that did *not* have the break will get a - * temporary continue inserted in each iteration of the loop - * unroll. - * - * Note that since ls->num_loop_jumps is <= 1, it is impossible - * for both branches to end with a break. - */ - ir_instruction *ir_if_last = - (ir_instruction *) ir_if->then_instructions.get_tail(); - - if (is_break(ir_if_last)) { - continue_from_then_branch = false; - break_ir = ir_if_last; - break; - } else { - ir_if_last = - (ir_instruction *) ir_if->else_instructions.get_tail(); - - if (is_break(ir_if_last)) { - break_ir = ir_if_last; - continue_from_then_branch = true; - break; - } - } - } - } - - if (break_ir == NULL) - return visit_continue; - - /* move instructions after then if in the continue branch */ - while (!ir_if->get_next()->is_tail_sentinel()) { - ir_instruction *move_ir = (ir_instruction *) ir_if->get_next(); - - move_ir->remove(); - if (continue_from_then_branch) - ir_if->then_instructions.push_tail(move_ir); - else - ir_if->else_instructions.push_tail(move_ir); - } - - /* Remove the break from the if-statement. - */ - break_ir->remove(); - - void *const mem_ctx = ralloc_parent(ir); - ir_instruction *ir_to_replace = ir; - - for (int i = 0; i < iterations; i++) { - exec_list copy_list; - - copy_list.make_empty(); - clone_ir_list(mem_ctx, ©_list, &ir->body_instructions); - - ir_if = ((ir_instruction *) copy_list.get_tail())->as_if(); - assert(ir_if != NULL); - - ir_to_replace->insert_before(©_list); - ir_to_replace->remove(); - - /* placeholder that will be removed in the next iteration */ - ir_to_replace = - new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue); - - exec_list *const list = (continue_from_then_branch) - ? &ir_if->then_instructions : &ir_if->else_instructions; - - list->push_tail(ir_to_replace); - } - - ir_to_replace->remove(); - - this->progress = true; - return visit_continue; - } - } - void *const mem_ctx = ralloc_parent(ir); for (int i = 0; i < iterations; i++) { @@ -238,6 +120,219 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) ir->remove(); this->progress = true; +} + + +/** + * Unroll a loop whose last statement is an ir_if. If \c + * continue_from_then_branch is true, the loop is repeated only when the + * "then" branch of the if is taken; otherwise it is repeated only when the + * "else" branch of the if is taken. + * + * For example, if the input is: + * + * (loop (...) + * ...body... + * (if (cond) + * (...then_instrs...) + * (...else_instrs...))) + * + * And the iteration count is 3, and \c continue_from_then_branch is true, + * then the output will be: + * + * ...body... + * (if (cond) + * (...then_instrs... + * ...body... + * (if (cond) + * (...then_instrs... + * ...body... + * (if (cond) + * (...then_instrs...) + * (...else_instrs...))) + * (...else_instrs...))) + * (...else_instrs)) + */ +void +loop_unroll_visitor::complex_unroll(ir_loop *ir, int iterations, + bool continue_from_then_branch) +{ + void *const mem_ctx = ralloc_parent(ir); + ir_instruction *ir_to_replace = ir; + + for (int i = 0; i < iterations; i++) { + exec_list copy_list; + + copy_list.make_empty(); + clone_ir_list(mem_ctx, ©_list, &ir->body_instructions); + + ir_if *ir_if = ((ir_instruction *) copy_list.get_tail())->as_if(); + assert(ir_if != NULL); + + ir_to_replace->insert_before(©_list); + ir_to_replace->remove(); + + /* placeholder that will be removed in the next iteration */ + ir_to_replace = + new(mem_ctx) ir_loop_jump(ir_loop_jump::jump_continue); + + exec_list *const list = (continue_from_then_branch) + ? &ir_if->then_instructions : &ir_if->else_instructions; + + list->push_tail(ir_to_replace); + } + + ir_to_replace->remove(); + + this->progress = true; +} + + +/** + * Move all of the instructions which follow \c ir_if to the end of + * \c splice_dest. + * + * For example, in the code snippet: + * + * (if (cond) + * (...then_instructions... + * break) + * (...else_instructions...)) + * ...post_if_instructions... + * + * If \c ir_if points to the "if" instruction, and \c splice_dest points to + * (...else_instructions...), the code snippet is transformed into: + * + * (if (cond) + * (...then_instructions... + * break) + * (...else_instructions... + * ...post_if_instructions...)) + */ +void +loop_unroll_visitor::splice_post_if_instructions(ir_if *ir_if, + exec_list *splice_dest) +{ + while (!ir_if->get_next()->is_tail_sentinel()) { + ir_instruction *move_ir = (ir_instruction *) ir_if->get_next(); + + move_ir->remove(); + splice_dest->push_tail(move_ir); + } +} + + +ir_visitor_status +loop_unroll_visitor::visit_leave(ir_loop *ir) +{ + loop_variable_state *const ls = this->state->get(ir); + int iterations; + + /* If we've entered a loop that hasn't been analyzed, something really, + * really bad has happened. + */ + if (ls == NULL) { + assert(ls != NULL); + return visit_continue; + } + + /* Don't try to unroll loops where the number of iterations is not known + * at compile-time. + */ + if (ls->limiting_terminator == NULL) + return visit_continue; + + iterations = ls->limiting_terminator->iterations; + + /* Don't try to unroll loops that have zillions of iterations either. + */ + if (iterations > (int) max_iterations) + return visit_continue; + + /* Don't try to unroll nested loops and loops with a huge body. + */ + loop_unroll_count count(&ir->body_instructions); + + if (count.fail || count.nodes * iterations > (int)max_iterations * 15) + return visit_continue; + + /* Note: the limiting terminator contributes 1 to ls->num_loop_jumps. + * We'll be removing the limiting terminator before we unroll. + */ + assert(ls->num_loop_jumps > 0); + unsigned predicted_num_loop_jumps = ls->num_loop_jumps - 1; + + if (predicted_num_loop_jumps > 1) + return visit_continue; + + if (predicted_num_loop_jumps == 0) { + ls->limiting_terminator->ir->remove(); + simple_unroll(ir, iterations); + return visit_continue; + } + + ir_instruction *last_ir = (ir_instruction *) ir->body_instructions.get_tail(); + assert(last_ir != NULL); + + if (is_break(last_ir)) { + /* If the only loop-jump is a break at the end of the loop, the loop + * will execute exactly once. Remove the break and use the simple + * unroller with an iteration count of 1. + */ + last_ir->remove(); + + ls->limiting_terminator->ir->remove(); + simple_unroll(ir, 1); + return visit_continue; + } + + foreach_list(node, &ir->body_instructions) { + /* recognize loops in the form produced by ir_lower_jumps */ + ir_instruction *cur_ir = (ir_instruction *) node; + + /* Skip the limiting terminator, since it will go away when we + * unroll. + */ + if (cur_ir == ls->limiting_terminator->ir) + continue; + + ir_if *ir_if = cur_ir->as_if(); + if (ir_if != NULL) { + /* Determine which if-statement branch, if any, ends with a + * break. The branch that did *not* have the break will get a + * temporary continue inserted in each iteration of the loop + * unroll. + * + * Note that since ls->num_loop_jumps is <= 1, it is impossible + * for both branches to end with a break. + */ + ir_instruction *ir_if_last = + (ir_instruction *) ir_if->then_instructions.get_tail(); + + if (is_break(ir_if_last)) { + ls->limiting_terminator->ir->remove(); + splice_post_if_instructions(ir_if, &ir_if->else_instructions); + ir_if_last->remove(); + complex_unroll(ir, iterations, false); + return visit_continue; + } else { + ir_if_last = + (ir_instruction *) ir_if->else_instructions.get_tail(); + + if (is_break(ir_if_last)) { + ls->limiting_terminator->ir->remove(); + splice_post_if_instructions(ir_if, &ir_if->then_instructions); + ir_if_last->remove(); + complex_unroll(ir, iterations, true); + return visit_continue; + } + } + } + } + + /* Did not find the break statement. It must be in a complex if-nesting, + * so don't try to unroll. + */ return visit_continue; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_clip_distance.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_clip_distance.cpp index b33504d0b..fdb131296 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_clip_distance.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_clip_distance.cpp @@ -45,37 +45,63 @@ * LowerClipDistance flag in gl_shader_compiler_options to true. */ -#include "ir_hierarchical_visitor.h" +#include "glsl_symbol_table.h" +#include "ir_rvalue_visitor.h" #include "ir.h" +#include "program/prog_instruction.h" /* For WRITEMASK_* */ -class lower_clip_distance_visitor : public ir_hierarchical_visitor { +namespace { + +class lower_clip_distance_visitor : public ir_rvalue_visitor { public: - lower_clip_distance_visitor() - : progress(false), old_clip_distance_var(NULL), - new_clip_distance_var(NULL) + explicit lower_clip_distance_visitor(gl_shader_stage shader_stage) + : progress(false), old_clip_distance_1d_var(NULL), + old_clip_distance_2d_var(NULL), new_clip_distance_1d_var(NULL), + new_clip_distance_2d_var(NULL), shader_stage(shader_stage) { } virtual ir_visitor_status visit(ir_variable *); void create_indices(ir_rvalue*, ir_rvalue *&, ir_rvalue *&); - virtual ir_visitor_status visit_leave(ir_dereference_array *); + bool is_clip_distance_vec8(ir_rvalue *ir); + ir_rvalue *lower_clip_distance_vec8(ir_rvalue *ir); virtual ir_visitor_status visit_leave(ir_assignment *); void visit_new_assignment(ir_assignment *ir); virtual ir_visitor_status visit_leave(ir_call *); + virtual void handle_rvalue(ir_rvalue **rvalue); + + void fix_lhs(ir_assignment *); + bool progress; /** * Pointer to the declaration of gl_ClipDistance, if found. + * + * Note: + * + * - the 2d_var is for geometry shader input only. + * + * - since gl_ClipDistance is available in geometry shaders as both an + * input and an output, it's possible for both old_clip_distance_1d_var + * and old_clip_distance_2d_var to be non-null. */ - ir_variable *old_clip_distance_var; + ir_variable *old_clip_distance_1d_var; + ir_variable *old_clip_distance_2d_var; /** * Pointer to the newly-created gl_ClipDistanceMESA variable. */ - ir_variable *new_clip_distance_var; + ir_variable *new_clip_distance_1d_var; + ir_variable *new_clip_distance_2d_var; + + /** + * Type of shader we are compiling (e.g. MESA_SHADER_VERTEX) + */ + const gl_shader_stage shader_stage; }; +} /* anonymous namespace */ /** * Replace any declaration of gl_ClipDistance as an array of floats with a @@ -84,30 +110,61 @@ public: ir_visitor_status lower_clip_distance_visitor::visit(ir_variable *ir) { - /* No point in looking for the declaration of gl_ClipDistance if - * we've already found it. - */ - if (this->old_clip_distance_var) + if (!ir->name || strcmp(ir->name, "gl_ClipDistance") != 0) return visit_continue; + assert (ir->type->is_array()); + + if (!ir->type->element_type()->is_array()) { + /* 1D gl_ClipDistance (used for vertex and geometry output, and fragment + * input). + */ + if (this->old_clip_distance_1d_var) + return visit_continue; - if (ir->name && strcmp(ir->name, "gl_ClipDistance") == 0) { this->progress = true; - this->old_clip_distance_var = ir; - assert (ir->type->is_array()); + this->old_clip_distance_1d_var = ir; assert (ir->type->element_type() == glsl_type::float_type); unsigned new_size = (ir->type->array_size() + 3) / 4; /* Clone the old var so that we inherit all of its properties */ - this->new_clip_distance_var = ir->clone(ralloc_parent(ir), NULL); + this->new_clip_distance_1d_var = ir->clone(ralloc_parent(ir), NULL); /* And change the properties that we need to change */ - this->new_clip_distance_var->name - = ralloc_strdup(this->new_clip_distance_var, "gl_ClipDistanceMESA"); - this->new_clip_distance_var->type + this->new_clip_distance_1d_var->name + = ralloc_strdup(this->new_clip_distance_1d_var, + "gl_ClipDistanceMESA"); + this->new_clip_distance_1d_var->type = glsl_type::get_array_instance(glsl_type::vec4_type, new_size); - this->new_clip_distance_var->max_array_access = ir->max_array_access / 4; + this->new_clip_distance_1d_var->data.max_array_access + = ir->data.max_array_access / 4; - ir->replace_with(this->new_clip_distance_var); + ir->replace_with(this->new_clip_distance_1d_var); + } else { + /* 2D gl_ClipDistance (used for geometry input). */ + assert(ir->data.mode == ir_var_shader_in && + this->shader_stage == MESA_SHADER_GEOMETRY); + if (this->old_clip_distance_2d_var) + return visit_continue; + + this->progress = true; + this->old_clip_distance_2d_var = ir; + assert (ir->type->element_type()->element_type() == glsl_type::float_type); + unsigned new_size = (ir->type->element_type()->array_size() + 3) / 4; + + /* Clone the old var so that we inherit all of its properties */ + this->new_clip_distance_2d_var = ir->clone(ralloc_parent(ir), NULL); + + /* And change the properties that we need to change */ + this->new_clip_distance_2d_var->name + = ralloc_strdup(this->new_clip_distance_2d_var, "gl_ClipDistanceMESA"); + this->new_clip_distance_2d_var->type = glsl_type::get_array_instance( + glsl_type::get_array_instance(glsl_type::vec4_type, + new_size), + ir->type->array_size()); + this->new_clip_distance_2d_var->data.max_array_access + = ir->data.max_array_access / 4; + + ir->replace_with(this->new_clip_distance_2d_var); } return visit_continue; } @@ -173,78 +230,215 @@ lower_clip_distance_visitor::create_indices(ir_rvalue *old_index, /** - * Replace any expression that indexes into the gl_ClipDistance array with an - * expression that indexes into one of the vec4's in gl_ClipDistanceMESA and - * accesses the appropriate component. + * Determine whether the given rvalue describes an array of 8 floats that + * needs to be lowered to an array of 2 vec4's; that is, determine whether it + * matches one of the following patterns: + * + * - gl_ClipDistance (if gl_ClipDistance is 1D) + * - gl_ClipDistance[i] (if gl_ClipDistance is 2D) */ -ir_visitor_status -lower_clip_distance_visitor::visit_leave(ir_dereference_array *ir) +bool +lower_clip_distance_visitor::is_clip_distance_vec8(ir_rvalue *ir) { - /* If the gl_ClipDistance var hasn't been declared yet, then - * there's no way this deref can refer to it. + /* Note that geometry shaders contain gl_ClipDistance both as an input + * (which is a 2D array) and an output (which is a 1D array), so it's + * possible for both this->old_clip_distance_1d_var and + * this->old_clip_distance_2d_var to be non-NULL in the same shader. */ - if (!this->old_clip_distance_var) - return visit_continue; - ir_dereference_variable *old_var_ref = ir->array->as_dereference_variable(); - if (old_var_ref && old_var_ref->var == this->old_clip_distance_var) { - this->progress = true; - ir_rvalue *array_index; - ir_rvalue *swizzle_index; - this->create_indices(ir->array_index, array_index, swizzle_index); - void *mem_ctx = ralloc_parent(ir); - ir->array = new(mem_ctx) ir_dereference_array( - this->new_clip_distance_var, array_index); - ir->array_index = swizzle_index; + if (this->old_clip_distance_1d_var) { + ir_dereference_variable *var_ref = ir->as_dereference_variable(); + if (var_ref && var_ref->var == this->old_clip_distance_1d_var) + return true; } + if (this->old_clip_distance_2d_var) { + /* 2D clip distance is only possible as a geometry input */ + assert(this->shader_stage == MESA_SHADER_GEOMETRY); - return visit_continue; + ir_dereference_array *array_ref = ir->as_dereference_array(); + if (array_ref) { + ir_dereference_variable *var_ref = + array_ref->array->as_dereference_variable(); + if (var_ref && var_ref->var == this->old_clip_distance_2d_var) + return true; + } + } + return false; } /** - * Replace any assignment having gl_ClipDistance (undereferenced) as its LHS - * or RHS with a sequence of assignments, one for each component of the array. - * Each of these assignments is lowered to refer to gl_ClipDistanceMESA as - * appropriate. + * If the given ir satisfies is_clip_distance_vec8(), return new ir + * representing its lowered equivalent. That is, map: + * + * - gl_ClipDistance => gl_ClipDistanceMESA (if gl_ClipDistance is 1D) + * - gl_ClipDistance[i] => gl_ClipDistanceMESA[i] (if gl_ClipDistance is 2D) + * + * Otherwise return NULL. + */ +ir_rvalue * +lower_clip_distance_visitor::lower_clip_distance_vec8(ir_rvalue *ir) +{ + if (this->old_clip_distance_1d_var) { + ir_dereference_variable *var_ref = ir->as_dereference_variable(); + if (var_ref && var_ref->var == this->old_clip_distance_1d_var) { + return new(ralloc_parent(ir)) + ir_dereference_variable(this->new_clip_distance_1d_var); + } + } + if (this->old_clip_distance_2d_var) { + /* 2D clip distance is only possible as a geometry input */ + assert(this->shader_stage == MESA_SHADER_GEOMETRY); + + ir_dereference_array *array_ref = ir->as_dereference_array(); + if (array_ref) { + ir_dereference_variable *var_ref = + array_ref->array->as_dereference_variable(); + if (var_ref && var_ref->var == this->old_clip_distance_2d_var) { + return new(ralloc_parent(ir)) + ir_dereference_array(this->new_clip_distance_2d_var, + array_ref->array_index); + } + } + } + return NULL; +} + + +void +lower_clip_distance_visitor::handle_rvalue(ir_rvalue **rv) +{ + if (*rv == NULL) + return; + + ir_dereference_array *const array_deref = (*rv)->as_dereference_array(); + if (array_deref == NULL) + return; + + /* Replace any expression that indexes one of the floats in gl_ClipDistance + * with an expression that indexes into one of the vec4's in + * gl_ClipDistanceMESA and accesses the appropriate component. + */ + ir_rvalue *lowered_vec8 = + this->lower_clip_distance_vec8(array_deref->array); + if (lowered_vec8 != NULL) { + this->progress = true; + ir_rvalue *array_index; + ir_rvalue *swizzle_index; + this->create_indices(array_deref->array_index, array_index, swizzle_index); + void *mem_ctx = ralloc_parent(array_deref); + + ir_dereference_array *const new_array_deref = + new(mem_ctx) ir_dereference_array(lowered_vec8, array_index); + + ir_expression *const expr = + new(mem_ctx) ir_expression(ir_binop_vector_extract, + new_array_deref, + swizzle_index); + + *rv = expr; + } +} + +void +lower_clip_distance_visitor::fix_lhs(ir_assignment *ir) +{ + if (ir->lhs->ir_type == ir_type_expression) { + void *mem_ctx = ralloc_parent(ir); + ir_expression *const expr = (ir_expression *) ir->lhs; + + /* The expression must be of the form: + * + * (vector_extract gl_ClipDistanceMESA[i], j). + */ + assert(expr->operation == ir_binop_vector_extract); + assert(expr->operands[0]->ir_type == ir_type_dereference_array); + assert(expr->operands[0]->type == glsl_type::vec4_type); + + ir_dereference *const new_lhs = (ir_dereference *) expr->operands[0]; + ir->rhs = new(mem_ctx) ir_expression(ir_triop_vector_insert, + glsl_type::vec4_type, + new_lhs->clone(mem_ctx, NULL), + ir->rhs, + expr->operands[1]); + ir->set_lhs(new_lhs); + ir->write_mask = WRITEMASK_XYZW; + } +} + +/** + * Replace any assignment having the 1D gl_ClipDistance (undereferenced) as + * its LHS or RHS with a sequence of assignments, one for each component of + * the array. Each of these assignments is lowered to refer to + * gl_ClipDistanceMESA as appropriate. + * + * We need to do a similar replacement for 2D gl_ClipDistance, however since + * it's an input, the only case we need to address is where a 1D slice of it + * is the entire RHS of an assignment, e.g.: + * + * foo = gl_in[i].gl_ClipDistance */ ir_visitor_status lower_clip_distance_visitor::visit_leave(ir_assignment *ir) { - ir_dereference_variable *lhs_var = ir->lhs->as_dereference_variable(); - ir_dereference_variable *rhs_var = ir->rhs->as_dereference_variable(); - if ((lhs_var && lhs_var->var == this->old_clip_distance_var) - || (rhs_var && rhs_var->var == this->old_clip_distance_var)) { - /* LHS or RHS of the assignment is the entire gl_ClipDistance array. - * Since we are reshaping gl_ClipDistance from an array of floats to an - * array of vec4's, this isn't going to work as a bulk assignment - * anymore, so unroll it to element-by-element assignments and lower - * each of them. + /* First invoke the base class visitor. This causes handle_rvalue() to be + * called on ir->rhs and ir->condition. + */ + ir_rvalue_visitor::visit_leave(ir); + + if (this->is_clip_distance_vec8(ir->lhs) || + this->is_clip_distance_vec8(ir->rhs)) { + /* LHS or RHS of the assignment is the entire 1D gl_ClipDistance array + * (or a 1D slice of a 2D gl_ClipDistance input array). Since we are + * reshaping gl_ClipDistance from an array of floats to an array of + * vec4's, this isn't going to work as a bulk assignment anymore, so + * unroll it to element-by-element assignments and lower each of them. * * Note: to unroll into element-by-element assignments, we need to make - * clones of the LHS and RHS. This is only safe if the LHS and RHS are - * side-effect free. Fortunately, we know that they are, because the - * only kind of rvalue that can have side effects is an ir_call, and - * ir_calls only appear (a) as a statement on their own, or (b) as the - * RHS of an assignment that stores the result of the call in a - * temporary variable. + * clones of the LHS and RHS. This is safe because expressions and + * l-values are side-effect free. */ void *ctx = ralloc_parent(ir); - int array_size = this->old_clip_distance_var->type->array_size(); + int array_size = ir->lhs->type->array_size(); for (int i = 0; i < array_size; ++i) { ir_dereference_array *new_lhs = new(ctx) ir_dereference_array( ir->lhs->clone(ctx, NULL), new(ctx) ir_constant(i)); - new_lhs->accept(this); ir_dereference_array *new_rhs = new(ctx) ir_dereference_array( ir->rhs->clone(ctx, NULL), new(ctx) ir_constant(i)); - new_rhs->accept(this); - this->base_ir->insert_before( - new(ctx) ir_assignment(new_lhs, new_rhs)); + this->handle_rvalue((ir_rvalue **) &new_rhs); + + /* Handle the LHS after creating the new assignment. This must + * happen in this order because handle_rvalue may replace the old LHS + * with an ir_expression of ir_binop_vector_extract. Since this is + * not a valide l-value, this will cause an assertion in the + * ir_assignment constructor to fail. + * + * If this occurs, replace the mangled LHS with a dereference of the + * vector, and replace the RHS with an ir_triop_vector_insert. + */ + ir_assignment *const assign = new(ctx) ir_assignment(new_lhs, new_rhs); + this->handle_rvalue((ir_rvalue **) &assign->lhs); + this->fix_lhs(assign); + + this->base_ir->insert_before(assign); } ir->remove(); + + return visit_continue; } - return visit_continue; + /* Handle the LHS as if it were an r-value. Normally + * rvalue_visit(ir_assignment *) only visits the RHS, but we need to lower + * expressions in the LHS as well. + * + * This may cause the LHS to get replaced with an ir_expression of + * ir_binop_vector_extract. If this occurs, replace it with a dereference + * of the vector, and replace the RHS with an ir_triop_vector_insert. + */ + handle_rvalue((ir_rvalue **)&ir->lhs); + this->fix_lhs(ir); + + return rvalue_visit(ir); } @@ -265,11 +459,17 @@ lower_clip_distance_visitor::visit_new_assignment(ir_assignment *ir) /** - * If gl_ClipDistance appears as an argument in an ir_call expression, replace - * it with a temporary variable, and make sure the ir_call is preceded and/or - * followed by assignments that copy the contents of the temporary variable to - * and/or from gl_ClipDistance. Each of these assignments is then lowered to - * refer to gl_ClipDistanceMESA. + * If a 1D gl_ClipDistance variable appears as an argument in an ir_call + * expression, replace it with a temporary variable, and make sure the ir_call + * is preceded and/or followed by assignments that copy the contents of the + * temporary variable to and/or from gl_ClipDistance. Each of these + * assignments is then lowered to refer to gl_ClipDistanceMESA. + * + * We need to do a similar replacement for 2D gl_ClipDistance, however since + * it's an input, the only case we need to address is where a 1D slice of it + * is passed as an "in" parameter to an ir_call, e.g.: + * + * foo(gl_in[i].gl_ClipDistance) */ ir_visitor_status lower_clip_distance_visitor::visit_leave(ir_call *ir) @@ -288,20 +488,20 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir) formal_param_node = formal_param_node->next; actual_param_node = actual_param_node->next; - ir_dereference_variable *deref = actual_param->as_dereference_variable(); - if (deref && deref->var == this->old_clip_distance_var) { - /* User is trying to pass the whole gl_ClipDistance array to a - * function call. Since we are reshaping gl_ClipDistance from an - * array of floats to an array of vec4's, this isn't going to work - * anymore, so use a temporary array instead. + if (this->is_clip_distance_vec8(actual_param)) { + /* User is trying to pass the whole 1D gl_ClipDistance array (or a 1D + * slice of a 2D gl_ClipDistance array) to a function call. Since we + * are reshaping gl_ClipDistance from an array of floats to an array + * of vec4's, this isn't going to work anymore, so use a temporary + * array instead. */ ir_variable *temp_clip_distance = new(ctx) ir_variable( actual_param->type, "temp_clip_distance", ir_var_temporary, actual_param->get_precision()); this->base_ir->insert_before(temp_clip_distance); actual_param->replace_with( new(ctx) ir_dereference_variable(temp_clip_distance)); - if (formal_param->mode == ir_var_in - || formal_param->mode == ir_var_inout) { + if (formal_param->data.mode == ir_var_function_in + || formal_param->data.mode == ir_var_function_inout) { /* Copy from gl_ClipDistance to the temporary before the call. * Since we are going to insert this copy before the current * instruction, we need to visit it afterwards to make sure it @@ -309,19 +509,19 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir) */ ir_assignment *new_assignment = new(ctx) ir_assignment( new(ctx) ir_dereference_variable(temp_clip_distance), - new(ctx) ir_dereference_variable(old_clip_distance_var)); + actual_param->clone(ctx, NULL)); this->base_ir->insert_before(new_assignment); this->visit_new_assignment(new_assignment); } - if (formal_param->mode == ir_var_out - || formal_param->mode == ir_var_inout) { + if (formal_param->data.mode == ir_var_function_out + || formal_param->data.mode == ir_var_function_inout) { /* Copy from the temporary to gl_ClipDistance after the call. * Since visit_list_elements() has already decided which * instruction it's going to visit next, we need to visit * afterwards to make sure it gets lowered. */ ir_assignment *new_assignment = new(ctx) ir_assignment( - new(ctx) ir_dereference_variable(old_clip_distance_var), + actual_param->clone(ctx, NULL), new(ctx) ir_dereference_variable(temp_clip_distance)); this->base_ir->insert_after(new_assignment); this->visit_new_assignment(new_assignment); @@ -329,16 +529,21 @@ lower_clip_distance_visitor::visit_leave(ir_call *ir) } } - return visit_continue; + return rvalue_visit(ir); } bool -lower_clip_distance(exec_list *instructions) +lower_clip_distance(gl_shader *shader) { - lower_clip_distance_visitor v; + lower_clip_distance_visitor v(shader->Stage); - visit_list_elements(&v, instructions); + visit_list_elements(&v, shader->ir); + + if (v.new_clip_distance_1d_var) + shader->symbols->add_variable(v.new_clip_distance_1d_var); + if (v.new_clip_distance_2d_var) + shader->symbols->add_variable(v.new_clip_distance_2d_var); return v.progress; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp index 55ae0b182..59fe72724 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_discard.cpp @@ -108,6 +108,8 @@ #include "glsl_types.h" #include "ir.h" +namespace { + class lower_discard_visitor : public ir_hierarchical_visitor { public: lower_discard_visitor() @@ -120,6 +122,7 @@ public: bool progress; }; +} /* anonymous namespace */ bool lower_discard(exec_list *instructions) diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_discard_flow.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_discard_flow.cpp index cf3c4f8fd..bee53d29c 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_discard_flow.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_discard_flow.cpp @@ -48,6 +48,8 @@ #include "ir.h" #include "program/hash_table.h" +namespace { + class lower_discard_flow_visitor : public ir_hierarchical_visitor { public: lower_discard_flow_visitor(ir_variable *discarded) @@ -71,6 +73,8 @@ public: void *mem_ctx; }; +} /* anonymous namespace */ + ir_visitor_status lower_discard_flow_visitor::visit_enter(ir_loop_jump *ir) { diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp index b2dd5294b..b374b2328 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_if_to_cond_assign.cpp @@ -49,6 +49,8 @@ #include "ir.h" #include "program/hash_table.h" +namespace { + class ir_if_to_cond_assign_visitor : public ir_hierarchical_visitor { public: ir_if_to_cond_assign_visitor(unsigned max_depth) @@ -76,6 +78,8 @@ public: struct hash_table *condition_variables; }; +} /* anonymous namespace */ + bool lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth) { @@ -174,12 +178,12 @@ ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir) ir_assignment *assign; /* Check that both blocks don't contain anything we can't support. */ - foreach_iter(exec_list_iterator, then_iter, ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *)then_iter.get(); + foreach_list(n, &ir->then_instructions) { + ir_instruction *then_ir = (ir_instruction *) n; visit_tree(then_ir, check_control_flow, &found_control_flow); } - foreach_iter(exec_list_iterator, else_iter, ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *)else_iter.get(); + foreach_list(n, &ir->else_instructions) { + ir_instruction *else_ir = (ir_instruction *) n; visit_tree(else_ir, check_control_flow, &found_control_flow); } if (found_control_flow) diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp index 9541587bb..8d8088520 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_instructions.cpp @@ -37,6 +37,9 @@ * - POW_TO_EXP2 * - LOG_TO_LOG2 * - MOD_TO_FRACT + * - LDEXP_TO_ARITH + * - LRP_TO_ARITH + * - BITFIELD_INSERT_TO_BFM_BFI * * SUB_TO_ADD_NEG: * --------------- @@ -79,13 +82,35 @@ * Many GPUs don't have a MOD instruction (945 and 965 included), and * if we have to break it down like this anyway, it gives an * opportunity to do things like constant fold the (1.0 / op1) easily. + * + * LDEXP_TO_ARITH: + * ------------- + * Converts ir_binop_ldexp to arithmetic and bit operations. + * + * LRP_TO_ARITH: + * ------------- + * Converts ir_triop_lrp to (op0 * (1.0f - op2)) + (op1 * op2). + * + * BITFIELD_INSERT_TO_BFM_BFI: + * --------------------------- + * Breaks ir_quadop_bitfield_insert into ir_binop_bfm (bitfield mask) and + * ir_triop_bfi (bitfield insert). + * + * Many GPUs implement the bitfieldInsert() built-in from ARB_gpu_shader_5 + * with a pair of instructions. + * */ #include "main/core.h" /* for M_LOG2E */ #include "glsl_types.h" #include "ir.h" +#include "ir_builder.h" #include "ir_optimization.h" +using namespace ir_builder; + +namespace { + class lower_instructions_visitor : public ir_hierarchical_visitor { public: lower_instructions_visitor(unsigned lower) @@ -105,8 +130,13 @@ private: void exp_to_exp2(ir_expression *); void pow_to_exp2(ir_expression *); void log_to_log2(ir_expression *); + void lrp_to_arith(ir_expression *); + void bitfield_insert_to_bfm_bfi(ir_expression *); + void ldexp_to_arith(ir_expression *); }; +} /* anonymous namespace */ + /** * Determine if a particular type of lowering should occur */ @@ -268,6 +298,172 @@ lower_instructions_visitor::mod_to_fract(ir_expression *ir) this->progress = true; } +void +lower_instructions_visitor::lrp_to_arith(ir_expression *ir) +{ + /* (lrp x y a) -> x*(1-a) + y*a */ + + /* Save op2 */ + ir_variable *temp = new(ir) ir_variable(ir->operands[2]->type, "lrp_factor", + ir_var_temporary, precision_from_ir(ir->operands[2])); + this->base_ir->insert_before(temp); + this->base_ir->insert_before(assign(temp, ir->operands[2])); + + ir_constant *one = new(ir) ir_constant(1.0f); + + ir->operation = ir_binop_add; + ir->operands[0] = mul(ir->operands[0], sub(one, temp)); + ir->operands[1] = mul(ir->operands[1], temp); + ir->operands[2] = NULL; + + this->progress = true; +} + +void +lower_instructions_visitor::bitfield_insert_to_bfm_bfi(ir_expression *ir) +{ + /* Translates + * ir_quadop_bitfield_insert base insert offset bits + * into + * ir_triop_bfi (ir_binop_bfm bits offset) insert base + */ + + ir_rvalue *base_expr = ir->operands[0]; + + ir->operation = ir_triop_bfi; + ir->operands[0] = new(ir) ir_expression(ir_binop_bfm, + ir->type->get_base_type(), + ir->operands[3], + ir->operands[2]); + /* ir->operands[1] is still the value to insert. */ + ir->operands[2] = base_expr; + ir->operands[3] = NULL; + + this->progress = true; +} + +void +lower_instructions_visitor::ldexp_to_arith(ir_expression *ir) +{ + /* Translates + * ir_binop_ldexp x exp + * into + * + * extracted_biased_exp = rshift(bitcast_f2i(abs(x)), exp_shift); + * resulting_biased_exp = extracted_biased_exp + exp; + * + * if (resulting_biased_exp < 1) { + * return copysign(0.0, x); + * } + * + * return bitcast_u2f((bitcast_f2u(x) & sign_mantissa_mask) | + * lshift(i2u(resulting_biased_exp), exp_shift)); + * + * which we can't actually implement as such, since the GLSL IR doesn't + * have vectorized if-statements. We actually implement it without branches + * using conditional-select: + * + * extracted_biased_exp = rshift(bitcast_f2i(abs(x)), exp_shift); + * resulting_biased_exp = extracted_biased_exp + exp; + * + * is_not_zero_or_underflow = gequal(resulting_biased_exp, 1); + * x = csel(is_not_zero_or_underflow, x, copysign(0.0f, x)); + * resulting_biased_exp = csel(is_not_zero_or_underflow, + * resulting_biased_exp, 0); + * + * return bitcast_u2f((bitcast_f2u(x) & sign_mantissa_mask) | + * lshift(i2u(resulting_biased_exp), exp_shift)); + */ + + const unsigned vec_elem = ir->type->vector_elements; + + /* Types */ + const glsl_type *ivec = glsl_type::get_instance(GLSL_TYPE_INT, vec_elem, 1); + const glsl_type *bvec = glsl_type::get_instance(GLSL_TYPE_BOOL, vec_elem, 1); + + /* Constants */ + ir_constant *zeroi = ir_constant::zero(ir, ivec); + + ir_constant *sign_mask = new(ir) ir_constant(0x80000000u, vec_elem); + + ir_constant *exp_shift = new(ir) ir_constant(23u, vec_elem); + ir_constant *exp_width = new(ir) ir_constant(8u, vec_elem); + + /* Temporary variables */ + glsl_precision prec = ir->get_precision(); + ir_variable *x = new(ir) ir_variable(ir->type, "x", ir_var_temporary, prec); + ir_variable *exp = new(ir) ir_variable(ivec, "exp", ir_var_temporary, prec); + + ir_variable *zero_sign_x = new(ir) ir_variable(ir->type, "zero_sign_x", + ir_var_temporary, prec); + + ir_variable *extracted_biased_exp = + new(ir) ir_variable(ivec, "extracted_biased_exp", ir_var_temporary, prec); + ir_variable *resulting_biased_exp = + new(ir) ir_variable(ivec, "resulting_biased_exp", ir_var_temporary, prec); + + ir_variable *is_not_zero_or_underflow = + new(ir) ir_variable(bvec, "is_not_zero_or_underflow", ir_var_temporary, prec); + + ir_instruction &i = *base_ir; + + /* Copy and arguments. */ + i.insert_before(x); + i.insert_before(assign(x, ir->operands[0])); + i.insert_before(exp); + i.insert_before(assign(exp, ir->operands[1])); + + /* Extract the biased exponent from . */ + i.insert_before(extracted_biased_exp); + i.insert_before(assign(extracted_biased_exp, + rshift(bitcast_f2i(abs(x)), exp_shift))); + + i.insert_before(resulting_biased_exp); + i.insert_before(assign(resulting_biased_exp, + add(extracted_biased_exp, exp))); + + /* Test if result is ±0.0, subnormal, or underflow by checking if the + * resulting biased exponent would be less than 0x1. If so, the result is + * 0.0 with the sign of x. (Actually, invert the conditions so that + * immediate values are the second arguments, which is better for i965) + */ + i.insert_before(zero_sign_x); + i.insert_before(assign(zero_sign_x, + bitcast_u2f(bit_and(bitcast_f2u(x), sign_mask)))); + + i.insert_before(is_not_zero_or_underflow); + i.insert_before(assign(is_not_zero_or_underflow, + gequal(resulting_biased_exp, + new(ir) ir_constant(0x1, vec_elem)))); + i.insert_before(assign(x, csel(is_not_zero_or_underflow, + x, zero_sign_x))); + i.insert_before(assign(resulting_biased_exp, + csel(is_not_zero_or_underflow, + resulting_biased_exp, zeroi))); + + /* We could test for overflows by checking if the resulting biased exponent + * would be greater than 0xFE. Turns out we don't need to because the GLSL + * spec says: + * + * "If this product is too large to be represented in the + * floating-point type, the result is undefined." + */ + + ir_constant *exp_shift_clone = exp_shift->clone(ir, NULL); + ir->operation = ir_unop_bitcast_i2f; + ir->operands[0] = bitfield_insert(bitcast_f2i(x), resulting_biased_exp, + exp_shift_clone, exp_width); + ir->operands[1] = NULL; + + /* Don't generate new IR that would need to be lowered in an additional + * pass. + */ + if (lowering(BITFIELD_INSERT_TO_BFM_BFI)) + bitfield_insert_to_bfm_bfi(ir->operands[0]->as_expression()); + + this->progress = true; +} + ir_visitor_status lower_instructions_visitor::visit_leave(ir_expression *ir) { @@ -304,6 +500,21 @@ lower_instructions_visitor::visit_leave(ir_expression *ir) pow_to_exp2(ir); break; + case ir_triop_lrp: + if (lowering(LRP_TO_ARITH)) + lrp_to_arith(ir); + break; + + case ir_quadop_bitfield_insert: + if (lowering(BITFIELD_INSERT_TO_BFM_BFI)) + bitfield_insert_to_bfm_bfi(ir); + break; + + case ir_binop_ldexp: + if (lowering(LDEXP_TO_ARITH)) + ldexp_to_arith(ir); + break; + default: return visit_continue; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp index e1ef1fd14..b871ca0f4 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_jumps.cpp @@ -133,6 +133,8 @@ enum jump_strength strength_return }; +namespace { + struct block_record { /* minimum jump strength (of lowered IR, not pre-lowering IR) @@ -279,8 +281,13 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor { bool lower_main_return; ir_lower_jumps_visitor() + : progress(false), + pull_out_jumps(false), + lower_continue(false), + lower_break(false), + lower_sub_return(false), + lower_main_return(false) { - this->progress = false; } void truncate_after_instruction(exec_node *ir) @@ -444,7 +451,12 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor { virtual void visit(class ir_precision_statement * ir) { /* Nothing needs to be done. */ - } + } + + virtual void visit(class ir_typedecl_statement * ir) + { + /* Nothing needs to be done. */ + } enum jump_strength get_jump_strength(ir_instruction* ir) { @@ -997,6 +1009,8 @@ lower_continue: } }; +} /* anonymous namespace */ + bool do_lower_jumps(exec_list *instructions, bool pull_out_jumps, bool lower_sub_return, bool lower_main_return, bool lower_continue, bool lower_break) { diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_mat_op_to_vec.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_mat_op_to_vec.cpp index 5d5de075d..d69ac0498 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_mat_op_to_vec.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_mat_op_to_vec.cpp @@ -35,6 +35,8 @@ #include "ir_expression_flattening.h" #include "glsl_types.h" +namespace { + class ir_mat_op_to_vec_visitor : public ir_hierarchical_visitor { public: ir_mat_op_to_vec_visitor() @@ -63,6 +65,8 @@ public: bool made_progress; }; +} /* anonymous namespace */ + static bool mat_op_to_vec_predicate(ir_instruction *ir) { @@ -122,7 +126,7 @@ ir_mat_op_to_vec_visitor::do_mul_mat_mat(ir_dereference *result, ir_dereference *a, ir_dereference *b) { - int b_col, i; + unsigned b_col, i; ir_assignment *assign; ir_expression *expr; @@ -154,7 +158,7 @@ ir_mat_op_to_vec_visitor::do_mul_mat_vec(ir_dereference *result, ir_dereference *a, ir_dereference *b) { - int i; + unsigned i; ir_assignment *assign; ir_expression *expr; @@ -183,7 +187,7 @@ ir_mat_op_to_vec_visitor::do_mul_vec_mat(ir_dereference *result, ir_dereference *a, ir_dereference *b) { - int i; + unsigned i; for (i = 0; i < (int)b->type->matrix_columns; i++) { ir_rvalue *column_result; @@ -208,7 +212,7 @@ ir_mat_op_to_vec_visitor::do_mul_mat_scalar(ir_dereference *result, ir_dereference *a, ir_dereference *b) { - int i; + unsigned i; for (i = 0; i < (int)a->type->matrix_columns; i++) { ir_expression *column_expr; diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp new file mode 100644 index 000000000..85238c13d --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/lower_named_interface_blocks.cpp @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file lower_named_interface_blocks.cpp + * + * This lowering pass converts all interface blocks with instance names + * into interface blocks without an instance name. + * + * For example, the following shader: + * + * out block { + * float block_var; + * } inst_name; + * + * main() + * { + * inst_name.block_var = 0.0; + * } + * + * Is rewritten to: + * + * out block { + * float block_var; + * }; + * + * main() + * { + * block_var = 0.0; + * } + * + * This takes place after the shader code has already been verified with + * the interface name in place. + * + * The linking phase will use the interface block name rather than the + * interface's instance name when linking interfaces. + * + * This modification to the ir allows our currently existing dead code + * elimination to work with interface blocks without changes. + */ + +#include "glsl_symbol_table.h" +#include "ir.h" +#include "ir_optimization.h" +#include "ir_rvalue_visitor.h" +#include "program/hash_table.h" + +namespace { + +class flatten_named_interface_blocks_declarations : public ir_rvalue_visitor +{ +public: + void * const mem_ctx; + hash_table *interface_namespace; + + flatten_named_interface_blocks_declarations(void *mem_ctx) + : mem_ctx(mem_ctx), + interface_namespace(NULL) + { + } + + void run(exec_list *instructions); + + virtual ir_visitor_status visit_leave(ir_assignment *); + virtual void handle_rvalue(ir_rvalue **rvalue); +}; + +} /* anonymous namespace */ + +void +flatten_named_interface_blocks_declarations::run(exec_list *instructions) +{ + interface_namespace = hash_table_ctor(0, hash_table_string_hash, + hash_table_string_compare); + + /* First pass: adjust instance block variables with an instance name + * to not have an instance name. + * + * The interface block variables are stored in the interface_namespace + * hash table so they can be used in the second pass. + */ + foreach_list_safe(node, instructions) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (!var || !var->is_interface_instance()) + continue; + + /* It should be possible to handle uniforms during this pass, + * but, this will require changes to the other uniform block + * support code. + */ + if (var->data.mode == ir_var_uniform) + continue; + + const glsl_type * iface_t = var->type; + const glsl_type * array_t = NULL; + exec_node *insert_pos = var; + + if (iface_t->is_array()) { + array_t = iface_t; + iface_t = array_t->fields.array; + } + + assert (iface_t->is_interface()); + + for (unsigned i = 0; i < iface_t->length; i++) { + const char * field_name = iface_t->fields.structure[i].name; + char *iface_field_name = + ralloc_asprintf(mem_ctx, "%s.%s", + iface_t->name, field_name); + + ir_variable *found_var = + (ir_variable *) hash_table_find(interface_namespace, + iface_field_name); + if (!found_var) { + ir_variable *new_var; + char *var_name = + ralloc_strdup(mem_ctx, iface_t->fields.structure[i].name); + if (array_t == NULL) { + new_var = + new(mem_ctx) ir_variable(iface_t->fields.structure[i].type, + var_name, + (ir_variable_mode) var->data.mode, + iface_t->fields.structure[i].precision); + new_var->data.from_named_ifc_block_nonarray = 1; + } else { + const glsl_type *new_array_type = + glsl_type::get_array_instance( + iface_t->fields.structure[i].type, + array_t->length); + new_var = + new(mem_ctx) ir_variable(new_array_type, + var_name, + (ir_variable_mode) var->data.mode, + iface_t->fields.structure[i].precision); + new_var->data.from_named_ifc_block_array = 1; + } + new_var->data.location = iface_t->fields.structure[i].location; + new_var->data.explicit_location = (new_var->data.location >= 0); + new_var->data.interpolation = + iface_t->fields.structure[i].interpolation; + new_var->data.centroid = iface_t->fields.structure[i].centroid; + new_var->data.sample = iface_t->fields.structure[i].sample; + + new_var->init_interface_type(iface_t); + hash_table_insert(interface_namespace, new_var, + iface_field_name); + insert_pos->insert_after(new_var); + insert_pos = new_var; + } + } + var->remove(); + } + + /* Second pass: visit all ir_dereference_record instances, and if they + * reference an interface block, then flatten the refererence out. + */ + visit_list_elements(this, instructions); + hash_table_dtor(interface_namespace); + interface_namespace = NULL; +} + +ir_visitor_status +flatten_named_interface_blocks_declarations::visit_leave(ir_assignment *ir) +{ + ir_dereference_record *lhs_rec = ir->lhs->as_dereference_record(); + if (lhs_rec) { + ir_rvalue *lhs_rec_tmp = lhs_rec; + handle_rvalue(&lhs_rec_tmp); + if (lhs_rec_tmp != lhs_rec) { + ir->set_lhs(lhs_rec_tmp); + } + } + return rvalue_visit(ir); +} + +void +flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue) +{ + if (*rvalue == NULL) + return; + + ir_dereference_record *ir = (*rvalue)->as_dereference_record(); + if (ir == NULL) + return; + + ir_variable *var = ir->variable_referenced(); + if (var == NULL) + return; + + if (!var->is_interface_instance()) + return; + + /* It should be possible to handle uniforms during this pass, + * but, this will require changes to the other uniform block + * support code. + */ + if (var->data.mode == ir_var_uniform) + return; + + if (var->get_interface_type() != NULL) { + char *iface_field_name = + ralloc_asprintf(mem_ctx, "%s.%s", var->get_interface_type()->name, + ir->field); + /* Find the variable in the set of flattened interface blocks */ + ir_variable *found_var = + (ir_variable *) hash_table_find(interface_namespace, + iface_field_name); + assert(found_var); + + ir_dereference_variable *deref_var = + new(mem_ctx) ir_dereference_variable(found_var); + + ir_dereference_array *deref_array = + ir->record->as_dereference_array(); + if (deref_array != NULL) { + *rvalue = + new(mem_ctx) ir_dereference_array(deref_var, + deref_array->array_index); + } else { + *rvalue = deref_var; + } + } +} + +void +lower_named_interface_blocks(void *mem_ctx, gl_shader *shader) +{ + flatten_named_interface_blocks_declarations v_decl(mem_ctx); + v_decl.run(shader->ir); +} + diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp index db93c6d36..1e39c7282 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_output_reads.cpp @@ -37,11 +37,13 @@ * main() function to copy the final values to the actual shader outputs. */ +namespace { + class output_read_remover : public ir_hierarchical_visitor { protected: /** * A hash table mapping from the original ir_variable shader outputs - * (ir_var_out mode) to the new temporaries to be used instead. + * (ir_var_shader_out mode) to the new temporaries to be used instead. */ hash_table *replacements; @@ -50,10 +52,13 @@ public: output_read_remover(); ~output_read_remover(); virtual ir_visitor_status visit(class ir_dereference_variable *); + virtual ir_visitor_status visit(class ir_emit_vertex *); virtual ir_visitor_status visit_leave(class ir_return *); virtual ir_visitor_status visit_leave(class ir_function_signature *); }; +} /* anonymous namespace */ + /** * Hash function for the output variables - computes the hash of the name. * NOTE: We're using the name string to ensure that the hash doesn't depend @@ -86,7 +91,7 @@ output_read_remover::~output_read_remover() ir_visitor_status output_read_remover::visit(ir_dereference_variable *ir) { - if (ir->var->mode != ir_var_out) + if (ir->var->data.mode != ir_var_shader_out) return visit_continue; ir_variable *temp = (ir_variable *) hash_table_find(replacements, ir->var); @@ -95,8 +100,9 @@ output_read_remover::visit(ir_dereference_variable *ir) if (temp == NULL) { void *var_ctx = ralloc_parent(ir->var); temp = new(var_ctx) ir_variable(ir->var->type, ir->var->name, - ir_var_temporary, (glsl_precision)ir->var->precision); + ir_var_temporary, (glsl_precision)ir->var->data.precision); hash_table_insert(replacements, temp, ir->var); + ir->var->insert_after(temp); } /* Update the dereference to use the temporary */ @@ -116,7 +122,9 @@ copy(void *ctx, ir_variable *output, ir_variable *temp) return new(ctx) ir_assignment(lhs, rhs); } -/** Insert a copy-back assignment before a "return" statement */ +/** Insert a copy-back assignment before a "return" statement or a call to + * EmitVertex(). + */ static void emit_return_copy(const void *key, void *data, void *closure) { @@ -139,6 +147,14 @@ output_read_remover::visit_leave(ir_return *ir) return visit_continue; } +ir_visitor_status +output_read_remover::visit(ir_emit_vertex *ir) +{ + hash_table_call_foreach(replacements, emit_return_copy, ir); + hash_table_clear(replacements); + return visit_continue; +} + ir_visitor_status output_read_remover::visit_leave(ir_function_signature *sig) { diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp new file mode 100644 index 000000000..22c6d9462 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/lower_packed_varyings.cpp @@ -0,0 +1,688 @@ +/* + * Copyright © 2011 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file lower_varyings_to_packed.cpp + * + * This lowering pass generates GLSL code that manually packs varyings into + * vec4 slots, for the benefit of back-ends that don't support packed varyings + * natively. + * + * For example, the following shader: + * + * out mat3x2 foo; // location=4, location_frac=0 + * out vec3 bar[2]; // location=5, location_frac=2 + * + * main() + * { + * ... + * } + * + * Is rewritten to: + * + * mat3x2 foo; + * vec3 bar[2]; + * out vec4 packed4; // location=4, location_frac=0 + * out vec4 packed5; // location=5, location_frac=0 + * out vec4 packed6; // location=6, location_frac=0 + * + * main() + * { + * ... + * packed4.xy = foo[0]; + * packed4.zw = foo[1]; + * packed5.xy = foo[2]; + * packed5.zw = bar[0].xy; + * packed6.x = bar[0].z; + * packed6.yzw = bar[1]; + * } + * + * This lowering pass properly handles "double parking" of a varying vector + * across two varying slots. For example, in the code above, two of the + * components of bar[0] are stored in packed5, and the remaining component is + * stored in packed6. + * + * Note that in theory, the extra instructions may cause some loss of + * performance. However, hopefully in most cases the performance loss will + * either be absorbed by a later optimization pass, or it will be offset by + * memory bandwidth savings (because fewer varyings are used). + * + * This lowering pass also packs flat floats, ints, and uints together, by + * using ivec4 as the base type of flat "varyings", and using appropriate + * casts to convert floats and uints into ints. + * + * This lowering pass also handles varyings whose type is a struct or an array + * of struct. Structs are packed in order and with no gaps, so there may be a + * performance penalty due to structure elements being double-parked. + * + * Lowering of geometry shader inputs is slightly more complex, since geometry + * inputs are always arrays, so we need to lower arrays to arrays. For + * example, the following input: + * + * in struct Foo { + * float f; + * vec3 v; + * vec2 a[2]; + * } arr[3]; // location=4, location_frac=0 + * + * Would get lowered like this if it occurred in a fragment shader: + * + * struct Foo { + * float f; + * vec3 v; + * vec2 a[2]; + * } arr[3]; + * in vec4 packed4; // location=4, location_frac=0 + * in vec4 packed5; // location=5, location_frac=0 + * in vec4 packed6; // location=6, location_frac=0 + * in vec4 packed7; // location=7, location_frac=0 + * in vec4 packed8; // location=8, location_frac=0 + * in vec4 packed9; // location=9, location_frac=0 + * + * main() + * { + * arr[0].f = packed4.x; + * arr[0].v = packed4.yzw; + * arr[0].a[0] = packed5.xy; + * arr[0].a[1] = packed5.zw; + * arr[1].f = packed6.x; + * arr[1].v = packed6.yzw; + * arr[1].a[0] = packed7.xy; + * arr[1].a[1] = packed7.zw; + * arr[2].f = packed8.x; + * arr[2].v = packed8.yzw; + * arr[2].a[0] = packed9.xy; + * arr[2].a[1] = packed9.zw; + * ... + * } + * + * But it would get lowered like this if it occurred in a geometry shader: + * + * struct Foo { + * float f; + * vec3 v; + * vec2 a[2]; + * } arr[3]; + * in vec4 packed4[3]; // location=4, location_frac=0 + * in vec4 packed5[3]; // location=5, location_frac=0 + * + * main() + * { + * arr[0].f = packed4[0].x; + * arr[0].v = packed4[0].yzw; + * arr[0].a[0] = packed5[0].xy; + * arr[0].a[1] = packed5[0].zw; + * arr[1].f = packed4[1].x; + * arr[1].v = packed4[1].yzw; + * arr[1].a[0] = packed5[1].xy; + * arr[1].a[1] = packed5[1].zw; + * arr[2].f = packed4[2].x; + * arr[2].v = packed4[2].yzw; + * arr[2].a[0] = packed5[2].xy; + * arr[2].a[1] = packed5[2].zw; + * ... + * } + */ + +#include "glsl_symbol_table.h" +#include "ir.h" +#include "ir_optimization.h" + +namespace { + +/** + * Visitor that performs varying packing. For each varying declared in the + * shader, this visitor determines whether it needs to be packed. If so, it + * demotes it to an ordinary global, creates new packed varyings, and + * generates assignments to convert between the original varying and the + * packed varying. + */ +class lower_packed_varyings_visitor +{ +public: + lower_packed_varyings_visitor(void *mem_ctx, unsigned location_base, + unsigned locations_used, + ir_variable_mode mode, + unsigned gs_input_vertices, + exec_list *out_instructions); + + void run(exec_list *instructions); + +private: + ir_assignment *bitwise_assign_pack(ir_rvalue *lhs, ir_rvalue *rhs); + ir_assignment *bitwise_assign_unpack(ir_rvalue *lhs, ir_rvalue *rhs); + unsigned lower_rvalue(ir_rvalue *rvalue, unsigned fine_location, + ir_variable *unpacked_var, const char *name, + bool gs_input_toplevel, unsigned vertex_index); + unsigned lower_arraylike(ir_rvalue *rvalue, unsigned array_size, + unsigned fine_location, + ir_variable *unpacked_var, const char *name, + bool gs_input_toplevel, unsigned vertex_index); + ir_dereference *get_packed_varying_deref(unsigned location, + ir_variable *unpacked_var, + const char *name, + unsigned vertex_index); + bool needs_lowering(ir_variable *var); + + /** + * Memory context used to allocate new instructions for the shader. + */ + void * const mem_ctx; + + /** + * Location representing the first generic varying slot for this shader + * stage (e.g. VARYING_SLOT_VAR0 if we are packing vertex shader outputs). + * Varyings whose location is less than this value are assumed to + * correspond to special fixed function hardware, so they are not lowered. + */ + const unsigned location_base; + + /** + * Number of generic varying slots which are used by this shader. This is + * used to allocate temporary intermediate data structures. If any any + * varying used by this shader has a location greater than or equal to + * location_base + locations_used, an assertion will fire. + */ + const unsigned locations_used; + + /** + * Array of pointers to the packed varyings that have been created for each + * generic varying slot. NULL entries in this array indicate varying slots + * for which a packed varying has not been created yet. + */ + ir_variable **packed_varyings; + + /** + * Type of varying which is being lowered in this pass (either + * ir_var_shader_in or ir_var_shader_out). + */ + const ir_variable_mode mode; + + /** + * If we are currently lowering geometry shader inputs, the number of input + * vertices the geometry shader accepts. Otherwise zero. + */ + const unsigned gs_input_vertices; + + /** + * Exec list into which the visitor should insert the packing instructions. + * Caller provides this list; it should insert the instructions into the + * appropriate place in the shader once the visitor has finished running. + */ + exec_list *out_instructions; +}; + +} /* anonymous namespace */ + +lower_packed_varyings_visitor::lower_packed_varyings_visitor( + void *mem_ctx, unsigned location_base, unsigned locations_used, + ir_variable_mode mode, unsigned gs_input_vertices, + exec_list *out_instructions) + : mem_ctx(mem_ctx), + location_base(location_base), + locations_used(locations_used), + packed_varyings((ir_variable **) + rzalloc_array_size(mem_ctx, sizeof(*packed_varyings), + locations_used)), + mode(mode), + gs_input_vertices(gs_input_vertices), + out_instructions(out_instructions) +{ +} + +void +lower_packed_varyings_visitor::run(exec_list *instructions) +{ + foreach_list (node, instructions) { + ir_variable *var = ((ir_instruction *) node)->as_variable(); + if (var == NULL) + continue; + + if (var->data.mode != this->mode || + var->data.location < (int) this->location_base || + !this->needs_lowering(var)) + continue; + + /* This lowering pass is only capable of packing floats and ints + * together when their interpolation mode is "flat". Therefore, to be + * safe, caller should ensure that integral varyings always use flat + * interpolation, even when this is not required by GLSL. + */ + assert(var->data.interpolation == INTERP_QUALIFIER_FLAT || + !var->type->contains_integer()); + + /* Change the old varying into an ordinary global. */ + var->data.mode = ir_var_auto; + + /* Create a reference to the old varying. */ + ir_dereference_variable *deref + = new(this->mem_ctx) ir_dereference_variable(var); + + /* Recursively pack or unpack it. */ + this->lower_rvalue(deref, var->data.location * 4 + var->data.location_frac, var, + var->name, this->gs_input_vertices != 0, 0); + } +} + + +/** + * Make an ir_assignment from \c rhs to \c lhs, performing appropriate + * bitcasts if necessary to match up types. + * + * This function is called when packing varyings. + */ +ir_assignment * +lower_packed_varyings_visitor::bitwise_assign_pack(ir_rvalue *lhs, + ir_rvalue *rhs) +{ + if (lhs->type->base_type != rhs->type->base_type) { + /* Since we only mix types in flat varyings, and we always store flat + * varyings as type ivec4, we need only produce conversions from (uint + * or float) to int. + */ + assert(lhs->type->base_type == GLSL_TYPE_INT); + switch (rhs->type->base_type) { + case GLSL_TYPE_UINT: + rhs = new(this->mem_ctx) + ir_expression(ir_unop_u2i, lhs->type, rhs); + break; + case GLSL_TYPE_FLOAT: + rhs = new(this->mem_ctx) + ir_expression(ir_unop_bitcast_f2i, lhs->type, rhs); + break; + default: + assert(!"Unexpected type conversion while lowering varyings"); + break; + } + } + return new(this->mem_ctx) ir_assignment(lhs, rhs); +} + + +/** + * Make an ir_assignment from \c rhs to \c lhs, performing appropriate + * bitcasts if necessary to match up types. + * + * This function is called when unpacking varyings. + */ +ir_assignment * +lower_packed_varyings_visitor::bitwise_assign_unpack(ir_rvalue *lhs, + ir_rvalue *rhs) +{ + if (lhs->type->base_type != rhs->type->base_type) { + /* Since we only mix types in flat varyings, and we always store flat + * varyings as type ivec4, we need only produce conversions from int to + * (uint or float). + */ + assert(rhs->type->base_type == GLSL_TYPE_INT); + switch (lhs->type->base_type) { + case GLSL_TYPE_UINT: + rhs = new(this->mem_ctx) + ir_expression(ir_unop_i2u, lhs->type, rhs); + break; + case GLSL_TYPE_FLOAT: + rhs = new(this->mem_ctx) + ir_expression(ir_unop_bitcast_i2f, lhs->type, rhs); + break; + default: + assert(!"Unexpected type conversion while lowering varyings"); + break; + } + } + return new(this->mem_ctx) ir_assignment(lhs, rhs); +} + + +/** + * Recursively pack or unpack the given varying (or portion of a varying) by + * traversing all of its constituent vectors. + * + * \param fine_location is the location where the first constituent vector + * should be packed--the word "fine" indicates that this location is expressed + * in multiples of a float, rather than multiples of a vec4 as is used + * elsewhere in Mesa. + * + * \param gs_input_toplevel should be set to true if we are lowering geometry + * shader inputs, and we are currently lowering the whole input variable + * (i.e. we are lowering the array whose index selects the vertex). + * + * \param vertex_index: if we are lowering geometry shader inputs, and the + * level of the array that we are currently lowering is *not* the top level, + * then this indicates which vertex we are currently lowering. Otherwise it + * is ignored. + * + * \return the location where the next constituent vector (after this one) + * should be packed. + */ +unsigned +lower_packed_varyings_visitor::lower_rvalue(ir_rvalue *rvalue, + unsigned fine_location, + ir_variable *unpacked_var, + const char *name, + bool gs_input_toplevel, + unsigned vertex_index) +{ + /* When gs_input_toplevel is set, we should be looking at a geometry shader + * input array. + */ + assert(!gs_input_toplevel || rvalue->type->is_array()); + + if (rvalue->type->is_record()) { + for (unsigned i = 0; i < rvalue->type->length; i++) { + if (i != 0) + rvalue = rvalue->clone(this->mem_ctx, NULL); + const char *field_name = rvalue->type->fields.structure[i].name; + ir_dereference_record *dereference_record = new(this->mem_ctx) + ir_dereference_record(rvalue, field_name); + char *deref_name + = ralloc_asprintf(this->mem_ctx, "%s.%s", name, field_name); + fine_location = this->lower_rvalue(dereference_record, fine_location, + unpacked_var, deref_name, false, + vertex_index); + } + return fine_location; + } else if (rvalue->type->is_array()) { + /* Arrays are packed/unpacked by considering each array element in + * sequence. + */ + return this->lower_arraylike(rvalue, rvalue->type->array_size(), + fine_location, unpacked_var, name, + gs_input_toplevel, vertex_index); + } else if (rvalue->type->is_matrix()) { + /* Matrices are packed/unpacked by considering each column vector in + * sequence. + */ + return this->lower_arraylike(rvalue, rvalue->type->matrix_columns, + fine_location, unpacked_var, name, + false, vertex_index); + } else if (rvalue->type->vector_elements + fine_location % 4 > 4) { + /* This vector is going to be "double parked" across two varying slots, + * so handle it as two separate assignments. + */ + unsigned left_components = 4 - fine_location % 4; + unsigned right_components + = rvalue->type->vector_elements - left_components; + unsigned left_swizzle_values[4] = { 0, 0, 0, 0 }; + unsigned right_swizzle_values[4] = { 0, 0, 0, 0 }; + char left_swizzle_name[4] = { 0, 0, 0, 0 }; + char right_swizzle_name[4] = { 0, 0, 0, 0 }; + for (unsigned i = 0; i < left_components; i++) { + left_swizzle_values[i] = i; + left_swizzle_name[i] = "xyzw"[i]; + } + for (unsigned i = 0; i < right_components; i++) { + right_swizzle_values[i] = i + left_components; + right_swizzle_name[i] = "xyzw"[i + left_components]; + } + ir_swizzle *left_swizzle = new(this->mem_ctx) + ir_swizzle(rvalue, left_swizzle_values, left_components); + ir_swizzle *right_swizzle = new(this->mem_ctx) + ir_swizzle(rvalue->clone(this->mem_ctx, NULL), right_swizzle_values, + right_components); + char *left_name + = ralloc_asprintf(this->mem_ctx, "%s.%s", name, left_swizzle_name); + char *right_name + = ralloc_asprintf(this->mem_ctx, "%s.%s", name, right_swizzle_name); + fine_location = this->lower_rvalue(left_swizzle, fine_location, + unpacked_var, left_name, false, + vertex_index); + return this->lower_rvalue(right_swizzle, fine_location, unpacked_var, + right_name, false, vertex_index); + } else { + /* No special handling is necessary; pack the rvalue into the + * varying. + */ + unsigned swizzle_values[4] = { 0, 0, 0, 0 }; + unsigned components = rvalue->type->vector_elements; + unsigned location = fine_location / 4; + unsigned location_frac = fine_location % 4; + for (unsigned i = 0; i < components; ++i) + swizzle_values[i] = i + location_frac; + ir_dereference *packed_deref = + this->get_packed_varying_deref(location, unpacked_var, name, + vertex_index); + ir_swizzle *swizzle = new(this->mem_ctx) + ir_swizzle(packed_deref, swizzle_values, components); + if (this->mode == ir_var_shader_out) { + ir_assignment *assignment + = this->bitwise_assign_pack(swizzle, rvalue); + this->out_instructions->push_tail(assignment); + } else { + ir_assignment *assignment + = this->bitwise_assign_unpack(rvalue, swizzle); + this->out_instructions->push_tail(assignment); + } + return fine_location + components; + } +} + +/** + * Recursively pack or unpack a varying for which we need to iterate over its + * constituent elements, accessing each one using an ir_dereference_array. + * This takes care of both arrays and matrices, since ir_dereference_array + * treats a matrix like an array of its column vectors. + * + * \param gs_input_toplevel should be set to true if we are lowering geometry + * shader inputs, and we are currently lowering the whole input variable + * (i.e. we are lowering the array whose index selects the vertex). + * + * \param vertex_index: if we are lowering geometry shader inputs, and the + * level of the array that we are currently lowering is *not* the top level, + * then this indicates which vertex we are currently lowering. Otherwise it + * is ignored. + */ +unsigned +lower_packed_varyings_visitor::lower_arraylike(ir_rvalue *rvalue, + unsigned array_size, + unsigned fine_location, + ir_variable *unpacked_var, + const char *name, + bool gs_input_toplevel, + unsigned vertex_index) +{ + for (unsigned i = 0; i < array_size; i++) { + if (i != 0) + rvalue = rvalue->clone(this->mem_ctx, NULL); + ir_constant *constant = new(this->mem_ctx) ir_constant(i); + ir_dereference_array *dereference_array = new(this->mem_ctx) + ir_dereference_array(rvalue, constant); + if (gs_input_toplevel) { + /* Geometry shader inputs are a special case. Instead of storing + * each element of the array at a different location, all elements + * are at the same location, but with a different vertex index. + */ + (void) this->lower_rvalue(dereference_array, fine_location, + unpacked_var, name, false, i); + } else { + char *subscripted_name + = ralloc_asprintf(this->mem_ctx, "%s[%d]", name, i); + fine_location = + this->lower_rvalue(dereference_array, fine_location, + unpacked_var, subscripted_name, + false, vertex_index); + } + } + return fine_location; +} + +/** + * Retrieve the packed varying corresponding to the given varying location. + * If no packed varying has been created for the given varying location yet, + * create it and add it to the shader before returning it. + * + * The newly created varying inherits its interpolation parameters from \c + * unpacked_var. Its base type is ivec4 if we are lowering a flat varying, + * vec4 otherwise. + * + * \param vertex_index: if we are lowering geometry shader inputs, then this + * indicates which vertex we are currently lowering. Otherwise it is ignored. + */ +ir_dereference * +lower_packed_varyings_visitor::get_packed_varying_deref( + unsigned location, ir_variable *unpacked_var, const char *name, + unsigned vertex_index) +{ + unsigned slot = location - this->location_base; + assert(slot < locations_used); + if (this->packed_varyings[slot] == NULL) { + char *packed_name = ralloc_asprintf(this->mem_ctx, "packed:%s", name); + const glsl_type *packed_type; + if (unpacked_var->data.interpolation == INTERP_QUALIFIER_FLAT) + packed_type = glsl_type::ivec4_type; + else + packed_type = glsl_type::vec4_type; + if (this->gs_input_vertices != 0) { + packed_type = + glsl_type::get_array_instance(packed_type, + this->gs_input_vertices); + } + ir_variable *packed_var = new(this->mem_ctx) + ir_variable(packed_type, packed_name, this->mode, (glsl_precision)unpacked_var->data.precision); + if (this->gs_input_vertices != 0) { + /* Prevent update_array_sizes() from messing with the size of the + * array. + */ + packed_var->data.max_array_access = this->gs_input_vertices - 1; + } + packed_var->data.centroid = unpacked_var->data.centroid; + packed_var->data.sample = unpacked_var->data.sample; + packed_var->data.interpolation = unpacked_var->data.interpolation; + packed_var->data.location = location; + unpacked_var->insert_before(packed_var); + this->packed_varyings[slot] = packed_var; + } else { + /* For geometry shader inputs, only update the packed variable name the + * first time we visit each component. + */ + if (this->gs_input_vertices == 0 || vertex_index == 0) { + ralloc_asprintf_append((char **) &this->packed_varyings[slot]->name, + ",%s", name); + } + } + + ir_dereference *deref = new(this->mem_ctx) + ir_dereference_variable(this->packed_varyings[slot]); + if (this->gs_input_vertices != 0) { + /* When lowering GS inputs, the packed variable is an array, so we need + * to dereference it using vertex_index. + */ + ir_constant *constant = new(this->mem_ctx) ir_constant(vertex_index); + deref = new(this->mem_ctx) ir_dereference_array(deref, constant); + } + return deref; +} + +bool +lower_packed_varyings_visitor::needs_lowering(ir_variable *var) +{ + /* Things composed of vec4's don't need lowering. Everything else does. */ + const glsl_type *type = var->type; + if (this->gs_input_vertices != 0) { + assert(type->is_array()); + type = type->element_type(); + } + if (type->is_array()) + type = type->fields.array; + if (type->vector_elements == 4) + return false; + return true; +} + + +/** + * Visitor that splices varying packing code before every use of EmitVertex() + * in a geometry shader. + */ +class lower_packed_varyings_gs_splicer : public ir_hierarchical_visitor +{ +public: + explicit lower_packed_varyings_gs_splicer(void *mem_ctx, + const exec_list *instructions); + + virtual ir_visitor_status visit(ir_emit_vertex *ev); + +private: + /** + * Memory context used to allocate new instructions for the shader. + */ + void * const mem_ctx; + + /** + * Instructions that should be spliced into place before each EmitVertex() + * call. + */ + const exec_list *instructions; +}; + + +lower_packed_varyings_gs_splicer::lower_packed_varyings_gs_splicer( + void *mem_ctx, const exec_list *instructions) + : mem_ctx(mem_ctx), instructions(instructions) +{ +} + + +ir_visitor_status +lower_packed_varyings_gs_splicer::visit(ir_emit_vertex *ev) +{ + foreach_list(node, this->instructions) { + ir_instruction *ir = (ir_instruction *) node; + ev->insert_before(ir->clone(this->mem_ctx, NULL)); + } + return visit_continue; +} + + +void +lower_packed_varyings(void *mem_ctx, unsigned location_base, + unsigned locations_used, ir_variable_mode mode, + unsigned gs_input_vertices, gl_shader *shader) +{ + exec_list *instructions = shader->ir; + ir_function *main_func = shader->symbols->get_function("main"); + exec_list void_parameters; + ir_function_signature *main_func_sig + = main_func->matching_signature(NULL, &void_parameters); + exec_list new_instructions; + lower_packed_varyings_visitor visitor(mem_ctx, location_base, + locations_used, mode, + gs_input_vertices, &new_instructions); + visitor.run(instructions); + if (mode == ir_var_shader_out) { + if (shader->Stage == MESA_SHADER_GEOMETRY) { + /* For geometry shaders, outputs need to be lowered before each call + * to EmitVertex() + */ + lower_packed_varyings_gs_splicer splicer(mem_ctx, &new_instructions); + splicer.run(instructions); + } else { + /* For other shader types, outputs need to be lowered at the end of + * main() + */ + main_func_sig->body.append_list(&new_instructions); + } + } else { + /* Shader inputs need to be lowered at the beginning of main() */ + main_func_sig->body.head->insert_before(&new_instructions); + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp new file mode 100644 index 000000000..db73c7b0f --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/lower_packing_builtins.cpp @@ -0,0 +1,1314 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "ir.h" +#include "ir_builder.h" +#include "ir_optimization.h" +#include "ir_rvalue_visitor.h" + +namespace { + +using namespace ir_builder; + +/** + * A visitor that lowers built-in floating-point pack/unpack expressions + * such packSnorm2x16. + */ +class lower_packing_builtins_visitor : public ir_rvalue_visitor { +public: + /** + * \param op_mask is a bitmask of `enum lower_packing_builtins_op` + */ + explicit lower_packing_builtins_visitor(int op_mask) + : op_mask(op_mask), + progress(false) + { + /* Mutually exclusive options. */ + assert(!((op_mask & LOWER_PACK_HALF_2x16) && + (op_mask & LOWER_PACK_HALF_2x16_TO_SPLIT))); + + assert(!((op_mask & LOWER_UNPACK_HALF_2x16) && + (op_mask & LOWER_UNPACK_HALF_2x16_TO_SPLIT))); + + factory.instructions = &factory_instructions; + } + + virtual ~lower_packing_builtins_visitor() + { + assert(factory_instructions.is_empty()); + } + + bool get_progress() { return progress; } + + void handle_rvalue(ir_rvalue **rvalue) + { + if (!*rvalue) + return; + + ir_expression *expr = (*rvalue)->as_expression(); + if (!expr) + return; + + enum lower_packing_builtins_op lowering_op = + choose_lowering_op(expr->operation); + + if (lowering_op == LOWER_PACK_UNPACK_NONE) + return; + + setup_factory(ralloc_parent(expr)); + + ir_rvalue *op0 = expr->operands[0]; + ralloc_steal(factory.mem_ctx, op0); + + switch (lowering_op) { + case LOWER_PACK_SNORM_2x16: + *rvalue = lower_pack_snorm_2x16(op0); + break; + case LOWER_PACK_SNORM_4x8: + *rvalue = lower_pack_snorm_4x8(op0); + break; + case LOWER_PACK_UNORM_2x16: + *rvalue = lower_pack_unorm_2x16(op0); + break; + case LOWER_PACK_UNORM_4x8: + *rvalue = lower_pack_unorm_4x8(op0); + break; + case LOWER_PACK_HALF_2x16: + *rvalue = lower_pack_half_2x16(op0); + break; + case LOWER_PACK_HALF_2x16_TO_SPLIT: + *rvalue = split_pack_half_2x16(op0); + break; + case LOWER_UNPACK_SNORM_2x16: + *rvalue = lower_unpack_snorm_2x16(op0); + break; + case LOWER_UNPACK_SNORM_4x8: + *rvalue = lower_unpack_snorm_4x8(op0); + break; + case LOWER_UNPACK_UNORM_2x16: + *rvalue = lower_unpack_unorm_2x16(op0); + break; + case LOWER_UNPACK_UNORM_4x8: + *rvalue = lower_unpack_unorm_4x8(op0); + break; + case LOWER_UNPACK_HALF_2x16: + *rvalue = lower_unpack_half_2x16(op0); + break; + case LOWER_UNPACK_HALF_2x16_TO_SPLIT: + *rvalue = split_unpack_half_2x16(op0); + break; + case LOWER_PACK_UNPACK_NONE: + assert(!"not reached"); + break; + } + + teardown_factory(); + progress = true; + } + +private: + const int op_mask; + bool progress; + ir_factory factory; + exec_list factory_instructions; + + /** + * Determine the needed lowering operation by filtering \a expr_op + * through \ref op_mask. + */ + enum lower_packing_builtins_op + choose_lowering_op(ir_expression_operation expr_op) + { + /* C++ regards int and enum as fundamentally different types. + * So, we can't simply return from each case; we must cast the return + * value. + */ + int result; + + switch (expr_op) { + case ir_unop_pack_snorm_2x16: + result = op_mask & LOWER_PACK_SNORM_2x16; + break; + case ir_unop_pack_snorm_4x8: + result = op_mask & LOWER_PACK_SNORM_4x8; + break; + case ir_unop_pack_unorm_2x16: + result = op_mask & LOWER_PACK_UNORM_2x16; + break; + case ir_unop_pack_unorm_4x8: + result = op_mask & LOWER_PACK_UNORM_4x8; + break; + case ir_unop_pack_half_2x16: + result = op_mask & (LOWER_PACK_HALF_2x16 | LOWER_PACK_HALF_2x16_TO_SPLIT); + break; + case ir_unop_unpack_snorm_2x16: + result = op_mask & LOWER_UNPACK_SNORM_2x16; + break; + case ir_unop_unpack_snorm_4x8: + result = op_mask & LOWER_UNPACK_SNORM_4x8; + break; + case ir_unop_unpack_unorm_2x16: + result = op_mask & LOWER_UNPACK_UNORM_2x16; + break; + case ir_unop_unpack_unorm_4x8: + result = op_mask & LOWER_UNPACK_UNORM_4x8; + break; + case ir_unop_unpack_half_2x16: + result = op_mask & (LOWER_UNPACK_HALF_2x16 | LOWER_UNPACK_HALF_2x16_TO_SPLIT); + break; + default: + result = LOWER_PACK_UNPACK_NONE; + break; + } + + return static_cast(result); + } + + void + setup_factory(void *mem_ctx) + { + assert(factory.mem_ctx == NULL); + assert(factory.instructions->is_empty()); + + factory.mem_ctx = mem_ctx; + } + + void + teardown_factory() + { + base_ir->insert_before(factory.instructions); + assert(factory.instructions->is_empty()); + factory.mem_ctx = NULL; + } + + template + ir_constant* + constant(T x) + { + return factory.constant(x); + } + + /** + * \brief Pack two uint16's into a single uint32. + * + * Interpret the given uvec2 as a uint16 pair. Pack the pair into a uint32 + * where the least significant bits specify the first element of the pair. + * Return the uint32. + */ + ir_rvalue* + pack_uvec2_to_uint(ir_rvalue *uvec2_rval) + { + assert(uvec2_rval->type == glsl_type::uvec2_type); + + /* uvec2 u = UVEC2_RVAL; */ + ir_variable *u = factory.make_temp(glsl_type::uvec2_type, + "tmp_pack_uvec2_to_uint"); + factory.emit(assign(u, uvec2_rval)); + + /* return (u.y << 16) | (u.x & 0xffff); */ + return bit_or(lshift(swizzle_y(u), constant(16u)), + bit_and(swizzle_x(u), constant(0xffffu))); + } + + /** + * \brief Pack four uint8's into a single uint32. + * + * Interpret the given uvec4 as a uint32 4-typle. Pack the 4-tuple into a + * uint32 where the least significant bits specify the first element of the + * 4-tuple. Return the uint32. + */ + ir_rvalue* + pack_uvec4_to_uint(ir_rvalue *uvec4_rval) + { + assert(uvec4_rval->type == glsl_type::uvec4_type); + + /* uvec4 u = UVEC4_RVAL; */ + ir_variable *u = factory.make_temp(glsl_type::uvec4_type, + "tmp_pack_uvec4_to_uint"); + factory.emit(assign(u, bit_and(uvec4_rval, constant(0xffu)))); + + /* return (u.w << 24) | (u.z << 16) | (u.y << 8) | u.x; */ + return bit_or(bit_or(lshift(swizzle_w(u), constant(24u)), + lshift(swizzle_z(u), constant(16u))), + bit_or(lshift(swizzle_y(u), constant(8u)), + swizzle_x(u))); + } + + /** + * \brief Unpack a uint32 into two uint16's. + * + * Interpret the given uint32 as a uint16 pair where the uint32's least + * significant bits specify the pair's first element. Return the uint16 + * pair as a uvec2. + */ + ir_rvalue* + unpack_uint_to_uvec2(ir_rvalue *uint_rval) + { + assert(uint_rval->type == glsl_type::uint_type); + + /* uint u = UINT_RVAL; */ + ir_variable *u = factory.make_temp(glsl_type::uint_type, + "tmp_unpack_uint_to_uvec2_u"); + factory.emit(assign(u, uint_rval)); + + /* uvec2 u2; */ + ir_variable *u2 = factory.make_temp(glsl_type::uvec2_type, + "tmp_unpack_uint_to_uvec2_u2"); + + /* u2.x = u & 0xffffu; */ + factory.emit(assign(u2, bit_and(u, constant(0xffffu)), WRITEMASK_X)); + + /* u2.y = u >> 16u; */ + factory.emit(assign(u2, rshift(u, constant(16u)), WRITEMASK_Y)); + + return deref(u2).val; + } + + /** + * \brief Unpack a uint32 into four uint8's. + * + * Interpret the given uint32 as a uint8 4-tuple where the uint32's least + * significant bits specify the 4-tuple's first element. Return the uint8 + * 4-tuple as a uvec4. + */ + ir_rvalue* + unpack_uint_to_uvec4(ir_rvalue *uint_rval) + { + assert(uint_rval->type == glsl_type::uint_type); + + /* uint u = UINT_RVAL; */ + ir_variable *u = factory.make_temp(glsl_type::uint_type, + "tmp_unpack_uint_to_uvec4_u"); + factory.emit(assign(u, uint_rval)); + + /* uvec4 u4; */ + ir_variable *u4 = factory.make_temp(glsl_type::uvec4_type, + "tmp_unpack_uint_to_uvec4_u4"); + + /* u4.x = u & 0xffu; */ + factory.emit(assign(u4, bit_and(u, constant(0xffu)), WRITEMASK_X)); + + /* u4.y = (u >> 8u) & 0xffu; */ + factory.emit(assign(u4, bit_and(rshift(u, constant(8u)), + constant(0xffu)), WRITEMASK_Y)); + + /* u4.z = (u >> 16u) & 0xffu; */ + factory.emit(assign(u4, bit_and(rshift(u, constant(16u)), + constant(0xffu)), WRITEMASK_Z)); + + /* u4.w = (u >> 24u) */ + factory.emit(assign(u4, rshift(u, constant(24u)), WRITEMASK_W)); + + return deref(u4).val; + } + + /** + * \brief Lower a packSnorm2x16 expression. + * + * \param vec2_rval is packSnorm2x16's input + * \return packSnorm2x16's output as a uint rvalue + */ + ir_rvalue* + lower_pack_snorm_2x16(ir_rvalue *vec2_rval) + { + /* From page 88 (94 of pdf) of the GLSL ES 3.00 spec: + * + * highp uint packSnorm2x16(vec2 v) + * -------------------------------- + * First, converts each component of the normalized floating-point value + * v into 16-bit integer values. Then, the results are packed into the + * returned 32-bit unsigned integer. + * + * The conversion for component c of v to fixed point is done as + * follows: + * + * packSnorm2x16: round(clamp(c, -1, +1) * 32767.0) + * + * The first component of the vector will be written to the least + * significant bits of the output; the last component will be written to + * the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return pack_uvec2_to_uint( + * uvec2(ivec2( + * round(clamp(VEC2_RVALUE, -1.0f, 1.0f) * 32767.0f)))); + * + * It is necessary to first convert the vec2 to ivec2 rather than directly + * converting vec2 to uvec2 because the latter conversion is undefined. + * From page 56 (62 of pdf) of the GLSL ES 3.00 spec: "It is undefined to + * convert a negative floating point value to an uint". + */ + assert(vec2_rval->type == glsl_type::vec2_type); + + ir_rvalue *result = pack_uvec2_to_uint( + i2u(f2i(round_even(mul(clamp(vec2_rval, + constant(-1.0f), + constant(1.0f)), + constant(32767.0f)))))); + + assert(result->type == glsl_type::uint_type); + return result; + } + + /** + * \brief Lower a packSnorm4x8 expression. + * + * \param vec4_rval is packSnorm4x8's input + * \return packSnorm4x8's output as a uint rvalue + */ + ir_rvalue* + lower_pack_snorm_4x8(ir_rvalue *vec4_rval) + { + /* From page 137 (143 of pdf) of the GLSL 4.30 spec: + * + * highp uint packSnorm4x8(vec4 v) + * ------------------------------- + * First, converts each component of the normalized floating-point value + * v into 8-bit integer values. Then, the results are packed into the + * returned 32-bit unsigned integer. + * + * The conversion for component c of v to fixed point is done as + * follows: + * + * packSnorm4x8: round(clamp(c, -1, +1) * 127.0) + * + * The first component of the vector will be written to the least + * significant bits of the output; the last component will be written to + * the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return pack_uvec4_to_uint( + * uvec4(ivec4( + * round(clamp(VEC4_RVALUE, -1.0f, 1.0f) * 127.0f)))); + * + * It is necessary to first convert the vec4 to ivec4 rather than directly + * converting vec4 to uvec4 because the latter conversion is undefined. + * From page 87 (93 of pdf) of the GLSL 4.30 spec: "It is undefined to + * convert a negative floating point value to an uint". + */ + assert(vec4_rval->type == glsl_type::vec4_type); + + ir_rvalue *result = pack_uvec4_to_uint( + i2u(f2i(round_even(mul(clamp(vec4_rval, + constant(-1.0f), + constant(1.0f)), + constant(127.0f)))))); + + assert(result->type == glsl_type::uint_type); + return result; + } + + /** + * \brief Lower an unpackSnorm2x16 expression. + * + * \param uint_rval is unpackSnorm2x16's input + * \return unpackSnorm2x16's output as a vec2 rvalue + */ + ir_rvalue* + lower_unpack_snorm_2x16(ir_rvalue *uint_rval) + { + /* From page 88 (94 of pdf) of the GLSL ES 3.00 spec: + * + * highp vec2 unpackSnorm2x16 (highp uint p) + * ----------------------------------------- + * First, unpacks a single 32-bit unsigned integer p into a pair of + * 16-bit unsigned integers. Then, each component is converted to + * a normalized floating-point value to generate the returned + * two-component vector. + * + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackSnorm2x16: clamp(f / 32767.0, -1,+1) + * + * The first component of the returned vector will be extracted from the + * least significant bits of the input; the last component will be + * extracted from the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return clamp( + * ((ivec2(unpack_uint_to_uvec2(UINT_RVALUE)) << 16) >> 16) / 32767.0f, + * -1.0f, 1.0f); + * + * The above IR may appear unnecessarily complex, but the intermediate + * conversion to ivec2 and the bit shifts are necessary to correctly unpack + * negative floats. + * + * To see why, consider packing and then unpacking vec2(-1.0, 0.0). + * packSnorm2x16 encodes -1.0 as the int16 0xffff. During unpacking, we + * place that int16 into an int32, which results in the *positive* integer + * 0x0000ffff. The int16's sign bit becomes, in the int32, the rather + * unimportant bit 16. We must now extend the int16's sign bit into bits + * 17-32, which is accomplished by left-shifting then right-shifting. + */ + + assert(uint_rval->type == glsl_type::uint_type); + + ir_rvalue *result = + clamp(div(i2f(rshift(lshift(u2i(unpack_uint_to_uvec2(uint_rval)), + constant(16)), + constant(16u))), + constant(32767.0f)), + constant(-1.0f), + constant(1.0f)); + + assert(result->type == glsl_type::vec2_type); + return result; + } + + /** + * \brief Lower an unpackSnorm4x8 expression. + * + * \param uint_rval is unpackSnorm4x8's input + * \return unpackSnorm4x8's output as a vec4 rvalue + */ + ir_rvalue* + lower_unpack_snorm_4x8(ir_rvalue *uint_rval) + { + /* From page 137 (143 of pdf) of the GLSL 4.30 spec: + * + * highp vec4 unpackSnorm4x8 (highp uint p) + * ---------------------------------------- + * First, unpacks a single 32-bit unsigned integer p into four + * 8-bit unsigned integers. Then, each component is converted to + * a normalized floating-point value to generate the returned + * four-component vector. + * + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackSnorm4x8: clamp(f / 127.0, -1, +1) + * + * The first component of the returned vector will be extracted from the + * least significant bits of the input; the last component will be + * extracted from the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return clamp( + * ((ivec4(unpack_uint_to_uvec4(UINT_RVALUE)) << 24) >> 24) / 127.0f, + * -1.0f, 1.0f); + * + * The above IR may appear unnecessarily complex, but the intermediate + * conversion to ivec4 and the bit shifts are necessary to correctly unpack + * negative floats. + * + * To see why, consider packing and then unpacking vec4(-1.0, 0.0, 0.0, + * 0.0). packSnorm4x8 encodes -1.0 as the int8 0xff. During unpacking, we + * place that int8 into an int32, which results in the *positive* integer + * 0x000000ff. The int8's sign bit becomes, in the int32, the rather + * unimportant bit 8. We must now extend the int8's sign bit into bits + * 9-32, which is accomplished by left-shifting then right-shifting. + */ + + assert(uint_rval->type == glsl_type::uint_type); + + ir_rvalue *result = + clamp(div(i2f(rshift(lshift(u2i(unpack_uint_to_uvec4(uint_rval)), + constant(24u)), + constant(24u))), + constant(127.0f)), + constant(-1.0f), + constant(1.0f)); + + assert(result->type == glsl_type::vec4_type); + return result; + } + + /** + * \brief Lower a packUnorm2x16 expression. + * + * \param vec2_rval is packUnorm2x16's input + * \return packUnorm2x16's output as a uint rvalue + */ + ir_rvalue* + lower_pack_unorm_2x16(ir_rvalue *vec2_rval) + { + /* From page 88 (94 of pdf) of the GLSL ES 3.00 spec: + * + * highp uint packUnorm2x16 (vec2 v) + * --------------------------------- + * First, converts each component of the normalized floating-point value + * v into 16-bit integer values. Then, the results are packed into the + * returned 32-bit unsigned integer. + * + * The conversion for component c of v to fixed point is done as + * follows: + * + * packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) + * + * The first component of the vector will be written to the least + * significant bits of the output; the last component will be written to + * the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return pack_uvec2_to_uint(uvec2( + * round(clamp(VEC2_RVALUE, 0.0f, 1.0f) * 65535.0f))); + * + * Here it is safe to directly convert the vec2 to uvec2 because the the + * vec2 has been clamped to a non-negative range. + */ + + assert(vec2_rval->type == glsl_type::vec2_type); + + ir_rvalue *result = pack_uvec2_to_uint( + f2u(round_even(mul(saturate(vec2_rval), constant(65535.0f))))); + + assert(result->type == glsl_type::uint_type); + return result; + } + + /** + * \brief Lower a packUnorm4x8 expression. + * + * \param vec4_rval is packUnorm4x8's input + * \return packUnorm4x8's output as a uint rvalue + */ + ir_rvalue* + lower_pack_unorm_4x8(ir_rvalue *vec4_rval) + { + /* From page 137 (143 of pdf) of the GLSL 4.30 spec: + * + * highp uint packUnorm4x8 (vec4 v) + * -------------------------------- + * First, converts each component of the normalized floating-point value + * v into 8-bit integer values. Then, the results are packed into the + * returned 32-bit unsigned integer. + * + * The conversion for component c of v to fixed point is done as + * follows: + * + * packUnorm4x8: round(clamp(c, 0, +1) * 255.0) + * + * The first component of the vector will be written to the least + * significant bits of the output; the last component will be written to + * the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return pack_uvec4_to_uint(uvec4( + * round(clamp(VEC2_RVALUE, 0.0f, 1.0f) * 255.0f))); + * + * Here it is safe to directly convert the vec4 to uvec4 because the the + * vec4 has been clamped to a non-negative range. + */ + + assert(vec4_rval->type == glsl_type::vec4_type); + + ir_rvalue *result = pack_uvec4_to_uint( + f2u(round_even(mul(saturate(vec4_rval), constant(255.0f))))); + + assert(result->type == glsl_type::uint_type); + return result; + } + + /** + * \brief Lower an unpackUnorm2x16 expression. + * + * \param uint_rval is unpackUnorm2x16's input + * \return unpackUnorm2x16's output as a vec2 rvalue + */ + ir_rvalue* + lower_unpack_unorm_2x16(ir_rvalue *uint_rval) + { + /* From page 89 (95 of pdf) of the GLSL ES 3.00 spec: + * + * highp vec2 unpackUnorm2x16 (highp uint p) + * ----------------------------------------- + * First, unpacks a single 32-bit unsigned integer p into a pair of + * 16-bit unsigned integers. Then, each component is converted to + * a normalized floating-point value to generate the returned + * two-component vector. + * + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackUnorm2x16: f / 65535.0 + * + * The first component of the returned vector will be extracted from the + * least significant bits of the input; the last component will be + * extracted from the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return vec2(unpack_uint_to_uvec2(UINT_RVALUE)) / 65535.0; + */ + + assert(uint_rval->type == glsl_type::uint_type); + + ir_rvalue *result = div(u2f(unpack_uint_to_uvec2(uint_rval)), + constant(65535.0f)); + + assert(result->type == glsl_type::vec2_type); + return result; + } + + /** + * \brief Lower an unpackUnorm4x8 expression. + * + * \param uint_rval is unpackUnorm4x8's input + * \return unpackUnorm4x8's output as a vec4 rvalue + */ + ir_rvalue* + lower_unpack_unorm_4x8(ir_rvalue *uint_rval) + { + /* From page 137 (143 of pdf) of the GLSL 4.30 spec: + * + * highp vec4 unpackUnorm4x8 (highp uint p) + * ---------------------------------------- + * First, unpacks a single 32-bit unsigned integer p into four + * 8-bit unsigned integers. Then, each component is converted to + * a normalized floating-point value to generate the returned + * two-component vector. + * + * The conversion for unpacked fixed-point value f to floating point is + * done as follows: + * + * unpackUnorm4x8: f / 255.0 + * + * The first component of the returned vector will be extracted from the + * least significant bits of the input; the last component will be + * extracted from the most significant bits. + * + * This function generates IR that approximates the following pseudo-GLSL: + * + * return vec4(unpack_uint_to_uvec4(UINT_RVALUE)) / 255.0; + */ + + assert(uint_rval->type == glsl_type::uint_type); + + ir_rvalue *result = div(u2f(unpack_uint_to_uvec4(uint_rval)), + constant(255.0f)); + + assert(result->type == glsl_type::vec4_type); + return result; + } + + /** + * \brief Lower the component-wise calculation of packHalf2x16. + * + * \param f_rval is one component of packHafl2x16's input + * \param e_rval is the unshifted exponent bits of f_rval + * \param m_rval is the unshifted mantissa bits of f_rval + * + * \return a uint rvalue that encodes a float16 in its lower 16 bits + */ + ir_rvalue* + pack_half_1x16_nosign(ir_rvalue *f_rval, + ir_rvalue *e_rval, + ir_rvalue *m_rval) + { + assert(e_rval->type == glsl_type::uint_type); + assert(m_rval->type == glsl_type::uint_type); + + /* uint u16; */ + ir_variable *u16 = factory.make_temp(glsl_type::uint_type, + "tmp_pack_half_1x16_u16"); + + /* float f = FLOAT_RVAL; */ + ir_variable *f = factory.make_temp(glsl_type::float_type, + "tmp_pack_half_1x16_f"); + factory.emit(assign(f, f_rval)); + + /* uint e = E_RVAL; */ + ir_variable *e = factory.make_temp(glsl_type::uint_type, + "tmp_pack_half_1x16_e"); + factory.emit(assign(e, e_rval)); + + /* uint m = M_RVAL; */ + ir_variable *m = factory.make_temp(glsl_type::uint_type, + "tmp_pack_half_1x16_m"); + factory.emit(assign(m, m_rval)); + + /* Preliminaries + * ------------- + * + * For a float16, the bit layout is: + * + * sign: 15 + * exponent: 10:14 + * mantissa: 0:9 + * + * Let f16 be a float16 value. The sign, exponent, and mantissa + * determine its value thus: + * + * if e16 = 0 and m16 = 0, then zero: (-1)^s16 * 0 (1) + * if e16 = 0 and m16!= 0, then subnormal: (-1)^s16 * 2^(e16 - 14) * (m16 / 2^10) (2) + * if 0 < e16 < 31, then normal: (-1)^s16 * 2^(e16 - 15) * (1 + m16 / 2^10) (3) + * if e16 = 31 and m16 = 0, then infinite: (-1)^s16 * inf (4) + * if e16 = 31 and m16 != 0, then NaN (5) + * + * where 0 <= m16 < 2^10. + * + * For a float32, the bit layout is: + * + * sign: 31 + * exponent: 23:30 + * mantissa: 0:22 + * + * Let f32 be a float32 value. The sign, exponent, and mantissa + * determine its value thus: + * + * if e32 = 0 and m32 = 0, then zero: (-1)^s * 0 (10) + * if e32 = 0 and m32 != 0, then subnormal: (-1)^s * 2^(e32 - 126) * (m32 / 2^23) (11) + * if 0 < e32 < 255, then normal: (-1)^s * 2^(e32 - 127) * (1 + m32 / 2^23) (12) + * if e32 = 255 and m32 = 0, then infinite: (-1)^s * inf (13) + * if e32 = 255 and m32 != 0, then NaN (14) + * + * where 0 <= m32 < 2^23. + * + * The minimum and maximum normal float16 values are + * + * min_norm16 = 2^(1 - 15) * (1 + 0 / 2^10) = 2^(-14) (20) + * max_norm16 = 2^(30 - 15) * (1 + 1023 / 2^10) (21) + * + * The step at max_norm16 is + * + * max_step16 = 2^5 (22) + * + * Observe that the float16 boundary values in equations 20-21 lie in the + * range of normal float32 values. + * + * + * Rounding Behavior + * ----------------- + * Not all float32 values can be exactly represented as a float16. We + * round all such intermediate float32 values to the nearest float16; if + * the float32 is exactly between to float16 values, we round to the one + * with an even mantissa. This rounding behavior has several benefits: + * + * - It has no sign bias. + * + * - It reproduces the behavior of real hardware: opcode F32TO16 in Intel's + * GPU ISA. + * + * - By reproducing the behavior of the GPU (at least on Intel hardware), + * compile-time evaluation of constant packHalf2x16 GLSL expressions will + * result in the same value as if the expression were executed on the + * GPU. + * + * Calculation + * ----------- + * Our task is to compute s16, e16, m16 given f32. Since this function + * ignores the sign bit, assume that s32 = s16 = 0. There are several + * cases consider. + */ + + factory.emit( + + /* Case 1) f32 is NaN + * + * The resultant f16 will also be NaN. + */ + + /* if (e32 == 255 && m32 != 0) { */ + if_tree(logic_and(equal(e, constant(0xffu << 23u)), + logic_not(equal(m, constant(0u)))), + + assign(u16, constant(0x7fffu)), + + /* Case 2) f32 lies in the range [0, min_norm16). + * + * The resultant float16 will be either zero, subnormal, or normal. + * + * Solving + * + * f32 = min_norm16 (30) + * + * gives + * + * e32 = 113 and m32 = 0 (31) + * + * Therefore this case occurs if and only if + * + * e32 < 113 (32) + */ + + /* } else if (e32 < 113) { */ + if_tree(less(e, constant(113u << 23u)), + + /* u16 = uint(round_to_even(abs(f32) * float(1u << 24u))); */ + assign(u16, f2u(round_even(mul(expr(ir_unop_abs, f), + constant((float) (1 << 24)))))), + + /* Case 3) f32 lies in the range + * [min_norm16, max_norm16 + max_step16). + * + * The resultant float16 will be either normal or infinite. + * + * Solving + * + * f32 = max_norm16 + max_step16 (40) + * = 2^15 * (1 + 1023 / 2^10) + 2^5 (41) + * = 2^16 (42) + * gives + * + * e32 = 143 and m32 = 0 (43) + * + * We already solved the boundary condition f32 = min_norm16 above + * in equation 31. Therefore this case occurs if and only if + * + * 113 <= e32 and e32 < 143 + */ + + /* } else if (e32 < 143) { */ + if_tree(less(e, constant(143u << 23u)), + + /* The addition below handles the case where the mantissa rounds + * up to 1024 and bumps the exponent. + * + * u16 = ((e - (112u << 23u)) >> 13u) + * + round_to_even((float(m) / (1u << 13u)); + */ + assign(u16, add(rshift(sub(e, constant(112u << 23u)), + constant(13u)), + f2u(round_even( + div(u2f(m), constant((float) (1 << 13))))))), + + /* Case 4) f32 lies in the range [max_norm16 + max_step16, inf]. + * + * The resultant float16 will be infinite. + * + * The cases above caught all float32 values in the range + * [0, max_norm16 + max_step16), so this is the fall-through case. + */ + + /* } else { */ + + assign(u16, constant(31u << 10u)))))); + + /* } */ + + return deref(u16).val; + } + + /** + * \brief Lower a packHalf2x16 expression. + * + * \param vec2_rval is packHalf2x16's input + * \return packHalf2x16's output as a uint rvalue + */ + ir_rvalue* + lower_pack_half_2x16(ir_rvalue *vec2_rval) + { + /* From page 89 (95 of pdf) of the GLSL ES 3.00 spec: + * + * highp uint packHalf2x16 (mediump vec2 v) + * ---------------------------------------- + * Returns an unsigned integer obtained by converting the components of + * a two-component floating-point vector to the 16-bit floating-point + * representation found in the OpenGL ES Specification, and then packing + * these two 16-bit integers into a 32-bit unsigned integer. + * + * The first vector component specifies the 16 least- significant bits + * of the result; the second component specifies the 16 most-significant + * bits. + */ + + assert(vec2_rval->type == glsl_type::vec2_type); + + /* vec2 f = VEC2_RVAL; */ + ir_variable *f = factory.make_temp(glsl_type::vec2_type, + "tmp_pack_half_2x16_f"); + factory.emit(assign(f, vec2_rval)); + + /* uvec2 f32 = bitcast_f2u(f); */ + ir_variable *f32 = factory.make_temp(glsl_type::uvec2_type, + "tmp_pack_half_2x16_f32"); + factory.emit(assign(f32, expr(ir_unop_bitcast_f2u, f))); + + /* uvec2 f16; */ + ir_variable *f16 = factory.make_temp(glsl_type::uvec2_type, + "tmp_pack_half_2x16_f16"); + + /* Get f32's unshifted exponent bits. + * + * uvec2 e = f32 & 0x7f800000u; + */ + ir_variable *e = factory.make_temp(glsl_type::uvec2_type, + "tmp_pack_half_2x16_e"); + factory.emit(assign(e, bit_and(f32, constant(0x7f800000u)))); + + /* Get f32's unshifted mantissa bits. + * + * uvec2 m = f32 & 0x007fffffu; + */ + ir_variable *m = factory.make_temp(glsl_type::uvec2_type, + "tmp_pack_half_2x16_m"); + factory.emit(assign(m, bit_and(f32, constant(0x007fffffu)))); + + /* Set f16's exponent and mantissa bits. + * + * f16.x = pack_half_1x16_nosign(e.x, m.x); + * f16.y = pack_half_1y16_nosign(e.y, m.y); + */ + factory.emit(assign(f16, pack_half_1x16_nosign(swizzle_x(f), + swizzle_x(e), + swizzle_x(m)), + WRITEMASK_X)); + factory.emit(assign(f16, pack_half_1x16_nosign(swizzle_y(f), + swizzle_y(e), + swizzle_y(m)), + WRITEMASK_Y)); + + /* Set f16's sign bits. + * + * f16 |= (f32 & (1u << 31u) >> 16u; + */ + factory.emit( + assign(f16, bit_or(f16, + rshift(bit_and(f32, constant(1u << 31u)), + constant(16u))))); + + + /* return (f16.y << 16u) | f16.x; */ + ir_rvalue *result = bit_or(lshift(swizzle_y(f16), + constant(16u)), + swizzle_x(f16)); + + assert(result->type == glsl_type::uint_type); + return result; + } + + /** + * \brief Split packHalf2x16's vec2 operand into two floats. + * + * \param vec2_rval is packHalf2x16's input + * \return a uint rvalue + * + * Some code generators, such as the i965 fragment shader, require that all + * vector expressions be lowered to a sequence of scalar expressions. + * However, packHalf2x16 cannot be scalarized by the same mechanism as + * a true vector operation because its input and output have a differing + * number of vector components. + * + * This method scalarizes packHalf2x16 by transforming it from an unary + * operation having vector input to a binary operation having scalar input. + * That is, it transforms + * + * packHalf2x16(VEC2_RVAL); + * + * into + * + * vec2 v = VEC2_RVAL; + * return packHalf2x16_split(v.x, v.y); + */ + ir_rvalue* + split_pack_half_2x16(ir_rvalue *vec2_rval) + { + assert(vec2_rval->type == glsl_type::vec2_type); + + ir_variable *v = factory.make_temp(glsl_type::vec2_type, + "tmp_split_pack_half_2x16_v"); + factory.emit(assign(v, vec2_rval)); + + return expr(ir_binop_pack_half_2x16_split, swizzle_x(v), swizzle_y(v)); + } + + /** + * \brief Lower the component-wise calculation of unpackHalf2x16. + * + * Given a uint that encodes a float16 in its lower 16 bits, this function + * returns a uint that encodes a float32 with the same value. The sign bit + * of the float16 is ignored. + * + * \param e_rval is the unshifted exponent bits of a float16 + * \param m_rval is the unshifted mantissa bits of a float16 + * \param a uint rvalue that encodes a float32 + */ + ir_rvalue* + unpack_half_1x16_nosign(ir_rvalue *e_rval, ir_rvalue *m_rval) + { + assert(e_rval->type == glsl_type::uint_type); + assert(m_rval->type == glsl_type::uint_type); + + /* uint u32; */ + ir_variable *u32 = factory.make_temp(glsl_type::uint_type, + "tmp_unpack_half_1x16_u32"); + + /* uint e = E_RVAL; */ + ir_variable *e = factory.make_temp(glsl_type::uint_type, + "tmp_unpack_half_1x16_e"); + factory.emit(assign(e, e_rval)); + + /* uint m = M_RVAL; */ + ir_variable *m = factory.make_temp(glsl_type::uint_type, + "tmp_unpack_half_1x16_m"); + factory.emit(assign(m, m_rval)); + + /* Preliminaries + * ------------- + * + * For a float16, the bit layout is: + * + * sign: 15 + * exponent: 10:14 + * mantissa: 0:9 + * + * Let f16 be a float16 value. The sign, exponent, and mantissa + * determine its value thus: + * + * if e16 = 0 and m16 = 0, then zero: (-1)^s16 * 0 (1) + * if e16 = 0 and m16!= 0, then subnormal: (-1)^s16 * 2^(e16 - 14) * (m16 / 2^10) (2) + * if 0 < e16 < 31, then normal: (-1)^s16 * 2^(e16 - 15) * (1 + m16 / 2^10) (3) + * if e16 = 31 and m16 = 0, then infinite: (-1)^s16 * inf (4) + * if e16 = 31 and m16 != 0, then NaN (5) + * + * where 0 <= m16 < 2^10. + * + * For a float32, the bit layout is: + * + * sign: 31 + * exponent: 23:30 + * mantissa: 0:22 + * + * Let f32 be a float32 value. The sign, exponent, and mantissa + * determine its value thus: + * + * if e32 = 0 and m32 = 0, then zero: (-1)^s * 0 (10) + * if e32 = 0 and m32 != 0, then subnormal: (-1)^s * 2^(e32 - 126) * (m32 / 2^23) (11) + * if 0 < e32 < 255, then normal: (-1)^s * 2^(e32 - 127) * (1 + m32 / 2^23) (12) + * if e32 = 255 and m32 = 0, then infinite: (-1)^s * inf (13) + * if e32 = 255 and m32 != 0, then NaN (14) + * + * where 0 <= m32 < 2^23. + * + * Calculation + * ----------- + * Our task is to compute s32, e32, m32 given f16. Since this function + * ignores the sign bit, assume that s32 = s16 = 0. There are several + * cases consider. + */ + + factory.emit( + + /* Case 1) f16 is zero or subnormal. + * + * The simplest method of calcuating f32 in this case is + * + * f32 = f16 (20) + * = 2^(-14) * (m16 / 2^10) (21) + * = m16 / 2^(-24) (22) + */ + + /* if (e16 == 0) { */ + if_tree(equal(e, constant(0u)), + + /* u32 = bitcast_f2u(float(m) / float(1 << 24)); */ + assign(u32, expr(ir_unop_bitcast_f2u, + div(u2f(m), constant((float)(1 << 24))))), + + /* Case 2) f16 is normal. + * + * The equation + * + * f32 = f16 (30) + * 2^(e32 - 127) * (1 + m32 / 2^23) = (31) + * 2^(e16 - 15) * (1 + m16 / 2^10) + * + * can be decomposed into two + * + * 2^(e32 - 127) = 2^(e16 - 15) (32) + * 1 + m32 / 2^23 = 1 + m16 / 2^10 (33) + * + * which solve to + * + * e32 = e16 + 112 (34) + * m32 = m16 * 2^13 (35) + */ + + /* } else if (e16 < 31)) { */ + if_tree(less(e, constant(31u << 10u)), + + /* u32 = ((e + (112 << 10)) | m) << 13; + */ + assign(u32, lshift(bit_or(add(e, constant(112u << 10u)), m), + constant(13u))), + + + /* Case 3) f16 is infinite. */ + if_tree(equal(m, constant(0u)), + + assign(u32, constant(255u << 23u)), + + /* Case 4) f16 is NaN. */ + /* } else { */ + + assign(u32, constant(0x7fffffffu)))))); + + /* } */ + + return deref(u32).val; + } + + /** + * \brief Lower an unpackHalf2x16 expression. + * + * \param uint_rval is unpackHalf2x16's input + * \return unpackHalf2x16's output as a vec2 rvalue + */ + ir_rvalue* + lower_unpack_half_2x16(ir_rvalue *uint_rval) + { + /* From page 89 (95 of pdf) of the GLSL ES 3.00 spec: + * + * mediump vec2 unpackHalf2x16 (highp uint v) + * ------------------------------------------ + * Returns a two-component floating-point vector with components + * obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit + * values, interpreting those values as 16-bit floating-point numbers + * according to the OpenGL ES Specification, and converting them to + * 32-bit floating-point values. + * + * The first component of the vector is obtained from the + * 16 least-significant bits of v; the second component is obtained + * from the 16 most-significant bits of v. + */ + assert(uint_rval->type == glsl_type::uint_type); + + /* uint u = RVALUE; + * uvec2 f16 = uvec2(u.x & 0xffff, u.y >> 16); + */ + ir_variable *f16 = factory.make_temp(glsl_type::uvec2_type, + "tmp_unpack_half_2x16_f16"); + factory.emit(assign(f16, unpack_uint_to_uvec2(uint_rval))); + + /* uvec2 f32; */ + ir_variable *f32 = factory.make_temp(glsl_type::uvec2_type, + "tmp_unpack_half_2x16_f32"); + + /* Get f16's unshifted exponent bits. + * + * uvec2 e = f16 & 0x7c00u; + */ + ir_variable *e = factory.make_temp(glsl_type::uvec2_type, + "tmp_unpack_half_2x16_e"); + factory.emit(assign(e, bit_and(f16, constant(0x7c00u)))); + + /* Get f16's unshifted mantissa bits. + * + * uvec2 m = f16 & 0x03ffu; + */ + ir_variable *m = factory.make_temp(glsl_type::uvec2_type, + "tmp_unpack_half_2x16_m"); + factory.emit(assign(m, bit_and(f16, constant(0x03ffu)))); + + /* Set f32's exponent and mantissa bits. + * + * f32.x = unpack_half_1x16_nosign(e.x, m.x); + * f32.y = unpack_half_1x16_nosign(e.y, m.y); + */ + factory.emit(assign(f32, unpack_half_1x16_nosign(swizzle_x(e), + swizzle_x(m)), + WRITEMASK_X)); + factory.emit(assign(f32, unpack_half_1x16_nosign(swizzle_y(e), + swizzle_y(m)), + WRITEMASK_Y)); + + /* Set f32's sign bit. + * + * f32 |= (f16 & 0x8000u) << 16u; + */ + factory.emit(assign(f32, bit_or(f32, + lshift(bit_and(f16, + constant(0x8000u)), + constant(16u))))); + + /* return bitcast_u2f(f32); */ + ir_rvalue *result = expr(ir_unop_bitcast_u2f, f32); + assert(result->type == glsl_type::vec2_type); + return result; + } + + /** + * \brief Split unpackHalf2x16 into two operations. + * + * \param uint_rval is unpackHalf2x16's input + * \return a vec2 rvalue + * + * Some code generators, such as the i965 fragment shader, require that all + * vector expressions be lowered to a sequence of scalar expressions. + * However, unpackHalf2x16 cannot be scalarized by the same method as + * a true vector operation because the number of components of its input + * and output differ. + * + * This method scalarizes unpackHalf2x16 by transforming it from a single + * operation having vec2 output to a pair of operations each having float + * output. That is, it transforms + * + * unpackHalf2x16(UINT_RVAL) + * + * into + * + * uint u = UINT_RVAL; + * vec2 v; + * + * v.x = unpackHalf2x16_split_x(u); + * v.y = unpackHalf2x16_split_y(u); + * + * return v; + */ + ir_rvalue* + split_unpack_half_2x16(ir_rvalue *uint_rval) + { + assert(uint_rval->type == glsl_type::uint_type); + + /* uint u = uint_rval; */ + ir_variable *u = factory.make_temp(glsl_type::uint_type, + "tmp_split_unpack_half_2x16_u"); + factory.emit(assign(u, uint_rval)); + + /* vec2 v; */ + ir_variable *v = factory.make_temp(glsl_type::vec2_type, + "tmp_split_unpack_half_2x16_v"); + + /* v.x = unpack_half_2x16_split_x(u); */ + factory.emit(assign(v, expr(ir_unop_unpack_half_2x16_split_x, u), + WRITEMASK_X)); + + /* v.y = unpack_half_2x16_split_y(u); */ + factory.emit(assign(v, expr(ir_unop_unpack_half_2x16_split_y, u), + WRITEMASK_Y)); + + return deref(v).val; + } +}; + +} // namespace anonymous + +/** + * \brief Lower the builtin packing functions. + * + * \param op_mask is a bitmask of `enum lower_packing_builtins_op`. + */ +bool +lower_packing_builtins(exec_list *instructions, int op_mask) +{ + lower_packing_builtins_visitor v(op_mask); + visit_list_elements(&v, instructions, true); + return v.get_progress(); +} diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp index 7485e330a..0dc6b5711 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_ubo_reference.cpp @@ -61,10 +61,58 @@ public: bool progress; }; -static inline unsigned int -align(unsigned int a, unsigned int align) +/** + * Determine the name of the interface block field + * + * This is the name of the specific member as it would appear in the + * \c gl_uniform_buffer_variable::Name field in the shader's + * \c UniformBlocks array. + */ +static const char * +interface_field_name(void *mem_ctx, char *base_name, ir_dereference *d) { - return (a + align - 1) / align * align; + ir_constant *previous_index = NULL; + + while (d != NULL) { + switch (d->ir_type) { + case ir_type_dereference_variable: { + ir_dereference_variable *v = (ir_dereference_variable *) d; + if (previous_index + && v->var->is_interface_instance() + && v->var->type->is_array()) + return ralloc_asprintf(mem_ctx, + "%s[%d]", + base_name, + previous_index->get_uint_component(0)); + else + return base_name; + + break; + } + + case ir_type_dereference_record: { + ir_dereference_record *r = (ir_dereference_record *) d; + + d = r->record->as_dereference(); + break; + } + + case ir_type_dereference_array: { + ir_dereference_array *a = (ir_dereference_array *) d; + + d = a->array->as_dereference(); + previous_index = a->array_index->as_constant(); + break; + } + + default: + assert(!"Should not get here."); + break; + } + } + + assert(!"Should not get here."); + return NULL; } void @@ -78,13 +126,31 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) return; ir_variable *var = deref->variable_referenced(); - if (!var || var->uniform_block == -1) + if (!var || !var->is_in_uniform_block()) return; mem_ctx = ralloc_parent(*rvalue); - uniform_block = var->uniform_block; - struct gl_uniform_block *block = &shader->UniformBlocks[uniform_block]; - this->ubo_var = &block->Uniforms[var->location]; + + const char *const field_name = + interface_field_name(mem_ctx, (char *) var->get_interface_type()->name, + deref); + + this->uniform_block = -1; + for (unsigned i = 0; i < shader->NumUniformBlocks; i++) { + if (strcmp(field_name, shader->UniformBlocks[i].Name) == 0) { + this->uniform_block = i; + + struct gl_uniform_block *block = &shader->UniformBlocks[i]; + + this->ubo_var = var->is_interface_instance() + ? &block->Uniforms[0] : &block->Uniforms[var->data.location]; + + break; + } + } + + assert(this->uniform_block != (unsigned) -1); + ir_rvalue *offset = new(mem_ctx) ir_constant(0u); unsigned const_offset = 0; bool row_major = !!ubo_var->RowMajor; @@ -111,9 +177,21 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) * vector) is handled below in emit_ubo_loads. */ array_stride = 4; + } else if (deref_array->type->is_interface()) { + /* We're processing an array dereference of an interface instance + * array. The thing being dereferenced *must* be a variable + * dereference because intefaces cannot be embedded an other + * types. In terms of calculating the offsets for the lowering + * pass, we don't care about the array index. All elements of an + * interface instance array will have the same offsets relative to + * the base of the block that backs them. + */ + assert(deref_array->array->as_dereference_variable()); + deref = deref_array->array->as_dereference(); + break; } else { array_stride = deref_array->type->std140_size(row_major); - array_stride = align(array_stride, 16); + array_stride = glsl_align(array_stride, 16); } ir_constant *const_index = deref_array->array_index->as_constant(); @@ -138,7 +216,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) const glsl_type *type = struct_type->fields.structure[i].type; unsigned field_align = type->std140_base_alignment(row_major); max_field_align = MAX2(field_align, max_field_align); - intra_struct_offset = align(intra_struct_offset, field_align); + intra_struct_offset = glsl_align(intra_struct_offset, field_align); if (strcmp(struct_type->fields.structure[i].name, deref_record->field) == 0) @@ -146,7 +224,7 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue) intra_struct_offset += type->std140_size(row_major); } - const_offset = align(const_offset, max_field_align); + const_offset = glsl_align(const_offset, max_field_align); const_offset += intra_struct_offset; deref = deref_record->record->as_dereference(); @@ -217,8 +295,8 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, field->name); field_offset = - align(field_offset, - field->type->std140_base_alignment(!!ubo_var->RowMajor)); + glsl_align(field_offset, + field->type->std140_base_alignment(!!ubo_var->RowMajor)); emit_ubo_loads(field_deref, base_offset, deref_offset + field_offset); @@ -229,7 +307,8 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, if (deref->type->is_array()) { unsigned array_stride = - align(deref->type->fields.array->std140_size(!!ubo_var->RowMajor), 16); + glsl_align(deref->type->fields.array->std140_size(!!ubo_var->RowMajor), + 16); for (unsigned i = 0; i < deref->type->length; i++) { ir_constant *element = new(mem_ctx) ir_constant(i); @@ -278,18 +357,14 @@ lower_ubo_reference_visitor::emit_ubo_loads(ir_dereference *deref, unsigned matrix_stride = 16; for (unsigned i = 0; i < deref->type->vector_elements; i++) { - ir_rvalue *chan = new(mem_ctx) ir_constant((int)i); - ir_dereference *deref_chan = - new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL), - chan); - ir_rvalue *chan_offset = add(base_offset, new(mem_ctx) ir_constant(deref_offset + i * matrix_stride)); - base_ir->insert_before(assign(deref_chan, + base_ir->insert_before(assign(deref->clone(mem_ctx, NULL), ubo_load(glsl_type::float_type, - chan_offset))); + chan_offset), + (1U << i))); } } } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp index e750404d0..319a11c3e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_variable_index_to_cond_assign.cpp @@ -99,7 +99,7 @@ compare_index_block(exec_list *instructions, ir_variable *index, ir_rvalue *const condition_val = new(mem_ctx) ir_expression(ir_binop_equal, - &glsl_type::bool_type[components - 1], + glsl_type::bvec(components), broadcast_index, test_indices); @@ -122,6 +122,7 @@ is_array_or_matrix(const ir_rvalue *ir) return (ir->type->is_array() || ir->type->is_matrix()); } +namespace { /** * Replace a dereference of a variable with a specified r-value * @@ -191,6 +192,12 @@ struct assignment_generator ir_variable* var; assignment_generator() + : base_ir(NULL), + rvalue(NULL), + old_index(NULL), + is_write(false), + write_mask(0), + var(NULL) { } @@ -358,18 +365,22 @@ public: if (var == NULL) return this->lower_temps; - switch (var->mode) { + switch (var->data.mode) { case ir_var_auto: case ir_var_temporary: return this->lower_temps; case ir_var_uniform: return this->lower_uniforms; - case ir_var_in: + case ir_var_function_in: case ir_var_const_in: - return (var->location == -1) ? this->lower_temps : this->lower_inputs; - case ir_var_out: - return (var->location == -1) ? this->lower_temps : this->lower_outputs; - case ir_var_inout: + return this->lower_temps; + case ir_var_shader_in: + return this->lower_inputs; + case ir_var_function_out: + return this->lower_temps; + case ir_var_shader_out: + return this->lower_outputs; + case ir_var_function_inout: return this->lower_temps; } @@ -508,6 +519,8 @@ public: } }; +} /* anonymous namespace */ + bool lower_variable_index_to_cond_assign(exec_list *instructions, bool lower_input, diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp index 0c26ed016..ddd753896 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_cond_assign.cpp @@ -41,6 +41,8 @@ #include "ir_optimization.h" #include "glsl_types.h" +namespace { + /** * Visitor class for replacing expressions with ir_constant values. */ @@ -52,7 +54,12 @@ public: progress = false; } - ir_rvalue *convert_vec_index_to_cond_assign(ir_rvalue *val); + ir_rvalue *convert_vec_index_to_cond_assign(void *mem_ctx, + ir_rvalue *orig_vector, + ir_rvalue *orig_index, + const glsl_type *type); + + ir_rvalue *convert_vector_extract_to_cond_assign(ir_rvalue *ir); virtual ir_visitor_status visit_enter(ir_expression *); virtual ir_visitor_status visit_enter(ir_swizzle *); @@ -64,25 +71,19 @@ public: bool progress; }; +} /* anonymous namespace */ + ir_rvalue * -ir_vec_index_to_cond_assign_visitor::convert_vec_index_to_cond_assign(ir_rvalue *ir) +ir_vec_index_to_cond_assign_visitor::convert_vec_index_to_cond_assign(void *mem_ctx, + ir_rvalue *orig_vector, + ir_rvalue *orig_index, + const glsl_type *type) { - ir_dereference_array *orig_deref = ir->as_dereference_array(); - ir_assignment *assign; - ir_variable *index, *var; - ir_dereference *deref; - int i; + ir_assignment *assign, *value_assign; + ir_variable *index, *var, *value; + ir_dereference *deref, *deref_value; + unsigned i; - if (!orig_deref) - return ir; - - if (orig_deref->array->type->is_matrix() || - orig_deref->array->type->is_array()) - return ir; - - void *mem_ctx = ralloc_parent(ir); - - assert(orig_deref->array_index->type->base_type == GLSL_TYPE_INT); exec_list list; @@ -92,32 +93,41 @@ ir_vec_index_to_cond_assign_visitor::convert_vec_index_to_cond_assign(ir_rvalue ir_var_temporary, glsl_precision_undefined); list.push_tail(index); deref = new(base_ir) ir_dereference_variable(index); - assign = new(base_ir) ir_assignment(deref, orig_deref->array_index, NULL); + assign = new(base_ir) ir_assignment(deref, orig_index, NULL); list.push_tail(assign); + /* Store the value inside a temp, thus avoiding matrixes duplication */ + value = new(base_ir) ir_variable(orig_vector->type, "vec_value_tmp", + ir_var_temporary, orig_vector->get_precision()); + list.push_tail(value); + deref_value = new(base_ir) ir_dereference_variable(value); + value_assign = new(base_ir) ir_assignment(deref_value, orig_vector); + list.push_tail(value_assign); + /* Temporary where we store whichever value we swizzle out. */ - var = new(base_ir) ir_variable(ir->type, "vec_index_tmp_v", - ir_var_temporary, precision_from_ir(ir)); - list.push_tail(var); + var = new(base_ir) ir_variable(type, "vec_index_tmp_v", + ir_var_temporary, orig_vector->get_precision()); + list.push_tail(var); /* Generate a single comparison condition "mask" for all of the components * in the vector. */ ir_rvalue *const cond_deref = compare_index_block(&list, index, 0, - orig_deref->array->type->vector_elements, + orig_vector->type->vector_elements, mem_ctx); /* Generate a conditional move of each vector element to the temp. */ - for (i = 0; i < (int)orig_deref->array->type->vector_elements; i++) { + for (i = 0; i < (int)orig_vector->type->vector_elements; i++) { ir_rvalue *condition_swizzle = - new(base_ir) ir_swizzle(cond_deref->clone(ir, NULL), i, 0, 0, 0, 1); + new(base_ir) ir_swizzle(cond_deref->clone(mem_ctx, NULL), + i, 0, 0, 0, 1); /* Just clone the rest of the deref chain when trying to get at the * underlying variable. */ ir_rvalue *swizzle = - new(base_ir) ir_swizzle(orig_deref->array->clone(mem_ctx, NULL), + new(base_ir) ir_swizzle(deref_value->clone(mem_ctx, NULL), i, 0, 0, 0, 1); deref = new(base_ir) ir_dereference_variable(var); @@ -134,13 +144,27 @@ ir_vec_index_to_cond_assign_visitor::convert_vec_index_to_cond_assign(ir_rvalue return new(base_ir) ir_dereference_variable(var); } +ir_rvalue * +ir_vec_index_to_cond_assign_visitor::convert_vector_extract_to_cond_assign(ir_rvalue *ir) +{ + ir_expression *const expr = ir->as_expression(); + + if (expr == NULL || expr->operation != ir_binop_vector_extract) + return ir; + + return convert_vec_index_to_cond_assign(ralloc_parent(ir), + expr->operands[0], + expr->operands[1], + ir->type); +} + ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_enter(ir_expression *ir) { unsigned int i; for (i = 0; i < ir->get_num_operands(); i++) { - ir->operands[i] = convert_vec_index_to_cond_assign(ir->operands[i]); + ir->operands[i] = convert_vector_extract_to_cond_assign(ir->operands[i]); } return visit_continue; @@ -153,7 +177,7 @@ ir_vec_index_to_cond_assign_visitor::visit_enter(ir_swizzle *ir) * the result of indexing a vector is. But maybe at some point we'll end up * using swizzling of scalars for vector construction. */ - ir->val = convert_vec_index_to_cond_assign(ir->val); + ir->val = convert_vector_extract_to_cond_assign(ir->val); return visit_continue; } @@ -161,100 +185,22 @@ ir_vec_index_to_cond_assign_visitor::visit_enter(ir_swizzle *ir) ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_leave(ir_assignment *ir) { - ir_variable *index, *var; - ir_dereference_variable *deref; - ir_assignment *assign; - int i; - ir->rhs = convert_vec_index_to_cond_assign(ir->rhs); - if (ir->condition) - ir->condition = convert_vec_index_to_cond_assign(ir->condition); + ir->rhs = convert_vector_extract_to_cond_assign(ir->rhs); - /* Last, handle the LHS */ - ir_dereference_array *orig_deref = ir->lhs->as_dereference_array(); - - if (!orig_deref || - orig_deref->array->type->is_matrix() || - orig_deref->array->type->is_array()) - return visit_continue; - - void *mem_ctx = ralloc_parent(ir); - - assert(orig_deref->array_index->type->base_type == GLSL_TYPE_INT); - - exec_list list; - - /* Store the index to a temporary to avoid reusing its tree. */ - index = new(ir) ir_variable(glsl_type::int_type, "vec_index_tmp_i", - ir_var_temporary, glsl_precision_undefined); - list.push_tail(index); - deref = new(ir) ir_dereference_variable(index); - assign = new(ir) ir_assignment(deref, orig_deref->array_index, NULL); - list.push_tail(assign); - - /* Store the RHS to a temporary to avoid reusing its tree. */ - var = new(ir) ir_variable(ir->rhs->type, "vec_index_tmp_v", - ir_var_temporary, precision_from_ir(ir->rhs)); - list.push_tail(var); - deref = new(ir) ir_dereference_variable(var); - assign = new(ir) ir_assignment(deref, ir->rhs, NULL); - list.push_tail(assign); - - /* Generate a single comparison condition "mask" for all of the components - * in the vector. - */ - ir_rvalue *const cond_deref = - compare_index_block(&list, index, 0, - orig_deref->array->type->vector_elements, - mem_ctx); - - /* Generate a conditional move of each vector element to the temp. */ - for (i = 0; i < (int)orig_deref->array->type->vector_elements; i++) { - ir_rvalue *condition_swizzle = - new(ir) ir_swizzle(cond_deref->clone(ir, NULL), i, 0, 0, 0, 1); - - - /* Just clone the rest of the deref chain when trying to get at the - * underlying variable. - */ - ir_rvalue *swizzle = - new(ir) ir_swizzle(orig_deref->array->clone(mem_ctx, NULL), - i, 0, 0, 0, 1); - - deref = new(ir) ir_dereference_variable(var); - assign = new(ir) ir_assignment(swizzle, deref, condition_swizzle); - list.push_tail(assign); + if (ir->condition) { + ir->condition = convert_vector_extract_to_cond_assign(ir->condition); } - /* If the original assignment has a condition, respect that original - * condition! This is acomplished by wrapping the new conditional - * assignments in an if-statement that uses the original condition. - */ - if (ir->condition != NULL) { - /* No need to clone the condition because the IR that it hangs on is - * going to be removed from the instruction sequence. - */ - ir_if *if_stmt = new(mem_ctx) ir_if(ir->condition); - - list.move_nodes_to(&if_stmt->then_instructions); - ir->insert_before(if_stmt); - } else { - ir->insert_before(&list); - } - - ir->remove(); - - this->progress = true; - return visit_continue; } ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); - ir_rvalue *new_param = convert_vec_index_to_cond_assign(param); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; + ir_rvalue *new_param = convert_vector_extract_to_cond_assign(param); if (new_param != param) { param->replace_with(new_param); @@ -268,7 +214,7 @@ ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_enter(ir_return *ir) { if (ir->value) { - ir->value = convert_vec_index_to_cond_assign(ir->value); + ir->value = convert_vector_extract_to_cond_assign(ir->value); } return visit_continue; @@ -277,7 +223,7 @@ ir_vec_index_to_cond_assign_visitor::visit_enter(ir_return *ir) ir_visitor_status ir_vec_index_to_cond_assign_visitor::visit_enter(ir_if *ir) { - ir->condition = convert_vec_index_to_cond_assign(ir->condition); + ir->condition = convert_vector_extract_to_cond_assign(ir->condition); return visit_continue; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp index cfdfae0d9..b5bb00c30 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vec_index_to_swizzle.cpp @@ -39,6 +39,8 @@ * Visitor class for replacing expressions with ir_constant values. */ +namespace { + class ir_vec_index_to_swizzle_visitor : public ir_hierarchical_visitor { public: ir_vec_index_to_swizzle_visitor() @@ -46,7 +48,7 @@ public: progress = false; } - ir_rvalue *convert_vec_index_to_swizzle(ir_rvalue *val); + ir_rvalue *convert_vector_extract_to_swizzle(ir_rvalue *val); virtual ir_visitor_status visit_enter(ir_expression *); virtual ir_visitor_status visit_enter(ir_swizzle *); @@ -58,21 +60,17 @@ public: bool progress; }; +} /* anonymous namespace */ + ir_rvalue * -ir_vec_index_to_swizzle_visitor::convert_vec_index_to_swizzle(ir_rvalue *ir) +ir_vec_index_to_swizzle_visitor::convert_vector_extract_to_swizzle(ir_rvalue *ir) { - ir_dereference_array *deref = ir->as_dereference_array(); - ir_constant *ir_constant; - - if (!deref) + ir_expression *const expr = ir->as_expression(); + if (expr == NULL || expr->operation != ir_binop_vector_extract) return ir; - if (deref->array->type->is_matrix() || deref->array->type->is_array()) - return ir; - - assert(deref->array_index->type->base_type == GLSL_TYPE_INT); - ir_constant = deref->array_index->constant_expression_value(); - if (!ir_constant) + ir_constant *const idx = expr->operands[1]->constant_expression_value(); + if (idx == NULL) return ir; void *ctx = ralloc_parent(ir); @@ -92,10 +90,10 @@ ir_vec_index_to_swizzle_visitor::convert_vec_index_to_swizzle(ir_rvalue *ir) * The ir_swizzle constructor gets angry if the index is negative or too * large. For simplicity sake, just clamp the index to [0, size-1]. */ - const int i = MIN2(MAX2(ir_constant->value.i[0], 0), - ((int)deref->array->type->vector_elements - 1)); + const int i = CLAMP(idx->value.i[0], 0, + (int) expr->operands[0]->type->vector_elements - 1); - return new(ctx) ir_swizzle(deref->array, i, 0, 0, 0, 1); + return new(ctx) ir_swizzle(expr->operands[0], i, 0, 0, 0, 1); } ir_visitor_status @@ -104,7 +102,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_expression *ir) unsigned int i; for (i = 0; i < ir->get_num_operands(); i++) { - ir->operands[i] = convert_vec_index_to_swizzle(ir->operands[i]); + ir->operands[i] = convert_vector_extract_to_swizzle(ir->operands[i]); } return visit_continue; @@ -117,7 +115,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_swizzle *ir) * the result of indexing a vector is. But maybe at some point we'll end up * using swizzling of scalars for vector construction. */ - ir->val = convert_vec_index_to_swizzle(ir->val); + ir->val = convert_vector_extract_to_swizzle(ir->val); return visit_continue; } @@ -125,8 +123,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_swizzle *ir) ir_visitor_status ir_vec_index_to_swizzle_visitor::visit_enter(ir_assignment *ir) { - ir->set_lhs(convert_vec_index_to_swizzle(ir->lhs)); - ir->rhs = convert_vec_index_to_swizzle(ir->rhs); + ir->rhs = convert_vector_extract_to_swizzle(ir->rhs); return visit_continue; } @@ -134,9 +131,9 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_assignment *ir) ir_visitor_status ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); - ir_rvalue *new_param = convert_vec_index_to_swizzle(param); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; + ir_rvalue *new_param = convert_vector_extract_to_swizzle(param); if (new_param != param) { param->replace_with(new_param); @@ -150,7 +147,7 @@ ir_visitor_status ir_vec_index_to_swizzle_visitor::visit_enter(ir_return *ir) { if (ir->value) { - ir->value = convert_vec_index_to_swizzle(ir->value); + ir->value = convert_vector_extract_to_swizzle(ir->value); } return visit_continue; @@ -159,7 +156,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_return *ir) ir_visitor_status ir_vec_index_to_swizzle_visitor::visit_enter(ir_if *ir) { - ir->condition = convert_vec_index_to_swizzle(ir->condition); + ir->condition = convert_vector_extract_to_swizzle(ir->condition); return visit_continue; } diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vector.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vector.cpp index f10f77a4a..022bcceec 100644 --- a/3rdparty/glsl-optimizer/src/glsl/lower_vector.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vector.cpp @@ -31,9 +31,11 @@ #include "ir.h" #include "ir_rvalue_visitor.h" +namespace { + class lower_vector_visitor : public ir_rvalue_visitor { public: - lower_vector_visitor() : progress(false) + lower_vector_visitor() : dont_lower_swz(false), progress(false) { /* empty */ } @@ -48,6 +50,8 @@ public: bool progress; }; +} /* anonymous namespace */ + /** * Determine if an IR expression tree looks like an extended swizzle * diff --git a/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp b/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp new file mode 100644 index 000000000..6d7cfa942 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/lower_vector_insert.cpp @@ -0,0 +1,142 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include "ir.h" +#include "ir_builder.h" +#include "ir_rvalue_visitor.h" +#include "ir_optimization.h" + +using namespace ir_builder; + +namespace { + +class vector_insert_visitor : public ir_rvalue_visitor { +public: + vector_insert_visitor(bool lower_nonconstant_index) + : progress(false), lower_nonconstant_index(lower_nonconstant_index) + { + factory.instructions = &factory_instructions; + } + + virtual ~vector_insert_visitor() + { + assert(factory_instructions.is_empty()); + } + + virtual void handle_rvalue(ir_rvalue **rv); + + ir_factory factory; + exec_list factory_instructions; + bool progress; + bool lower_nonconstant_index; +}; + +} /* anonymous namespace */ + +void +vector_insert_visitor::handle_rvalue(ir_rvalue **rv) +{ + if (*rv == NULL || (*rv)->ir_type != ir_type_expression) + return; + + ir_expression *const expr = (ir_expression *) *rv; + + if (likely(expr->operation != ir_triop_vector_insert)) + return; + + factory.mem_ctx = ralloc_parent(expr); + + ir_constant *const idx = expr->operands[2]->constant_expression_value(); + if (idx != NULL) { + /* Replace (vector_insert (vec) (scalar) (index)) with a dereference of + * a new temporary. The new temporary gets assigned as + * + * t = vec + * t.mask = scalar + * + * where mask is the component selected by index. + */ + ir_variable *const temp = + factory.make_temp(expr->operands[0]->type, "vec_tmp"); + + const int mask = 1 << idx->value.i[0]; + + factory.emit(assign(temp, expr->operands[0])); + factory.emit(assign(temp, expr->operands[1], mask)); + + this->progress = true; + *rv = new(factory.mem_ctx) ir_dereference_variable(temp); + } else if (this->lower_nonconstant_index) { + /* Replace (vector_insert (vec) (scalar) (index)) with a dereference of + * a new temporary. The new temporary gets assigned as + * + * t = vec + * if (index == 0) + * t.x = scalar + * if (index == 1) + * t.y = scalar + * if (index == 2) + * t.z = scalar + * if (index == 3) + * t.w = scalar + */ + ir_variable *const temp = + factory.make_temp(expr->operands[0]->type, "vec_tmp"); + + ir_variable *const src_temp = + factory.make_temp(expr->operands[1]->type, "src_temp"); + + factory.emit(assign(temp, expr->operands[0])); + factory.emit(assign(src_temp, expr->operands[1])); + + for (unsigned i = 0; i < expr->type->vector_elements; i++) { + ir_constant *const cmp_index = + new(factory.mem_ctx) ir_constant(int(i)); + + ir_variable *const cmp_result = + factory.make_temp(glsl_type::bool_type, "index_condition"); + + factory.emit(assign(cmp_result, + equal(expr->operands[2]->clone(factory.mem_ctx, + NULL), + cmp_index))); + + factory.emit(if_tree(cmp_result, + assign(temp, src_temp, WRITEMASK_X << i))); + } + + this->progress = true; + *rv = new(factory.mem_ctx) ir_dereference_variable(temp); + } + + base_ir->insert_before(factory.instructions); +} + +bool +lower_vector_insert(exec_list *instructions, bool lower_nonconstant_index) +{ + vector_insert_visitor v(lower_nonconstant_index); + + visit_list_elements(&v, instructions); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/main.cpp b/3rdparty/glsl-optimizer/src/glsl/main.cpp index 04143ad43..03b7c786b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/main.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/main.cpp @@ -34,11 +34,12 @@ #include "ast.h" #include "glsl_parser_extras.h" #include "ir_optimization.h" -#include "ir_print_visitor.h" #include "program.h" #include "loop_analysis.h" #include "standalone_scaffolding.h" +static int glsl_version = 330; + static void initialize_context(struct gl_context *ctx, gl_api api) { @@ -47,15 +48,150 @@ initialize_context(struct gl_context *ctx, gl_api api) /* The standalone compiler needs to claim support for almost * everything in order to compile the built-in functions. */ - ctx->Const.GLSLVersion = 140; + ctx->Const.GLSLVersion = glsl_version; + ctx->Extensions.ARB_ES3_compatibility = true; - ctx->Const.MaxClipPlanes = 8; - ctx->Const.MaxDrawBuffers = 2; + switch (ctx->Const.GLSLVersion) { + case 100: + ctx->Const.MaxClipPlanes = 0; + ctx->Const.MaxCombinedTextureImageUnits = 8; + ctx->Const.MaxDrawBuffers = 2; + ctx->Const.MinProgramTexelOffset = 0; + ctx->Const.MaxProgramTexelOffset = 0; + ctx->Const.MaxLights = 0; + ctx->Const.MaxTextureCoordUnits = 0; + ctx->Const.MaxTextureUnits = 8; - /* More than the 1.10 minimum to appease parser tests taken from - * apps that (hopefully) already checked the number of coords. - */ - ctx->Const.MaxTextureCoordUnits = 4; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 8; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 128 * 4; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = + ctx->Const.MaxCombinedTextureImageUnits; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 16 * 4; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ + + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; + break; + case 110: + case 120: + ctx->Const.MaxClipPlanes = 6; + ctx->Const.MaxCombinedTextureImageUnits = 2; + ctx->Const.MaxDrawBuffers = 1; + ctx->Const.MinProgramTexelOffset = 0; + ctx->Const.MaxProgramTexelOffset = 0; + ctx->Const.MaxLights = 8; + ctx->Const.MaxTextureCoordUnits = 2; + ctx->Const.MaxTextureUnits = 2; + + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = + ctx->Const.MaxCombinedTextureImageUnits; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ + + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; + break; + case 130: + case 140: + ctx->Const.MaxClipPlanes = 8; + ctx->Const.MaxCombinedTextureImageUnits = 16; + ctx->Const.MaxDrawBuffers = 8; + ctx->Const.MinProgramTexelOffset = -8; + ctx->Const.MaxProgramTexelOffset = 7; + ctx->Const.MaxLights = 8; + ctx->Const.MaxTextureCoordUnits = 8; + ctx->Const.MaxTextureUnits = 2; + + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64; + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ + + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents / 4; + break; + case 150: + case 330: + ctx->Const.MaxClipPlanes = 8; + ctx->Const.MaxDrawBuffers = 8; + ctx->Const.MinProgramTexelOffset = -8; + ctx->Const.MaxProgramTexelOffset = 7; + ctx->Const.MaxLights = 8; + ctx->Const.MaxTextureCoordUnits = 8; + ctx->Const.MaxTextureUnits = 2; + + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 64; + + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents = 128; + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ + + ctx->Const.MaxCombinedTextureImageUnits = + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits + + ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; + + ctx->Const.MaxGeometryOutputVertices = 256; + ctx->Const.MaxGeometryTotalOutputComponents = 1024; + +// ctx->Const.MaxGeometryVaryingComponents = 64; + + ctx->Const.MaxVarying = 60 / 4; + break; + case 300: + ctx->Const.MaxClipPlanes = 8; + ctx->Const.MaxCombinedTextureImageUnits = 32; + ctx->Const.MaxDrawBuffers = 4; + ctx->Const.MinProgramTexelOffset = -8; + ctx->Const.MaxProgramTexelOffset = 7; + ctx->Const.MaxLights = 0; + ctx->Const.MaxTextureCoordUnits = 0; + ctx->Const.MaxTextureUnits = 0; + + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 1024; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxInputComponents = 0; /* not used */ + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 16 * 4; + + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 16; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 224; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 15 * 4; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxOutputComponents = 0; /* not used */ + + ctx->Const.MaxVarying = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents / 4; + break; + } ctx->Driver.NewShader = _mesa_new_shader; } @@ -103,18 +239,17 @@ load_text_file(void *ctx, const char *file_name) return text; } -int glsl_es = 0; int dump_ast = 0; int dump_hir = 0; int dump_lir = 0; int do_link = 0; const struct option compiler_opts[] = { - { "glsl-es", 0, &glsl_es, 1 }, - { "dump-ast", 0, &dump_ast, 1 }, - { "dump-hir", 0, &dump_hir, 1 }, - { "dump-lir", 0, &dump_lir, 1 }, - { "link", 0, &do_link, 1 }, + { "dump-ast", no_argument, &dump_ast, 1 }, + { "dump-hir", no_argument, &dump_hir, 1 }, + { "dump-lir", no_argument, &dump_lir, 1 }, + { "link", no_argument, &do_link, 1 }, + { "version", required_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; @@ -141,69 +276,15 @@ void compile_shader(struct gl_context *ctx, struct gl_shader *shader) { struct _mesa_glsl_parse_state *state = - new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader); - - const char *source = shader->Source; - state->error = glcpp_preprocess(state, &source, &state->info_log, - state->extensions, ctx->API) != 0; - - if (!state->error) { - _mesa_glsl_lexer_ctor(state, source); - _mesa_glsl_parse(state); - _mesa_glsl_lexer_dtor(state); - } - - if (dump_ast) { - foreach_list_const(n, &state->translation_unit) { - ast_node *ast = exec_node_data(ast_node, n, link); - ast->print(); - } - printf("\n\n"); - } - - shader->ir = new(shader) exec_list; - if (!state->error && !state->translation_unit.is_empty()) - _mesa_ast_to_hir(shader->ir, state); - - /* Print out the unoptimized IR. */ - if (!state->error && dump_hir) { - validate_ir_tree(shader->ir); - _mesa_print_ir(shader->ir, state); - } - - /* Optimization passes */ - if (!state->error && !shader->ir->is_empty()) { - bool progress; - do { - progress = do_common_optimization(shader->ir, false, false, 32); - } while (progress); - - validate_ir_tree(shader->ir); - } + new(shader) _mesa_glsl_parse_state(ctx, shader->Stage, shader); + _mesa_glsl_compile_shader(ctx, shader, dump_ast, dump_hir); /* Print out the resulting IR */ if (!state->error && dump_lir) { _mesa_print_ir(shader->ir, state); } - shader->symbols = state->symbols; - shader->CompileStatus = !state->error; - shader->Version = state->language_version; - memcpy(shader->builtins_to_link, state->builtins_to_link, - sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link); - shader->num_builtins_to_link = state->num_builtins_to_link; - - if (shader->InfoLog) - ralloc_free(shader->InfoLog); - - shader->InfoLog = state->info_log; - - /* Retain any live IR, but trash the rest. */ - reparent_ir(shader->ir, shader); - - ralloc_free(state); - return; } @@ -213,17 +294,43 @@ main(int argc, char **argv) int status = EXIT_SUCCESS; struct gl_context local_ctx; struct gl_context *ctx = &local_ctx; + bool glsl_es = false; int c; int idx = 0; - while ((c = getopt_long(argc, argv, "", compiler_opts, &idx)) != -1) - /* empty */ ; + while ((c = getopt_long(argc, argv, "", compiler_opts, &idx)) != -1) { + switch (c) { + case 'v': + glsl_version = strtol(optarg, NULL, 10); + switch (glsl_version) { + case 100: + case 300: + glsl_es = true; + break; + case 110: + case 120: + case 130: + case 140: + case 150: + case 330: + glsl_es = false; + break; + default: + fprintf(stderr, "Unrecognized GLSL version `%s'\n", optarg); + usage_fail(argv[0]); + break; + } + break; + default: + break; + } + } if (argc <= optind) usage_fail(argv[0]); - initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL); + initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL_COMPAT); struct gl_shader_program *whole_program; @@ -255,6 +362,7 @@ main(int argc, char **argv) shader->Type = GL_FRAGMENT_SHADER; else usage_fail(argv[0]); + shader->Stage = _mesa_shader_enum_to_shader_stage(shader->Type); shader->Source = load_text_file(whole_program, argv[optind]); if (shader->Source == NULL) { @@ -264,8 +372,10 @@ main(int argc, char **argv) compile_shader(ctx, shader); - if (!shader->CompileStatus) { + if (strlen(shader->InfoLog) > 0) printf("Info log for %s:\n%s\n", argv[optind], shader->InfoLog); + + if (!shader->CompileStatus) { status = EXIT_FAILURE; break; } @@ -279,12 +389,12 @@ main(int argc, char **argv) printf("Info log for linking:\n%s\n", whole_program->InfoLog); } - for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) ralloc_free(whole_program->_LinkedShaders[i]); ralloc_free(whole_program); _mesa_glsl_release_types(); - _mesa_glsl_release_functions(); + _mesa_glsl_release_builtin_functions(); return status; } diff --git a/3rdparty/glsl-optimizer/src/glsl/msvc/.gitignore b/3rdparty/glsl-optimizer/src/glsl/msvc/.gitignore deleted file mode 100644 index bd0540649..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/msvc/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.ncb -*.user -*.suo -_ReSharper.* -build \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj b/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj deleted file mode 100644 index 0e267c74b..000000000 --- a/3rdparty/glsl-optimizer/src/glsl/msvc/mesaglsl2.vcproj +++ /dev/null @@ -1,1045 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp index d77fcc540..69a1ec031 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_algebraic.cpp @@ -32,8 +32,11 @@ #include "ir_visitor.h" #include "ir_rvalue_visitor.h" #include "ir_optimization.h" +#include "ir_builder.h" #include "glsl_types.h" +using namespace ir_builder; + namespace { /** @@ -84,6 +87,18 @@ is_vec_one(ir_constant *ir) return (ir == NULL) ? false : ir->is_one(); } +static inline bool +is_vec_two(ir_constant *ir) +{ + return (ir == NULL) ? false : ir->is_value(2.0, 2); +} + +static inline bool +is_vec_negative_one(ir_constant *ir) +{ + return (ir == NULL) ? false : ir->is_negative_one(); +} + static inline bool is_vec_basis(ir_constant *ir) { @@ -192,13 +207,11 @@ ir_algebraic_visitor::swizzle_if_required(ir_expression *expr, ir_rvalue * ir_algebraic_visitor::handle_expression(ir_expression *ir) { - ir_constant *op_const[2] = {NULL, NULL}; - ir_expression *op_expr[2] = {NULL, NULL}; - ir_expression *temp; + ir_constant *op_const[4] = {NULL, NULL, NULL, NULL}; + ir_expression *op_expr[4] = {NULL, NULL, NULL, NULL}; unsigned int i; - if (ir->get_num_operands() > 2) - return ir; + assert(ir->get_num_operands() <= 4); for (i = 0; i < ir->get_num_operands(); i++) { if (ir->operands[i]->type->is_matrix()) return ir; @@ -211,6 +224,36 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) this->mem_ctx = ralloc_parent(ir); switch (ir->operation) { + case ir_unop_abs: + if (op_expr[0] == NULL) + break; + + switch (op_expr[0]->operation) { + case ir_unop_abs: + case ir_unop_neg: + return abs(op_expr[0]->operands[0]); + default: + break; + } + break; + + case ir_unop_neg: + if (op_expr[0] == NULL) + break; + + if (op_expr[0]->operation == ir_unop_neg) { + return op_expr[0]->operands[0]; + } + if (op_expr[0] && op_expr[0]->operation == ir_binop_sub) { + // -(A-B) => (B-A) + this->progress = true; + return new(mem_ctx) ir_expression(ir_binop_sub, + ir->type, + op_expr[0]->operands[1], + op_expr[0]->operands[0]); + } + break; + case ir_unop_logic_not: { enum ir_expression_operation new_op = ir_unop_logic_not; @@ -234,7 +277,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) } if (new_op != ir_unop_logic_not) { - this->progress = true; return new(mem_ctx) ir_expression(new_op, ir->type, op_expr[0]->operands[0], @@ -244,103 +286,127 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) break; } - case ir_unop_neg: { - if (op_expr[0] && op_expr[0]->operation == ir_binop_sub) { - // -(A-B) => (B-A) - this->progress = true; - return new(mem_ctx) ir_expression(ir_binop_sub, - ir->type, - op_expr[0]->operands[1], - op_expr[0]->operands[0]); - } - break; - } - case ir_binop_add: - if (is_vec_zero(op_const[0])) { - this->progress = true; - return swizzle_if_required(ir, ir->operands[1]); - } - if (is_vec_zero(op_const[1])) { - this->progress = true; - return swizzle_if_required(ir, ir->operands[0]); - } + if (is_vec_zero(op_const[0])) + return ir->operands[1]; + if (is_vec_zero(op_const[1])) + return ir->operands[0]; /* Reassociate addition of constants so that we can do constant * folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); + + // A + (-B) => A-B + if (op_expr[1] && op_expr[1]->operation == ir_unop_neg) { + this->progress = true; + return sub(ir->operands[0], op_expr[1]->operands[0]); + } + + /* Replace (-x + y) * a + x and commutative variations with lrp(x, y, a). + * + * (-x + y) * a + x + * (x * -a) + (y * a) + x + * x + (x * -a) + (y * a) + * x * (1 - a) + y * a + * lrp(x, y, a) + */ + for (int mul_pos = 0; mul_pos < 2; mul_pos++) { + ir_expression *mul = op_expr[mul_pos]; + + if (!mul || mul->operation != ir_binop_mul) + continue; + + /* Multiply found on one of the operands. Now check for an + * inner addition operation. + */ + for (int inner_add_pos = 0; inner_add_pos < 2; inner_add_pos++) { + ir_expression *inner_add = + mul->operands[inner_add_pos]->as_expression(); + + if (!inner_add || inner_add->operation != ir_binop_add) + continue; + + /* Inner addition found on one of the operands. Now check for + * one of the operands of the inner addition to be the negative + * of x_operand. + */ + for (int neg_pos = 0; neg_pos < 2; neg_pos++) { + ir_expression *neg = + inner_add->operands[neg_pos]->as_expression(); + + if (!neg || neg->operation != ir_unop_neg) + continue; + + ir_rvalue *x_operand = ir->operands[1 - mul_pos]; + + if (!neg->operands[0]->equals(x_operand)) + continue; + + ir_rvalue *y_operand = inner_add->operands[1 - neg_pos]; + ir_rvalue *a_operand = mul->operands[1 - inner_add_pos]; + + if (x_operand->type != y_operand->type || + x_operand->type != a_operand->type) + continue; + + return lrp(x_operand, y_operand, a_operand); + } + } + } break; case ir_binop_sub: - if (is_vec_zero(op_const[0])) { - this->progress = true; - temp = new(mem_ctx) ir_expression(ir_unop_neg, - ir->operands[1]->type, - ir->operands[1], - NULL); - return swizzle_if_required(ir, temp); - } - if (is_vec_zero(op_const[1])) { - this->progress = true; - return swizzle_if_required(ir, ir->operands[0]); - } + if (is_vec_zero(op_const[0])) + return neg(ir->operands[1]); + if (is_vec_zero(op_const[1])) + return ir->operands[0]; break; case ir_binop_mul: - if (is_vec_one(op_const[0])) { - this->progress = true; - return swizzle_if_required(ir, ir->operands[1]); - } - if (is_vec_one(op_const[1])) { - this->progress = true; - return swizzle_if_required(ir, ir->operands[0]); - } + if (is_vec_one(op_const[0])) + return ir->operands[1]; + if (is_vec_one(op_const[1])) + return ir->operands[0]; - if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) { - this->progress = true; + if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) return ir_constant::zero(ir, ir->type); - } + + if (is_vec_negative_one(op_const[0])) + return neg(ir->operands[1]); + if (is_vec_negative_one(op_const[1])) + return neg(ir->operands[0]); + /* Reassociate multiplication of constants so that we can do * constant folding. */ if (op_const[0] && !op_const[1]) - reassociate_constant(ir, 0, op_const[0], - ir->operands[1]->as_expression()); + reassociate_constant(ir, 0, op_const[0], op_expr[1]); if (op_const[1] && !op_const[0]) - reassociate_constant(ir, 1, op_const[1], - ir->operands[0]->as_expression()); + reassociate_constant(ir, 1, op_const[1], op_expr[0]); break; case ir_binop_div: if (is_vec_one(op_const[0]) && ir->type->base_type == GLSL_TYPE_FLOAT) { - this->progress = true; - temp = new(mem_ctx) ir_expression(ir_unop_rcp, + return new(mem_ctx) ir_expression(ir_unop_rcp, ir->operands[1]->type, ir->operands[1], NULL); - return swizzle_if_required(ir, temp); - } - if (is_vec_one(op_const[1])) { - this->progress = true; - return swizzle_if_required(ir, ir->operands[0]); } + if (is_vec_one(op_const[1])) + return ir->operands[0]; break; case ir_binop_dot: - if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) { - this->progress = true; + if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) return ir_constant::zero(mem_ctx, ir->type); - } + if (is_vec_basis(op_const[0])) { - this->progress = true; unsigned component = 0; for (unsigned c = 0; c < op_const[0]->type->vector_elements; c++) { if (op_const[0]->value.f[c] == 1.0) @@ -349,7 +415,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) return new(mem_ctx) ir_swizzle(ir->operands[1], component, 0, 0, 0, 1); } if (is_vec_basis(op_const[1])) { - this->progress = true; unsigned component = 0; for (unsigned c = 0; c < op_const[1]->type->vector_elements; c++) { if (op_const[1]->value.f[c] == 1.0) @@ -359,46 +424,55 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) } break; + case ir_binop_rshift: + case ir_binop_lshift: + /* 0 >> x == 0 */ + if (is_vec_zero(op_const[0])) + return ir->operands[0]; + /* x >> 0 == x */ + if (is_vec_zero(op_const[1])) + return ir->operands[0]; + break; + case ir_binop_logic_and: - /* FINISHME: Also simplify (a && a) to (a). */ if (is_vec_one(op_const[0])) { - this->progress = true; return ir->operands[1]; } else if (is_vec_one(op_const[1])) { - this->progress = true; return ir->operands[0]; } else if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) { - this->progress = true; return ir_constant::zero(mem_ctx, ir->type); + } else if (op_expr[0] && op_expr[0]->operation == ir_unop_logic_not && + op_expr[1] && op_expr[1]->operation == ir_unop_logic_not) { + /* De Morgan's Law: + * (not A) and (not B) === not (A or B) + */ + return logic_not(logic_or(op_expr[0]->operands[0], + op_expr[1]->operands[0])); + } else if (ir->operands[0]->equals(ir->operands[1])) { + /* (a && a) == a */ + return ir->operands[0]; } break; case ir_binop_logic_xor: - /* FINISHME: Also simplify (a ^^ a) to (false). */ if (is_vec_zero(op_const[0])) { - this->progress = true; return ir->operands[1]; } else if (is_vec_zero(op_const[1])) { - this->progress = true; return ir->operands[0]; } else if (is_vec_one(op_const[0])) { - this->progress = true; - return new(mem_ctx) ir_expression(ir_unop_logic_not, ir->type, - ir->operands[1], NULL); + return logic_not(ir->operands[1]); } else if (is_vec_one(op_const[1])) { - this->progress = true; - return new(mem_ctx) ir_expression(ir_unop_logic_not, ir->type, - ir->operands[0], NULL); + return logic_not(ir->operands[0]); + } else if (ir->operands[0]->equals(ir->operands[1])) { + /* (a ^^ a) == false */ + return ir_constant::zero(mem_ctx, ir->type); } break; case ir_binop_logic_or: - /* FINISHME: Also simplify (a || a) to (a). */ if (is_vec_zero(op_const[0])) { - this->progress = true; return ir->operands[1]; } else if (is_vec_zero(op_const[1])) { - this->progress = true; return ir->operands[0]; } else if (is_vec_one(op_const[0]) || is_vec_one(op_const[1])) { ir_constant_data data; @@ -406,34 +480,57 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) for (unsigned i = 0; i < 16; i++) data.b[i] = true; - this->progress = true; return new(mem_ctx) ir_constant(ir->type, &data); + } else if (op_expr[0] && op_expr[0]->operation == ir_unop_logic_not && + op_expr[1] && op_expr[1]->operation == ir_unop_logic_not) { + /* De Morgan's Law: + * (not A) or (not B) === not (A and B) + */ + return logic_not(logic_and(op_expr[0]->operands[0], + op_expr[1]->operands[0])); + } else if (ir->operands[0]->equals(ir->operands[1])) { + /* (a || a) == a */ + return ir->operands[0]; } break; - case ir_unop_rcp: - if (op_expr[0] && op_expr[0]->operation == ir_unop_rcp) { - this->progress = true; - return op_expr[0]->operands[0]; - } + case ir_binop_pow: + /* 1^x == 1 */ + if (is_vec_one(op_const[0])) + return op_const[0]; - /* FINISHME: We should do rcp(rsq(x)) -> sqrt(x) for some - * backends, except that some backends will have done sqrt -> - * rcp(rsq(x)) and we don't want to undo it for them. + /* pow(2,x) == exp2(x) */ + if (is_vec_two(op_const[0])) + return expr(ir_unop_exp2, ir->operands[1]); + + break; + + case ir_unop_rcp: + if (op_expr[0] && op_expr[0]->operation == ir_unop_rcp) + return op_expr[0]->operands[0]; + + /* While ir_to_mesa.cpp will lower sqrt(x) to rcp(rsq(x)), it does so at + * its IR level, so we can always apply this transformation. */ + if (op_expr[0] && op_expr[0]->operation == ir_unop_rsq) + return sqrt(op_expr[0]->operands[0]); /* As far as we know, all backends are OK with rsq. */ if (op_expr[0] && op_expr[0]->operation == ir_unop_sqrt) { - this->progress = true; - temp = new(mem_ctx) ir_expression(ir_unop_rsq, - op_expr[0]->operands[0]->type, - op_expr[0]->operands[0], - NULL); - return swizzle_if_required(ir, temp); + return rsq(op_expr[0]->operands[0]); } break; + case ir_triop_lrp: + /* Operands are (x, y, a). */ + if (is_vec_zero(op_const[2])) { + return ir->operands[0]; + } else if (is_vec_one(op_const[2])) { + return ir->operands[1]; + } + break; + default: break; } @@ -451,7 +548,17 @@ ir_algebraic_visitor::handle_rvalue(ir_rvalue **rvalue) if (!expr || expr->operation == ir_quadop_vector) return; - *rvalue = handle_expression(expr); + ir_rvalue *new_rvalue = handle_expression(expr); + if (new_rvalue == *rvalue) + return; + + /* If the expr used to be some vec OP scalar returning a vector, and the + * optimization gave us back a scalar, we still need to turn it into a + * vector. + */ + *rvalue = swizzle_if_required(expr, new_rvalue); + + this->progress = true; } bool diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp index c2056838c..35d8ae630 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_array_splitting.cpp @@ -36,11 +36,12 @@ #include "ir.h" #include "ir_visitor.h" #include "ir_rvalue_visitor.h" -#include "ir_print_visitor.h" #include "glsl_types.h" static bool debug = false; +namespace { + namespace opt_array_splitting { class variable_entry : public exec_node @@ -78,6 +79,7 @@ public: }; } /* namespace */ + using namespace opt_array_splitting; /** @@ -113,13 +115,15 @@ public: void *mem_ctx; }; +} /* namespace */ + variable_entry * ir_array_reference_visitor::get_variable_entry(ir_variable *var) { assert(var); - if (var->mode != ir_var_auto && - var->mode != ir_var_temporary) + if (var->data.mode != ir_var_auto && + var->data.mode != ir_var_temporary) return NULL; if (!(var->type->is_array() || var->type->is_matrix())) @@ -128,11 +132,11 @@ ir_array_reference_visitor::get_variable_entry(ir_variable *var) /* If the array hasn't been sized yet, we can't split it. After * linking, this should be resolved. */ - if (var->type->is_array() && var->type->length == 0) + if (var->type->is_unsized_array()) return NULL; - foreach_iter(exec_list_iterator, iter, this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, &this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) return entry; } @@ -220,8 +224,8 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions, } /* Trim out variables we found that we can't split. */ - foreach_iter(exec_list_iterator, iter, variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list_safe(n, &variable_list) { + variable_entry *entry = (variable_entry *) n; if (debug) { printf("array %s@%p: decl %d, split %d\n", @@ -266,8 +270,8 @@ ir_array_splitting_visitor::get_splitting_entry(ir_variable *var) { assert(var); - foreach_iter(exec_list_iterator, iter, *this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) { return entry; } @@ -364,11 +368,11 @@ optimize_split_arrays(exec_list *instructions, bool linked) /* Replace the decls of the arrays to be split with their split * components. */ - foreach_iter(exec_list_iterator, iter, refs.variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, &refs.variable_list) { + variable_entry *entry = (variable_entry *) n; const struct glsl_type *type = entry->var->type; const struct glsl_type *subtype; - glsl_precision subprec = (glsl_precision)entry->var->precision; + glsl_precision subprec = (glsl_precision)entry->var->data.precision; if (type->is_matrix()) { subtype = type->column_type(); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp index 7d94d481c..d0e575460 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_constant_folding.cpp @@ -122,12 +122,13 @@ ir_visitor_status ir_constant_folding_visitor::visit_enter(ir_call *ir) { /* Attempt to constant fold parameters */ - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *sig_param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *sig_param = (ir_variable *) formal_node; - if (sig_param->mode == ir_var_in || sig_param->mode == ir_var_const_in) { + if (sig_param->data.mode == ir_var_function_in + || sig_param->data.mode == ir_var_const_in) { ir_rvalue *new_param = param_rval; handle_rvalue(&new_param); @@ -135,7 +136,6 @@ ir_constant_folding_visitor::visit_enter(ir_call *ir) param_rval->replace_with(new_param); } } - sig_iter.next(); } /* Next, see if the call can be replaced with an assignment of a constant */ diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp index 270c9ea51..9865dcbf0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_constant_propagation.cpp @@ -92,6 +92,7 @@ public: ir_constant_propagation_visitor() { progress = false; + killed_all = false; mem_ctx = ralloc_context(0); this->acp = new(mem_ctx) exec_list; this->kills = new(mem_ctx) exec_list; @@ -171,8 +172,8 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue) channel = i; } - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (entry->var == deref->var && entry->write_mask & (1 << channel)) { found = entry; break; @@ -280,11 +281,12 @@ ir_visitor_status ir_constant_propagation_visitor::visit_enter(ir_call *ir) { /* Do constant propagation on call parameters, but skip any out params */ - exec_list_iterator sig_param_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { - ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); - ir_rvalue *param = (ir_rvalue *)iter.get(); - if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) { + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *param = (ir_rvalue *) actual_node; + if (sig_param->data.mode != ir_var_function_out + && sig_param->data.mode != ir_var_function_inout) { ir_rvalue *new_param = param; handle_rvalue(&new_param); if (new_param != param) @@ -292,14 +294,13 @@ ir_constant_propagation_visitor::visit_enter(ir_call *ir) else param->accept(this); } - sig_param_iter.next(); } /* Since we're unlinked, we don't (necssarily) know the side effects of * this call. So kill all copies. Except if it's a built-in; we know * they are side effect free. */ - if (!ir->callee->is_builtin) { + if (!ir->callee->is_builtin()) { acp->make_empty(); this->killed_all = true; } @@ -319,8 +320,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a constant of the original */ - foreach_iter(exec_list_iterator, iter, *orig_acp) { - acp_entry *a = (acp_entry *)iter.get(); + foreach_list(n, orig_acp) { + acp_entry *a = (acp_entry *) n; this->acp->push_tail(new(this->mem_ctx) acp_entry(a)); } @@ -335,8 +336,8 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var, k->write_mask); } } @@ -380,8 +381,8 @@ ir_constant_propagation_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var, k->write_mask); } @@ -399,8 +400,8 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) return; /* Remove any entries currently in the ACP for this kill. */ - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list_safe(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (entry->var == var) { entry->write_mask &= ~write_mask; @@ -412,8 +413,8 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask) /* Add this writemask of the variable to the list of killed * variables in this block. */ - foreach_iter(exec_list_iterator, iter, *this->kills) { - kill_entry *entry = (kill_entry *)iter.get(); + foreach_list(n, this->kills) { + kill_entry *entry = (kill_entry *) n; if (entry->var == var) { entry->write_mask |= write_mask; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp index 5b8dcc25e..2a5628942 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_constant_variable.cpp @@ -133,13 +133,13 @@ ir_visitor_status ir_constant_variable_visitor::visit_enter(ir_call *ir) { /* Mark any out parameters as assigned to */ - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param_rval = (ir_rvalue *)iter.get(); - ir_variable *param = (ir_variable *)sig_iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_rvalue *param_rval = (ir_rvalue *) actual_node; + ir_variable *param = (ir_variable *) formal_node; - if (param->mode == ir_var_out || - param->mode == ir_var_inout) { + if (param->data.mode == ir_var_function_out || + param->data.mode == ir_var_function_inout) { ir_variable *var = param_rval->variable_referenced(); struct assignment_entry *entry; @@ -147,7 +147,6 @@ ir_constant_variable_visitor::visit_enter(ir_call *ir) entry = get_assignment_entry(var, &this->list); entry->assignment_count++; } - sig_iter.next(); } /* Mark the return storage as having been assigned to */ @@ -167,9 +166,9 @@ ir_visitor_status ir_constant_variable_visitor::visit_enter(ir_function_signature *ir) { /* Mark any in parameters as assigned to */ - foreach_iter(exec_list_iterator, iter, ir->parameters) { - ir_variable *var = (ir_variable *)iter.get(); - if (var->mode == ir_var_in || var->mode == ir_var_const_in || var->mode == ir_var_inout) { + foreach_list(n, &ir->parameters) { + ir_variable *var = (ir_variable *)n; + if (var->data.mode == ir_var_function_in || var->data.mode == ir_var_const_in || var->data.mode == ir_var_function_inout) { struct assignment_entry *entry; entry = get_assignment_entry(var, &this->list); entry->assignment_count++; @@ -212,13 +211,12 @@ do_constant_variable_unlinked(exec_list *instructions) { bool progress = false; - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_function *f = ir->as_function(); if (f) { - foreach_iter(exec_list_iterator, sigiter, *f) { - ir_function_signature *sig = - (ir_function_signature *) sigiter.get(); + foreach_list(signode, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) signode; if (do_constant_variable(&sig->body)) progress = true; } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp index 7901c819d..2beede4a8 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation.cpp @@ -167,8 +167,8 @@ ir_copy_propagation_visitor::visit(ir_dereference_variable *ir) ir_variable *var = ir->var; - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (var == entry->lhs) { ir->var = entry->rhs; @@ -185,21 +185,21 @@ ir_visitor_status ir_copy_propagation_visitor::visit_enter(ir_call *ir) { /* Do copy propagation on call parameters, but skip any out params */ - exec_list_iterator sig_param_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { - ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); - ir_instruction *ir = (ir_instruction *)iter.get(); - if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) { + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *ir = (ir_rvalue *) actual_node; + if (sig_param->data.mode != ir_var_function_out + && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); } - sig_param_iter.next(); } /* Since we're unlinked, we don't (necessarily) know the side effects of * this call. So kill all copies. * For any built-in functions, do not do this; they are side effect-free. */ - if (!ir->callee->is_builtin) { + if (!ir->callee->is_builtin()) { acp->make_empty(); this->killed_all = true; } @@ -219,8 +219,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a copy of the original */ - foreach_iter(exec_list_iterator, iter, *orig_acp) { - acp_entry *a = (acp_entry *)iter.get(); + foreach_list(n, orig_acp) { + acp_entry *a = (acp_entry *) n; this->acp->push_tail(new(this->mem_ctx) acp_entry(a->lhs, a->rhs)); } @@ -235,8 +235,8 @@ ir_copy_propagation_visitor::handle_if_block(exec_list *instructions) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var); } } @@ -279,8 +279,8 @@ ir_copy_propagation_visitor::visit_enter(ir_loop *ir) this->acp = orig_acp; this->killed_all = this->killed_all || orig_killed_all; - foreach_iter(exec_list_iterator, iter, *new_kills) { - kill_entry *k = (kill_entry *)iter.get(); + foreach_list(n, new_kills) { + kill_entry *k = (kill_entry *) n; kill(k->var); } @@ -294,8 +294,8 @@ ir_copy_propagation_visitor::kill(ir_variable *var) assert(var != NULL); /* Remove any entries currently in the ACP for this kill. */ - foreach_iter(exec_list_iterator, iter, *acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list_safe(n, acp) { + acp_entry *entry = (acp_entry *) n; if (entry->lhs == var || entry->rhs == var) { entry->remove(); @@ -332,7 +332,7 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir) ir->condition = new(ralloc_parent(ir)) ir_constant(false); this->progress = true; } else { - if (lhs_var->precision == rhs_var->precision || lhs_var->precision==glsl_precision_undefined || rhs_var->precision==glsl_precision_undefined) { + if (lhs_var->data.precision == rhs_var->data.precision || lhs_var->data.precision==glsl_precision_undefined || rhs_var->data.precision==glsl_precision_undefined) { entry = new(this->mem_ctx) acp_entry(lhs_var, rhs_var); this->acp->push_tail(entry); } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp index 7d1936305..95160de80 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_copy_propagation_elements.cpp @@ -244,8 +244,8 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) /* Try to find ACP entries covering swizzle_chan[], hoping they're * the same source variable. */ - foreach_iter(exec_list_iterator, iter, *this->acp) { - acp_entry *entry = (acp_entry *)iter.get(); + foreach_list(n, this->acp) { + acp_entry *entry = (acp_entry *) n; if (var == entry->lhs) { for (int c = 0; c < chans; c++) { @@ -293,21 +293,21 @@ ir_visitor_status ir_copy_propagation_elements_visitor::visit_enter(ir_call *ir) { /* Do copy propagation on call parameters, but skip any out params */ - exec_list_iterator sig_param_iter = ir->callee->parameters.iterator(); - foreach_iter(exec_list_iterator, iter, ir->actual_parameters) { - ir_variable *sig_param = (ir_variable *)sig_param_iter.get(); - ir_instruction *ir = (ir_instruction *)iter.get(); - if (sig_param->mode != ir_var_out && sig_param->mode != ir_var_inout) { + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *ir = (ir_rvalue *) actual_node; + if (sig_param->data.mode != ir_var_function_out + && sig_param->data.mode != ir_var_function_inout) { ir->accept(this); } - sig_param_iter.next(); } /* Since we're unlinked, we don't (necessarily) know the side effects of * this call. So kill all copies. Except if it's a built-in; we know * they are side effect free. */ - if (!ir->callee->is_builtin) { + if (!ir->callee->is_builtin()) { acp->make_empty(); this->killed_all = true; } @@ -327,8 +327,8 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions) this->killed_all = false; /* Populate the initial acp with a copy of the original */ - foreach_iter(exec_list_iterator, iter, *orig_acp) { - acp_entry *a = (acp_entry *)iter.get(); + foreach_list(n, orig_acp) { + acp_entry *a = (acp_entry *) n; this->acp->push_tail(new(this->mem_ctx) acp_entry(a)); } @@ -469,7 +469,7 @@ ir_copy_propagation_elements_visitor::add_copy(ir_assignment *ir) swizzle[i] = orig_swizzle[j++]; } - if (lhs->var->precision != rhs->var->precision && lhs->var->precision!=glsl_precision_undefined && rhs->var->precision!=glsl_precision_undefined) + if (lhs->var->data.precision != rhs->var->data.precision && lhs->var->data.precision!=glsl_precision_undefined && rhs->var->data.precision!=glsl_precision_undefined) return; int write_mask = ir->write_mask; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp new file mode 100644 index 000000000..284aac2d2 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_cse.cpp @@ -0,0 +1,424 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_cse.cpp + * + * constant subexpression elimination at the GLSL IR level. + * + * Compare to brw_fs_cse.cpp for a more complete CSE implementation. This one + * is generic and handles texture operations, but it's rather simple currently + * and doesn't support modification of variables in the available expressions + * list, so it can't do variables other than uniforms or shader inputs. + */ + +#include "ir.h" +#include "ir_visitor.h" +#include "ir_rvalue_visitor.h" +#include "ir_basic_block.h" +#include "ir_optimization.h" +#include "ir_builder.h" +#include "glsl_types.h" + +using namespace ir_builder; + +static bool debug = false; + +namespace { + +/** + * This is the record of an available expression for common subexpression + * elimination. + */ +class ae_entry : public exec_node +{ +public: + ae_entry(ir_instruction *base_ir, ir_rvalue **val) + : val(val), base_ir(base_ir) + { + assert(val); + assert(*val); + assert(base_ir); + + var = NULL; + } + + /** + * The pointer to the expression that we might be able to reuse + * + * Note the double pointer -- this is the place in the base_ir expression + * tree that we would rewrite to move the expression out to a new variable + * assignment. + */ + ir_rvalue **val; + + /** + * Root instruction in the basic block where the expression appeared. + * + * This is used so that we can insert the new variable declaration into the + * instruction stream (since *val is just somewhere in base_ir's expression + * tree). + */ + ir_instruction *base_ir; + + /** + * The variable that the expression has been stored in, if it's been CSEd + * once already. + */ + ir_variable *var; +}; + +class cse_visitor : public ir_rvalue_visitor { +public: + cse_visitor(exec_list *validate_instructions) + : validate_instructions(validate_instructions) + { + progress = false; + mem_ctx = ralloc_context(NULL); + this->ae = new(mem_ctx) exec_list; + } + ~cse_visitor() + { + ralloc_free(mem_ctx); + } + + virtual ir_visitor_status visit_enter(ir_function_signature *ir); + virtual ir_visitor_status visit_enter(ir_loop *ir); + virtual ir_visitor_status visit_enter(ir_if *ir); + virtual ir_visitor_status visit_enter(ir_call *ir); + virtual void handle_rvalue(ir_rvalue **rvalue); + + bool progress; + +private: + void *mem_ctx; + + ir_rvalue *try_cse(ir_rvalue *rvalue); + void add_to_ae(ir_rvalue **rvalue); + + /** List of ae_entry: The available expressions to reuse */ + exec_list *ae; + + /** + * The whole shader, so that we can validate_ir_tree in debug mode. + * + * This proved quite useful when trying to get the tree manipulation + * right. + */ + exec_list *validate_instructions; +}; + +/** + * Visitor to walk an expression tree to check that all variables referenced + * are constants. + */ +class is_cse_candidate_visitor : public ir_hierarchical_visitor +{ +public: + + is_cse_candidate_visitor() + : ok(true) + { + } + + virtual ir_visitor_status visit(ir_dereference_variable *ir); + + bool ok; +}; + + +class contains_rvalue_visitor : public ir_rvalue_visitor +{ +public: + + contains_rvalue_visitor(ir_rvalue *val) + : val(val) + { + found = false; + } + + virtual void handle_rvalue(ir_rvalue **rvalue); + + bool found; + +private: + ir_rvalue *val; +}; + +} /* unnamed namespace */ + +static void +dump_ae(exec_list *ae) +{ + int i = 0; + + printf("CSE: AE contents:\n"); + foreach_list(node, ae) { + ae_entry *entry = (ae_entry *)node; + + printf("CSE: AE %2d (%p): ", i, entry); + (*entry->val)->print(); + printf("\n"); + + if (entry->var) + printf("CSE: in var %p:\n", entry->var); + + i++; + } +} + +ir_visitor_status +is_cse_candidate_visitor::visit(ir_dereference_variable *ir) +{ + /* Currently, since we don't handle kills of the ae based on variables + * getting assigned, we can only handle constant variables. + */ + if (ir->var->data.read_only) { + return visit_continue; + } else { + ok = false; + return visit_stop; + } +} + +void +contains_rvalue_visitor::handle_rvalue(ir_rvalue **rvalue) +{ + if (*rvalue == val) + found = true; +} + +static bool +contains_rvalue(ir_rvalue *haystack, ir_rvalue *needle) +{ + contains_rvalue_visitor v(needle); + haystack->accept(&v); + return v.found; +} + +static bool +is_cse_candidate(ir_rvalue *ir) +{ + /* Our temporary variable assignment generation isn't ready to handle + * anything bigger than a vector. + */ + if (!ir->type->is_vector() && !ir->type->is_scalar()) + return false; + + /* Only handle expressions and textures currently. We may want to extend + * to variable-index array dereferences at some point. + */ + switch (ir->ir_type) { + case ir_type_expression: + case ir_type_texture: + break; + default: + return false; + } + + is_cse_candidate_visitor v; + + ir->accept(&v); + + return v.ok; +} + + +/** + * Tries to find and return a reference to a previous computation of a given + * expression. + * + * Walk the list of available expressions checking if any of them match the + * rvalue, and if so, move the previous copy of the expression to a temporary + * and return a reference of the temporary. + */ +ir_rvalue * +cse_visitor::try_cse(ir_rvalue *rvalue) +{ + foreach_list(node, ae) { + ae_entry *entry = (ae_entry *)node; + + if (debug) { + printf("Comparing to AE %p: ", entry); + (*entry->val)->print(); + printf("\n"); + } + + if (!rvalue->equals(*entry->val)) + continue; + + if (debug) { + printf("CSE: Replacing: "); + (*entry->val)->print(); + printf("\n"); + printf("CSE: with: "); + rvalue->print(); + printf("\n"); + } + + if (!entry->var) { + ir_instruction *base_ir = entry->base_ir; + + ir_variable *var = new(rvalue) ir_variable(rvalue->type, + "cse", + ir_var_auto, rvalue->get_precision()); + + /* Write the previous expression result into a new variable. */ + base_ir->insert_before(var); + ir_assignment *assignment = assign(var, *entry->val); + base_ir->insert_before(assignment); + + /* Replace the expression in the original tree with a deref of the + * variable, but keep tracking the expression for further reuse. + */ + *entry->val = new(rvalue) ir_dereference_variable(var); + entry->val = &assignment->rhs; + + entry->var = var; + + /* Update the base_irs in the AE list. We have to be sure that + * they're correct -- expressions from our base_ir that weren't moved + * need to stay in this base_ir (so that later consumption of them + * puts new variables between our new variable and our base_ir), but + * expressions from our base_ir that we *did* move need base_ir + * updated so that any further elimination from inside gets its new + * assignments put before our new assignment. + */ + foreach_list(fixup_node, ae) { + ae_entry *fixup_entry = (ae_entry *)fixup_node; + if (contains_rvalue(assignment->rhs, *fixup_entry->val)) + fixup_entry->base_ir = assignment; + } + + if (debug) + dump_ae(ae); + } + + /* Replace the expression in our current tree with the variable. */ + return new(rvalue) ir_dereference_variable(entry->var); + } + + return NULL; +} + +/** Add the rvalue to the list of available expressions for CSE. */ +void +cse_visitor::add_to_ae(ir_rvalue **rvalue) +{ + if (debug) { + printf("CSE: Add to AE: "); + (*rvalue)->print(); + printf("\n"); + } + + ae->push_tail(new(mem_ctx) ae_entry(base_ir, rvalue)); + + if (debug) + dump_ae(ae); +} + +void +cse_visitor::handle_rvalue(ir_rvalue **rvalue) +{ + if (!*rvalue) + return; + + if (debug) { + printf("CSE: handle_rvalue "); + (*rvalue)->print(); + printf("\n"); + } + + if (!is_cse_candidate(*rvalue)) + return; + + ir_rvalue *new_rvalue = try_cse(*rvalue); + if (new_rvalue) { + *rvalue = new_rvalue; + progress = true; + + if (debug) + validate_ir_tree(validate_instructions); + } else { + add_to_ae(rvalue); + } +} + +ir_visitor_status +cse_visitor::visit_enter(ir_if *ir) +{ + handle_rvalue(&ir->condition); + + ae->make_empty(); + visit_list_elements(this, &ir->then_instructions); + + ae->make_empty(); + visit_list_elements(this, &ir->else_instructions); + + ae->make_empty(); + return visit_continue_with_parent; +} + +ir_visitor_status +cse_visitor::visit_enter(ir_function_signature *ir) +{ + ae->make_empty(); + visit_list_elements(this, &ir->body); + + ae->make_empty(); + return visit_continue_with_parent; +} + +ir_visitor_status +cse_visitor::visit_enter(ir_loop *ir) +{ + ae->make_empty(); + visit_list_elements(this, &ir->body_instructions); + + ae->make_empty(); + return visit_continue_with_parent; +} + +ir_visitor_status +cse_visitor::visit_enter(ir_call *ir) +{ + /* Because call is an exec_list of ir_rvalues, handle_rvalue gets passed a + * pointer to the (ir_rvalue *) on the stack. Since we save those pointers + * in the AE list, we can't let handle_rvalue get called. + */ + return visit_continue_with_parent; +} + +/** + * Does a (uniform-value) constant subexpression elimination pass on the code + * present in the instruction stream. + */ +bool +do_cse(exec_list *instructions) +{ + cse_visitor v(instructions); + + visit_list_elements(&v, instructions); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp new file mode 100644 index 000000000..4ca02737f --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_builtin_varyings.cpp @@ -0,0 +1,591 @@ +/* + * Copyright © 2013 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_dead_builtin_varyings.cpp + * + * This eliminates the built-in shader outputs which are either not written + * at all or not used by the next stage. It also eliminates unused elements + * of gl_TexCoord inputs, which reduces the overall varying usage. + * The varyings handled here are the primary and secondary color, the fog, + * and the texture coordinates (gl_TexCoord). + * + * This pass is necessary, because the Mesa GLSL linker cannot eliminate + * built-in varyings like it eliminates user-defined varyings, because + * the built-in varyings have pre-assigned locations. Also, the elimination + * of unused gl_TexCoord elements requires its own lowering pass anyway. + * + * It's implemented by replacing all occurences of dead varyings with + * temporary variables, which creates dead code. It is recommended to run + * a dead-code elimination pass after this. + * + * If any texture coordinate slots can be eliminated, the gl_TexCoord array is + * broken down into separate vec4 variables with locations equal to + * VARYING_SLOT_TEX0 + i. + * + * The same is done for the gl_FragData fragment shader output. + */ + +#include "main/core.h" /* for snprintf and ARRAY_SIZE */ +#include "ir.h" +#include "ir_rvalue_visitor.h" +#include "ir_optimization.h" +#include "ir_print_visitor.h" +#include "glsl_types.h" +#include "link_varyings.h" + +namespace { + +/** + * This obtains detailed information about built-in varyings from shader code. + */ +class varying_info_visitor : public ir_hierarchical_visitor { +public: + /* "mode" can be either ir_var_shader_in or ir_var_shader_out */ + varying_info_visitor(ir_variable_mode mode, bool find_frag_outputs = false) + : lower_texcoord_array(true), + texcoord_array(NULL), + texcoord_usage(0), + find_frag_outputs(find_frag_outputs), + lower_fragdata_array(true), + fragdata_array(NULL), + fragdata_usage(0), + color_usage(0), + tfeedback_color_usage(0), + fog(NULL), + has_fog(false), + tfeedback_has_fog(false), + mode(mode) + { + memset(color, 0, sizeof(color)); + memset(backcolor, 0, sizeof(backcolor)); + } + + virtual ir_visitor_status visit_enter(ir_dereference_array *ir) + { + ir_variable *var = ir->variable_referenced(); + + if (!var || var->data.mode != this->mode) + return visit_continue; + + if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) { + this->fragdata_array = var; + + ir_constant *index = ir->array_index->as_constant(); + if (index == NULL) { + /* This is variable indexing. */ + this->fragdata_usage |= (1 << var->type->array_size()) - 1; + this->lower_fragdata_array = false; + } + else { + this->fragdata_usage |= 1 << index->get_uint_component(0); + } + + /* Don't visit the leaves of ir_dereference_array. */ + return visit_continue_with_parent; + } + + if (!this->find_frag_outputs && var->data.location == VARYING_SLOT_TEX0) { + this->texcoord_array = var; + + ir_constant *index = ir->array_index->as_constant(); + if (index == NULL) { + /* There is variable indexing, we can't lower the texcoord array. + */ + this->texcoord_usage |= (1 << var->type->array_size()) - 1; + this->lower_texcoord_array = false; + } + else { + this->texcoord_usage |= 1 << index->get_uint_component(0); + } + + /* Don't visit the leaves of ir_dereference_array. */ + return visit_continue_with_parent; + } + + return visit_continue; + } + + virtual ir_visitor_status visit(ir_dereference_variable *ir) + { + ir_variable *var = ir->variable_referenced(); + + if (var->data.mode != this->mode || !var->type->is_array()) + return visit_continue; + + if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) { + /* This is a whole array dereference. */ + this->fragdata_usage |= (1 << var->type->array_size()) - 1; + this->lower_fragdata_array = false; + return visit_continue; + } + + if (!this->find_frag_outputs && var->data.location == VARYING_SLOT_TEX0) { + /* This is a whole array dereference like "gl_TexCoord = x;", + * there's probably no point in lowering that. + */ + this->texcoord_usage |= (1 << var->type->array_size()) - 1; + this->lower_texcoord_array = false; + } + return visit_continue; + } + + virtual ir_visitor_status visit(ir_variable *var) + { + if (var->data.mode != this->mode) + return visit_continue; + + /* Nothing to do here for fragment outputs. */ + if (this->find_frag_outputs) + return visit_continue; + + /* Handle colors and fog. */ + switch (var->data.location) { + case VARYING_SLOT_COL0: + this->color[0] = var; + this->color_usage |= 1; + break; + case VARYING_SLOT_COL1: + this->color[1] = var; + this->color_usage |= 2; + break; + case VARYING_SLOT_BFC0: + this->backcolor[0] = var; + this->color_usage |= 1; + break; + case VARYING_SLOT_BFC1: + this->backcolor[1] = var; + this->color_usage |= 2; + break; + case VARYING_SLOT_FOGC: + this->fog = var; + this->has_fog = true; + break; + } + + return visit_continue; + } + + void get(exec_list *ir, + unsigned num_tfeedback_decls, + tfeedback_decl *tfeedback_decls) + { + /* Handle the transform feedback varyings. */ + for (unsigned i = 0; i < num_tfeedback_decls; i++) { + if (!tfeedback_decls[i].is_varying()) + continue; + + unsigned location = tfeedback_decls[i].get_location(); + + switch (location) { + case VARYING_SLOT_COL0: + case VARYING_SLOT_BFC0: + this->tfeedback_color_usage |= 1; + break; + case VARYING_SLOT_COL1: + case VARYING_SLOT_BFC1: + this->tfeedback_color_usage |= 2; + break; + case VARYING_SLOT_FOGC: + this->tfeedback_has_fog = true; + break; + default: + if (location >= VARYING_SLOT_TEX0 && + location <= VARYING_SLOT_TEX7) { + this->lower_texcoord_array = false; + } + } + } + + /* Process the shader. */ + visit_list_elements(this, ir); + + if (!this->texcoord_array) { + this->lower_texcoord_array = false; + } + if (!this->fragdata_array) { + this->lower_fragdata_array = false; + } + } + + bool lower_texcoord_array; + ir_variable *texcoord_array; + unsigned texcoord_usage; /* bitmask */ + + bool find_frag_outputs; /* false if it's looking for varyings */ + bool lower_fragdata_array; + ir_variable *fragdata_array; + unsigned fragdata_usage; /* bitmask */ + + ir_variable *color[2]; + ir_variable *backcolor[2]; + unsigned color_usage; /* bitmask */ + unsigned tfeedback_color_usage; /* bitmask */ + + ir_variable *fog; + bool has_fog; + bool tfeedback_has_fog; + + ir_variable_mode mode; +}; + + +/** + * This replaces unused varyings with temporary variables. + * + * If "ir" is the producer, the "external" usage should come from + * the consumer. It also works the other way around. If either one is + * missing, set the "external" usage to a full mask. + */ +class replace_varyings_visitor : public ir_rvalue_visitor { +public: + replace_varyings_visitor(exec_list *ir, + const varying_info_visitor *info, + unsigned external_texcoord_usage, + unsigned external_color_usage, + bool external_has_fog) + : info(info), new_fog(NULL) + { + void *const ctx = ir; + + memset(this->new_fragdata, 0, sizeof(this->new_fragdata)); + memset(this->new_texcoord, 0, sizeof(this->new_texcoord)); + memset(this->new_color, 0, sizeof(this->new_color)); + memset(this->new_backcolor, 0, sizeof(this->new_backcolor)); + + const char *mode_str = + info->mode == ir_var_shader_in ? "in" : "out"; + + /* Handle texcoord outputs. + * + * We're going to break down the gl_TexCoord array into separate + * variables. First, add declarations of the new variables all + * occurences of gl_TexCoord will be replaced with. + */ + if (info->lower_texcoord_array) { + prepare_array(ir, this->new_texcoord, ARRAY_SIZE(this->new_texcoord), + VARYING_SLOT_TEX0, "TexCoord", mode_str, + info->texcoord_usage, external_texcoord_usage); + } + + /* Handle gl_FragData in the same way like gl_TexCoord. */ + if (info->lower_fragdata_array) { + prepare_array(ir, this->new_fragdata, ARRAY_SIZE(this->new_fragdata), + FRAG_RESULT_DATA0, "FragData", mode_str, + info->fragdata_usage, (1 << MAX_DRAW_BUFFERS) - 1); + } + + /* Create dummy variables which will replace set-but-unused color and + * fog outputs. + */ + external_color_usage |= info->tfeedback_color_usage; + + for (int i = 0; i < 2; i++) { + char name[32]; + + if (!(external_color_usage & (1 << i))) { + if (info->color[i]) { + snprintf(name, 32, "gl_%s_FrontColor%i_dummy", mode_str, i); + this->new_color[i] = + new (ctx) ir_variable(glsl_type::vec4_type, name, + ir_var_temporary, glsl_precision_medium); + } + + if (info->backcolor[i]) { + snprintf(name, 32, "gl_%s_BackColor%i_dummy", mode_str, i); + this->new_backcolor[i] = + new (ctx) ir_variable(glsl_type::vec4_type, name, + ir_var_temporary, glsl_precision_medium); + } + } + } + + if (!external_has_fog && !info->tfeedback_has_fog && + info->fog) { + char name[32]; + + snprintf(name, 32, "gl_%s_FogFragCoord_dummy", mode_str); + this->new_fog = new (ctx) ir_variable(glsl_type::float_type, name, + ir_var_temporary, glsl_precision_high); + } + + /* Now do the replacing. */ + visit_list_elements(this, ir); + } + + void prepare_array(exec_list *ir, + class ir_variable **new_var, + int max_elements, unsigned start_location, + const char *var_name, const char *mode_str, + unsigned usage, unsigned external_usage) + { + void *const ctx = ir; + + for (int i = max_elements-1; i >= 0; i--) { + if (usage & (1 << i)) { + char name[32]; + + if (!(external_usage & (1 << i))) { + /* This varying is unused in the next stage. Declare + * a temporary instead of an output. */ + snprintf(name, 32, "gl_%s_%s%i_dummy", mode_str, var_name, i); + new_var[i] = + new (ctx) ir_variable(glsl_type::vec4_type, name, + ir_var_temporary, glsl_precision_undefined); + } + else { + snprintf(name, 32, "gl_%s_%s%i", mode_str, var_name, i); + new_var[i] = + new(ctx) ir_variable(glsl_type::vec4_type, name, + this->info->mode, glsl_precision_undefined); + new_var[i]->data.location = start_location + i; + new_var[i]->data.explicit_location = true; + new_var[i]->data.explicit_index = 0; + } + + ir->head->insert_before(new_var[i]); + } + } + } + + virtual ir_visitor_status visit(ir_variable *var) + { + /* Remove the gl_TexCoord array. */ + if (this->info->lower_texcoord_array && + var == this->info->texcoord_array) { + var->remove(); + } + + /* Remove the gl_FragData array. */ + if (this->info->lower_fragdata_array && + var == this->info->fragdata_array) { + var->remove(); + } + + /* Replace set-but-unused color and fog outputs with dummy variables. */ + for (int i = 0; i < 2; i++) { + if (var == this->info->color[i] && this->new_color[i]) { + var->replace_with(this->new_color[i]); + } + if (var == this->info->backcolor[i] && + this->new_backcolor[i]) { + var->replace_with(this->new_backcolor[i]); + } + } + + if (var == this->info->fog && this->new_fog) { + var->replace_with(this->new_fog); + } + + return visit_continue; + } + + virtual void handle_rvalue(ir_rvalue **rvalue) + { + if (!*rvalue) + return; + + void *ctx = ralloc_parent(*rvalue); + + /* Replace an array dereference gl_TexCoord[i] with a single + * variable dereference representing gl_TexCoord[i]. + */ + if (this->info->lower_texcoord_array) { + /* gl_TexCoord[i] occurence */ + ir_dereference_array *const da = (*rvalue)->as_dereference_array(); + + if (da && da->variable_referenced() == + this->info->texcoord_array) { + unsigned i = da->array_index->as_constant()->get_uint_component(0); + + *rvalue = new(ctx) ir_dereference_variable(this->new_texcoord[i]); + return; + } + } + + /* Same for gl_FragData. */ + if (this->info->lower_fragdata_array) { + /* gl_FragData[i] occurence */ + ir_dereference_array *const da = (*rvalue)->as_dereference_array(); + + if (da && da->variable_referenced() == this->info->fragdata_array) { + unsigned i = da->array_index->as_constant()->get_uint_component(0); + + *rvalue = new(ctx) ir_dereference_variable(this->new_fragdata[i]); + return; + } + } + + /* Replace set-but-unused color and fog outputs with dummy variables. */ + ir_dereference_variable *const dv = (*rvalue)->as_dereference_variable(); + if (!dv) + return; + + ir_variable *var = dv->variable_referenced(); + + for (int i = 0; i < 2; i++) { + if (var == this->info->color[i] && this->new_color[i]) { + *rvalue = new(ctx) ir_dereference_variable(this->new_color[i]); + return; + } + if (var == this->info->backcolor[i] && + this->new_backcolor[i]) { + *rvalue = new(ctx) ir_dereference_variable(this->new_backcolor[i]); + return; + } + } + + if (var == this->info->fog && this->new_fog) { + *rvalue = new(ctx) ir_dereference_variable(this->new_fog); + } + } + + virtual ir_visitor_status visit_leave(ir_assignment *ir) + { + handle_rvalue(&ir->rhs); + handle_rvalue(&ir->condition); + + /* We have to use set_lhs when changing the LHS of an assignment. */ + ir_rvalue *lhs = ir->lhs; + + handle_rvalue(&lhs); + if (lhs != ir->lhs) { + ir->set_lhs(lhs); + } + + return visit_continue; + } + +private: + const varying_info_visitor *info; + ir_variable *new_fragdata[MAX_DRAW_BUFFERS]; + ir_variable *new_texcoord[MAX_TEXTURE_COORD_UNITS]; + ir_variable *new_color[2]; + ir_variable *new_backcolor[2]; + ir_variable *new_fog; +}; + +} /* anonymous namespace */ + +static void +lower_texcoord_array(exec_list *ir, const varying_info_visitor *info) +{ + replace_varyings_visitor(ir, info, + (1 << MAX_TEXTURE_COORD_UNITS) - 1, + 1 | 2, true); +} + +static void +lower_fragdata_array(exec_list *ir) +{ + varying_info_visitor info(ir_var_shader_out, true); + info.get(ir, 0, NULL); + + replace_varyings_visitor(ir, &info, 0, 0, 0); +} + + +void +do_dead_builtin_varyings(struct gl_context *ctx, + gl_shader *producer, gl_shader *consumer, + unsigned num_tfeedback_decls, + tfeedback_decl *tfeedback_decls) +{ + /* Lower the gl_FragData array to separate variables. */ + if (consumer && consumer->Stage == MESA_SHADER_FRAGMENT) { + lower_fragdata_array(consumer->ir); + } + + /* Lowering of built-in varyings has no effect with the core context and + * GLES2, because they are not available there. + * + * EXT_separate_shader_objects doesn't allow this optimization, + * because a program object can be bound partially (e.g. only one + * stage of a program object can be bound). + */ + if (ctx->API == API_OPENGL_CORE || + ctx->API == API_OPENGLES2 || + ctx->Extensions.EXT_separate_shader_objects) { + return; + } + + /* Information about built-in varyings. */ + varying_info_visitor producer_info(ir_var_shader_out); + varying_info_visitor consumer_info(ir_var_shader_in); + + if (producer) { + producer_info.get(producer->ir, num_tfeedback_decls, tfeedback_decls); + + if (!consumer) { + /* At least eliminate unused gl_TexCoord elements. */ + if (producer_info.lower_texcoord_array) { + lower_texcoord_array(producer->ir, &producer_info); + } + return; + } + } + + if (consumer) { + consumer_info.get(consumer->ir, 0, NULL); + + if (!producer) { + /* At least eliminate unused gl_TexCoord elements. */ + if (consumer_info.lower_texcoord_array) { + lower_texcoord_array(consumer->ir, &consumer_info); + } + return; + } + } + + /* Eliminate the outputs unused by the consumer. */ + if (producer_info.lower_texcoord_array || + producer_info.color_usage || + producer_info.has_fog) { + replace_varyings_visitor(producer->ir, + &producer_info, + consumer_info.texcoord_usage, + consumer_info.color_usage, + consumer_info.has_fog); + } + + /* The gl_TexCoord fragment shader inputs can be initialized + * by GL_COORD_REPLACE, so we can't eliminate them. + * + * This doesn't prevent elimination of the gl_TexCoord elements which + * are not read by the fragment shader. We want to eliminate those anyway. + */ + if (consumer->Stage == MESA_SHADER_FRAGMENT) { + producer_info.texcoord_usage = (1 << MAX_TEXTURE_COORD_UNITS) - 1; + } + + /* Eliminate the inputs uninitialized by the producer. */ + if (consumer_info.lower_texcoord_array || + consumer_info.color_usage || + consumer_info.has_fog) { + replace_varyings_visitor(consumer->ir, + &consumer_info, + producer_info.texcoord_usage, + producer_info.color_usage, + producer_info.has_fog); + } +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp index de8475f95..af53d94fd 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code.cpp @@ -31,6 +31,7 @@ #include "ir_visitor.h" #include "ir_variable_refcount.h" #include "glsl_types.h" +#include "main/hash_table.h" static bool debug = false; @@ -49,8 +50,9 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) v.run(instructions); - foreach_iter(exec_list_iterator, iter, v.variable_list) { - ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)iter.get(); + struct hash_entry *e; + hash_table_foreach(v.ht, e) { + ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)e->data; /* Since each assignment is a reference, the refereneced count must be * greater than or equal to the assignment count. If they are equal, @@ -75,10 +77,11 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) if (entry->assign) { /* Remove a single dead assignment to the variable we found. - * Don't do so if it's a shader output, though. + * Don't do so if it's a shader or function output, though. */ - if (entry->var->mode != ir_var_out && - entry->var->mode != ir_var_inout) { + if (entry->var->data.mode != ir_var_function_out && + entry->var->data.mode != ir_var_function_inout && + entry->var->data.mode != ir_var_shader_out) { entry->assign->remove(); progress = true; @@ -95,15 +98,10 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned) /* uniform initializers are precious, and could get used by another * stage. Also, once uniform locations have been assigned, the * declaration cannot be deleted. - * - * Also, GL_ARB_uniform_buffer_object says that std140 - * uniforms will not be eliminated. Since we always do - * std140, just don't eliminate uniforms in UBOs. */ - if (entry->var->mode == ir_var_uniform && + if (entry->var->data.mode == ir_var_uniform && (uniform_locations_assigned || - entry->var->constant_value || - entry->var->uniform_block != -1)) + entry->var->constant_value)) continue; entry->var->remove(); @@ -131,13 +129,12 @@ do_dead_code_unlinked(exec_list *instructions) { bool progress = false; - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_function *f = ir->as_function(); if (f) { - foreach_iter(exec_list_iterator, sigiter, *f) { - ir_function_signature *sig = - (ir_function_signature *) sigiter.get(); + foreach_list(signode, &f->signatures) { + ir_function_signature *sig = (ir_function_signature *) signode; /* The setting of the uniform_locations_assigned flag here is * irrelevent. If there is a uniform declaration encountered * inside the body of the function, something has already gone diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp index 8c31802a6..e7d46edbe 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_code_local.cpp @@ -70,8 +70,8 @@ public: void kill_channels(ir_variable *const var, int used) { - foreach_iter(exec_list_iterator, iter, *this->assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, this->assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs == var) { if (var->type->is_scalar() || var->type->is_vector()) { @@ -114,6 +114,23 @@ public: return visit_continue_with_parent; } + virtual ir_visitor_status visit(ir_emit_vertex *ir) + { + /* For the purpose of dead code elimination, emitting a vertex counts as + * "reading" all of the currently assigned output variables. + */ + foreach_list_safe(n, this->assignments) { + assignment_entry *entry = (assignment_entry *) n; + if (entry->lhs->data.mode == ir_var_shader_out) { + if (debug) + printf("kill %s\n", entry->lhs->name); + entry->remove(); + } + } + + return visit_continue; + } + private: exec_list *assignments; }; @@ -179,8 +196,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("looking for %s.0x%01x to remove\n", var->name, ir->write_mask); - foreach_iter(exec_list_iterator, iter, *assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs != var) continue; @@ -241,8 +258,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) */ if (debug) printf("looking for %s to remove\n", var->name); - foreach_iter(exec_list_iterator, iter, *assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list_safe(n, assignments) { + assignment_entry *entry = (assignment_entry *) n; if (entry->lhs == var) { if (debug) @@ -263,8 +280,8 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments) printf("add %s\n", var->name); printf("current entries\n"); - foreach_iter(exec_list_iterator, iter, *assignments) { - assignment_entry *entry = (assignment_entry *)iter.get(); + foreach_list(n, assignments) { + assignment_entry *entry = (assignment_entry *) n; printf(" %s (0x%01x)\n", entry->lhs->name, entry->available); } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp index cd3b2c12e..8bb278e45 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_dead_functions.cpp @@ -74,8 +74,8 @@ public: signature_entry * ir_dead_functions_visitor::get_signature_entry(ir_function_signature *sig) { - foreach_iter(exec_list_iterator, iter, this->signature_list) { - signature_entry *entry = (signature_entry *)iter.get(); + foreach_list(n, &this->signature_list) { + signature_entry *entry = (signature_entry *) n; if (entry->signature == sig) return entry; } @@ -123,8 +123,8 @@ do_dead_functions(exec_list *instructions) * the unused ones, and remove function definitions that have no more * signatures. */ - foreach_iter(exec_list_iterator, iter, v.signature_list) { - signature_entry *entry = (signature_entry *)iter.get(); + foreach_list_safe(n, &v.signature_list) { + signature_entry *entry = (signature_entry *) n; if (!entry->used) { entry->signature->remove(); @@ -137,8 +137,8 @@ do_dead_functions(exec_list *instructions) /* We don't just do this above when we nuked a signature because of * const pointers. */ - foreach_iter(exec_list_iterator, iter, *instructions) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list_safe(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; ir_function *func = ir->as_function(); if (func && func->signatures.is_empty()) { diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_flatten_nested_if_blocks.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_flatten_nested_if_blocks.cpp new file mode 100644 index 000000000..c70210204 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_flatten_nested_if_blocks.cpp @@ -0,0 +1,103 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_flatten_nested_if_blocks.cpp + * + * Flattens nested if blocks such as: + * + * if (x) { + * if (y) { + * ... + * } + * } + * + * into a single if block with a combined condition: + * + * if (x && y) { + * ... + * } + */ + +#include "ir.h" +#include "ir_builder.h" + +using namespace ir_builder; + +namespace { + +class nested_if_flattener : public ir_hierarchical_visitor { +public: + nested_if_flattener() + { + progress = false; + } + + ir_visitor_status visit_leave(ir_if *); + ir_visitor_status visit_enter(ir_assignment *); + + bool progress; +}; + +} /* unnamed namespace */ + +/* We only care about the top level "if" instructions, so don't + * descend into expressions. + */ +ir_visitor_status +nested_if_flattener::visit_enter(ir_assignment *ir) +{ + (void) ir; + return visit_continue_with_parent; +} + +bool +opt_flatten_nested_if_blocks(exec_list *instructions) +{ + nested_if_flattener v; + + v.run(instructions); + return v.progress; +} + + +ir_visitor_status +nested_if_flattener::visit_leave(ir_if *ir) +{ + /* Only handle a single ir_if within the then clause of an ir_if. No extra + * instructions, no else clauses, nothing. + */ + if (ir->then_instructions.is_empty() || !ir->else_instructions.is_empty()) + return visit_continue; + + ir_if *inner = ((ir_instruction *) ir->then_instructions.head)->as_if(); + if (!inner || !inner->next->is_tail_sentinel() || + !inner->else_instructions.is_empty()) + return visit_continue; + + ir->condition = logic_and(ir->condition, inner->condition); + inner->then_instructions.move_nodes_to(&ir->then_instructions); + + progress = true; + return visit_continue; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp new file mode 100644 index 000000000..9044fd680 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_flip_matrices.cpp @@ -0,0 +1,124 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_flip_matrices.cpp + * + * Convert (matrix * vector) operations to (vector * matrixTranspose), + * which can be done using dot products rather than multiplies and adds. + * On some hardware, this is more efficient. + * + * This currently only does the conversion for built-in matrices which + * already have transposed equivalents. Namely, gl_ModelViewProjectionMatrix + * and gl_TextureMatrix. + */ +#include "ir.h" +#include "ir_optimization.h" +#include "main/macros.h" + +namespace { +class matrix_flipper : public ir_hierarchical_visitor { +public: + matrix_flipper(exec_list *instructions) + { + progress = false; + mvp_transpose = NULL; + texmat_transpose = NULL; + + foreach_list(n, instructions) { + ir_instruction *ir = (ir_instruction *) n; + ir_variable *var = ir->as_variable(); + if (!var) + continue; + if (strcmp(var->name, "gl_ModelViewProjectionMatrixTranspose") == 0) + mvp_transpose = var; + if (strcmp(var->name, "gl_TextureMatrixTranspose") == 0) + texmat_transpose = var; + } + } + + ir_visitor_status visit_enter(ir_expression *ir); + + bool progress; + +private: + ir_variable *mvp_transpose; + ir_variable *texmat_transpose; +}; +} + +ir_visitor_status +matrix_flipper::visit_enter(ir_expression *ir) +{ + if (ir->operation != ir_binop_mul || + !ir->operands[0]->type->is_matrix() || + !ir->operands[1]->type->is_vector()) + return visit_continue; + + ir_variable *mat_var = ir->operands[0]->variable_referenced(); + if (!mat_var) + return visit_continue; + + if (mvp_transpose && + strcmp(mat_var->name, "gl_ModelViewProjectionMatrix") == 0) { +#ifndef NDEBUG + ir_dereference_variable *deref = ir->operands[0]->as_dereference_variable(); + assert(deref && deref->var == mat_var); +#endif + + void *mem_ctx = ralloc_parent(ir); + + ir->operands[0] = ir->operands[1]; + ir->operands[1] = new(mem_ctx) ir_dereference_variable(mvp_transpose); + + progress = true; + } else if (texmat_transpose && + strcmp(mat_var->name, "gl_TextureMatrix") == 0) { + ir_dereference_array *array_ref = ir->operands[0]->as_dereference_array(); + assert(array_ref != NULL); + ir_dereference_variable *var_ref = array_ref->array->as_dereference_variable(); + assert(var_ref && var_ref->var == mat_var); + + ir->operands[0] = ir->operands[1]; + ir->operands[1] = array_ref; + + var_ref->var = texmat_transpose; + + texmat_transpose->data.max_array_access = + MAX2(texmat_transpose->data.max_array_access, mat_var->data.max_array_access); + + progress = true; + } + + return visit_continue; +} + +bool +opt_flip_matrices(struct exec_list *instructions) +{ + matrix_flipper v(instructions); + + visit_list_elements(&v, instructions); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp index 6e5c0d277..89aa1bb16 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_function_inlining.cpp @@ -35,9 +35,9 @@ #include "program/hash_table.h" static void -do_sampler_replacement(exec_list *instructions, - ir_variable *sampler, - ir_dereference *deref); +do_variable_replacement(exec_list *instructions, + ir_variable *orig, + ir_dereference *repl); namespace { @@ -121,7 +121,7 @@ ir_call::generate_inline(ir_instruction *next_ir) ht = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare); num_parameters = 0; - foreach_iter(exec_list_iterator, iter_sig, this->callee->parameters) + foreach_list(n, &this->callee->parameters) num_parameters++; parameters = new ir_variable *[num_parameters]; @@ -130,43 +130,42 @@ ir_call::generate_inline(ir_instruction *next_ir) * and set up the mapping of real function body variables to ours. */ i = 0; - exec_list_iterator sig_param_iter = this->callee->parameters.iterator(); - exec_list_iterator param_iter = this->actual_parameters.iterator(); glsl_precision prec_params_max = glsl_precision_undefined; - for (i = 0; i < num_parameters; i++) { - ir_variable *sig_param = (ir_variable *) sig_param_iter.get(); - ir_rvalue *param = (ir_rvalue *) param_iter.get(); + foreach_two_lists(formal_node, &this->callee->parameters, + actual_node, &this->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *param = (ir_rvalue *) actual_node; /* Generate a new variable for the parameter. */ - if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) { - /* For samplers, we want the inlined sampler references - * referencing the passed in sampler variable, since that - * will have the location information, which an assignment of - * a sampler wouldn't. Fix it up below. + if (sig_param->type->contains_opaque()) { + /* For opaque types, we want the inlined variable references + * referencing the passed in variable, since that will have + * the location information, which an assignment of an opaque + * variable wouldn't. Fix it up below. */ parameters[i] = NULL; } else { parameters[i] = sig_param->clone(ctx, ht); - parameters[i]->mode = ir_var_auto; + parameters[i]->data.mode = ir_var_auto; - parameters[i]->precision = (glsl_precision)parameters[i]->precision; - if (parameters[i]->precision == glsl_precision_undefined) - parameters[i]->precision = param->get_precision(); - prec_params_max = higher_precision (prec_params_max, (glsl_precision)parameters[i]->precision); + parameters[i]->data.precision = (glsl_precision)parameters[i]->data.precision; + if (parameters[i]->data.precision == glsl_precision_undefined) + parameters[i]->data.precision = param->get_precision(); + prec_params_max = higher_precision (prec_params_max, (glsl_precision)parameters[i]->data.precision); /* Remove the read-only decoration becuase we're going to write * directly to this variable. If the cloned variable is left * read-only and the inlined function is inside a loop, the loop * analysis code will get confused. */ - parameters[i]->read_only = false; + parameters[i]->data.read_only = false; next_ir->insert_before(parameters[i]); } /* Move the actual param into our param variable if it's an 'in' type. */ - if (parameters[i] && (sig_param->mode == ir_var_in || - sig_param->mode == ir_var_const_in || - sig_param->mode == ir_var_inout)) { + if (parameters[i] && (sig_param->data.mode == ir_var_function_in || + sig_param->data.mode == ir_var_const_in || + sig_param->data.mode == ir_var_function_inout)) { ir_assignment *assign; assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(parameters[i]), @@ -174,38 +173,34 @@ ir_call::generate_inline(ir_instruction *next_ir) next_ir->insert_before(assign); } - sig_param_iter.next(); - param_iter.next(); + ++i; } exec_list new_instructions; /* Generate the inlined body of the function to a new list */ - foreach_iter(exec_list_iterator, iter, callee->body) { - ir_instruction *ir = (ir_instruction *)iter.get(); + foreach_list(n, &callee->body) { + ir_instruction *ir = (ir_instruction *) n; ir_instruction *new_ir = ir->clone(ctx, ht); new_instructions.push_tail(new_ir); visit_tree(new_ir, replace_return_with_assignment, this->return_deref); } - /* If any samplers were passed in, replace any deref of the sampler - * with a deref of the sampler argument. + /* If any opaque types were passed in, replace any deref of the + * opaque variable with a deref of the argument. */ - param_iter = this->actual_parameters.iterator(); - sig_param_iter = this->callee->parameters.iterator(); - for (i = 0; i < num_parameters; i++) { - ir_instruction *const param = (ir_instruction *) param_iter.get(); - ir_variable *sig_param = (ir_variable *) sig_param_iter.get(); + foreach_two_lists(formal_node, &this->callee->parameters, + actual_node, &this->actual_parameters) { + ir_rvalue *const param = (ir_rvalue *) actual_node; + ir_variable *sig_param = (ir_variable *) formal_node; - if (sig_param->type->base_type == GLSL_TYPE_SAMPLER) { + if (sig_param->type->contains_opaque()) { ir_dereference *deref = param->as_dereference(); assert(deref); - do_sampler_replacement(&new_instructions, sig_param, deref); + do_variable_replacement(&new_instructions, sig_param, deref); } - param_iter.next(); - sig_param_iter.next(); } /* Now push those new instructions in. */ @@ -215,15 +210,14 @@ ir_call::generate_inline(ir_instruction *next_ir) * variables to our own. */ i = 0; - param_iter = this->actual_parameters.iterator(); - sig_param_iter = this->callee->parameters.iterator(); - for (i = 0; i < num_parameters; i++) { - ir_instruction *const param = (ir_instruction *) param_iter.get(); - const ir_variable *const sig_param = (ir_variable *) sig_param_iter.get(); + foreach_two_lists(formal_node, &this->callee->parameters, + actual_node, &this->actual_parameters) { + ir_rvalue *const param = (ir_rvalue *) actual_node; + const ir_variable *const sig_param = (ir_variable *) formal_node; /* Move our param variable into the actual param if it's an 'out' type. */ - if (parameters[i] && (sig_param->mode == ir_var_out || - sig_param->mode == ir_var_inout)) { + if (parameters[i] && (sig_param->data.mode == ir_var_function_out || + sig_param->data.mode == ir_var_function_inout)) { ir_assignment *assign; assign = new(ctx) ir_assignment(param->clone(ctx, NULL)->as_rvalue(), @@ -232,8 +226,7 @@ ir_call::generate_inline(ir_instruction *next_ir) next_ir->insert_before(assign); } - param_iter.next(); - sig_param_iter.next(); + ++i; } delete [] parameters; @@ -288,23 +281,23 @@ ir_function_inlining_visitor::visit_enter(ir_call *ir) /** - * Replaces references to the "sampler" variable with a clone of "deref." + * Replaces references to the "orig" variable with a clone of "repl." * - * From the spec, samplers can appear in the tree as function + * From the spec, opaque types can appear in the tree as function * (non-out) parameters and as the result of array indexing and * structure field selection. In our builtin implementation, they * also appear in the sampler field of an ir_tex instruction. */ -class ir_sampler_replacement_visitor : public ir_hierarchical_visitor { +class ir_variable_replacement_visitor : public ir_hierarchical_visitor { public: - ir_sampler_replacement_visitor(ir_variable *sampler, ir_dereference *deref) + ir_variable_replacement_visitor(ir_variable *orig, ir_dereference *repl) { - this->sampler = sampler; - this->deref = deref; + this->orig = orig; + this->repl = repl; } - virtual ~ir_sampler_replacement_visitor() + virtual ~ir_variable_replacement_visitor() { } @@ -316,21 +309,21 @@ public: void replace_deref(ir_dereference **deref); void replace_rvalue(ir_rvalue **rvalue); - ir_variable *sampler; - ir_dereference *deref; + ir_variable *orig; + ir_dereference *repl; }; void -ir_sampler_replacement_visitor::replace_deref(ir_dereference **deref) +ir_variable_replacement_visitor::replace_deref(ir_dereference **deref) { ir_dereference_variable *deref_var = (*deref)->as_dereference_variable(); - if (deref_var && deref_var->var == this->sampler) { - *deref = this->deref->clone(ralloc_parent(*deref), NULL); + if (deref_var && deref_var->var == this->orig) { + *deref = this->repl->clone(ralloc_parent(*deref), NULL); } } void -ir_sampler_replacement_visitor::replace_rvalue(ir_rvalue **rvalue) +ir_variable_replacement_visitor::replace_rvalue(ir_rvalue **rvalue) { if (!*rvalue) return; @@ -345,7 +338,7 @@ ir_sampler_replacement_visitor::replace_rvalue(ir_rvalue **rvalue) } ir_visitor_status -ir_sampler_replacement_visitor::visit_leave(ir_texture *ir) +ir_variable_replacement_visitor::visit_leave(ir_texture *ir) { replace_deref(&ir->sampler); @@ -353,24 +346,24 @@ ir_sampler_replacement_visitor::visit_leave(ir_texture *ir) } ir_visitor_status -ir_sampler_replacement_visitor::visit_leave(ir_dereference_array *ir) +ir_variable_replacement_visitor::visit_leave(ir_dereference_array *ir) { replace_rvalue(&ir->array); return visit_continue; } ir_visitor_status -ir_sampler_replacement_visitor::visit_leave(ir_dereference_record *ir) +ir_variable_replacement_visitor::visit_leave(ir_dereference_record *ir) { replace_rvalue(&ir->record); return visit_continue; } ir_visitor_status -ir_sampler_replacement_visitor::visit_leave(ir_call *ir) +ir_variable_replacement_visitor::visit_leave(ir_call *ir) { - foreach_iter(exec_list_iterator, iter, *ir) { - ir_rvalue *param = (ir_rvalue *)iter.get(); + foreach_list_safe(n, &ir->actual_parameters) { + ir_rvalue *param = (ir_rvalue *) n; ir_rvalue *new_param = param; replace_rvalue(&new_param); @@ -382,11 +375,11 @@ ir_sampler_replacement_visitor::visit_leave(ir_call *ir) } static void -do_sampler_replacement(exec_list *instructions, - ir_variable *sampler, - ir_dereference *deref) +do_variable_replacement(exec_list *instructions, + ir_variable *orig, + ir_dereference *repl) { - ir_sampler_replacement_visitor v(sampler, deref); + ir_variable_replacement_visitor v(orig, repl); visit_list_elements(&v, instructions); } diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp index e1a23d94a..2bec8252e 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_if_simplification.cpp @@ -25,7 +25,8 @@ * \file opt_if_simplification.cpp * * Moves constant branches of if statements out to the surrounding - * instruction stream. + * instruction stream, and inverts if conditionals to avoid empty + * "then" blocks. */ #include "ir.h" @@ -89,18 +90,42 @@ ir_if_simplification_visitor::visit_leave(ir_if *ir) * that matters out. */ if (condition_constant->value.b[0]) { - foreach_iter(exec_list_iterator, then_iter, ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *)then_iter.get(); + foreach_list_safe(n, &ir->then_instructions) { + ir_instruction *then_ir = (ir_instruction *) n; ir->insert_before(then_ir); } } else { - foreach_iter(exec_list_iterator, else_iter, ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *)else_iter.get(); + foreach_list_safe(n, &ir->else_instructions) { + ir_instruction *else_ir = (ir_instruction *) n; ir->insert_before(else_ir); } } ir->remove(); this->made_progress = true; + return visit_continue; + } + + /* Turn: + * + * if (cond) { + * } else { + * do_work(); + * } + * + * into : + * + * if (!cond) + * do_work(); + * + * which avoids control flow for "else" (which is usually more + * expensive than normal operations), and the "not" can usually be + * folded into the generation of "cond" anyway. + */ + if (ir->then_instructions.is_empty()) { + ir->condition = new(ralloc_parent(ir->condition)) + ir_expression(ir_unop_logic_not, ir->condition); + ir->else_instructions.move_nodes_to(&ir->then_instructions); + this->made_progress = true; } return visit_continue; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_noop_swizzle.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_noop_swizzle.cpp index 693719e3d..586ad5e61 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_noop_swizzle.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_noop_swizzle.cpp @@ -32,7 +32,6 @@ #include "ir.h" #include "ir_visitor.h" #include "ir_rvalue_visitor.h" -#include "ir_print_visitor.h" #include "glsl_types.h" namespace { diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp index dd85e2fb7..0ac16bc07 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_structure_splitting.cpp @@ -34,7 +34,6 @@ #include "ir.h" #include "ir_visitor.h" -#include "ir_print_visitor.h" #include "ir_rvalue_visitor.h" #include "glsl_types.h" @@ -104,11 +103,12 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var) { assert(var); - if (!var->type->is_record() || var->mode == ir_var_uniform) + if (!var->type->is_record() || var->data.mode == ir_var_uniform + || var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out) return NULL; - foreach_iter(exec_list_iterator, iter, this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, &this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) return entry; } @@ -209,8 +209,8 @@ ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var) if (!var->type->is_record()) return NULL; - foreach_iter(exec_list_iterator, iter, *this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list(n, this->variable_list) { + variable_entry *entry = (variable_entry *) n; if (entry->var == var) { return entry; } @@ -315,8 +315,8 @@ do_structure_splitting(exec_list *instructions) visit_list_elements(&refs, instructions); /* Trim out variables we can't split. */ - foreach_iter(exec_list_iterator, iter, refs.variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list_safe(n, &refs.variable_list) { + variable_entry *entry = (variable_entry *) n; if (debug) { printf("structure %s@%p: decl %d, whole_access %d\n", @@ -337,8 +337,8 @@ do_structure_splitting(exec_list *instructions) /* Replace the decls of the structures to be split with their split * components. */ - foreach_iter(exec_list_iterator, iter, refs.variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + foreach_list_safe(n, &refs.variable_list) { + variable_entry *entry = (variable_entry *) n; const struct glsl_type *type = entry->var->type; entry->mem_ctx = ralloc_parent(entry->var); diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp index d6a1177cf..775e8fb81 100644 --- a/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/opt_tree_grafting.cpp @@ -184,7 +184,7 @@ ir_visitor_status ir_tree_grafting_visitor::visit_enter(ir_assignment *ir) { // if we're entering into assignment of different precision, leave now - if (ir->lhs->get_precision() != this->graft_var->precision && ir->lhs->get_precision() != glsl_precision_undefined && this->graft_var->precision != glsl_precision_undefined) + if (ir->lhs->get_precision() != this->graft_var->data.precision && ir->lhs->get_precision() != glsl_precision_undefined && this->graft_var->data.precision != glsl_precision_undefined) return visit_continue_with_parent; return visit_continue; } @@ -219,14 +219,14 @@ ir_tree_grafting_visitor::visit_enter(ir_function_signature *ir) ir_visitor_status ir_tree_grafting_visitor::visit_enter(ir_call *ir) { - exec_list_iterator sig_iter = ir->callee->parameters.iterator(); - /* Reminder: iterating ir_call iterates its parameters. */ - foreach_iter(exec_list_iterator, iter, *ir) { - ir_variable *sig_param = (ir_variable *)sig_iter.get(); - ir_rvalue *ir = (ir_rvalue *)iter.get(); + foreach_two_lists(formal_node, &ir->callee->parameters, + actual_node, &ir->actual_parameters) { + ir_variable *sig_param = (ir_variable *) formal_node; + ir_rvalue *ir = (ir_rvalue *) actual_node; ir_rvalue *new_ir = ir; - if (sig_param->mode != ir_var_in && sig_param->mode != ir_var_const_in) { + if (sig_param->data.mode != ir_var_function_in + && sig_param->data.mode != ir_var_const_in) { if (check_graft(ir, sig_param) == visit_stop) return visit_stop; continue; @@ -236,7 +236,6 @@ ir_tree_grafting_visitor::visit_enter(ir_call *ir) ir->replace_with(new_ir); return visit_stop; } - sig_iter.next(); } if (ir->return_deref && check_graft(ir, ir->return_deref->var) == visit_stop) @@ -286,6 +285,8 @@ ir_tree_grafting_visitor::visit_enter(ir_texture *ir) switch (ir->op) { case ir_tex: + case ir_lod: + case ir_query_levels: break; case ir_txb: if (do_graft(&ir->lod_info.bias)) @@ -297,11 +298,19 @@ ir_tree_grafting_visitor::visit_enter(ir_texture *ir) if (do_graft(&ir->lod_info.lod)) return visit_stop; break; + case ir_txf_ms: + if (do_graft(&ir->lod_info.sample_index)) + return visit_stop; + break; case ir_txd: if (do_graft(&ir->lod_info.grad.dPdx) || do_graft(&ir->lod_info.grad.dPdy)) return visit_stop; break; + case ir_tg4: + if (do_graft(&ir->lod_info.component)) + return visit_stop; + break; } return visit_continue; @@ -363,8 +372,9 @@ tree_grafting_basic_block(ir_instruction *bb_first, if (!lhs_var) continue; - if (lhs_var->mode == ir_var_out || - lhs_var->mode == ir_var_inout) + if (lhs_var->data.mode == ir_var_function_out || + lhs_var->data.mode == ir_var_function_inout || + lhs_var->data.mode == ir_var_shader_out) continue; ir_variable_refcount_entry *entry = info->refs->get_variable_entry(lhs_var); @@ -374,7 +384,7 @@ tree_grafting_basic_block(ir_instruction *bb_first, entry->referenced_count != 2) continue; - glsl_precision var_prec = (glsl_precision)lhs_var->precision; + glsl_precision var_prec = (glsl_precision)lhs_var->data.precision; glsl_precision rhs_prec = assign->rhs->get_precision(); if (var_prec != rhs_prec && var_prec != glsl_precision_undefined && rhs_prec != glsl_precision_undefined) continue; diff --git a/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp b/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp new file mode 100644 index 000000000..c8a7e607a --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl/opt_vectorize.cpp @@ -0,0 +1,368 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file opt_vectorize.cpp + * + * Combines scalar assignments of the same expression (modulo swizzle) to + * multiple channels of the same variable into a single vectorized expression + * and assignment. + * + * Many generated shaders contain scalarized code. That is, they contain + * + * r1.x = log2(v0.x); + * r1.y = log2(v0.y); + * r1.z = log2(v0.z); + * + * rather than + * + * r1.xyz = log2(v0.xyz); + * + * We look for consecutive assignments of the same expression (modulo swizzle) + * to each channel of the same variable. + * + * For instance, we want to convert these three scalar operations + * + * (assign (x) (var_ref r1) (expression float log2 (swiz x (var_ref v0)))) + * (assign (y) (var_ref r1) (expression float log2 (swiz y (var_ref v0)))) + * (assign (z) (var_ref r1) (expression float log2 (swiz z (var_ref v0)))) + * + * into a single vector operation + * + * (assign (xyz) (var_ref r1) (expression vec3 log2 (swiz xyz (var_ref v0)))) + */ + +#include "ir.h" +#include "ir_visitor.h" +#include "ir_optimization.h" +#include "glsl_types.h" +#include "program/prog_instruction.h" + +namespace { + +class ir_vectorize_visitor : public ir_hierarchical_visitor { +public: + void clear() + { + assignment[0] = NULL; + assignment[1] = NULL; + assignment[2] = NULL; + assignment[3] = NULL; + current_assignment = NULL; + last_assignment = NULL; + channels = 0; + has_swizzle = false; + } + + ir_vectorize_visitor() + { + clear(); + progress = false; + } + + virtual ir_visitor_status visit_enter(ir_assignment *); + virtual ir_visitor_status visit_enter(ir_swizzle *); + virtual ir_visitor_status visit_enter(ir_if *); + virtual ir_visitor_status visit_enter(ir_loop *); + + virtual ir_visitor_status visit_leave(ir_assignment *); + + void try_vectorize(); + + ir_assignment *assignment[4]; + ir_assignment *current_assignment, *last_assignment; + unsigned channels; + bool has_swizzle; + + bool progress; +}; + +} /* unnamed namespace */ + +/** + * Rewrites the swizzles and types of a right-hand side of an assignment. + * + * From the example above, this function would be called (by visit_tree()) on + * the nodes of the tree (expression float log2 (swiz z (var_ref v0))), + * rewriting it into (expression vec3 log2 (swiz xyz (var_ref v0))). + * + * The function modifies only ir_expressions and ir_swizzles. For expressions + * it sets a new type and swizzles any scalar dereferences into appropriately + * sized vector arguments. For example, if combining + * + * (assign (x) (var_ref r1) (expression float + (swiz x (var_ref v0) (var_ref v1)))) + * (assign (y) (var_ref r1) (expression float + (swiz y (var_ref v0) (var_ref v1)))) + * + * where v1 is a scalar, rewrite_swizzle() would insert a swizzle on + * (var_ref v1) such that the final result was + * + * (assign (xy) (var_ref r1) (expression vec2 + (swiz xy (var_ref v0)) + * (swiz xx (var_ref v1)))) + * + * For swizzles, it sets a new type, and if the variable being swizzled is a + * vector it overwrites the swizzle mask with the ir_swizzle_mask passed as the + * data parameter. If the swizzled variable is scalar, then the swizzle was + * added by an earlier call to rewrite_swizzle() on an expression, so the + * mask should not be modified. + */ +static void +rewrite_swizzle(ir_instruction *ir, void *data) +{ + ir_swizzle_mask *mask = (ir_swizzle_mask *)data; + + switch (ir->ir_type) { + case ir_type_swizzle: { + ir_swizzle *swz = (ir_swizzle *)ir; + if (swz->val->type->is_vector()) { + swz->mask = *mask; + } + swz->type = glsl_type::get_instance(swz->type->base_type, + mask->num_components, 1); + break; + } + case ir_type_expression: { + ir_expression *expr = (ir_expression *)ir; + expr->type = glsl_type::get_instance(expr->type->base_type, + mask->num_components, 1); + for (unsigned i = 0; i < 4; i++) { + if (expr->operands[i]) { + ir_dereference *deref = expr->operands[i]->as_dereference(); + if (deref && deref->type->is_scalar()) { + expr->operands[i] = new(ir) ir_swizzle(deref, 0, 0, 0, 0, + mask->num_components); + } + ir_constant *cns = expr->operands[i]->as_constant(); + if (cns && cns->type->is_scalar()) { + expr->operands[i] = new(ir) ir_swizzle(cns, 0, 0, 0, 0, + mask->num_components); + } + } + } + break; + } + default: + break; + } +} + +/** + * Attempt to vectorize the previously saved assignments, and clear them from + * consideration. + * + * If the assignments are able to be combined, it modifies in-place the last + * assignment seen to be an equivalent vector form of the scalar assignments. + * It then removes the other now obsolete scalar assignments. + */ +void +ir_vectorize_visitor::try_vectorize() +{ + if (this->last_assignment && this->channels > 1) { + ir_swizzle_mask mask = {0, 0, 0, 0, channels, 0}; + + this->last_assignment->write_mask = 0; + + for (unsigned i = 0, j = 0; i < 4; i++) { + if (this->assignment[i]) { + this->last_assignment->write_mask |= 1 << i; + + if (this->assignment[i] != this->last_assignment) { + this->assignment[i]->remove(); + } + + switch (j) { + case 0: mask.x = i; break; + case 1: mask.y = i; break; + case 2: mask.z = i; break; + case 3: mask.w = i; break; + } + + j++; + } + } + + visit_tree(this->last_assignment->rhs, rewrite_swizzle, &mask); + + this->progress = true; + } + clear(); +} + +/** + * Returns whether the write mask is a single channel. + */ +static bool +single_channel_write_mask(unsigned write_mask) +{ + return write_mask != 0 && (write_mask & (write_mask - 1)) == 0; +} + +/** + * Translates single-channeled write mask to single-channeled swizzle. + */ +static unsigned +write_mask_to_swizzle(unsigned write_mask) +{ + switch (write_mask) { + case WRITEMASK_X: return SWIZZLE_X; + case WRITEMASK_Y: return SWIZZLE_Y; + case WRITEMASK_Z: return SWIZZLE_Z; + case WRITEMASK_W: return SWIZZLE_W; + } + assert(!"not reached"); + unreachable(); +} + +/** + * Returns whether a single-channeled write mask matches a swizzle. + */ +static bool +write_mask_matches_swizzle(unsigned write_mask, + const ir_swizzle *swz) +{ + return ((write_mask == WRITEMASK_X && swz->mask.x == SWIZZLE_X) || + (write_mask == WRITEMASK_Y && swz->mask.x == SWIZZLE_Y) || + (write_mask == WRITEMASK_Z && swz->mask.x == SWIZZLE_Z) || + (write_mask == WRITEMASK_W && swz->mask.x == SWIZZLE_W)); +} + +/** + * Upon entering an ir_assignment, attempt to vectorize the currently tracked + * assignments if the current assignment is not suitable. Keep a pointer to + * the current assignment. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_assignment *ir) +{ + ir_dereference *lhs = this->last_assignment != NULL ? + this->last_assignment->lhs : NULL; + ir_rvalue *rhs = this->last_assignment != NULL ? + this->last_assignment->rhs : NULL; + + if (ir->condition || + this->channels >= 4 || + !single_channel_write_mask(ir->write_mask) || + (lhs && !ir->lhs->equals(lhs)) || + (rhs && !ir->rhs->equals(rhs, ir_type_swizzle))) { + try_vectorize(); + } + + this->current_assignment = ir; + + return visit_continue; +} + +/** + * Upon entering an ir_swizzle, set ::has_swizzle if we're visiting from an + * ir_assignment (i.e., that ::current_assignment is set) and the swizzle mask + * matches the current assignment's write mask. + * + * If the write mask doesn't match the swizzle mask, remove the current + * assignment from further consideration. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_swizzle *ir) +{ + if (this->current_assignment) { + if (write_mask_matches_swizzle(this->current_assignment->write_mask, ir)) { + this->has_swizzle = true; + } else { + this->current_assignment = NULL; + } + } + return visit_continue; +} + +/* Since there is no statement to visit between the "then" and "else" + * instructions try to vectorize before, in between, and after them to avoid + * combining statements from different basic blocks. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_if *ir) +{ + try_vectorize(); + + visit_list_elements(this, &ir->then_instructions); + try_vectorize(); + + visit_list_elements(this, &ir->else_instructions); + try_vectorize(); + + return visit_continue_with_parent; +} + +/* Since there is no statement to visit between the instructions in the body of + * the loop and the instructions after it try to vectorize before and after the + * body to avoid combining statements from different basic blocks. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_loop *ir) +{ + try_vectorize(); + + visit_list_elements(this, &ir->body_instructions); + try_vectorize(); + + return visit_continue_with_parent; +} + +/** + * Upon leaving an ir_assignment, save a pointer to it in ::assignment[] if + * the swizzle mask(s) found were appropriate. Also save a pointer in + * ::last_assignment so that we can compare future assignments with it. + * + * Finally, clear ::current_assignment and ::has_swizzle. + */ +ir_visitor_status +ir_vectorize_visitor::visit_leave(ir_assignment *ir) +{ + if (this->has_swizzle && this->current_assignment) { + assert(this->current_assignment == ir); + + unsigned channel = write_mask_to_swizzle(this->current_assignment->write_mask); + this->assignment[channel] = ir; + this->channels++; + + this->last_assignment = this->current_assignment; + } + this->current_assignment = NULL; + this->has_swizzle = false; + return visit_continue; +} + +/** + * Combines scalar assignments of the same expression (modulo swizzle) to + * multiple channels of the same variable into a single vectorized expression + * and assignment. + */ +bool +do_vectorize(exec_list *instructions) +{ + ir_vectorize_visitor v; + + v.run(instructions); + + /* Try to vectorize the last assignments seen. */ + v.try_vectorize(); + + return v.progress; +} diff --git a/3rdparty/glsl-optimizer/src/glsl/program.h b/3rdparty/glsl-optimizer/src/glsl/program.h index 437ca1462..f15113a08 100644 --- a/3rdparty/glsl-optimizer/src/glsl/program.h +++ b/3rdparty/glsl-optimizer/src/glsl/program.h @@ -16,20 +16,37 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "main/core.h" +#ifdef __cplusplus +extern "C" { +#endif + +extern void +_mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, + bool dump_ast, bool dump_hir); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + extern void link_shaders(struct gl_context *ctx, struct gl_shader_program *prog); extern void -linker_error(gl_shader_program *prog, const char *fmt, ...) +linker_error(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3); extern void -linker_warning(gl_shader_program *prog, const char *fmt, ...) +linker_warning(struct gl_shader_program *prog, const char *fmt, ...) PRINTFLIKE(2, 3); + +extern long +parse_program_resource_name(const GLchar *name, + const GLchar **out_base_name_end); diff --git a/3rdparty/glsl-optimizer/src/glsl/ralloc.c b/3rdparty/glsl-optimizer/src/glsl/ralloc.c index 4bd88fc91..85e682658 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ralloc.c +++ b/3rdparty/glsl-optimizer/src/glsl/ralloc.c @@ -29,7 +29,7 @@ #include /* Android defines SIZE_MAX in limits.h, instead of the standard stdint.h */ -#if defined(__ANDROID__) || defined(ANDROID) +#ifdef ANDROID #include #endif @@ -41,14 +41,6 @@ _CRTIMP int _vscprintf(const char *format, va_list argptr); #include "ralloc.h" -#ifdef __GNUC__ -#define likely(x) __builtin_expect(!!(x),1) -#define unlikely(x) __builtin_expect(!!(x),0) -#else -#define likely(x) !!(x) -#define unlikely(x) !!(x) -#endif - #ifndef va_copy #ifdef __va_copy #define va_copy(dest, src) __va_copy((dest), (src)) @@ -61,8 +53,10 @@ _CRTIMP int _vscprintf(const char *format, va_list argptr); struct ralloc_header { +#ifdef DEBUG /* A canary value used to determine whether a pointer is ralloc'd. */ unsigned canary; +#endif struct ralloc_header *parent; @@ -86,7 +80,9 @@ get_header(const void *ptr) { ralloc_header *info = (ralloc_header *) (((char *) ptr) - sizeof(ralloc_header)); +#ifdef DEBUG assert(info->canary == CANARY); +#endif return info; } @@ -115,13 +111,19 @@ void * ralloc_size(const void *ctx, size_t size) { void *block = calloc(1, size + sizeof(ralloc_header)); + ralloc_header *info; + ralloc_header *parent; - ralloc_header *info = (ralloc_header *) block; - ralloc_header *parent = ctx != NULL ? get_header(ctx) : NULL; + if (unlikely(block == NULL)) + return NULL; + info = (ralloc_header *) block; + parent = ctx != NULL ? get_header(ctx) : NULL; add_child(parent, info); +#ifdef DEBUG info->canary = CANARY; +#endif return PTR_FROM_HEADER(info); } @@ -393,7 +395,7 @@ ralloc_asprintf(const void *ctx, const char *fmt, ...) /* Return the length of the string that would be generated by a printf-style * format and argument list, not including the \0 byte. */ -static size_t +size_t printf_length(const char *fmt, va_list untouched_args) { int size; diff --git a/3rdparty/glsl-optimizer/src/glsl/ralloc.h b/3rdparty/glsl-optimizer/src/glsl/ralloc.h index bcaaa8493..44dd34392 100644 --- a/3rdparty/glsl-optimizer/src/glsl/ralloc.h +++ b/3rdparty/glsl-optimizer/src/glsl/ralloc.h @@ -54,6 +54,7 @@ extern "C" { #include #include #include +#include "main/compiler.h" /** * \def ralloc(ctx, type) @@ -301,7 +302,7 @@ bool ralloc_strncat(char **dest, const char *str, size_t n); * * \return The newly allocated string. */ -char *ralloc_asprintf (const void *ctx, const char *fmt, ...); +char *ralloc_asprintf (const void *ctx, const char *fmt, ...) PRINTFLIKE(2, 3); /** * Print to a string, given a va_list. @@ -334,7 +335,8 @@ char *ralloc_vasprintf(const void *ctx, const char *fmt, va_list args); * \return True unless allocation failed. */ bool ralloc_asprintf_rewrite_tail(char **str, size_t *start, - const char *fmt, ...); + const char *fmt, ...) + PRINTFLIKE(3, 4); /** * Rewrite the tail of an existing string, starting at a given index. @@ -376,7 +378,8 @@ bool ralloc_vasprintf_rewrite_tail(char **str, size_t *start, const char *fmt, * * \return True unless allocation failed. */ -bool ralloc_asprintf_append (char **str, const char *fmt, ...); +bool ralloc_asprintf_append (char **str, const char *fmt, ...) + PRINTFLIKE(2, 3); /** * Append formatted text to the supplied string, given a va_list. @@ -397,8 +400,50 @@ bool ralloc_asprintf_append (char **str, const char *fmt, ...); bool ralloc_vasprintf_append(char **str, const char *fmt, va_list args); /// @} + +size_t printf_length(const char *fmt, va_list untouched_args); + + #ifdef __cplusplus } /* end of extern "C" */ #endif +/** + * Declare C++ new and delete operators which use ralloc. + * + * Placing this macro in the body of a class makes it possible to do: + * + * TYPE *var = new(mem_ctx) TYPE(...); + * delete var; + * + * which is more idiomatic in C++ than calling ralloc. + */ +#define DECLARE_RALLOC_CXX_OPERATORS(TYPE) \ +private: \ + static void _ralloc_destructor(void *p) \ + { \ + reinterpret_cast(p)->~TYPE(); \ + } \ +public: \ + static void* operator new(size_t size, void *mem_ctx) \ + { \ + void *p = ralloc_size(mem_ctx, size); \ + assert(p != NULL); \ + if (!HAS_TRIVIAL_DESTRUCTOR(TYPE)) \ + ralloc_set_destructor(p, _ralloc_destructor); \ + return p; \ + } \ + \ + static void operator delete(void *p) \ + { \ + /* The object's destructor is guaranteed to have already been \ + * called by the delete operator at this point -- Make sure it's \ + * not called again. \ + */ \ + if (!HAS_TRIVIAL_DESTRUCTOR(TYPE)) \ + ralloc_set_destructor(p, NULL); \ + ralloc_free(p); \ + } + + #endif diff --git a/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp b/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp index 913534afa..cc4ca6ce8 100644 --- a/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/s_expression.cpp @@ -66,18 +66,18 @@ read_atom(void *ctx, const char *&src, char *&symbol_buffer) return NULL; // no atom // Check for the special symbol '+INF', which means +Infinity. Note: C99 - // requires strtod to parse '+INF' as +Infinity, but we still support some + // requires strtof to parse '+INF' as +Infinity, but we still support some // non-C99-compliant compilers (e.g. MSVC). if (n == 4 && strncmp(src, "+INF", 4) == 0) { expr = new(ctx) s_float(std::numeric_limits::infinity()); } else { // Check if the atom is a number. char *float_end = NULL; - double f = glsl_strtod(src, &float_end); + float f = glsl_strtof(src, &float_end); if (float_end != src) { char *int_end = NULL; int i = strtol(src, &int_end, 10); - // If strtod matched more characters, it must have a decimal part + // If strtof matched more characters, it must have a decimal part if (float_end > int_end) expr = new(ctx) s_float((float)f); else @@ -162,8 +162,8 @@ void s_symbol::print() void s_list::print() { printf("("); - foreach_iter(exec_list_iterator, it, this->subexpressions) { - s_expression *expr = (s_expression*) it.get(); + foreach_list(n, &this->subexpressions) { + s_expression *expr = (s_expression *) n; expr->print(); if (!expr->next->is_tail_sentinel()) printf(" "); @@ -201,11 +201,11 @@ s_match(s_expression *top, unsigned n, s_pattern *pattern, bool partial) return false; unsigned i = 0; - foreach_iter(exec_list_iterator, it, list->subexpressions) { + foreach_list(node, &list->subexpressions) { if (i >= n) return partial; /* More actual items than the pattern expected */ - s_expression *expr = (s_expression *) it.get(); + s_expression *expr = (s_expression *) node; if (expr == NULL || !pattern[i].match(expr)) return false; diff --git a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp index 679714e38..91794719b 100644 --- a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp +++ b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.cpp @@ -33,6 +33,24 @@ #include #include "ralloc.h" +void +_mesa_warning(struct gl_context *ctx, const char *fmt, ...) +{ + va_list vargs; + (void) ctx; + + va_start(vargs, fmt); + + /* This output is not thread-safe, but that's good enough for the + * standalone compiler. + */ + fprintf(stderr, "Mesa warning: "); + vfprintf(stderr, fmt, vargs); + fprintf(stderr, "\n"); + + va_end(vargs); +} + void _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, struct gl_shader *sh) @@ -42,7 +60,7 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, } void -_mesa_shader_debug(struct gl_context *, GLenum, GLuint, +_mesa_shader_debug(struct gl_context *, GLenum, GLuint *id, const char *, int) { } @@ -58,6 +76,7 @@ _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) shader = rzalloc(NULL, struct gl_shader); if (shader) { shader->Type = type; + shader->Stage = _mesa_shader_enum_to_shader_stage(type); shader->Name = name; shader->RefCount = 1; } @@ -72,14 +91,35 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Extensions.dummy_false = false; ctx->Extensions.dummy_true = true; - ctx->Extensions.ARB_ES2_compatibility = true; + ctx->Extensions.ARB_conservative_depth = true; ctx->Extensions.ARB_draw_instanced = true; + ctx->Extensions.ARB_ES2_compatibility = true; + ctx->Extensions.ARB_ES3_compatibility = true; + ctx->Extensions.ARB_explicit_attrib_location = true; ctx->Extensions.ARB_fragment_coord_conventions = true; - ctx->Extensions.EXT_texture_array = true; - ctx->Extensions.NV_texture_rectangle = true; - ctx->Extensions.EXT_texture3D = true; - ctx->Extensions.OES_EGL_image_external = true; + ctx->Extensions.ARB_gpu_shader5 = true; + ctx->Extensions.ARB_sample_shading = true; ctx->Extensions.ARB_shader_bit_encoding = true; + ctx->Extensions.ARB_shader_stencil_export = true; + ctx->Extensions.ARB_shader_texture_lod = true; + ctx->Extensions.ARB_shading_language_420pack = true; + ctx->Extensions.ARB_shading_language_packing = true; + ctx->Extensions.ARB_texture_cube_map_array = true; + ctx->Extensions.ARB_texture_gather = true; + ctx->Extensions.ARB_texture_multisample = true; + ctx->Extensions.ARB_texture_query_levels = true; + ctx->Extensions.ARB_texture_query_lod = true; + ctx->Extensions.ARB_uniform_buffer_object = true; + ctx->Extensions.ARB_viewport_array = true; + + ctx->Extensions.OES_EGL_image_external = true; + ctx->Extensions.OES_standard_derivatives = true; + + ctx->Extensions.EXT_shader_integer_mix = true; + ctx->Extensions.EXT_texture3D = true; + ctx->Extensions.EXT_texture_array = true; + + ctx->Extensions.NV_texture_rectangle = true; ctx->Const.GLSLVersion = 120; @@ -88,14 +128,28 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Const.MaxClipPlanes = 6; ctx->Const.MaxTextureUnits = 2; ctx->Const.MaxTextureCoordUnits = 2; - ctx->Const.VertexProgram.MaxAttribs = 16; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs = 16; - ctx->Const.VertexProgram.MaxUniformComponents = 512; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents = 512; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents = 32; ctx->Const.MaxVarying = 8; /* == gl_MaxVaryingFloats / 4 */ - ctx->Const.MaxVertexTextureImageUnits = 0; + ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits = 0; ctx->Const.MaxCombinedTextureImageUnits = 2; - ctx->Const.MaxTextureImageUnits = 2; - ctx->Const.FragmentProgram.MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = 2; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents = 64; + ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxInputComponents = 32; ctx->Const.MaxDrawBuffers = 1; + + /* Set up default shader compiler options. */ + struct gl_shader_compiler_options options; + memset(&options, 0, sizeof(options)); + options.MaxUnrollIterations = 32; + options.MaxIfDepth = UINT_MAX; + + /* Default pragma settings */ + options.DefaultPragmas.Optimize = true; + + for (int sh = 0; sh < MESA_SHADER_STAGES; ++sh) + memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options)); } diff --git a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h index 41ce35bef..327fef2df 100644 --- a/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h +++ b/3rdparty/glsl-optimizer/src/glsl/standalone_scaffolding.h @@ -31,8 +31,12 @@ #ifndef STANDALONE_SCAFFOLDING_H #define STANDALONE_SCAFFOLDING_H +#include #include "main/mtypes.h" +extern "C" void +_mesa_warning(struct gl_context *ctx, const char *fmtString, ... ); + extern "C" void _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, struct gl_shader *sh); @@ -41,9 +45,25 @@ extern "C" struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); extern "C" void -_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint id, +_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id, const char *msg, int len); +static inline gl_shader_stage +_mesa_shader_enum_to_shader_stage(GLenum v) +{ + switch (v) { + case GL_VERTEX_SHADER: + return MESA_SHADER_VERTEX; + case GL_FRAGMENT_SHADER: + return MESA_SHADER_FRAGMENT; + case GL_GEOMETRY_SHADER: + return MESA_SHADER_GEOMETRY; + default: + assert(!"bad value in _mesa_shader_enum_to_shader_stage()"); + return MESA_SHADER_VERTEX; + } +} + /** * Initialize the given gl_context structure to a reasonable set of * defaults representing the minimum capabilities required by the diff --git a/3rdparty/glsl-optimizer/src/glsl/strtod.c b/3rdparty/glsl-optimizer/src/glsl/strtod.c index 822364cbf..5d4346b5a 100644 --- a/3rdparty/glsl-optimizer/src/glsl/strtod.c +++ b/3rdparty/glsl-optimizer/src/glsl/strtod.c @@ -45,7 +45,7 @@ double glsl_strtod(const char *s, char **end) { #if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ - !defined(__HAIKU__) && !defined(__UCLIBC__) && !defined(__ANDROID__) + !defined(__HAIKU__) && !defined(__UCLIBC__) static locale_t loc = NULL; if (!loc) { loc = newlocale(LC_CTYPE_MASK, "C", NULL); @@ -55,3 +55,25 @@ glsl_strtod(const char *s, char **end) return strtod(s, end); #endif } + + +/** + * Wrapper around strtof which uses the "C" locale so the decimal + * point is always '.' + */ +float +glsl_strtof(const char *s, char **end) +{ +#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ + !defined(__HAIKU__) && !defined(__UCLIBC__) + static locale_t loc = NULL; + if (!loc) { + loc = newlocale(LC_CTYPE_MASK, "C", NULL); + } + return strtof_l(s, end, loc); +#elif _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE + return strtof(s, end); +#else + return (float) strtod(s, end); +#endif +} diff --git a/3rdparty/glsl-optimizer/src/glsl/strtod.h b/3rdparty/glsl-optimizer/src/glsl/strtod.h index 0cf6409d4..ad847dbb0 100644 --- a/3rdparty/glsl-optimizer/src/glsl/strtod.h +++ b/3rdparty/glsl-optimizer/src/glsl/strtod.h @@ -34,6 +34,9 @@ extern "C" { extern double glsl_strtod(const char *s, char **end); +extern float +glsl_strtof(const char *s, char **end); + #ifdef __cplusplus } diff --git a/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp b/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp new file mode 100644 index 000000000..8ac3a416c --- /dev/null +++ b/3rdparty/glsl-optimizer/src/glsl_optimizer_lib.gyp @@ -0,0 +1,179 @@ +{ + 'includes': [ + '../target_defaults.gypi', + ], + 'targets': [ + { + 'target_name': 'glsl_optimizer_lib', + 'type': 'static_library', + 'include_dirs': [ + 'glsl', + 'mesa', + '../include', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'glsl', + ], + }, + 'sources': [ + 'glsl/glcpp/glcpp-lex.c', + 'glsl/glcpp/glcpp-parse.c', + 'glsl/glcpp/glcpp-parse.h', + 'glsl/glcpp/glcpp.h', + 'glsl/glcpp/pp.c', + 'glsl/ast.h', + 'glsl/ast_array_index.cpp', + 'glsl/ast_expr.cpp', + 'glsl/ast_function.cpp', + 'glsl/ast_to_hir.cpp', + 'glsl/ast_type.cpp', + 'glsl/builtin_functions.cpp', + 'glsl/builtin_types.h', + 'glsl/builtin_variables.cpp', + 'glsl/glsl_lexer.cpp', + 'glsl/glsl_optimizer.cpp', + 'glsl/glsl_optimizer.h', + 'glsl/glsl_parser.cpp', + 'glsl/glsl_parser.h', + 'glsl/glsl_parser_extras.cpp', + 'glsl/glsl_parser_extras.h', + 'glsl/glsl_symbol_table.cpp', + 'glsl/glsl_symbol_table.h', + 'glsl/glsl_types.cpp', + 'glsl/glsl_types.h', + 'glsl/hir_field_selection.cpp', + 'glsl/ir.cpp', + 'glsl/ir.h', + 'glsl/ir_basic_block.cpp', + 'glsl/ir_basic_block.h', + 'glsl/ir_builder.cpp', + 'glsl/ir_builder.h', + 'glsl/ir_clone.cpp', + 'glsl/ir_constant_expression.cpp', + 'glsl/ir_equals.cpp', + 'glsl/ir_expression_flattening.cpp', + 'glsl/ir_expression_flattening.h', + 'glsl/ir_function.cpp', + 'glsl/ir_function_can_inline.cpp', + 'glsl/ir_function_detect_recursion.cpp', + 'glsl/ir_function_inlining.h', + 'glsl/ir_hierarchical_visitor.cpp', + 'glsl/ir_hierarchical_visitor.h', + 'glsl/ir_hv_accept.cpp', + 'glsl/ir_import_prototypes.cpp', + 'glsl/ir_optimization.h', + 'glsl/ir_print_glsl_visitor.cpp', + 'glsl/ir_print_glsl_visitor.h', + 'glsl/ir_print_visitor.cpp', + 'glsl/ir_print_visitor.h', + 'glsl/ir_rvalue_visitor.cpp', + 'glsl/ir_rvalue_visitor.h', + 'glsl/ir_uniform.h', + 'glsl/ir_unused_structs.cpp', + 'glsl/ir_unused_structs.h', + 'glsl/ir_validate.cpp', + 'glsl/ir_variable_refcount.cpp', + 'glsl/ir_variable_refcount.h', + 'glsl/ir_visitor.h', + 'glsl/link_atomics.cpp', + 'glsl/link_functions.cpp', + 'glsl/link_uniform_block_active_visitor.cpp', + 'glsl/link_uniform_block_active_visitor.h', + 'glsl/link_uniform_blocks.cpp', + 'glsl/link_uniform_initializers.cpp', + 'glsl/link_uniforms.cpp', + 'glsl/link_varyings.cpp', + 'glsl/link_varyings.h', + 'glsl/linker.cpp', + 'glsl/linker.h', + 'glsl/list.h', + 'glsl/loop_analysis.cpp', + 'glsl/loop_analysis.h', + 'glsl/loop_controls.cpp', + 'glsl/loop_unroll.cpp', + 'glsl/lower_clip_distance.cpp', + 'glsl/lower_discard.cpp', + 'glsl/lower_discard_flow.cpp', + 'glsl/lower_if_to_cond_assign.cpp', + 'glsl/lower_instructions.cpp', + 'glsl/lower_jumps.cpp', + 'glsl/lower_mat_op_to_vec.cpp', + 'glsl/lower_noise.cpp', + 'glsl/lower_packed_varyings.cpp', + 'glsl/lower_packing_builtins.cpp', + 'glsl/lower_variable_index_to_cond_assign.cpp', + 'glsl/lower_vec_index_to_cond_assign.cpp', + 'glsl/lower_vec_index_to_swizzle.cpp', + 'glsl/lower_vector.cpp', + 'glsl/opt_algebraic.cpp', + 'glsl/opt_array_splitting.cpp', + 'glsl/opt_constant_folding.cpp', + 'glsl/opt_constant_propagation.cpp', + 'glsl/opt_constant_variable.cpp', + 'glsl/opt_copy_propagation.cpp', + 'glsl/opt_copy_propagation_elements.cpp', + 'glsl/opt_cse.cpp', + 'glsl/opt_dead_code.cpp', + 'glsl/opt_dead_code_local.cpp', + 'glsl/opt_dead_functions.cpp', + 'glsl/opt_flatten_nested_if_blocks.cpp', + 'glsl/opt_function_inlining.cpp', + 'glsl/opt_if_simplification.cpp', + 'glsl/opt_noop_swizzle.cpp', + 'glsl/opt_redundant_jumps.cpp', + 'glsl/opt_structure_splitting.cpp', + 'glsl/opt_swizzle_swizzle.cpp', + 'glsl/opt_tree_grafting.cpp', + 'glsl/opt_vectorize.cpp', + 'glsl/program.h', + 'glsl/ralloc.c', + 'glsl/ralloc.h', + 'glsl/s_expression.cpp', + 'glsl/s_expression.h', + 'glsl/standalone_scaffolding.cpp', + 'glsl/standalone_scaffolding.h', + 'glsl/strtod.c', + 'glsl/strtod.h', + 'mesa/main/compiler.h', + 'mesa/main/config.h', + 'mesa/main/context.h', + 'mesa/main/core.h', + 'mesa/main/dd.h', + 'mesa/main/glheader.h', + 'mesa/main/glminimal.h', + 'mesa/main/hash_table.c', + 'mesa/main/hash_table.h', + 'mesa/main/imports.c', + 'mesa/main/imports.h', + 'mesa/main/macros.h', + 'mesa/main/mtypes.h', + 'mesa/main/simple_list.h', + 'mesa/program/hash_table.h', + 'mesa/program/prog_hash_table.c', + 'mesa/program/prog_instruction.h', + 'mesa/program/prog_parameter.h', + 'mesa/program/prog_statevars.h', + 'mesa/program/symbol_table.c', + 'mesa/program/symbol_table.h', + ], + 'conditions': [ + ['OS=="win"', { + 'include_dirs': [ + '../include/c99', + ], + 'defines': [ + '_LIB', + 'NOMINMAX', + '_CRT_SECURE_NO_WARNINGS', + '_CRT_SECURE_NO_DEPRECATE', + '__STDC_VERSION__=199901L', + '__STDC__', + 'strdup=_strdup', + ], + 'msvs_disabled_warnings': [4028, 4244, 4267, 4996], + }], + ], + } + ] +} \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/src/mesa/.gitignore b/3rdparty/glsl-optimizer/src/mesa/.gitignore deleted file mode 100644 index 5fc607b9e..000000000 --- a/3rdparty/glsl-optimizer/src/mesa/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Makefile diff --git a/3rdparty/glsl-optimizer/src/mesa/main/.gitignore b/3rdparty/glsl-optimizer/src/mesa/main/.gitignore index b26be227f..837f49036 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/.gitignore +++ b/3rdparty/glsl-optimizer/src/mesa/main/.gitignore @@ -1,10 +1,10 @@ -api_exec_es1.c +api_exec.c dispatch.h enums.c get_es1.c get_es2.c git_sha1.h git_sha1.h.tmp -api_exec_es1_dispatch.h -api_exec_es1_remap_helper.h remap_helper.h +get_hash.h +get_hash.h.tmp diff --git a/3rdparty/glsl-optimizer/src/mesa/main/compiler.h b/3rdparty/glsl-optimizer/src/mesa/main/compiler.h index a8cddaf8f..97075f58e 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/compiler.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/compiler.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -18,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -36,11 +36,7 @@ #include #include -#if defined(__alpha__) && defined(CCPML) -#include /* use Compaq's Fast Math Library on Alpha */ -#else #include -#endif #include #include #include @@ -48,6 +44,8 @@ #include #include +#include "c99_compat.h" /* inline, __func__, etc. */ + #ifdef __cplusplus extern "C" { @@ -82,15 +80,13 @@ extern "C" { */ #if defined(_MSC_VER) # define finite _finite -#elif defined(__WATCOMC__) -# define finite _finite #endif /** * Disable assorted warnings */ -#if !defined(OPENSTEP) && (defined(_WIN32) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP) +#if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(__GNUC__) /* mingw environment */ # pragma warning( disable : 4068 ) /* unknown pragma */ # pragma warning( disable : 4710 ) /* function 'foo' not inlined */ @@ -105,36 +101,10 @@ extern "C" { # endif # endif #endif -#if defined(__WATCOMC__) -# pragma disable_message(201) /* Disable unreachable code warnings */ -#endif -/** - * Function inlining - */ -#ifndef inline -# ifdef __cplusplus - /* C++ supports inline keyword */ -# elif defined(__GNUC__) -# define inline __inline__ -# elif defined(_MSC_VER) -# define inline __inline -# elif defined(__ICL) -# define inline __inline -# elif defined(__INTEL_COMPILER) - /* Intel compiler supports inline keyword */ -# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) -# define inline __inline -# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) - /* C99 supports inline keyword */ -# elif (__STDC_VERSION__ >= 199901L) - /* C99 supports inline keyword */ -# else -# define inline -# endif -#endif +/* XXX: Use standard `inline` keyword instead */ #ifndef INLINE # define INLINE inline #endif @@ -177,37 +147,10 @@ extern "C" { # endif #endif -/** - * The __FUNCTION__ gcc variable is generally only used for debugging. - * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. - * Don't define it if using a newer Windows compiler. - */ +/* XXX: Use standard `__func__` instead */ #ifndef __FUNCTION__ -# if defined(__VMS) -# define __FUNCTION__ "VMS$NL:" -# elif !defined(__GNUC__) && !defined(__xlC__) && \ - (!defined(_MSC_VER) || _MSC_VER < 1300) -# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ - (defined(__SUNPRO_C) && defined(__C99FEATURES__)) -# define __FUNCTION__ __func__ -# else -# define __FUNCTION__ "" -# endif -# endif +# define __FUNCTION__ __func__ #endif -#ifndef __func__ -# if (__STDC_VERSION__ >= 199901L) || \ - (defined(__SUNPRO_C) && defined(__C99FEATURES__)) - /* __func__ is part of C99 */ -# elif defined(_MSC_VER) -# if _MSC_VER >= 1300 -# define __func__ __FUNCTION__ -# else -# define __func__ "" -# endif -# endif -#endif - /** * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32. @@ -246,7 +189,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) -#if !defined(CAPI) && defined(_WIN32) && !defined(BUILD_FOR_SNAP) +#if !defined(CAPI) && defined(_WIN32) #define CAPI _cdecl #endif @@ -256,7 +199,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) * than GNU C */ #ifndef _ASMAPI -#if defined(_WIN32) && !defined(BUILD_FOR_SNAP)/* was: !defined( __GNUC__ ) && !defined( VMS ) && !defined( __INTEL_COMPILER )*/ +#if defined(_WIN32) #define _ASMAPI __cdecl #else #define _ASMAPI @@ -287,9 +230,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) * ASSERT macro */ #if !defined(_WIN32_WCE) -#if defined(BUILD_FOR_SNAP) && defined(CHECKED) -# define ASSERT(X) _CHECK(X) -#elif defined(DEBUG) +#if defined(DEBUG) # define ASSERT(X) assert(X) #else # define ASSERT(X) @@ -304,9 +245,24 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) */ #define STATIC_ASSERT(COND) \ do { \ - typedef int static_assertion_failed[(!!(COND))*2-1]; \ + (void) sizeof(char [1 - 2*!(COND)]); \ } while (0) +/** + * Unreachable macro. Useful for suppressing "control reaches end of non-void + * function" warnings. + */ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 5 +#define unreachable() __builtin_unreachable() +#elif (defined(__clang__) && defined(__has_builtin)) +# if __has_builtin(__builtin_unreachable) +# define unreachable() __builtin_unreachable() +# endif +#endif + +#ifndef unreachable +#define unreachable() +#endif #if (__GNUC__ >= 3) #define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) @@ -318,6 +274,15 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) #define NULL 0 #endif +/* Used to optionally mark structures with misaligned elements or size as + * packed, to trade off performance for space. + */ +#if (__GNUC__ >= 3) +#define PACKED __attribute__((__packed__)) +#else +#define PACKED +#endif + /** * LONGSTRING macro @@ -355,15 +320,16 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) * USE_IEEE: Determine if we're using IEEE floating point */ #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ - defined(__s390x__) || defined(__powerpc__) || \ + defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \ defined(__x86_64__) || \ + defined(__m68k__) || \ defined(ia64) || defined(__ia64__) || \ defined(__hppa__) || defined(hpux) || \ defined(__mips) || defined(_MIPS_ARCH) || \ - defined(__arm__) || \ + defined(__arm__) || defined(__aarch64__) || \ defined(__sh__) || defined(__m32r__) || \ (defined(__sun) && defined(_IEEE_754)) || \ - (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) + defined(__alpha__) #define USE_IEEE #define IEEE_ONE 0x3f800000 #endif @@ -421,36 +387,6 @@ do { \ __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \ } while (0) -#elif defined(__WATCOMC__) && defined(__386__) -#define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ -#define FAST_X86_FPU 0x003f /* See GCC comments above */ -void _watcom_start_fast_math(unsigned short *x,unsigned short *mask); -#pragma aux _watcom_start_fast_math = \ - "fnstcw word ptr [eax]" \ - "fldcw word ptr [ecx]" \ - parm [eax] [ecx] \ - modify exact []; -void _watcom_end_fast_math(unsigned short *x); -#pragma aux _watcom_end_fast_math = \ - "fnclex" \ - "fldcw word ptr [eax]" \ - parm [eax] \ - modify exact []; -#if defined(NO_FAST_MATH) -#define START_FAST_MATH(x) \ -do { \ - static GLushort mask = DEFAULT_X86_FPU; \ - _watcom_start_fast_math(&x,&mask); \ -} while (0) -#else -#define START_FAST_MATH(x) \ -do { \ - static GLushort mask = FAST_X86_FPU; \ - _watcom_start_fast_math(&x,&mask); \ -} while (0) -#endif -#define END_FAST_MATH(x) _watcom_end_fast_math(&x) - #elif defined(_MSC_VER) && defined(_M_IX86) #define DEFAULT_X86_FPU 0x037f /* See GCC comments above */ #define FAST_X86_FPU 0x003f /* See GCC comments above */ @@ -482,7 +418,29 @@ do { \ #define Elements(x) (sizeof(x)/sizeof(*(x))) #endif - +#ifdef __cplusplus +/** + * Macro function that evaluates to true if T is a trivially + * destructible type -- that is, if its (non-virtual) destructor + * performs no action and all member variables and base classes are + * trivially destructible themselves. + */ +# if defined(__GNUC__) +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# endif +# elif (defined(__clang__) && defined(__has_feature)) +# if __has_feature(has_trivial_destructor) +# define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# endif +# endif +# ifndef HAS_TRIVIAL_DESTRUCTOR + /* It's always safe (if inefficient) to assume that a + * destructor is non-trivial. + */ +# define HAS_TRIVIAL_DESTRUCTOR(T) (false) +# endif +#endif #ifdef __cplusplus } diff --git a/3rdparty/glsl-optimizer/src/mesa/main/config.h b/3rdparty/glsl-optimizer/src/mesa/main/config.h index ead1d323c..0c1782ad7 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/config.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/config.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.5 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * Copyright (C) 2008 VMware, Inc. All Rights Reserved. @@ -18,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -90,9 +90,6 @@ /** Line width granularity */ #define LINE_WIDTH_GRANULARITY 0.1 -/** Max texture palette / color table size */ -#define MAX_COLOR_TABLE_SIZE 256 - /** Max memory to allow for a single texture image (in megabytes) */ #define MAX_TEXTURE_MBYTES 1024 @@ -124,7 +121,7 @@ * Max number of texture image units. Also determines number of texture * samplers in shaders. */ -#define MAX_TEXTURE_IMAGE_UNITS 16 +#define MAX_TEXTURE_IMAGE_UNITS 32 /** * Larger of MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS. @@ -140,6 +137,9 @@ #define MAX_VIEWPORT_WIDTH 16384 #define MAX_VIEWPORT_HEIGHT 16384 +/** Maximun number of viewports supported with ARB_viewport_array */ +#define MAX_VIEWPORTS 16 + /** Maxmimum size for CVA. May be overridden by the drivers. */ #define MAX_ARRAY_LOCK_SIZE 3000 @@ -170,6 +170,17 @@ /*@{*/ #define MAX_PROGRAM_LOCAL_PARAMS 4096 #define MAX_UNIFORMS 4096 +#define MAX_UNIFORM_BUFFERS 15 /* + 1 default uniform buffer */ +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_UNIFORM_BUFFERS (MAX_UNIFORM_BUFFERS * 6) +#define MAX_ATOMIC_COUNTERS 4096 +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_ATOMIC_BUFFERS (MAX_UNIFORM_BUFFERS * 6) +/* Size of an atomic counter in bytes according to ARB_shader_atomic_counters */ +#define ATOMIC_COUNTER_SIZE 4 +#define MAX_IMAGE_UNIFORMS 16 +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 6) /*@}*/ /** @@ -186,8 +197,8 @@ #define MAX_PROGRAM_MATRIX_STACK_DEPTH 4 #define MAX_PROGRAM_CALL_DEPTH 8 #define MAX_PROGRAM_TEMPS 256 -#define MAX_PROGRAM_ADDRESS_REGS 2 -#define MAX_VARYING 16 /**< number of float[4] vectors */ +#define MAX_PROGRAM_ADDRESS_REGS 1 +#define MAX_VARYING 32 /**< number of float[4] vectors */ #define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS #define MAX_PROGRAM_INPUTS 32 #define MAX_PROGRAM_OUTPUTS 64 @@ -204,15 +215,6 @@ #define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0 /*@}*/ -/** For GL_NV_vertex_program */ -/*@{*/ -#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128 -#define MAX_NV_VERTEX_PROGRAM_TEMPS 12 -#define MAX_NV_VERTEX_PROGRAM_PARAMS 96 -#define MAX_NV_VERTEX_PROGRAM_INPUTS 16 -#define MAX_NV_VERTEX_PROGRAM_OUTPUTS 15 -/*@}*/ - /** For GL_NV_fragment_program */ /*@{*/ #define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */ @@ -227,9 +229,8 @@ /** For GL_ARB_vertex_shader */ /*@{*/ #define MAX_VERTEX_GENERIC_ATTRIBS 16 -#define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_VERTEX_TEXTURE_IMAGE_UNITS + \ - MAX_TEXTURE_IMAGE_UNITS) +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS * 6) /*@}*/ @@ -254,20 +255,22 @@ /** For GL_ARB_geometry_shader4 */ /*@{*/ -#define MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 8 -#define MAX_GEOMETRY_VARYING_COMPONENTS 32 -#define MAX_VERTEX_VARYING_COMPONENTS 32 #define MAX_GEOMETRY_UNIFORM_COMPONENTS 512 #define MAX_GEOMETRY_OUTPUT_VERTICES 256 #define MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 1024 /*@}*/ -/** For GL_ARB_debug_output */ +/** For GL_ARB_debug_output and GL_KHR_debug */ /*@{*/ #define MAX_DEBUG_LOGGED_MESSAGES 10 #define MAX_DEBUG_MESSAGE_LENGTH 4096 /*@}*/ +/** For GL_KHR_debug */ +/*@{*/ +#define MAX_LABEL_LENGTH 256 +#define MAX_DEBUG_GROUP_STACK_DEPTH 64 +/*@}*/ /* * Color channel component order diff --git a/3rdparty/glsl-optimizer/src/mesa/main/context.h b/3rdparty/glsl-optimizer/src/mesa/main/context.h index ce7bd415c..4e4149c16 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/context.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/context.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -36,14 +36,13 @@ extern "C" { #endif - /** * Checks if the context is for Desktop GL (Compatibility or Core) */ static inline GLboolean _mesa_is_desktop_gl(const struct gl_context *ctx) { - return ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE; + return ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGL_CORE; } @@ -67,6 +66,17 @@ _mesa_is_gles3(const struct gl_context *ctx) } +/** + * Checks if the context supports geometry shaders. + */ +static inline GLboolean +_mesa_has_geometry_shaders(const struct gl_context *ctx) +{ + return _mesa_is_desktop_gl(ctx) && + (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4); +} + + #ifdef __cplusplus } #endif diff --git a/3rdparty/glsl-optimizer/src/mesa/main/core.h b/3rdparty/glsl-optimizer/src/mesa/main/core.h index c28a8af53..73ed01c25 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/core.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/core.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.9 * * Copyright (C) 2010 LunarG Inc. * @@ -32,8 +31,7 @@ * The public header of core mesa. * * This file is the (only) public header of core mesa. It is supposed to be - * used by GLX, WGL, and GLSL. It is important that headers directly or - * indirectly included here do not perform feature tests (#if FEATURE_xxx). + * used by GLX, WGL, and GLSL. */ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/dd.h b/3rdparty/glsl-optimizer/src/mesa/main/dd.h index 8a2247837..a6ee9405e 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/dd.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/dd.h @@ -5,7 +5,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -22,9 +21,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -52,5 +52,4 @@ struct dd_function_table { }; - #endif /* DD_INCLUDED */ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/glheader.h b/3rdparty/glsl-optimizer/src/mesa/main/glheader.h index 37176d3af..7f3b59f18 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/glheader.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/glheader.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -33,8 +33,6 @@ #define GLHEADER_H - - #define GL_GLEXT_PROTOTYPES #include "glminimal.h" @@ -43,6 +41,7 @@ #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 #define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 #define GL_DEBUG_TYPE_ERROR_ARB 0x824C #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D @@ -124,6 +123,7 @@ extern "C" { typedef int GLfixed; typedef int GLclampx; +typedef unsigned short GLhalfARB; #ifndef GL_OES_EGL_image @@ -138,7 +138,9 @@ typedef void *GLeglImageOES; #define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 #endif +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB + #ifndef GL_OES_point_size_array #define GL_POINT_SIZE_ARRAY_OES 0x8B9C #define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A @@ -174,12 +176,6 @@ typedef void *GLeglImageOES; #define GL_PALETTE8_RGB5_A1_OES 0x8B99 #endif -#ifndef GL_OES_matrix_get -#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D -#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E -#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F -#endif - #ifndef GL_ES_VERSION_2_0 #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 diff --git a/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h b/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h index 3b3e02453..beba21ade 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/glminimal.h @@ -98,6 +98,8 @@ typedef float GLfloat; /* single precision float */ typedef float GLclampf; /* single precision float in [0,1] */ typedef double GLdouble; /* double precision float */ typedef double GLclampd; /* double precision float in [0,1] */ +typedef char GLchar; +typedef char GLcharARB; @@ -133,6 +135,10 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_QUADS 0x0007 #define GL_QUAD_STRIP 0x0008 #define GL_POLYGON 0x0009 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D /* Matrix Mode */ @@ -395,4 +401,21 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D + + + #endif /* __gl_h_ */ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/hash_table.c b/3rdparty/glsl-optimizer/src/mesa/main/hash_table.c new file mode 100644 index 000000000..ee4c2e0c4 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/mesa/main/hash_table.c @@ -0,0 +1,441 @@ +/* + * Copyright © 2009,2012 Intel Corporation + * Copyright © 1988-2004 Keith Packard and Bart Massey. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Except as contained in this notice, the names of the authors + * or their institutions shall not be used in advertising or + * otherwise to promote the sale, use or other dealings in this + * Software without prior written authorization from the + * authors. + * + * Authors: + * Eric Anholt + * Keith Packard + */ + +/** + * Implements an open-addressing, linear-reprobing hash table. + * + * For more information, see: + * + * http://cgit.freedesktop.org/~anholt/hash_table/tree/README + */ + +#include +#include + +#include "main/hash_table.h" +#include "main/macros.h" +#include "../../glsl/ralloc.h" + +static const uint32_t deleted_key_value; + +/** + * From Knuth -- a good choice for hash/rehash values is p, p-2 where + * p and p-2 are both prime. These tables are sized to have an extra 10% + * free to avoid exponential performance degradation as the hash table fills + */ +static const struct { + uint32_t max_entries, size, rehash; +} hash_sizes[] = { + { 2, 5, 3 }, + { 4, 7, 5 }, + { 8, 13, 11 }, + { 16, 19, 17 }, + { 32, 43, 41 }, + { 64, 73, 71 }, + { 128, 151, 149 }, + { 256, 283, 281 }, + { 512, 571, 569 }, + { 1024, 1153, 1151 }, + { 2048, 2269, 2267 }, + { 4096, 4519, 4517 }, + { 8192, 9013, 9011 }, + { 16384, 18043, 18041 }, + { 32768, 36109, 36107 }, + { 65536, 72091, 72089 }, + { 131072, 144409, 144407 }, + { 262144, 288361, 288359 }, + { 524288, 576883, 576881 }, + { 1048576, 1153459, 1153457 }, + { 2097152, 2307163, 2307161 }, + { 4194304, 4613893, 4613891 }, + { 8388608, 9227641, 9227639 }, + { 16777216, 18455029, 18455027 }, + { 33554432, 36911011, 36911009 }, + { 67108864, 73819861, 73819859 }, + { 134217728, 147639589, 147639587 }, + { 268435456, 295279081, 295279079 }, + { 536870912, 590559793, 590559791 }, + { 1073741824, 1181116273, 1181116271}, + { 2147483648ul, 2362232233ul, 2362232231ul} +}; + +static int +entry_is_free(const struct hash_entry *entry) +{ + return entry->key == NULL; +} + +static int +entry_is_deleted(const struct hash_table *ht, struct hash_entry *entry) +{ + return entry->key == ht->deleted_key; +} + +static int +entry_is_present(const struct hash_table *ht, struct hash_entry *entry) +{ + return entry->key != NULL && entry->key != ht->deleted_key; +} + +struct hash_table * +_mesa_hash_table_create(void *mem_ctx, + bool (*key_equals_function)(const void *a, + const void *b)) +{ + struct hash_table *ht; + + ht = ralloc(mem_ctx, struct hash_table); + if (ht == NULL) + return NULL; + + ht->mem_ctx = mem_ctx; + ht->size_index = 0; + ht->size = hash_sizes[ht->size_index].size; + ht->rehash = hash_sizes[ht->size_index].rehash; + ht->max_entries = hash_sizes[ht->size_index].max_entries; + ht->key_equals_function = key_equals_function; + ht->table = rzalloc_array(ht, struct hash_entry, ht->size); + ht->entries = 0; + ht->deleted_entries = 0; + ht->deleted_key = &deleted_key_value; + + if (ht->table == NULL) { + ralloc_free(ht); + return NULL; + } + + return ht; +} + +/** + * Frees the given hash table. + * + * If delete_function is passed, it gets called on each entry present before + * freeing. + */ +void +_mesa_hash_table_destroy(struct hash_table *ht, + void (*delete_function)(struct hash_entry *entry)) +{ + if (!ht) + return; + + if (delete_function) { + struct hash_entry *entry; + + hash_table_foreach(ht, entry) { + delete_function(entry); + } + } + ralloc_free(ht); +} + +/** Sets the value of the key pointer used for deleted entries in the table. + * + * The assumption is that usually keys are actual pointers, so we use a + * default value of a pointer to an arbitrary piece of storage in the library. + * But in some cases a consumer wants to store some other sort of value in the + * table, like a uint32_t, in which case that pointer may conflict with one of + * their valid keys. This lets that user select a safe value. + * + * This must be called before any keys are actually deleted from the table. + */ +void +_mesa_hash_table_set_deleted_key(struct hash_table *ht, const void *deleted_key) +{ + ht->deleted_key = deleted_key; +} + +/** + * Finds a hash table entry with the given key and hash of that key. + * + * Returns NULL if no entry is found. Note that the data pointer may be + * modified by the user. + */ +struct hash_entry * +_mesa_hash_table_search(struct hash_table *ht, uint32_t hash, + const void *key) +{ + uint32_t start_hash_address = hash % ht->size; + uint32_t hash_address = start_hash_address; + + do { + uint32_t double_hash; + + struct hash_entry *entry = ht->table + hash_address; + + if (entry_is_free(entry)) { + return NULL; + } else if (entry_is_present(ht, entry) && entry->hash == hash) { + if (ht->key_equals_function(key, entry->key)) { + return entry; + } + } + + double_hash = 1 + hash % ht->rehash; + + hash_address = (hash_address + double_hash) % ht->size; + } while (hash_address != start_hash_address); + + return NULL; +} + +static void +_mesa_hash_table_rehash(struct hash_table *ht, int new_size_index) +{ + struct hash_table old_ht; + struct hash_entry *table, *entry; + + if (new_size_index >= ARRAY_SIZE(hash_sizes)) + return; + + table = rzalloc_array(ht, struct hash_entry, + hash_sizes[new_size_index].size); + if (table == NULL) + return; + + old_ht = *ht; + + ht->table = table; + ht->size_index = new_size_index; + ht->size = hash_sizes[ht->size_index].size; + ht->rehash = hash_sizes[ht->size_index].rehash; + ht->max_entries = hash_sizes[ht->size_index].max_entries; + ht->entries = 0; + ht->deleted_entries = 0; + + hash_table_foreach(&old_ht, entry) { + _mesa_hash_table_insert(ht, entry->hash, + entry->key, entry->data); + } + + ralloc_free(old_ht.table); +} + +/** + * Inserts the key with the given hash into the table. + * + * Note that insertion may rearrange the table on a resize or rehash, + * so previously found hash_entries are no longer valid after this function. + */ +struct hash_entry * +_mesa_hash_table_insert(struct hash_table *ht, uint32_t hash, + const void *key, void *data) +{ + uint32_t start_hash_address, hash_address; + + if (ht->entries >= ht->max_entries) { + _mesa_hash_table_rehash(ht, ht->size_index + 1); + } else if (ht->deleted_entries + ht->entries >= ht->max_entries) { + _mesa_hash_table_rehash(ht, ht->size_index); + } + + start_hash_address = hash % ht->size; + hash_address = start_hash_address; + do { + struct hash_entry *entry = ht->table + hash_address; + uint32_t double_hash; + + if (!entry_is_present(ht, entry)) { + if (entry_is_deleted(ht, entry)) + ht->deleted_entries--; + entry->hash = hash; + entry->key = key; + entry->data = data; + ht->entries++; + return entry; + } + + /* Implement replacement when another insert happens + * with a matching key. This is a relatively common + * feature of hash tables, with the alternative + * generally being "insert the new value as well, and + * return it first when the key is searched for". + * + * Note that the hash table doesn't have a delete + * callback. If freeing of old data pointers is + * required to avoid memory leaks, perform a search + * before inserting. + */ + if (entry->hash == hash && + ht->key_equals_function(key, entry->key)) { + entry->key = key; + entry->data = data; + return entry; + } + + + double_hash = 1 + hash % ht->rehash; + + hash_address = (hash_address + double_hash) % ht->size; + } while (hash_address != start_hash_address); + + /* We could hit here if a required resize failed. An unchecked-malloc + * application could ignore this result. + */ + return NULL; +} + +/** + * This function deletes the given hash table entry. + * + * Note that deletion doesn't otherwise modify the table, so an iteration over + * the table deleting entries is safe. + */ +void +_mesa_hash_table_remove(struct hash_table *ht, + struct hash_entry *entry) +{ + if (!entry) + return; + + entry->key = ht->deleted_key; + ht->entries--; + ht->deleted_entries++; +} + +/** + * This function is an iterator over the hash table. + * + * Pass in NULL for the first entry, as in the start of a for loop. Note that + * an iteration over the table is O(table_size) not O(entries). + */ +struct hash_entry * +_mesa_hash_table_next_entry(struct hash_table *ht, + struct hash_entry *entry) +{ + if (entry == NULL) + entry = ht->table; + else + entry = entry + 1; + + for (; entry != ht->table + ht->size; entry++) { + if (entry_is_present(ht, entry)) { + return entry; + } + } + + return NULL; +} + +/** + * Returns a random entry from the hash table. + * + * This may be useful in implementing random replacement (as opposed + * to just removing everything) in caches based on this hash table + * implementation. @predicate may be used to filter entries, or may + * be set to NULL for no filtering. + */ +struct hash_entry * +_mesa_hash_table_random_entry(struct hash_table *ht, + bool (*predicate)(struct hash_entry *entry)) +{ + struct hash_entry *entry; + uint32_t i = rand() % ht->size; + + if (ht->entries == 0) + return NULL; + + for (entry = ht->table + i; entry != ht->table + ht->size; entry++) { + if (entry_is_present(ht, entry) && + (!predicate || predicate(entry))) { + return entry; + } + } + + for (entry = ht->table; entry != ht->table + i; entry++) { + if (entry_is_present(ht, entry) && + (!predicate || predicate(entry))) { + return entry; + } + } + + return NULL; +} + + +/** + * Quick FNV-1 hash implementation based on: + * http://www.isthe.com/chongo/tech/comp/fnv/ + * + * FNV-1 is not be the best hash out there -- Jenkins's lookup3 is supposed to + * be quite good, and it probably beats FNV. But FNV has the advantage that + * it involves almost no code. For an improvement on both, see Paul + * Hsieh's http://www.azillionmonkeys.com/qed/hash.html + */ +uint32_t +_mesa_hash_data(const void *data, size_t size) +{ + uint32_t hash = 2166136261ul; + const uint8_t *bytes = data; + + while (size-- != 0) { + hash ^= *bytes; + hash = hash * 0x01000193; + bytes++; + } + + return hash; +} + +/** FNV-1 string hash implementation */ +uint32_t +_mesa_hash_string(const char *key) +{ + uint32_t hash = 2166136261ul; + + while (*key != 0) { + hash ^= *key; + hash = hash * 0x01000193; + key++; + } + + return hash; +} + +/** + * String compare function for use as the comparison callback in + * _mesa_hash_table_create(). + */ +bool +_mesa_key_string_equal(const void *a, const void *b) +{ + return strcmp(a, b) == 0; +} + +bool +_mesa_key_pointer_equal(const void *a, const void *b) +{ + return a == b; +} diff --git a/3rdparty/glsl-optimizer/src/mesa/main/hash_table.h b/3rdparty/glsl-optimizer/src/mesa/main/hash_table.h new file mode 100644 index 000000000..ad1dae478 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/mesa/main/hash_table.h @@ -0,0 +1,107 @@ +/* + * Copyright © 2009,2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#ifndef _HASH_TABLE_H +#define _HASH_TABLE_H + +#include +#include + +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct hash_entry { + uint32_t hash; + const void *key; + void *data; +}; + +struct hash_table { + void *mem_ctx; + struct hash_entry *table; + bool (*key_equals_function)(const void *a, const void *b); + const void *deleted_key; + uint32_t size; + uint32_t rehash; + uint32_t max_entries; + uint32_t size_index; + uint32_t entries; + uint32_t deleted_entries; +}; + +struct hash_table * +_mesa_hash_table_create(void *mem_ctx, + bool (*key_equals_function)(const void *a, + const void *b)); +void _mesa_hash_table_destroy(struct hash_table *ht, + void (*delete_function)(struct hash_entry *entry)); +void _mesa_hash_table_set_deleted_key(struct hash_table *ht, + const void *deleted_key); + +struct hash_entry * +_mesa_hash_table_insert(struct hash_table *ht, uint32_t hash, + const void *key, void *data); +struct hash_entry * +_mesa_hash_table_search(struct hash_table *ht, uint32_t hash, + const void *key); +void _mesa_hash_table_remove(struct hash_table *ht, + struct hash_entry *entry); + +struct hash_entry *_mesa_hash_table_next_entry(struct hash_table *ht, + struct hash_entry *entry); +struct hash_entry * +_mesa_hash_table_random_entry(struct hash_table *ht, + bool (*predicate)(struct hash_entry *entry)); + +uint32_t _mesa_hash_data(const void *data, size_t size); +uint32_t _mesa_hash_string(const char *key); +bool _mesa_key_string_equal(const void *a, const void *b); +bool _mesa_key_pointer_equal(const void *a, const void *b); + +static inline uint32_t _mesa_hash_pointer(const void *pointer) +{ + return _mesa_hash_data(&pointer, sizeof(pointer)); +} + +/** + * This foreach function is safe against deletion (which just replaces + * an entry's data with the deleted marker), but not against insertion + * (which may rehash the table, making entry a dangling pointer). + */ +#define hash_table_foreach(ht, entry) \ + for (entry = _mesa_hash_table_next_entry(ht, NULL); \ + entry != NULL; \ + entry = _mesa_hash_table_next_entry(ht, entry)) + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif /* _HASH_TABLE_H */ diff --git a/3rdparty/glsl-optimizer/src/mesa/main/imports.c b/3rdparty/glsl-optimizer/src/mesa/main/imports.c new file mode 100644 index 000000000..53b4af523 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/mesa/main/imports.c @@ -0,0 +1,622 @@ +/** + * \file imports.c + * Standard C library function wrappers. + * + * Imports are services which the device driver or window system or + * operating system provides to the core renderer. The core renderer (Mesa) + * will call these functions in order to do memory allocation, simple I/O, + * etc. + * + * Some drivers will want to override/replace this file with something + * specialized, but that'll be rare. + * + * Eventually, I want to move roll the glheader.h file into this. + * + * \todo Functions still needed: + * - scanf + * - qsort + * - rand and RAND_MAX + */ + +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + + +#include "imports.h" +#include "context.h" +#include "mtypes.h" + +#ifdef _GNU_SOURCE +#include +#ifdef __APPLE__ +#include +#endif +#endif + + +#ifdef _WIN32 +#define vsnprintf _vsnprintf +#elif defined(__IBMC__) || defined(__IBMCPP__) +extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); +#endif + +/**********************************************************************/ +/** \name Memory */ +/*@{*/ + +/** + * Allocate aligned memory. + * + * \param bytes number of bytes to allocate. + * \param alignment alignment (must be greater than zero). + * + * Allocates extra memory to accommodate rounding up the address for + * alignment and to record the real malloc address. + * + * \sa _mesa_align_free(). + */ +void * +_mesa_align_malloc(size_t bytes, unsigned long alignment) +{ +#if defined(HAVE_POSIX_MEMALIGN) + void *mem; + int err = posix_memalign(& mem, alignment, bytes); + if (err) + return NULL; + return mem; +#elif defined(_WIN32) && defined(_MSC_VER) + return _aligned_malloc(bytes, alignment); +#else + uintptr_t ptr, buf; + + ASSERT( alignment > 0 ); + + ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *)); + if (!ptr) + return NULL; + + buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1); + *(uintptr_t *)(buf - sizeof(void *)) = ptr; + +#ifdef DEBUG + /* mark the non-aligned area */ + while ( ptr < buf - sizeof(void *) ) { + *(unsigned long *)ptr = 0xcdcdcdcd; + ptr += sizeof(unsigned long); + } +#endif + + return (void *) buf; +#endif /* defined(HAVE_POSIX_MEMALIGN) */ +} + +/** + * Same as _mesa_align_malloc(), but using calloc(1, ) instead of + * malloc() + */ +void * +_mesa_align_calloc(size_t bytes, unsigned long alignment) +{ +#if defined(HAVE_POSIX_MEMALIGN) + void *mem; + + mem = _mesa_align_malloc(bytes, alignment); + if (mem != NULL) { + (void) memset(mem, 0, bytes); + } + + return mem; +#elif defined(_WIN32) && defined(_MSC_VER) + void *mem; + + mem = _aligned_malloc(bytes, alignment); + if (mem != NULL) { + (void) memset(mem, 0, bytes); + } + + return mem; +#else + uintptr_t ptr, buf; + + ASSERT( alignment > 0 ); + + ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *)); + if (!ptr) + return NULL; + + buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1); + *(uintptr_t *)(buf - sizeof(void *)) = ptr; + +#ifdef DEBUG + /* mark the non-aligned area */ + while ( ptr < buf - sizeof(void *) ) { + *(unsigned long *)ptr = 0xcdcdcdcd; + ptr += sizeof(unsigned long); + } +#endif + + return (void *)buf; +#endif /* defined(HAVE_POSIX_MEMALIGN) */ +} + +/** + * Free memory which was allocated with either _mesa_align_malloc() + * or _mesa_align_calloc(). + * \param ptr pointer to the memory to be freed. + * The actual address to free is stored in the word immediately before the + * address the client sees. + * Note that it is legal to pass NULL pointer to this function and will be + * handled accordingly. + */ +void +_mesa_align_free(void *ptr) +{ +#if defined(HAVE_POSIX_MEMALIGN) + free(ptr); +#elif defined(_WIN32) && defined(_MSC_VER) + _aligned_free(ptr); +#else + if (ptr) { + void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); + void *realAddr = *cubbyHole; + free(realAddr); + } +#endif /* defined(HAVE_POSIX_MEMALIGN) */ +} + +/** + * Reallocate memory, with alignment. + */ +void * +_mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, + unsigned long alignment) +{ +#if defined(_WIN32) && defined(_MSC_VER) + (void) oldSize; + return _aligned_realloc(oldBuffer, newSize, alignment); +#else + const size_t copySize = (oldSize < newSize) ? oldSize : newSize; + void *newBuf = _mesa_align_malloc(newSize, alignment); + if (newBuf && oldBuffer && copySize > 0) { + memcpy(newBuf, oldBuffer, copySize); + } + + _mesa_align_free(oldBuffer); + return newBuf; +#endif +} + + + +/** Reallocate memory */ +void * +_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) +{ + const size_t copySize = (oldSize < newSize) ? oldSize : newSize; + void *newBuffer = malloc(newSize); + if (newBuffer && oldBuffer && copySize > 0) + memcpy(newBuffer, oldBuffer, copySize); + free(oldBuffer); + return newBuffer; +} + +/*@}*/ + + +/**********************************************************************/ +/** \name Math */ +/*@{*/ + + +#ifndef __GNUC__ +/** + * Find the first bit set in a word. + */ +int +ffs(int i) +{ + register int bit = 0; + if (i != 0) { + if ((i & 0xffff) == 0) { + bit += 16; + i >>= 16; + } + if ((i & 0xff) == 0) { + bit += 8; + i >>= 8; + } + if ((i & 0xf) == 0) { + bit += 4; + i >>= 4; + } + while ((i & 1) == 0) { + bit++; + i >>= 1; + } + bit++; + } + return bit; +} + + +/** + * Find position of first bit set in given value. + * XXX Warning: this function can only be used on 64-bit systems! + * \return position of least-significant bit set, starting at 1, return zero + * if no bits set. + */ +int +ffsll(long long int val) +{ + int bit; + + assert(sizeof(val) == 8); + + bit = ffs((int) val); + if (bit != 0) + return bit; + + bit = ffs((int) (val >> 32)); + if (bit != 0) + return 32 + bit; + + return 0; +} +#endif /* __GNUC__ */ + + +#if !defined(__GNUC__) ||\ + ((__GNUC__ * 100 + __GNUC_MINOR__) < 304) /* Not gcc 3.4 or later */ +/** + * Return number of bits set in given GLuint. + */ +unsigned int +_mesa_bitcount(unsigned int n) +{ + unsigned int bits; + for (bits = 0; n > 0; n = n >> 1) { + bits += (n & 1); + } + return bits; +} + +/** + * Return number of bits set in given 64-bit uint. + */ +unsigned int +_mesa_bitcount_64(uint64_t n) +{ + unsigned int bits; + for (bits = 0; n > 0; n = n >> 1) { + bits += (n & 1); + } + return bits; +} +#endif + + +/* Using C99 rounding functions for roundToEven() implementation is + * difficult, because round(), rint, and nearbyint() are affected by + * fesetenv(), which the application may have done for its own + * purposes. Mesa's IROUND macro is close to what we want, but it + * rounds away from 0 on n + 0.5. + */ +int +_mesa_round_to_even(float val) +{ + int rounded = IROUND(val); + + if (val - floor(val) == 0.5) { + if (rounded % 2 != 0) + rounded += val > 0 ? -1 : 1; + } + + return rounded; +} + + +/** + * Convert a 4-byte float to a 2-byte half float. + * + * Not all float32 values can be represented exactly as a float16 value. We + * round such intermediate float32 values to the nearest float16. When the + * float32 lies exactly between to float16 values, we round to the one with + * an even mantissa. + * + * This rounding behavior has several benefits: + * - It has no sign bias. + * + * - It reproduces the behavior of real hardware: opcode F32TO16 in Intel's + * GPU ISA. + * + * - By reproducing the behavior of the GPU (at least on Intel hardware), + * compile-time evaluation of constant packHalf2x16 GLSL expressions will + * result in the same value as if the expression were executed on the GPU. + */ +GLhalfARB +_mesa_float_to_half(float val) +{ + const fi_type fi = {val}; + const int flt_m = fi.i & 0x7fffff; + const int flt_e = (fi.i >> 23) & 0xff; + const int flt_s = (fi.i >> 31) & 0x1; + int s, e, m = 0; + GLhalfARB result; + + /* sign bit */ + s = flt_s; + + /* handle special cases */ + if ((flt_e == 0) && (flt_m == 0)) { + /* zero */ + /* m = 0; - already set */ + e = 0; + } + else if ((flt_e == 0) && (flt_m != 0)) { + /* denorm -- denorm float maps to 0 half */ + /* m = 0; - already set */ + e = 0; + } + else if ((flt_e == 0xff) && (flt_m == 0)) { + /* infinity */ + /* m = 0; - already set */ + e = 31; + } + else if ((flt_e == 0xff) && (flt_m != 0)) { + /* NaN */ + m = 1; + e = 31; + } + else { + /* regular number */ + const int new_exp = flt_e - 127; + if (new_exp < -14) { + /* The float32 lies in the range (0.0, min_normal16) and is rounded + * to a nearby float16 value. The result will be either zero, subnormal, + * or normal. + */ + e = 0; + m = _mesa_round_to_even((1 << 24) * fabsf(fi.f)); + } + else if (new_exp > 15) { + /* map this value to infinity */ + /* m = 0; - already set */ + e = 31; + } + else { + /* The float32 lies in the range + * [min_normal16, max_normal16 + max_step16) + * and is rounded to a nearby float16 value. The result will be + * either normal or infinite. + */ + e = new_exp + 15; + m = _mesa_round_to_even(flt_m / (float) (1 << 13)); + } + } + + assert(0 <= m && m <= 1024); + if (m == 1024) { + /* The float32 was rounded upwards into the range of the next exponent, + * so bump the exponent. This correctly handles the case where f32 + * should be rounded up to float16 infinity. + */ + ++e; + m = 0; + } + + result = (s << 15) | (e << 10) | m; + return result; +} + + +/** + * Convert a 2-byte half float to a 4-byte float. + * Based on code from: + * http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/008786.html + */ +float +_mesa_half_to_float(GLhalfARB val) +{ + /* XXX could also use a 64K-entry lookup table */ + const int m = val & 0x3ff; + const int e = (val >> 10) & 0x1f; + const int s = (val >> 15) & 0x1; + int flt_m, flt_e, flt_s; + fi_type fi; + float result; + + /* sign bit */ + flt_s = s; + + /* handle special cases */ + if ((e == 0) && (m == 0)) { + /* zero */ + flt_m = 0; + flt_e = 0; + } + else if ((e == 0) && (m != 0)) { + /* denorm -- denorm half will fit in non-denorm single */ + const float half_denorm = 1.0f / 16384.0f; /* 2^-14 */ + float mantissa = ((float) (m)) / 1024.0f; + float sign = s ? -1.0f : 1.0f; + return sign * mantissa * half_denorm; + } + else if ((e == 31) && (m == 0)) { + /* infinity */ + flt_e = 0xff; + flt_m = 0; + } + else if ((e == 31) && (m != 0)) { + /* NaN */ + flt_e = 0xff; + flt_m = 1; + } + else { + /* regular */ + flt_e = e + 112; + flt_m = m << 13; + } + + fi.i = (flt_s << 31) | (flt_e << 23) | flt_m; + result = fi.f; + return result; +} + +/*@}*/ + + +/**********************************************************************/ +/** \name Sort & Search */ +/*@{*/ + +/** + * Wrapper for bsearch(). + */ +void * +_mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, + int (*compar)(const void *, const void *) ) +{ +#if defined(_WIN32_WCE) + void *mid; + int cmp; + while (nmemb) { + nmemb >>= 1; + mid = (char *)base + nmemb * size; + cmp = (*compar)(key, mid); + if (cmp == 0) + return mid; + if (cmp > 0) { + base = (char *)mid + size; + --nmemb; + } + } + return NULL; +#else + return bsearch(key, base, nmemb, size, compar); +#endif +} + +/*@}*/ + + +/**********************************************************************/ +/** \name Environment vars */ +/*@{*/ + +/** + * Wrapper for getenv(). + */ +char * +_mesa_getenv( const char *var ) +{ +#if defined(_XBOX) || defined(_WIN32_WCE) + return NULL; +#else + return getenv(var); +#endif +} + +/*@}*/ + + +/**********************************************************************/ +/** \name String */ +/*@{*/ + +/** + * Implemented using malloc() and strcpy. + * Note that NULL is handled accordingly. + */ +char * +_mesa_strdup( const char *s ) +{ + if (s) { + size_t l = strlen(s); + char *s2 = malloc(l + 1); + if (s2) + strcpy(s2, s); + return s2; + } + else { + return NULL; + } +} + +/** Wrapper around strtof() */ +float +_mesa_strtof( const char *s, char **end ) +{ +#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ + !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__) && \ + !defined(__NetBSD__) + static locale_t loc = NULL; + if (!loc) { + loc = newlocale(LC_CTYPE_MASK, "C", NULL); + } + return strtof_l(s, end, loc); +#elif defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) + return strtof(s, end); +#else + return (float)strtod(s, end); +#endif +} + +/** Compute simple checksum/hash for a string */ +unsigned int +_mesa_str_checksum(const char *str) +{ + /* This could probably be much better */ + unsigned int sum, i; + const char *c; + sum = i = 1; + for (c = str; *c; c++, i++) + sum += *c * (i % 100); + return sum + i; +} + + +/*@}*/ + + +/** Needed due to #ifdef's, above. */ +int +_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list args) +{ + return vsnprintf( str, size, fmt, args); +} + +/** Wrapper around vsnprintf() */ +int +_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) +{ + int r; + va_list args; + va_start( args, fmt ); + r = vsnprintf( str, size, fmt, args ); + va_end( args ); + return r; +} + + diff --git a/3rdparty/glsl-optimizer/src/mesa/main/imports.h b/3rdparty/glsl-optimizer/src/mesa/main/imports.h index 7cfb2d589..51b44e5ea 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/imports.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/imports.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.5 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -80,7 +80,7 @@ extern "C" { * these casts generate warnings. * The following union typedef is used to solve that. */ -typedef union { GLfloat f; GLint i; } fi_type; +typedef union { GLfloat f; GLint i; GLuint u; } fi_type; @@ -114,7 +114,7 @@ typedef union { GLfloat f; GLint i; } fi_type; #define floorf(f) ((float) floor(f)) #define logf(f) ((float) log(f)) -#if defined(__ANDROID__) || defined(ANDROID) +#ifdef ANDROID #define log2f(f) (logf(f) * (float) (1.0 / M_LN2)) #else #define log2f(f) ((float) log2(f)) @@ -140,6 +140,7 @@ static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); } static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; } static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; } #define strtoll(p, e, b) _strtoi64(p, e, b) +#define strcasecmp(s1, s2) _stricmp(s1, s2) #endif /*@}*/ @@ -213,8 +214,6 @@ static inline int IS_INF_OR_NAN( float x ) #define IS_INF_OR_NAN(x) (!isfinite(x)) #elif defined(finite) #define IS_INF_OR_NAN(x) (!finite(x)) -#elif defined(__VMS) -#define IS_INF_OR_NAN(x) (!finite(x)) #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define IS_INF_OR_NAN(x) (!isfinite(x)) #else @@ -493,17 +492,11 @@ _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); #ifndef FFS_DEFINED #define FFS_DEFINED 1 #ifdef __GNUC__ - -#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(ANDROID) || defined(__APPLE__) #define ffs __builtin_ffs #define ffsll __builtin_ffsll -#endif - #else - extern int ffs(int i); extern int ffsll(long long int i); - #endif /*__ GNUC__ */ #endif /* FFS_DEFINED */ @@ -541,6 +534,15 @@ _mesa_fls(unsigned int n) #endif } +extern int +_mesa_round_to_even(float val); + +extern GLhalfARB +_mesa_float_to_half(float f); + +extern float +_mesa_half_to_float(GLhalfARB h); + extern void * _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, diff --git a/3rdparty/glsl-optimizer/src/mesa/main/macros.h b/3rdparty/glsl-optimizer/src/mesa/main/macros.h index a9aae4e7d..c76c3d658 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/macros.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/macros.h @@ -5,7 +5,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -22,9 +21,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -137,7 +137,6 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255] ***/ #if defined(USE_IEEE) && !defined(DEBUG) -#define IEEE_0996 0x3f7f0000 /* 0.996 or so */ /* This function/macro is sensitive to precision. Test very carefully * if you change it! */ @@ -147,7 +146,7 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; __tmp.f = (F); \ if (__tmp.i < 0) \ UB = (GLubyte) 0; \ - else if (__tmp.i >= IEEE_0996) \ + else if (__tmp.i >= IEEE_ONE) \ UB = (GLubyte) 255; \ else { \ __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \ @@ -167,6 +166,42 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256]; ub = ((GLubyte) F_TO_I((f) * 255.0F)) #endif +static inline GLfloat INT_AS_FLT(GLint i) +{ + fi_type tmp; + tmp.i = i; + return tmp.f; +} + +static inline GLfloat UINT_AS_FLT(GLuint u) +{ + fi_type tmp; + tmp.u = u; + return tmp.f; +} + +/** + * Convert a floating point value to an unsigned fixed point value. + * + * \param frac_bits The number of bits used to store the fractional part. + */ +static INLINE uint32_t +U_FIXED(float value, uint32_t frac_bits) +{ + value *= (1 << frac_bits); + return value < 0.0f ? 0 : (uint32_t) value; +} + +/** + * Convert a floating point value to an signed fixed point value. + * + * \param frac_bits The number of bits used to store the fractional part. + */ +static INLINE int32_t +S_FIXED(float value, uint32_t frac_bits) +{ + return (int32_t) (value * (1 << frac_bits)); +} /*@}*/ @@ -569,6 +604,32 @@ do { \ /*@}*/ +/** Copy \p sz elements into a homegeneous (4-element) vector, giving + * default values to the remaining components. + * The default values are chosen based on \p type. + */ +static inline void +COPY_CLEAN_4V_TYPE_AS_FLOAT(GLfloat dst[4], int sz, const GLfloat src[4], + GLenum type) +{ + switch (type) { + case GL_FLOAT: + ASSIGN_4V(dst, 0, 0, 0, 1); + break; + case GL_INT: + ASSIGN_4V(dst, INT_AS_FLT(0), INT_AS_FLT(0), + INT_AS_FLT(0), INT_AS_FLT(1)); + break; + case GL_UNSIGNED_INT: + ASSIGN_4V(dst, UINT_AS_FLT(0), UINT_AS_FLT(0), + UINT_AS_FLT(0), UINT_AS_FLT(1)); + break; + default: + ASSIGN_4V(dst, 0.0f, 0.0f, 0.0f, 1.0f); /* silence warnings */ + ASSERT(!"Unexpected type in COPY_CLEAN_4V_TYPE_AS_FLOAT macro"); + } + COPY_SZ_4V(dst, sz, src); +} /** \name Linear interpolation functions */ /*@{*/ @@ -613,6 +674,37 @@ INTERP_4F(GLfloat t, GLfloat dst[4], const GLfloat out[4], const GLfloat in[4]) #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C)) #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C)) +static inline unsigned +minify(unsigned value, unsigned levels) +{ + return MAX2(1, value >> levels); +} + +/** + * Align a value up to an alignment value + * + * If \c value is not already aligned to the requested alignment value, it + * will be rounded up. + * + * \param value Value to be rounded + * \param alignment Alignment value to be used. This must be a power of two. + * + * \sa ROUND_DOWN_TO() + */ +#define ALIGN(value, alignment) (((value) + (alignment) - 1) & ~((alignment) - 1)) + +/** + * Align a value down to an alignment value + * + * If \c value is not already aligned to the requested alignment value, it + * will be rounded down. + * + * \param value Value to be rounded + * \param alignment Alignment value to be used. This must be a power of two. + * + * \sa ALIGN() + */ +#define ROUND_DOWN_TO(value, alignment) ((value) & ~(alignment - 1)) /** Cross product of two 3-element vectors */ @@ -710,5 +802,10 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y) #define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E)) #define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE) +/* Compute the size of an array */ +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + +/* Stringify */ +#define STRINGIFY(x) #x #endif diff --git a/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h b/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h index d2ae6db4a..3ce336a80 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/mtypes.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -18,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -34,6 +34,8 @@ #define MTYPES_H +#include /* uint32_t */ + #include "main/glheader.h" #include "main/config.h" @@ -50,13 +52,17 @@ extern "C" { /*@{*/ struct gl_context; struct gl_uniform_storage; +struct prog_instruction; +struct gl_program_parameter_list; +struct set; +struct set_entry; /*@}*/ /** Extra draw modes beyond GL_POINTS, GL_TRIANGLE_FAN, etc */ -#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1) -#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2) -#define PRIM_UNKNOWN (GL_POLYGON+3) +#define PRIM_MAX GL_TRIANGLE_STRIP_ADJACENCY +#define PRIM_OUTSIDE_BEGIN_END (PRIM_MAX + 1) +#define PRIM_UNKNOWN (PRIM_MAX + 2) @@ -115,9 +121,6 @@ typedef enum * VERT_ATTRIB_TEX * include the classic texture coordinate attributes. * Is a subset of VERT_ATTRIB_FF. - * VERT_ATTRIB_GENERIC_NV - * include the NV shader attributes. - * Is a subset of VERT_ATTRIB_FF. * VERT_ATTRIB_GENERIC * include the OpenGL 2.0+ GLSL generic shader attributes. * These alias the generic GL_ARB_vertex_shader attributes. @@ -128,43 +131,92 @@ typedef enum #define VERT_ATTRIB_TEX(i) (VERT_ATTRIB_TEX0 + (i)) #define VERT_ATTRIB_TEX_MAX MAX_TEXTURE_COORD_UNITS -#define VERT_ATTRIB_GENERIC_NV(i) (VERT_ATTRIB_POS + (i)) -#define VERT_ATTRIB_GENERIC_NV_MAX MAX_VERTEX_GENERIC_ATTRIBS - #define VERT_ATTRIB_GENERIC(i) (VERT_ATTRIB_GENERIC0 + (i)) #define VERT_ATTRIB_GENERIC_MAX MAX_VERTEX_GENERIC_ATTRIBS + /** - * Indexes for vertex program result attributes. Note that - * _mesa_vert_result_to_frag_attrib() and _mesa_frag_attrib_to_vert_result() make - * assumptions about the layout of this enum. + * Indexes for vertex shader outputs, geometry shader inputs/outputs, and + * fragment shader inputs. + * + * Note that some of these values are not available to all pipeline stages. + * + * When this enum is updated, the following code must be updated too: + * - vertResults (in prog_print.c's arb_output_attrib_string()) + * - fragAttribs (in prog_print.c's arb_input_attrib_string()) + * - _mesa_varying_slot_in_fs() */ typedef enum { - VERT_RESULT_HPOS = 0, - VERT_RESULT_COL0 = 1, - VERT_RESULT_COL1 = 2, - VERT_RESULT_FOGC = 3, - VERT_RESULT_TEX0 = 4, - VERT_RESULT_TEX1 = 5, - VERT_RESULT_TEX2 = 6, - VERT_RESULT_TEX3 = 7, - VERT_RESULT_TEX4 = 8, - VERT_RESULT_TEX5 = 9, - VERT_RESULT_TEX6 = 10, - VERT_RESULT_TEX7 = 11, - VERT_RESULT_PSIZ = 12, - VERT_RESULT_BFC0 = 13, - VERT_RESULT_BFC1 = 14, - VERT_RESULT_EDGE = 15, - VERT_RESULT_CLIP_VERTEX = 16, - VERT_RESULT_CLIP_DIST0 = 17, - VERT_RESULT_CLIP_DIST1 = 18, - VERT_RESULT_VAR0 = 19, /**< shader varying */ - VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) -} gl_vert_result; + VARYING_SLOT_POS, + VARYING_SLOT_COL0, /* COL0 and COL1 must be contiguous */ + VARYING_SLOT_COL1, + VARYING_SLOT_FOGC, + VARYING_SLOT_TEX0, /* TEX0-TEX7 must be contiguous */ + VARYING_SLOT_TEX1, + VARYING_SLOT_TEX2, + VARYING_SLOT_TEX3, + VARYING_SLOT_TEX4, + VARYING_SLOT_TEX5, + VARYING_SLOT_TEX6, + VARYING_SLOT_TEX7, + VARYING_SLOT_PSIZ, /* Does not appear in FS */ + VARYING_SLOT_BFC0, /* Does not appear in FS */ + VARYING_SLOT_BFC1, /* Does not appear in FS */ + VARYING_SLOT_EDGE, /* Does not appear in FS */ + VARYING_SLOT_CLIP_VERTEX, /* Does not appear in FS */ + VARYING_SLOT_CLIP_DIST0, + VARYING_SLOT_CLIP_DIST1, + VARYING_SLOT_PRIMITIVE_ID, /* Does not appear in VS */ + VARYING_SLOT_LAYER, /* Appears as VS or GS output */ + VARYING_SLOT_VIEWPORT, /* Appears as VS or GS output */ + VARYING_SLOT_FACE, /* FS only */ + VARYING_SLOT_PNTC, /* FS only */ + VARYING_SLOT_VAR0, /* First generic varying slot */ + VARYING_SLOT_MAX = VARYING_SLOT_VAR0 + MAX_VARYING +} gl_varying_slot; + + +/** + * Fragment program results + */ +typedef enum +{ + FRAG_RESULT_DEPTH = 0, + FRAG_RESULT_STENCIL = 1, + /* If a single color should be written to all render targets, this + * register is written. No FRAG_RESULT_DATAn will be written. + */ + FRAG_RESULT_COLOR = 2, + FRAG_RESULT_SAMPLE_MASK = 3, + + /* FRAG_RESULT_DATAn are the per-render-target (GLSL gl_FragData[n] + * or ARB_fragment_program fragment.color[n]) color results. If + * any are written, FRAG_RESULT_COLOR will not be written. + */ + FRAG_RESULT_DATA0 = 4, + FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) +} gl_frag_result; + + +/** + * Shader stages. Note that these will become 5 with tessellation. + * + * The order must match how shaders are ordered in the pipeline. + * The GLSL linker assumes that if i= VERT_RESULT_CLIP_DIST0) - return vert_result - VERT_RESULT_CLIP_DIST0 + FRAG_ATTRIB_CLIP_DIST0; - else if (vert_result <= VERT_RESULT_TEX7) - return vert_result; - else - return -1; -} - - -/** - * Convert from a gl_frag_attrib value to the corresponding gl_vert_result. - * - * FRAG_ATTRIB_WPOS is converted to VERT_RESULT_HPOS. - * - * gl_frag_attrib values which have no corresponding gl_vert_result - * (FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC) are converted to a value of -1. - */ -static inline int -_mesa_frag_attrib_to_vert_result(gl_frag_attrib frag_attrib) -{ - if (frag_attrib <= FRAG_ATTRIB_TEX7) - return frag_attrib; - else if (frag_attrib >= FRAG_ATTRIB_CLIP_DIST0) - return frag_attrib - FRAG_ATTRIB_CLIP_DIST0 + VERT_RESULT_CLIP_DIST0; - else - return -1; -} - - -/** - * Fragment program results - */ -typedef enum -{ - FRAG_RESULT_DEPTH = 0, - FRAG_RESULT_STENCIL = 1, - /* If a single color should be written to all render targets, this - * register is written. No FRAG_RESULT_DATAn will be written. - */ - FRAG_RESULT_COLOR = 2, - - /* FRAG_RESULT_DATAn are the per-render-target (GLSL gl_FragData[n] - * or ARB_fragment_program fragment.color[n]) color results. If - * any are written, FRAG_RESULT_COLOR will not be written. - */ - FRAG_RESULT_DATA0 = 3, - FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) -} gl_frag_result; - - - -struct gl_config; - - - /** * An index for each type of texture object. These correspond to the GL * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. @@ -322,6 +264,9 @@ struct gl_config; */ typedef enum { + TEXTURE_2D_MULTISAMPLE_INDEX, + TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, + TEXTURE_CUBE_ARRAY_INDEX, TEXTURE_BUFFER_INDEX, TEXTURE_2D_ARRAY_INDEX, TEXTURE_1D_ARRAY_INDEX, @@ -396,29 +341,23 @@ struct gl_transform_feedback_info - - /** * Names of the various vertex/fragment program register files, etc. * * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) * All values should fit in a 4-bit field. * - * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM, - * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to - * be "uniform" variables since they can only be set outside glBegin/End. - * They're also all stored in the same Parameters array. + * NOTE: PROGRAM_STATE_VAR, PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be + * considered to be "uniform" variables since they can only be set outside + * glBegin/End. They're also all stored in the same Parameters array. */ typedef enum { PROGRAM_TEMPORARY, /**< machine->Temporary[] */ + PROGRAM_ARRAY, /**< Arrays & Matrixes */ PROGRAM_INPUT, /**< machine->Inputs[] */ PROGRAM_OUTPUT, /**< machine->Outputs[] */ - PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */ - PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */ - PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */ - PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */ PROGRAM_CONSTANT, /**< gl_program->Parameters[] */ PROGRAM_UNIFORM, /**< gl_program->Parameters[] */ PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */ @@ -436,10 +375,13 @@ typedef enum */ typedef enum { - SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ - SYSTEM_VALUE_VERTEX_ID, /**< Vertex shader only */ - SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ - SYSTEM_VALUE_MAX /**< Number of values */ + SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ + SYSTEM_VALUE_VERTEX_ID, /**< Vertex shader only */ + SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ + SYSTEM_VALUE_SAMPLE_ID, /**< Fragment shader only */ + SYSTEM_VALUE_SAMPLE_POS, /**< Fragment shader only */ + SYSTEM_VALUE_SAMPLE_MASK_IN, /**< Fragment shader only */ + SYSTEM_VALUE_MAX /**< Number of values */ } gl_system_value; @@ -455,7 +397,8 @@ enum glsl_interp_qualifier INTERP_QUALIFIER_NONE = 0, INTERP_QUALIFIER_SMOOTH, INTERP_QUALIFIER_FLAT, - INTERP_QUALIFIER_NOPERSPECTIVE + INTERP_QUALIFIER_NOPERSPECTIVE, + INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */ }; @@ -485,12 +428,17 @@ struct gl_program GLuint Id; GLubyte *String; /**< Null-terminated program text */ GLint RefCount; - GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */ + GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_GEOMETRY_PROGRAM_NV */ GLenum Format; /**< String encoding format */ - GLboolean Resident; - /** Numbered local parameters */ - GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4]; + /** + * Local parameters used by the program. + * + * It's dynamically allocated because it is rarely used (just + * assembly-style programs), and MAX_PROGRAM_LOCAL_PARAMS entries once it's + * allocated. + */ + GLfloat (*LocalParams)[4]; /** Map from sampler unit to texture unit (set by glUniform1i()) */ GLubyte SamplerUnits[MAX_SAMPLERS]; @@ -525,30 +473,6 @@ struct gl_program }; -/** Vertex program object */ -struct gl_vertex_program -{ - struct gl_program Base; /**< base class */ - GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ - GLboolean IsPositionInvariant; - GLboolean UsesClipDistance; -}; - - -/** Geometry program object */ -struct gl_geometry_program -{ - struct gl_program Base; /**< base class */ - - GLint VerticesOut; - GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, - GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ - GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ -}; - - - - /** Set by #pragma directives */ struct gl_sl_pragmas { @@ -564,8 +488,13 @@ struct gl_sl_pragmas */ struct gl_shader { - GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER || GL_GEOMETRY_SHADER_ARB (first field!) */ + /** GL_FRAGMENT_SHADER || GL_VERTEX_SHADER || GL_GEOMETRY_SHADER_ARB. + * Must be the first field. + */ + GLenum Type; + gl_shader_stage Stage; GLuint Name; /**< AKA the handle */ + GLchar *Label; /**< GL_KHR_debug */ GLint RefCount; /**< Reference count */ GLboolean DeletePending; GLboolean CompileStatus; @@ -576,6 +505,7 @@ struct gl_shader struct gl_sl_pragmas Pragmas; unsigned Version; /**< GLSL version used for linking */ + GLboolean IsES; /**< True if this shader uses GLSL ES */ /** * \name Sampler tracking @@ -589,12 +519,31 @@ struct gl_shader /*@}*/ /** - * Number of uniform components used by this shader. + * Map from sampler unit to texture unit (set by glUniform1i()) + * + * A sampler unit is associated with each sampler uniform by the linker. + * The sampler unit associated with each uniform is stored in the + * \c gl_uniform_storage::sampler field. + */ + GLubyte SamplerUnits[MAX_SAMPLERS]; + /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ + gl_texture_index SamplerTargets[MAX_SAMPLERS]; + + /** + * Number of default uniform block components used by this shader. * * This field is only set post-linking. */ unsigned num_uniform_components; + /** + * Number of combined uniform components used by this shader. + * + * This field is only set post-linking. It is the sum of the uniform block + * sizes divided by sizeof(float), and num_uniform_compoennts. + */ + unsigned num_combined_uniform_components; + /** * This shader's uniform block information. * @@ -607,33 +556,84 @@ struct gl_shader struct exec_list *ir; struct glsl_symbol_table *symbols; - /** Shaders containing built-in functions that are used for linking. */ - struct gl_shader *builtins_to_link[16]; - unsigned num_builtins_to_link; + int uses_builtin_functions; + + /** + * Geometry shader state from GLSL 1.50 layout qualifiers. + */ + struct { + GLint VerticesOut; + /** + * GL_POINTS, GL_LINES, GL_LINES_ADJACENCY, GL_TRIANGLES, or + * GL_TRIANGLES_ADJACENCY, or PRIM_UNKNOWN if it's not set in this + * shader. + */ + GLenum InputType; + /** + * GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP, or PRIM_UNKNOWN if + * it's not set in this shader. + */ + GLenum OutputType; + } Geom; + + /** + * Map from image uniform index to image unit (set by glUniform1i()) + * + * An image uniform index is associated with each image uniform by + * the linker. The image index associated with each uniform is + * stored in the \c gl_uniform_storage::image field. + */ + GLubyte ImageUnits[MAX_IMAGE_UNIFORMS]; + + /** + * Access qualifier specified in the shader for each image uniform + * index. Either \c GL_READ_ONLY, \c GL_WRITE_ONLY or \c + * GL_READ_WRITE. + * + * It may be different, though only more strict than the value of + * \c gl_image_unit::Access for the corresponding image unit. + */ + GLenum ImageAccess[MAX_IMAGE_UNIFORMS]; + + /** + * Number of image uniforms defined in the shader. It specifies + * the number of valid elements in the \c ImageUnits and \c + * ImageAccess arrays above. + */ + GLuint NumImages; }; -/** - * Shader stages. Note that these will become 5 with tessellation. - * These MUST have the same values as gallium's PIPE_SHADER_* - */ -typedef enum -{ - MESA_SHADER_VERTEX = 0, - MESA_SHADER_FRAGMENT = 1, - MESA_SHADER_GEOMETRY = 2, - MESA_SHADER_TYPES = 3 -} gl_shader_type; - struct gl_uniform_buffer_variable { char *Name; + + /** + * Name of the uniform as seen by glGetUniformIndices. + * + * glGetUniformIndices requires that the block instance index \b not be + * present in the name of queried uniforms. + * + * \note + * \c gl_uniform_buffer_variable::IndexName and + * \c gl_uniform_buffer_variable::Name may point to identical storage. + */ + char *IndexName; + const struct glsl_type *Type; - unsigned int Buffer; unsigned int Offset; GLboolean RowMajor; }; + +enum gl_uniform_block_packing +{ + ubo_packing_std140, + ubo_packing_shared, + ubo_packing_packed +}; + + struct gl_uniform_block { /** Declared name of the uniform block */ @@ -655,8 +655,37 @@ struct gl_uniform_block * (GL_UNIFORM_BLOCK_DATA_SIZE). */ GLuint UniformBufferSize; + + /** + * Layout specified in the shader + * + * This isn't accessible through the API, but it is used while + * cross-validating uniform blocks. + */ + enum gl_uniform_block_packing _Packing; }; +/** + * Structure that represents a reference to an atomic buffer from some + * shader program. + */ +struct gl_active_atomic_buffer +{ + /** Uniform indices of the atomic counters declared within it. */ + GLuint *Uniforms; + GLuint NumUniforms; + + /** Binding point index associated with it. */ + GLuint Binding; + + /** Minimum reasonable size it is expected to have. */ + GLuint MinimumSize; + + /** Shader stages making use of it. */ + GLboolean StageReferences[MESA_SHADER_STAGES]; +}; + + /** * A GLSL program object. * Basically a linked collection of vertex and fragment shaders. @@ -665,9 +694,15 @@ struct gl_shader_program { GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */ GLuint Name; /**< aka handle or ID */ + GLchar *Label; /**< GL_KHR_debug */ GLint RefCount; /**< Reference count */ GLboolean DeletePending; + /** + * Is the application intending to glGetProgramBinary this program? + */ + GLboolean BinaryRetreivableHint; + /** * Flags that the linker should not reject the program if it lacks * a vertex or fragment shader. GLES2 doesn't allow separate @@ -720,17 +755,33 @@ struct gl_shader_program /** Post-link gl_FragDepth layout for ARB_conservative_depth. */ enum gl_frag_depth_layout FragDepthLayout; - /** Geometry shader state - copied into gl_geometry_program at link time */ + /** + * Geometry shader state - copied into gl_geometry_program by + * _mesa_copy_linked_program_data(). + */ struct { + GLint VerticesIn; GLint VerticesOut; GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ + /** + * True if gl_ClipDistance is written to. Copied into + * gl_geometry_program by _mesa_copy_linked_program_data(). + */ + GLboolean UsesClipDistance; + GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or + 0 if not present. */ + GLboolean UsesEndPrimitive; } Geom; - /** Vertex shader state - copied into gl_vertex_program at link time */ + /** Vertex shader state */ struct { - GLboolean UsesClipDistance; /**< True if gl_ClipDistance is written to. */ + /** + * True if gl_ClipDistance is written to. Copied into gl_vertex_program + * by _mesa_copy_linked_program_data(). + */ + GLboolean UsesClipDistance; GLuint ClipDistanceArraySize; /**< Size of the gl_ClipDistance array, or 0 if not present. */ } Vert; @@ -739,9 +790,30 @@ struct gl_shader_program unsigned NumUserUniformStorage; struct gl_uniform_storage *UniformStorage; + /** + * Size of the gl_ClipDistance array that is output from the last pipeline + * stage before the fragment shader. + */ + unsigned LastClipDistanceArraySize; + struct gl_uniform_block *UniformBlocks; unsigned NumUniformBlocks; + /** + * Scale factor for the uniform base location + * + * This is used to generate locations (returned by \c glGetUniformLocation) + * of uniforms. The base location of the uniform is multiplied by this + * value, and the array index is added. + * + * \note + * Must be >= 1. + * + * \sa + * _mesa_uniform_merge_location_offset, _mesa_uniform_split_location_offset + */ + unsigned UniformLocationBaseScale; + /** * Indices into the _LinkedShaders's UniformBlocks[] array for each stage * they're used in, or -1. @@ -749,7 +821,7 @@ struct gl_shader_program * This is used to maintain the Binding values of the stage's UniformBlocks[] * and to answer the GL_UNIFORM_BLOCK_REFERENCED_BY_*_SHADER queries. */ - int *UniformBlockStageIndex[MESA_SHADER_TYPES]; + int *UniformBlockStageIndex[MESA_SHADER_STAGES]; /** * Map of active uniform names to locations @@ -761,23 +833,16 @@ struct gl_shader_program */ struct string_to_uint_map *UniformHash; - /** - * Map from sampler unit to texture unit (set by glUniform1i()) - * - * A sampler unit is associated with each sampler uniform by the linker. - * The sampler unit associated with each uniform is stored in the - * \c gl_uniform_storage::sampler field. - */ - GLubyte SamplerUnits[MAX_SAMPLERS]; - /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ - gl_texture_index SamplerTargets[MAX_SAMPLERS]; + struct gl_active_atomic_buffer *AtomicBuffers; + unsigned NumAtomicBuffers; GLboolean LinkStatus; /**< GL_LINK_STATUS */ GLboolean Validated; GLboolean _Used; /**< Ever used for drawing? */ - char *InfoLog; + GLchar *InfoLog; unsigned Version; /**< GLSL version used for linking */ + GLboolean IsES; /**< True if this program uses GLSL ES */ /** * Per-stage shaders resulting from the first stage of linking. @@ -786,20 +851,10 @@ struct gl_shader_program * \c MESA_SHADER_* defines. Entries for non-existent stages will be * \c NULL. */ - struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES]; + struct gl_shader *_LinkedShaders[MESA_SHADER_STAGES]; }; -#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ -#define GLSL_LOG 0x2 /**< Write shaders to files */ -#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ -#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ -#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ -#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ -#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ -#define GLSL_REPORT_ERRORS 0x100 /**< Print compilation errors */ - - /** * Compiler options for a single GLSL shaders type @@ -808,7 +863,6 @@ struct gl_shader_compiler_options { /** Driver-selectable options: */ GLboolean EmitCondCodes; /**< Use condition codes? */ - GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ GLboolean EmitNoLoops; GLboolean EmitNoFunctions; GLboolean EmitNoCont; /**< Emit CONT opcode? */ @@ -829,6 +883,15 @@ struct gl_shader_compiler_options GLuint MaxIfDepth; /**< Maximum nested IF blocks */ GLuint MaxUnrollIterations; + + /** + * Optimize code for array of structures backends. + * + * This is a proxy for: + * - preferring DP4 instructions (rather than MUL/MAD) for + * matrix * vector operations, such as position transformation. + */ + GLboolean OptimizeForAOS; struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ }; @@ -836,8 +899,6 @@ struct gl_shader_compiler_options - - /** * Limits for vertex, geometry and fragment programs/shaders. */ @@ -866,9 +927,41 @@ struct gl_program_constants GLuint MaxNativeParameters; /* For shaders */ GLuint MaxUniformComponents; /**< Usually == MaxParameters * 4 */ + + /** + * \name Per-stage input / output limits + * + * Previous to OpenGL 3.2, the intrastage data limits were advertised with + * a single value: GL_MAX_VARYING_COMPONENTS (GL_MAX_VARYING_VECTORS in + * ES). This is stored as \c gl_constants::MaxVarying. + * + * Starting with OpenGL 3.2, the limits are advertised with per-stage + * variables. Each stage as a certain number of outputs that it can feed + * to the next stage and a certain number inputs that it can consume from + * the previous stage. + * + * Vertex shader inputs do not participate this in this accounting. + * These are tracked exclusively by \c gl_program_constants::MaxAttribs. + * + * Fragment shader outputs do not participate this in this accounting. + * These are tracked exclusively by \c gl_constants::MaxDrawBuffers. + */ + /*@{*/ + GLuint MaxInputComponents; + GLuint MaxOutputComponents; + /*@}*/ + /* GL_ARB_uniform_buffer_object */ GLuint MaxUniformBlocks; GLuint MaxCombinedUniformComponents; + GLuint MaxTextureImageUnits; + + /* GL_ARB_shader_atomic_counters */ + GLuint MaxAtomicBuffers; + GLuint MaxAtomicCounters; + + /* GL_ARB_shader_image_load_store */ + GLuint MaxImageUniforms; }; @@ -878,22 +971,21 @@ struct gl_program_constants */ struct gl_constants { - GLint MaxTextureMbytes; /**< Max memory per image, in MB */ - GLint MaxTextureLevels; /**< Max mipmap levels. */ - GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ - GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ - GLint MaxArrayTextureLayers; /**< Max layers in array textures */ - GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ + GLuint MaxTextureMbytes; /**< Max memory per image, in MB */ + GLuint MaxTextureLevels; /**< Max mipmap levels. */ + GLuint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ + GLuint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ + GLuint MaxArrayTextureLayers; /**< Max layers in array textures */ + GLuint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ GLuint MaxTextureCoordUnits; - GLuint MaxTextureImageUnits; - GLuint MaxVertexTextureImageUnits; GLuint MaxCombinedTextureImageUnits; - GLuint MaxGeometryTextureImageUnits; - GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ + GLuint MaxTextureUnits; /**< = MIN(CoordUnits, FragmentProgram.ImageUnits) */ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */ + GLuint TextureBufferOffsetAlignment; /**< GL_ARB_texture_buffer_range */ + GLuint MaxArrayLockSize; GLint SubPixelBits; @@ -905,18 +997,20 @@ struct gl_constants GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */ GLfloat LineWidthGranularity; - GLuint MaxColorTableSize; - GLuint MaxClipPlanes; GLuint MaxLights; GLfloat MaxShininess; /**< GL_NV_light_max_exponent */ GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */ GLuint MaxViewportWidth, MaxViewportHeight; + GLuint MaxViewports; /**< GL_ARB_viewport_array */ + GLuint ViewportSubpixelBits; /**< GL_ARB_viewport_array */ + struct { + GLfloat Min; + GLfloat Max; + } ViewportBounds; /**< GL_ARB_viewport_array */ - struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */ - struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */ - struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */ + struct gl_program_constants Program[MESA_SHADER_STAGES]; GLuint MaxProgramMatrices; GLuint MaxProgramMatrixStackDepth; @@ -937,10 +1031,8 @@ struct gl_constants GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ - /** Number of varying vectors between vertex and fragment shaders */ + /** Number of varying vectors between any two shader stages. */ GLuint MaxVarying; - GLuint MaxVertexVaryingComponents; /**< Between vert and geom shader */ - GLuint MaxGeometryVaryingComponents; /**< Between geom and frag shader */ /** @{ * GL_ARB_uniform_buffer_object @@ -963,6 +1055,12 @@ struct gl_constants */ GLboolean ForceGLSLExtensionsWarn; + /** + * If non-zero, forces GLSL shaders without the #version directive to behave + * as if they began with "#version ForceGLSLVersion". + */ + GLuint ForceGLSLVersion; + /** * Does the driver support real 32-bit integers? (Otherwise, integers are * simulated via floats.) @@ -996,6 +1094,11 @@ struct gl_constants /** GL_EXT_gpu_shader4 */ GLint MinProgramTexelOffset, MaxProgramTexelOffset; + /** GL_ARB_texture_gather */ + GLuint MinProgramTextureGatherOffset; + GLuint MaxProgramTextureGatherOffset; + GLuint MaxProgramTextureGatherComponents; + /* GL_ARB_robustness */ GLenum ResetStrategy; @@ -1017,18 +1120,64 @@ struct gl_constants GLboolean StripTextureBorder; /** - * For drivers which can do a better job at eliminating unused varyings - * and uniforms than the GLSL compiler. + * For drivers which can do a better job at eliminating unused uniforms + * than the GLSL compiler. * * XXX Remove these as soon as a better solution is available. */ - GLboolean GLSLSkipStrictMaxVaryingLimitCheck; GLboolean GLSLSkipStrictMaxUniformLimitCheck; /** * Force software support for primitive restart in the VBO module. */ GLboolean PrimitiveRestartInSoftware; + + /** + * Always use the GetTransformFeedbackVertexCount() driver hook, rather + * than passing the transform feedback object to the drawing function. + */ + GLboolean AlwaysUseGetTransformFeedbackVertexCount; + + /** GL_ARB_map_buffer_alignment */ + GLuint MinMapBufferAlignment; + + /** + * Disable varying packing. This is out of spec, but potentially useful + * for older platforms that supports a limited number of texture + * indirections--on these platforms, unpacking the varyings in the fragment + * shader increases the number of texture indirections by 1, which might + * make some shaders not executable at all. + * + * Drivers that support transform feedback must set this value to GL_FALSE. + */ + GLboolean DisableVaryingPacking; + + /** + * Disable interpretation of line continuations (lines ending with a + * backslash character ('\') in GLSL source. + */ + GLboolean DisableGLSLLineContinuations; + + /** GL_ARB_texture_multisample */ + GLint MaxColorTextureSamples; + GLint MaxDepthTextureSamples; + GLint MaxIntegerSamples; + + /** GL_ARB_shader_atomic_counters */ + GLuint MaxAtomicBufferBindings; + GLuint MaxAtomicBufferSize; + GLuint MaxCombinedAtomicBuffers; + GLuint MaxCombinedAtomicCounters; + + /** GL_ARB_vertex_attrib_binding */ + GLint MaxVertexAttribRelativeOffset; + GLint MaxVertexAttribBindings; + + /* GL_ARB_shader_image_load_store */ + GLuint MaxImageUnits; + GLuint MaxCombinedImageUnitsAndFragmentOutputs; + GLuint MaxImageSamples; + GLuint MaxCombinedImageUniforms; }; @@ -1043,16 +1192,18 @@ struct gl_extensions GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */ GLboolean ANGLE_texture_compression_dxt; GLboolean ARB_ES2_compatibility; + GLboolean ARB_ES3_compatibility; + GLboolean ARB_arrays_of_arrays; GLboolean ARB_base_instance; GLboolean ARB_blend_func_extended; GLboolean ARB_color_buffer_float; GLboolean ARB_conservative_depth; - GLboolean ARB_copy_buffer; GLboolean ARB_depth_buffer_float; GLboolean ARB_depth_clamp; GLboolean ARB_depth_texture; GLboolean ARB_draw_buffers_blend; GLboolean ARB_draw_elements_base_vertex; + GLboolean ARB_draw_indirect; GLboolean ARB_draw_instanced; GLboolean ARB_fragment_coord_conventions; GLboolean ARB_fragment_program; @@ -1061,71 +1212,75 @@ struct gl_extensions GLboolean ARB_framebuffer_object; GLboolean ARB_explicit_attrib_location; GLboolean ARB_geometry_shader4; + GLboolean ARB_gpu_shader5; GLboolean ARB_half_float_pixel; GLboolean ARB_half_float_vertex; GLboolean ARB_instanced_arrays; + GLboolean ARB_internalformat_query; + GLboolean ARB_map_buffer_alignment; GLboolean ARB_map_buffer_range; GLboolean ARB_occlusion_query; GLboolean ARB_occlusion_query2; GLboolean ARB_point_sprite; + GLboolean ARB_sample_shading; GLboolean ARB_seamless_cube_map; + GLboolean ARB_shader_atomic_counters; GLboolean ARB_shader_bit_encoding; - GLboolean ARB_shader_objects; + GLboolean ARB_shader_image_load_store; GLboolean ARB_shader_stencil_export; GLboolean ARB_shader_texture_lod; - GLboolean ARB_shading_language_100; + GLboolean ARB_shading_language_packing; + GLboolean ARB_shading_language_420pack; GLboolean ARB_shadow; GLboolean ARB_sync; GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_buffer_object; + GLboolean ARB_texture_buffer_object_rgb32; + GLboolean ARB_texture_buffer_range; GLboolean ARB_texture_compression_rgtc; GLboolean ARB_texture_cube_map; + GLboolean ARB_texture_cube_map_array; GLboolean ARB_texture_env_combine; GLboolean ARB_texture_env_crossbar; GLboolean ARB_texture_env_dot3; GLboolean ARB_texture_float; + GLboolean ARB_texture_gather; + GLboolean ARB_texture_mirror_clamp_to_edge; GLboolean ARB_texture_multisample; GLboolean ARB_texture_non_power_of_two; + GLboolean ARB_texture_query_levels; + GLboolean ARB_texture_query_lod; GLboolean ARB_texture_rg; GLboolean ARB_texture_rgb10_a2ui; - GLboolean ARB_texture_storage; + GLboolean ARB_texture_view; GLboolean ARB_timer_query; GLboolean ARB_transform_feedback2; GLboolean ARB_transform_feedback3; GLboolean ARB_transform_feedback_instanced; - GLboolean ARB_transpose_matrix; GLboolean ARB_uniform_buffer_object; GLboolean ARB_vertex_program; GLboolean ARB_vertex_shader; + GLboolean ARB_vertex_type_10f_11f_11f_rev; GLboolean ARB_vertex_type_2_10_10_10_rev; - GLboolean ARB_window_pos; + GLboolean ARB_viewport_array; GLboolean EXT_blend_color; GLboolean EXT_blend_equation_separate; GLboolean EXT_blend_func_separate; GLboolean EXT_blend_minmax; - GLboolean EXT_clip_volume_hint; - GLboolean EXT_compiled_vertex_array; GLboolean EXT_depth_bounds_test; GLboolean EXT_draw_buffers2; - GLboolean EXT_draw_range_elements; - GLboolean EXT_fog_coord; GLboolean EXT_framebuffer_blit; GLboolean EXT_framebuffer_multisample; - GLboolean EXT_framebuffer_object; + GLboolean EXT_framebuffer_multisample_blit_scaled; GLboolean EXT_framebuffer_sRGB; GLboolean EXT_gpu_program_parameters; GLboolean EXT_gpu_shader4; - GLboolean EXT_packed_depth_stencil; GLboolean EXT_packed_float; - GLboolean EXT_packed_pixels; GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; GLboolean EXT_provoking_vertex; - GLboolean EXT_rescale_normal; - GLboolean EXT_shadow_funcs; - GLboolean EXT_secondary_color; GLboolean EXT_separate_shader_objects; - GLboolean EXT_separate_specular_color; + GLboolean EXT_shader_integer_mix; GLboolean EXT_stencil_two_side; GLboolean EXT_texture3D; GLboolean EXT_texture_array; @@ -1147,8 +1302,10 @@ struct gl_extensions GLboolean EXT_shadow_samplers; GLboolean EXT_frag_depth; /* vendor extensions */ + GLboolean AMD_performance_monitor; GLboolean AMD_seamless_cubemap_per_texture; - GLboolean APPLE_packed_pixels; + GLboolean AMD_shader_trinary_minmax; + GLboolean AMD_vertex_shader_layer; GLboolean APPLE_object_purgeable; GLboolean ATI_envmap_bumpmap; GLboolean ATI_texture_compression_3dc; @@ -1156,32 +1313,21 @@ struct gl_extensions GLboolean ATI_texture_env_combine3; GLboolean ATI_fragment_shader; GLboolean ATI_separate_stencil; - GLboolean IBM_rasterpos_clip; - GLboolean IBM_multimode_draw_arrays; GLboolean MESA_pack_invert; - GLboolean MESA_resize_buffers; GLboolean MESA_ycbcr_texture; - GLboolean MESA_texture_array; - GLboolean NV_blend_square; GLboolean NV_conditional_render; GLboolean NV_fog_distance; - GLboolean NV_fragment_program; GLboolean NV_fragment_program_option; - GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_primitive_restart; - GLboolean NV_read_buffer; GLboolean NV_texture_barrier; - GLboolean NV_texgen_reflection; GLboolean NV_texture_env_combine4; GLboolean NV_texture_rectangle; - GLboolean NV_vertex_program; - GLboolean NV_vertex_program1_1; - GLboolean SGIS_texture_lod; + GLboolean NV_vdpau_interop; GLboolean TDFX_texture_compression_FXT1; - GLboolean S3_s3tc; GLboolean OES_EGL_image; GLboolean OES_draw_texture; + GLboolean OES_depth_texture_cube_map; GLboolean OES_EGL_image_external; GLboolean OES_compressed_ETC1_RGB8_texture; GLboolean extension_sentinel; @@ -1195,31 +1341,49 @@ struct gl_extensions + /* This has to be included here. */ #include "dd.h" +/** @{ + * + * These are a mapping of the GL_ARB_debug_output/GL_KHR_debug enums + * to small enums suitable for use as an array index. + */ +enum mesa_debug_type { + MESA_DEBUG_TYPE_ERROR, + MESA_DEBUG_TYPE_DEPRECATED, + MESA_DEBUG_TYPE_UNDEFINED, + MESA_DEBUG_TYPE_PORTABILITY, + MESA_DEBUG_TYPE_PERFORMANCE, + MESA_DEBUG_TYPE_OTHER, + MESA_DEBUG_TYPE_MARKER, + MESA_DEBUG_TYPE_PUSH_GROUP, + MESA_DEBUG_TYPE_POP_GROUP, + MESA_DEBUG_TYPE_COUNT +}; -typedef enum { - SHADER_ERROR_UNKNOWN, - SHADER_ERROR_COUNT -} gl_shader_error; - /** * Enum for the OpenGL APIs we know about and may support. + * + * NOTE: This must match the api_enum table in + * src/mesa/main/get_hash_generator.py */ typedef enum { - API_OPENGL, /* legacy / compatibility contexts */ + API_OPENGL_COMPAT, /* legacy / compatibility contexts */ API_OPENGLES, API_OPENGLES2, API_OPENGL_CORE, + API_OPENGL_LAST = API_OPENGL_CORE } gl_api; + /** * Mesa rendering context. * @@ -1227,8 +1391,6 @@ typedef enum * OpenGL state is contained in this structure. * Think of this as a base class from which device drivers will derive * sub classes. - * - * The struct gl_context typedef names this structure. */ struct gl_context { @@ -1249,8 +1411,7 @@ struct gl_context GLuint Version; char *VersionString; - - struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_TYPES]; + struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_STAGES]; GLenum ErrorValue; /**< Last error code */ }; diff --git a/3rdparty/glsl-optimizer/src/mesa/main/simple_list.h b/3rdparty/glsl-optimizer/src/mesa/main/simple_list.h index cfeb4d144..aa6117aff 100644 --- a/3rdparty/glsl-optimizer/src/mesa/main/simple_list.h +++ b/3rdparty/glsl-optimizer/src/mesa/main/simple_list.h @@ -11,7 +11,6 @@ /* * Mesa 3-D graphics library - * Version: 3.5 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * @@ -28,9 +27,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ diff --git a/3rdparty/glsl-optimizer/src/mesa/program/hash_table.c b/3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c similarity index 99% rename from 3rdparty/glsl-optimizer/src/mesa/program/hash_table.c rename to 3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c index 92fc802ac..4139f26fb 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/hash_table.c +++ b/3rdparty/glsl-optimizer/src/mesa/program/prog_hash_table.c @@ -193,7 +193,7 @@ hash_table_call_foreach(struct hash_table *ht, void *closure), void *closure) { - int bucket; + unsigned bucket; for (bucket = 0; bucket < (int)ht->num_buckets; bucket++) { struct node *node, *temp; diff --git a/3rdparty/glsl-optimizer/src/mesa/program/prog_instruction.h b/3rdparty/glsl-optimizer/src/mesa/program/prog_instruction.h index e748b9cad..b9604e50d 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/prog_instruction.h +++ b/3rdparty/glsl-optimizer/src/mesa/program/prog_instruction.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.3 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -89,6 +89,342 @@ /*@}*/ +/** + * Condition codes + */ +/*@{*/ +#define COND_GT 1 /**< greater than zero */ +#define COND_EQ 2 /**< equal to zero */ +#define COND_LT 3 /**< less than zero */ +#define COND_UN 4 /**< unordered (NaN) */ +#define COND_GE 5 /**< greater than or equal to zero */ +#define COND_LE 6 /**< less than or equal to zero */ +#define COND_NE 7 /**< not equal to zero */ +#define COND_TR 8 /**< always true */ +#define COND_FL 9 /**< always false */ +/*@}*/ +/** + * Instruction precision for GL_NV_fragment_program + */ +/*@{*/ +#define FLOAT32 0x1 +#define FLOAT16 0x2 +#define FIXED12 0x4 +/*@}*/ + + +/** + * Saturation modes when storing values. + */ +/*@{*/ +#define SATURATE_OFF 0 +#define SATURATE_ZERO_ONE 1 +/*@}*/ + + +/** + * Per-component negation masks + */ +/*@{*/ +#define NEGATE_X 0x1 +#define NEGATE_Y 0x2 +#define NEGATE_Z 0x4 +#define NEGATE_W 0x8 +#define NEGATE_XYZ 0x7 +#define NEGATE_XYZW 0xf +#define NEGATE_NONE 0x0 +/*@}*/ + + +/** + * Program instruction opcodes for vertex, fragment and geometry programs. + */ +typedef enum prog_opcode { + /* ARB_vp ARB_fp NV_vp NV_fp GLSL */ + /*------------------------------------------*/ + OPCODE_NOP = 0, /* X */ + OPCODE_ABS, /* X X 1.1 X */ + OPCODE_ADD, /* X X X X X */ + OPCODE_ARL, /* X X X */ + OPCODE_BGNLOOP, /* opt */ + OPCODE_BGNSUB, /* opt */ + OPCODE_BRK, /* 2 opt */ + OPCODE_CAL, /* 2 2 opt */ + OPCODE_CMP, /* X X */ + OPCODE_CONT, /* opt */ + OPCODE_COS, /* X 2 X X */ + OPCODE_DDX, /* X X */ + OPCODE_DDY, /* X X */ + OPCODE_DP2, /* 2 X */ + OPCODE_DP3, /* X X X X X */ + OPCODE_DP4, /* X X X X X */ + OPCODE_DPH, /* X X 1.1 */ + OPCODE_DST, /* X X X X */ + OPCODE_ELSE, /* opt */ + OPCODE_END, /* X X X X opt */ + OPCODE_ENDIF, /* opt */ + OPCODE_ENDLOOP, /* opt */ + OPCODE_ENDSUB, /* opt */ + OPCODE_EX2, /* X X 2 X X */ + OPCODE_EXP, /* X X */ + OPCODE_FLR, /* X X 2 X X */ + OPCODE_FRC, /* X X 2 X X */ + OPCODE_IF, /* opt */ + OPCODE_KIL, /* X X */ + OPCODE_KIL_NV, /* X X */ + OPCODE_LG2, /* X X 2 X X */ + OPCODE_LIT, /* X X X X */ + OPCODE_LOG, /* X X */ + OPCODE_LRP, /* X X */ + OPCODE_MAD, /* X X X X X */ + OPCODE_MAX, /* X X X X X */ + OPCODE_MIN, /* X X X X X */ + OPCODE_MOV, /* X X X X X */ + OPCODE_MUL, /* X X X X X */ + OPCODE_NOISE1, /* X */ + OPCODE_NOISE2, /* X */ + OPCODE_NOISE3, /* X */ + OPCODE_NOISE4, /* X */ + OPCODE_PK2H, /* X */ + OPCODE_PK2US, /* X */ + OPCODE_PK4B, /* X */ + OPCODE_PK4UB, /* X */ + OPCODE_POW, /* X X X X */ + OPCODE_RCP, /* X X X X X */ + OPCODE_RET, /* 2 2 opt */ + OPCODE_RFL, /* X */ + OPCODE_RSQ, /* X X X X X */ + OPCODE_SCS, /* X X */ + OPCODE_SEQ, /* 2 X X */ + OPCODE_SFL, /* 2 X */ + OPCODE_SGE, /* X X X X X */ + OPCODE_SGT, /* 2 X X */ + OPCODE_SIN, /* X 2 X X */ + OPCODE_SLE, /* 2 X X */ + OPCODE_SLT, /* X X X X X */ + OPCODE_SNE, /* 2 X X */ + OPCODE_SSG, /* 2 X */ + OPCODE_STR, /* 2 X */ + OPCODE_SUB, /* X X 1.1 X X */ + OPCODE_SWZ, /* X X X */ + OPCODE_TEX, /* X 3 X X */ + OPCODE_TXB, /* X 3 X */ + OPCODE_TXD, /* X X */ + OPCODE_TXL, /* 3 2 X */ + OPCODE_TXP, /* X X */ + OPCODE_TXP_NV, /* 3 X */ + OPCODE_TRUNC, /* X */ + OPCODE_UP2H, /* X */ + OPCODE_UP2US, /* X */ + OPCODE_UP4B, /* X */ + OPCODE_UP4UB, /* X */ + OPCODE_X2D, /* X */ + OPCODE_XPD, /* X X */ + MAX_OPCODE +} gl_inst_opcode; + + +/** + * Number of bits for the src/dst register Index field. + * This limits the size of temp/uniform register files. + */ +#define INST_INDEX_BITS 12 + + +/** + * Instruction source register. + */ +struct prog_src_register +{ + GLuint File:4; /**< One of the PROGRAM_* register file values. */ + GLint Index:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit. + * May be negative for relative addressing. + */ + GLuint Swizzle:12; + GLuint RelAddr:1; + + /** Take the component-wise absolute value */ + GLuint Abs:1; + + /** + * Post-Abs negation. + * This will either be NEGATE_NONE or NEGATE_XYZW, except for the SWZ + * instruction which allows per-component negation. + */ + GLuint Negate:4; + + /** + * Is the register two-dimensional. + * Two dimensional registers are of the + * REGISTER[index][index2] format. + * They are used by the geometry shaders where + * the first index is the index within an array + * and the second index is the semantic of the + * array, e.g. gl_PositionIn[index] would become + * INPUT[index][gl_PositionIn] + */ + GLuint HasIndex2:1; + GLuint RelAddr2:1; + GLint Index2:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit. + * May be negative for relative + * addressing. */ +}; + + +/** + * Instruction destination register. + */ +struct prog_dst_register +{ + GLuint File:4; /**< One of the PROGRAM_* register file values */ + GLuint Index:INST_INDEX_BITS; /**< Unsigned, never negative */ + GLuint WriteMask:4; + GLuint RelAddr:1; + + /** + * \name Conditional destination update control. + * + * \since + * NV_fragment_program_option, NV_vertex_program2, NV_vertex_program2_option. + */ + /*@{*/ + /** + * Takes one of the 9 possible condition values (EQ, FL, GT, GE, LE, LT, + * NE, TR, or UN). Dest reg is only written to if the matching + * (swizzled) condition code value passes. When a conditional update mask + * is not specified, this will be \c COND_TR. + */ + GLuint CondMask:4; + + /** + * Condition code swizzle value. + */ + GLuint CondSwizzle:12; +}; + + +/** + * Vertex/fragment program instruction. + */ +struct prog_instruction +{ + gl_inst_opcode Opcode; + struct prog_src_register SrcReg[3]; + struct prog_dst_register DstReg; + + /** + * Indicates that the instruction should update the condition code + * register. + * + * \since + * NV_fragment_program_option, NV_vertex_program2, NV_vertex_program2_option. + */ + GLuint CondUpdate:1; + + /** + * If prog_instruction::CondUpdate is \c GL_TRUE, this value selects the + * condition code register that is to be updated. + * + * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition + * code register 0 is available. In GL_NV_vertex_program3 mode, condition + * code registers 0 and 1 are available. + * + * \since + * NV_fragment_program_option, NV_vertex_program2, NV_vertex_program2_option. + */ + GLuint CondDst:1; + + /** + * Saturate each value of the vectored result to the range [0,1] or the + * range [-1,1]. \c SSAT mode (i.e., saturation to the range [-1,1]) is + * only available in NV_fragment_program2 mode. + * Value is one of the SATURATE_* tokens. + * + * \since + * NV_fragment_program_option, NV_vertex_program3. + */ + GLuint SaturateMode:2; + + /** + * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12. + * + * \since + * NV_fragment_program_option. + */ + GLuint Precision:3; + + /** + * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. + */ + /*@{*/ + /** Source texture unit. */ + GLuint TexSrcUnit:5; + + /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */ + GLuint TexSrcTarget:4; + + /** True if tex instruction should do shadow comparison */ + GLuint TexShadow:1; + /*@}*/ + + /** + * For BRA and CAL instructions, the location to jump to. + * For BGNLOOP, points to ENDLOOP (and vice-versa). + * For BRK, points to ENDLOOP + * For IF, points to ELSE or ENDIF. + * For ELSE, points to ENDIF. + */ + GLint BranchTarget; + + /** for debugging purposes */ + const char *Comment; + + /** for driver use (try to remove someday) */ + GLint Aux; +}; + + +#ifdef __cplusplus +extern "C" { +#endif + +extern void +_mesa_init_instructions(struct prog_instruction *inst, GLuint count); + +extern struct prog_instruction * +_mesa_alloc_instructions(GLuint numInst); + +extern struct prog_instruction * +_mesa_realloc_instructions(struct prog_instruction *oldInst, + GLuint numOldInst, GLuint numNewInst); + +extern struct prog_instruction * +_mesa_copy_instructions(struct prog_instruction *dest, + const struct prog_instruction *src, GLuint n); + +extern void +_mesa_free_instructions(struct prog_instruction *inst, GLuint count); + +extern GLuint +_mesa_num_inst_src_regs(gl_inst_opcode opcode); + +extern GLuint +_mesa_num_inst_dst_regs(gl_inst_opcode opcode); + +extern GLboolean +_mesa_is_tex_instruction(gl_inst_opcode opcode); + +extern GLboolean +_mesa_check_soa_dependencies(const struct prog_instruction *inst); + +extern const char * +_mesa_opcode_string(gl_inst_opcode opcode); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* PROG_INSTRUCTION_H */ diff --git a/3rdparty/glsl-optimizer/src/mesa/program/prog_parameter.h b/3rdparty/glsl-optimizer/src/mesa/program/prog_parameter.h index 70faddafc..8daeea48b 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/prog_parameter.h +++ b/3rdparty/glsl-optimizer/src/mesa/program/prog_parameter.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.3 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ /** @@ -39,18 +39,6 @@ extern "C" { #endif -/** - * Program parameter flags - */ -/*@{*/ -#define PROG_PARAM_BIT_CENTROID 0x1 /**< for varying vars (GLSL 1.20) */ -#define PROG_PARAM_BIT_INVARIANT 0x2 /**< for varying vars (GLSL 1.20) */ -#define PROG_PARAM_BIT_FLAT 0x4 /**< for varying vars (GLSL 1.30) */ -#define PROG_PARAM_BIT_LINEAR 0x8 /**< for varying vars (GLSL 1.30) */ -#define PROG_PARAM_BIT_CYL_WRAP 0x10 /**< XXX gallium debug */ -/*@}*/ - - /** * Actual data for constant values of parameters. */ @@ -63,8 +51,6 @@ typedef union gl_constant_value } gl_constant_value; - - #ifdef __cplusplus } #endif diff --git a/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h b/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h index aff31f4a2..185b26d97 100644 --- a/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h +++ b/3rdparty/glsl-optimizer/src/mesa/program/prog_statevars.h @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef PROG_STATEVARS_H @@ -99,6 +99,8 @@ typedef enum gl_state_index_ { STATE_TEXENV_COLOR, + STATE_NUM_SAMPLES, /* An integer, not a float like the other state vars */ + STATE_DEPTH_RANGE, STATE_VERTEX_PROGRAM, diff --git a/3rdparty/glsl-optimizer/src/node/binding.cpp b/3rdparty/glsl-optimizer/src/node/binding.cpp new file mode 100644 index 000000000..27b9a0dd1 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/node/binding.cpp @@ -0,0 +1,17 @@ +#include +#include "shader.h" + +using namespace v8; + +void InitAll(Handle exports) +{ + // Export constants + exports->Set(String::NewSymbol("VERTEX_SHADER"), Int32::New(kGlslOptShaderVertex), ReadOnly); + exports->Set(String::NewSymbol("FRAGMENT_SHADER"), Int32::New(kGlslOptShaderFragment), ReadOnly); + + // Export classes + Compiler::Init(exports); + Shader::Init(exports); +} + +NODE_MODULE(glslOptimizer, InitAll); diff --git a/3rdparty/glsl-optimizer/src/node/compiler.cpp b/3rdparty/glsl-optimizer/src/node/compiler.cpp new file mode 100644 index 000000000..ea0e95c4d --- /dev/null +++ b/3rdparty/glsl-optimizer/src/node/compiler.cpp @@ -0,0 +1,74 @@ +#include "compiler.h" + +using namespace v8; +using namespace node; + +//---------------------------------------------------------------------- + +Compiler::Compiler(bool essl) +{ + _binding = glslopt_initialize(essl); +} + +//---------------------------------------------------------------------- + +Compiler::~Compiler() +{ + release(); +} + +//---------------------------------------------------------------------- + +void Compiler::release() +{ + if (_binding) + { + glslopt_cleanup(_binding); + + _binding = 0; + } +} + +//---------------------------------------------------------------------- + +void Compiler::Init(Handle exports) +{ + // Prepare constructor template + Local tpl = FunctionTemplate::New(New); + tpl->SetClassName(String::NewSymbol("Compiler")); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + // Prototype + SetPrototypeMethod(tpl, "dispose", Dispose); + + // Export the class + Persistent constructor = Persistent::New(tpl->GetFunction()); + exports->Set(String::NewSymbol("Compiler"), constructor); +} + +//---------------------------------------------------------------------- + +Handle Compiler::New(const Arguments& args) +{ + HandleScope scope; + + bool essl = args[0]->IsUndefined() ? true : args[0]->BooleanValue(); + + Compiler* obj = new Compiler(essl); + + obj->Wrap(args.This()); + + return args.This(); +} + +//---------------------------------------------------------------------- + +Handle Compiler::Dispose(const Arguments& args) +{ + HandleScope scope; + + Compiler* obj = ObjectWrap::Unwrap(args.This()); + obj->release(); + + return scope.Close(Undefined()); +} diff --git a/3rdparty/glsl-optimizer/src/node/compiler.h b/3rdparty/glsl-optimizer/src/node/compiler.h new file mode 100644 index 000000000..4d18e6ff4 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/node/compiler.h @@ -0,0 +1,25 @@ +#ifndef COMPILER_H +#define COMPILER_H + +#include +#include + +class Compiler : public node::ObjectWrap { +public: + static void Init(v8::Handle exports); + + inline glslopt_ctx* getBinding() const { return _binding; } + + void release(); + +private: + Compiler(bool essl); + ~Compiler(); + + glslopt_ctx* _binding; + + static v8::Handle New(const v8::Arguments& args); + static v8::Handle Dispose(const v8::Arguments& args); +}; + +#endif diff --git a/3rdparty/glsl-optimizer/src/node/shader.cpp b/3rdparty/glsl-optimizer/src/node/shader.cpp new file mode 100644 index 000000000..9d3fefc0d --- /dev/null +++ b/3rdparty/glsl-optimizer/src/node/shader.cpp @@ -0,0 +1,177 @@ +#include "shader.h" + +using namespace v8; +using namespace node; + +//---------------------------------------------------------------------- + +Shader::Shader(Compiler* compiler, int type, const char* source) +{ + if (compiler) + { + _binding = glslopt_optimize(compiler->getBinding(), (glslopt_shader_type)type, source, 0); + _compiled = glslopt_get_status(_binding); + } + else + { + _binding = 0; + _compiled = false; + } +} + +//---------------------------------------------------------------------- + +Shader::~Shader() +{ + release(); +} + +//---------------------------------------------------------------------- + +void Shader::release() +{ + if (_binding) + { + glslopt_shader_delete(_binding); + _binding = 0; + _compiled = false; + } +} + +//---------------------------------------------------------------------- + +const char* Shader::getOutput() const +{ + return (_compiled) ? glslopt_get_output(_binding) : ""; +} + +//---------------------------------------------------------------------- + +const char* Shader::getRawOutput() const +{ + return (_compiled) ? glslopt_get_raw_output(_binding) : ""; +} + +//---------------------------------------------------------------------- + +const char* Shader::getLog() const +{ + return (_compiled) ? glslopt_get_log(_binding) : ""; +} + +//---------------------------------------------------------------------- + +void Shader::Init(Handle exports) +{ + // Prepare constructor template + Local tpl = FunctionTemplate::New(New); + tpl->SetClassName(String::NewSymbol("Shader")); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + // Prototype + SetPrototypeMethod(tpl, "dispose", Dispose); + SetPrototypeMethod(tpl, "compiled", Compiled); + SetPrototypeMethod(tpl, "output", Output); + SetPrototypeMethod(tpl, "rawOutput", RawOutput); + SetPrototypeMethod(tpl, "log", Log); + + // Export the class + Persistent constructor = Persistent::New(tpl->GetFunction()); + exports->Set(String::NewSymbol("Shader"), constructor); +} + +//---------------------------------------------------------------------- + +Handle Shader::New(const Arguments& args) +{ + HandleScope scope; + + if (args.Length() == 3) + { + // Check the first parameter (compiler) + Local args0 = args[0]; + + if (args0->IsObject()) + { + // Check the second parameter (shader type) + Local args1 = args[1]; + + if (args1->IsInt32()) + { + // Check the third parameter (source code) + Local args2 = args[2]; + + if (args2->IsString()) + { + Compiler* compiler = ObjectWrap::Unwrap(args0->ToObject()); + int type = args1->Int32Value(); + String::Utf8Value sourceCode(args2->ToString()); + + Shader* obj = new Shader(compiler, type, *sourceCode); + obj->Wrap(args.This()); + + return args.This(); + } + } + } + } + + // Couldn't create the Shader + return ThrowException(String::New("Invalid arguments")); +} + +//---------------------------------------------------------------------- + +Handle Shader::Dispose(const Arguments& args) +{ + HandleScope scope; + + Shader* obj = ObjectWrap::Unwrap(args.This()); + obj->release(); + + return scope.Close(Undefined()); +} + +//---------------------------------------------------------------------- + +Handle Shader::Compiled(const Arguments& args) +{ + HandleScope scope; + + Shader* obj = ObjectWrap::Unwrap(args.This()); + + return scope.Close(Boolean::New(obj->isCompiled())); +} + +//---------------------------------------------------------------------- + +Handle Shader::Output(const Arguments& args) +{ + HandleScope scope; + + Shader* obj = ObjectWrap::Unwrap(args.This()); + + return scope.Close(String::New(obj->getOutput())); +} + +//---------------------------------------------------------------------- + +Handle Shader::RawOutput(const Arguments& args) +{ + HandleScope scope; + + Shader* obj = ObjectWrap::Unwrap(args.This()); + + return scope.Close(String::New(obj->getRawOutput())); +} + +//---------------------------------------------------------------------- + +Handle Shader::Log(const Arguments& args) +{ + HandleScope scope; + + Shader* obj = ObjectWrap::Unwrap(args.This()); + + return scope.Close(String::New(obj->getLog())); +} diff --git a/3rdparty/glsl-optimizer/src/node/shader.h b/3rdparty/glsl-optimizer/src/node/shader.h new file mode 100644 index 000000000..8bfb1caf7 --- /dev/null +++ b/3rdparty/glsl-optimizer/src/node/shader.h @@ -0,0 +1,33 @@ +#ifndef SHADER_H +#define SHADER_H + +#include "compiler.h" + +class Shader : public node::ObjectWrap { +public: + static void Init(v8::Handle exports); + + inline bool isCompiled() const { return _compiled; } + const char* getOutput() const; + const char* getRawOutput() const; + const char* getLog() const; + + void release(); + +private: + Shader(Compiler* compiler, int type, const char* source); + ~Shader(); + + glslopt_shader* _binding; + bool _compiled; + + static v8::Handle New(const v8::Arguments& args); + static v8::Handle Dispose(const v8::Arguments& args); + + static v8::Handle Compiled(const v8::Arguments& args); + static v8::Handle Output(const v8::Arguments& args); + static v8::Handle RawOutput(const v8::Arguments& args); + static v8::Handle Log(const v8::Arguments& args); +}; + +#endif diff --git a/3rdparty/glsl-optimizer/target_defaults.gypi b/3rdparty/glsl-optimizer/target_defaults.gypi new file mode 100644 index 000000000..a76ae69ea --- /dev/null +++ b/3rdparty/glsl-optimizer/target_defaults.gypi @@ -0,0 +1,28 @@ +{ + 'target_defaults': { + 'configurations': { + 'Debug': { + 'defines': [ + 'DEBUG', + '_DEBUG', + ], + }, + 'Release': { + 'defines': [ + 'NDEBUG', + ], + }, + }, + 'conditions': [ + ['OS=="win"', { + 'target_defaults': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '0', + }, + }, + }, + }], + ], + } +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt index 7a903b0e7..92a41e6a1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt @@ -20,5 +20,5 @@ mediump vec4 xlat_main( ) { void main() { mediump vec4 xl_retval; xl_retval = xlat_main( ); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt index fafa0adad..e2fb85363 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt index bc87a08da..cdd5f3a70 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt index 7a903b0e7..92a41e6a1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt @@ -20,5 +20,5 @@ mediump vec4 xlat_main( ) { void main() { mediump vec4 xl_retval; xl_retval = xlat_main( ); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt index fafa0adad..e2fb85363 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt index bc87a08da..cdd5f3a70 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt b/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt index 8088bc658..5ba2c6eef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt @@ -1,25 +1,25 @@ void main () { - int i_1; float a_2; if ((gl_FragCoord.x == 1.0)) { discard; }; a_2 = 4.0; - i_1 = 0; - for (int i_1 = 0; i_1 < 10; ) { - a_2 = (a_2 + 1.0); - i_1 = (i_1 + 1); + for (int i_1 = 0; i_1 < 10; i_1++, a_2 += 1.0) { }; while (true) { - a_2 = (a_2 + 2.0); + a_2 += 2.0; break; }; float tmpvar_3; tmpvar_3 = (a_2 + 1.0); float tmpvar_4; - tmpvar_4 = inversesqrt((-((tmpvar_3 * tmpvar_3)) - 1.0)); + tmpvar_4 = inversesqrt((-( + (tmpvar_3 * tmpvar_3) + ) - 1.0)); a_2 = tmpvar_4; gl_FragColor = vec4(tmpvar_4); } + +// inputs: 1, stats: 12 alu 1 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt index fb7cd4e03..dc2a65a80 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt @@ -5,5 +5,5 @@ mediump vec4 xlat_main( ) { void main() { mediump vec4 xl_retval; xl_retval = xlat_main( ); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt index b3532e0c7..dca274094 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = vec4(1.0, 1e+07, 1e-06, 1.5); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt index c41789ad6..486073c7c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt index dc43cb632..5fcb9bcc9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt @@ -21,3 +21,5 @@ void main () gl_FragColor = c_1; } + +// inputs: 1, stats: 4 alu 1 tex 3 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt index 57bd83189..2a54ffddd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-ir.txt @@ -1,15 +1,15 @@ -float otherValue; -uniform float value; float tmpvar_1; -//; float tmpvar_2; +uniform float value; +float otherValue; +//; //; //; void main () { -tmpvar_1 = log (value); -tmpvar_2 = tmpvar_1; -otherValue = tmpvar_2; +tmpvar_2 = log (value); +tmpvar_1 = tmpvar_2; +otherValue = tmpvar_1; vec4 tmpvar_3; tmpvar_3 = vec4(otherValue); vec4 tmpvar_4; diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt index 32bdf2b51..769e28614 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt @@ -4,3 +4,5 @@ void main () gl_FragColor = vec4(log(value)); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt index 2732a7876..254b89118 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt @@ -4,3 +4,5 @@ void main () gl_FragColor = vec4((vv + sin(vv))); } + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt index 2ea5bec87..5b8087106 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt @@ -3,3 +3,5 @@ void main () gl_FragColor = vec4(12.0, 12.0, 12.0, 12.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt index e1688fe34..7287d7d68 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-ir.txt @@ -1,5 +1,5 @@ -uniform float otherValue; uniform float value; +uniform float otherValue; void main () { float result_1; diff --git a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt index dff0ea386..920ca652a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt @@ -1,7 +1,9 @@ -uniform float otherValue; uniform float value; +uniform float otherValue; void main () { gl_FragColor = vec4((otherValue / (1.0/(value)))); } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt b/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt index c48d9620f..d0dcaf80a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt @@ -2,9 +2,12 @@ varying vec4 xlv_TEXCOORD0; void main () { vec4 res_1; - res_1.x = dFdx(xlv_TEXCOORD0.x); - res_1.y = dFdx(xlv_TEXCOORD0.y); - res_1.zw = (abs(dFdx(xlv_TEXCOORD0.xy)) + abs(dFdy(xlv_TEXCOORD0.xy))); + vec2 cse_2; + cse_2 = dFdx(xlv_TEXCOORD0.xy); + res_1.xy = cse_2; + res_1.zw = (abs(cse_2) + abs(dFdy(xlv_TEXCOORD0.xy))); gl_FragData[0] = res_1; } + +// inputs: 1, stats: 5 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt index 2f163265a..170e91252 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt @@ -18,3 +18,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt index 025c48c14..a3545c602 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/estest1-ir.txt @@ -3,11 +3,11 @@ struct v2f { vec2 uv0; vec2 uv1; }; -varying vec4 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform sampler2D _MainTex; -uniform sampler2D _Detail; uniform vec4 _Color; +uniform sampler2D _Detail; +uniform sampler2D _MainTex; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt index 269e6c9f5..23d11bb0b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt @@ -1,10 +1,12 @@ -varying vec4 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform sampler2D _MainTex; -uniform sampler2D _Detail; uniform vec4 _Color; +uniform sampler2D _Detail; +uniform sampler2D _MainTex; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; void main () { gl_FragData[0] = (((_Color * texture2D (_MainTex, xlv_TEXCOORD0.xy)) * texture2D (_Detail, xlv_TEXCOORD1.xy)) * 2.0); } + +// inputs: 2, stats: 3 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt index 25a3c200a..9aaac3e16 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt @@ -4,3 +4,5 @@ void main () gl_FragDepth = 0.9; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt index cd710f294..516fdf733 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt @@ -5,3 +5,5 @@ void main () gl_FragDepthEXT = 0.9; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt index 0197ab03b..563b8040f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-ir.txt @@ -1,6 +1,6 @@ #version 120 -uniform mat4x3 nonSqMat; uniform float inInit = 13.0; +uniform mat4x3 nonSqMat; void main () { float arr_1[4]; diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt index 322ee8fb4..622853356 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt @@ -1,6 +1,6 @@ #version 120 -uniform mat4x3 nonSqMat; uniform float inInit = 13.0; +uniform mat4x3 nonSqMat; void main () { vec4 v_1; @@ -11,3 +11,5 @@ void main () gl_FragColor = v_1; } + +// inputs: 0, stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt index 4b17b9c50..04b1d20ba 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-ir.txt @@ -1,6 +1,6 @@ #version 140 -out vec4 fragCol; in vec4 col; +out vec4 fragCol; void main () { vec4 tmpvar_1; diff --git a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt index d8e963f8d..dea2ad18e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt @@ -1,8 +1,10 @@ #version 140 -out vec4 fragCol; in vec4 col; +out vec4 fragCol; void main () { fragCol = col; } + +// inputs: 1, stats: 0 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt index 4817d90d6..1a689316b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt @@ -15,9 +15,9 @@ varying highp vec4 xlv_COLOR; void main() { mediump vec4 xl_retval; v2f xlt_i; - xlt_i.pos = highp vec4(0.0); - xlt_i.uv = highp vec2( xlv_TEXCOORD0); - xlt_i.color = highp vec4( xlv_COLOR); + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2( xlv_TEXCOORD0); + xlt_i.color = vec4( xlv_COLOR); xl_retval = xlat_main( xlt_i); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt index be574875c..b7df0cea9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-irES.txt @@ -3,8 +3,8 @@ struct v2f { highp vec2 uv; highp vec4 color; }; -varying highp vec4 xlv_COLOR; varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR; mediump vec4 xlat_main ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt index e922e7839..3b3bc07ab 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 2, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt index 9e7a1640d..0fd194113 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt @@ -1,5 +1,5 @@ -varying highp vec4 xlv_COLOR; varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR; void main () { mediump vec4 c_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 2, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt index 11e133519..da759bf62 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt @@ -9,6 +9,6 @@ varying highp vec2 xlv_TEXCOORD0; varying highp vec4 xlv_COLOR; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp vec2(xlv_TEXCOORD0), highp vec4(xlv_COLOR)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( vec2(xlv_TEXCOORD0), vec4(xlv_COLOR)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt index e4e250fa9..80247c0ba 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-irES.txt @@ -1,5 +1,5 @@ -varying highp vec4 xlv_COLOR; varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR; mediump vec4 xlat_main ( in highp vec2 uv_1, in highp vec4 color_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt index 9e7a1640d..0fd194113 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt @@ -1,5 +1,5 @@ -varying highp vec4 xlv_COLOR; varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR; void main () { mediump vec4 c_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 2, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt index 2462470cf..aa6db2102 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt @@ -72,6 +72,6 @@ mediump vec4 xlat_main( in highp vec4 uv ) { varying highp vec4 xlv_TEXCOORD0; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp vec4(xlv_TEXCOORD0)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt index db3545934..f3a0f5ad1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt @@ -95,10 +95,20 @@ void main () tmpvar_22.z = tmpvar_20; tmpvar_22.w = tmpvar_21; c_1 = (c_1 + tmpvar_22); - c_1.x = (c_1.x + (xlv_TEXCOORD0.x - float(int(xlv_TEXCOORD0.x)))); - c_1.xy = (c_1.xy + (xlv_TEXCOORD0.xy - vec2(ivec2(xlv_TEXCOORD0.xy)))); - c_1.xyz = (c_1.xyz + (xlv_TEXCOORD0.xyz - vec3(ivec3(xlv_TEXCOORD0.xyz)))); - c_1 = (c_1 + (xlv_TEXCOORD0 - vec4(ivec4(xlv_TEXCOORD0)))); + c_1.x = (c_1.x + (xlv_TEXCOORD0.x - float( + int(xlv_TEXCOORD0.x) + ))); + c_1.xy = (c_1.xy + (xlv_TEXCOORD0.xy - vec2( + ivec2(xlv_TEXCOORD0.xy) + ))); + c_1.xyz = (c_1.xyz + (xlv_TEXCOORD0.xyz - vec3( + ivec3(xlv_TEXCOORD0.xyz) + ))); + c_1 = (c_1 + (xlv_TEXCOORD0 - vec4( + ivec4(xlv_TEXCOORD0) + ))); gl_FragData[0] = c_1; } + +// inputs: 1, stats: 56 alu 0 tex 10 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt index ed5cd9407..8caecaf75 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt @@ -126,3 +126,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 1, stats: 56 alu 0 tex 10 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt index c1e60564a..603833e99 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-for-irES.txt @@ -2,10 +2,10 @@ struct v2f { highp vec2 uv; highp vec3 nl; }; -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; lowp vec4 xlat_main ( in v2f i_1 ) @@ -29,7 +29,9 @@ lowp vec4 xlat_main ( break; }; highp vec3 tmpvar_9; - tmpvar_9 = (light_2 + ((col_3.xyz * i_1.nl[j_4]) * _TerrainTreeLightColors[j_4].xyz)); + tmpvar_9 = (light_2 + ((col_3.xyz * + i_1.nl[j_4] + ) * _TerrainTreeLightColors[j_4].xyz)); light_2 = tmpvar_9; int _post_incdec_tmp_10; _post_incdec_tmp_10 = j_4; diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt index 7496920f5..a787b8f7c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt @@ -1,7 +1,7 @@ -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; void main () { lowp vec4 tmpvar_1; @@ -24,3 +24,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 9 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt index aac196da7..d88e837d7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-irES.txt @@ -2,10 +2,10 @@ struct v2f { highp vec2 uv; highp vec3 nl; }; -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; lowp vec4 xlat_main ( in v2f i_1 ) @@ -32,7 +32,9 @@ lowp vec4 xlat_main ( break; }; highp vec3 tmpvar_9; - tmpvar_9 = (light_3 + ((col_4.xyz * i_1.nl[j_2]) * _TerrainTreeLightColors[j_2].xyz)); + tmpvar_9 = (light_3 + ((col_4.xyz * + i_1.nl[j_2] + ) * _TerrainTreeLightColors[j_2].xyz)); light_3 = tmpvar_9; int tmpvar_10; tmpvar_10 = (j_2 + 1); diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt index 26465c54f..033600352 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt @@ -1,7 +1,7 @@ -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; void main () { lowp vec4 tmpvar_1; @@ -27,3 +27,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 10 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt index 903b1aae3..d0476c77c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-irES.txt @@ -2,10 +2,10 @@ struct v2f { highp vec2 uv; highp vec3 nl; }; -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; lowp vec4 xlat_main ( in v2f i_1 ) @@ -32,7 +32,9 @@ lowp vec4 xlat_main ( break; }; highp vec3 tmpvar_9; - tmpvar_9 = (light_2 + ((col_3.xyz * i_1.nl[j_4]) * _TerrainTreeLightColors[j_4].xyz)); + tmpvar_9 = (light_2 + ((col_3.xyz * + i_1.nl[j_4] + ) * _TerrainTreeLightColors[j_4].xyz)); light_2 = tmpvar_9; int _post_incdec_tmp_10; _post_incdec_tmp_10 = j_4; diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt index 26465c54f..033600352 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt @@ -1,7 +1,7 @@ -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; void main () { lowp vec4 tmpvar_1; @@ -27,3 +27,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 10 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt index e56870605..df4f957c0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-irES.txt @@ -1,6 +1,6 @@ void main () { - mediump float f_1; + highp float f_1; int i_2; int tmpvar_3; tmpvar_3 = 0; @@ -12,16 +12,16 @@ void main () if (!((i_2 < 32))) { break; }; - mediump float tmpvar_5; + highp float tmpvar_5; tmpvar_5 = (f_1 + (gl_FragCoord.x * float(i_2))); f_1 = tmpvar_5; int tmpvar_6; tmpvar_6 = (i_2 + 1); i_2 = tmpvar_6; }; - mediump vec4 tmpvar_7; + highp vec4 tmpvar_7; tmpvar_7 = vec4(f_1); - mediump vec4 tmpvar_8; + highp vec4 tmpvar_8; tmpvar_8 = tmpvar_7; gl_FragColor = tmpvar_8; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt index 55e1d732f..7639e2698 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt @@ -1,13 +1,14 @@ void main () { - mediump float f_1; - int i_2; - i_2 = 0; + highp float f_1; f_1 = 0.0; - for (int i_2 = 0; i_2 < 32; ) { + for (int i_2 = 0; i_2 < 32; i_2++) { f_1 = (f_1 + (gl_FragCoord.x * float(i_2))); - i_2 = (i_2 + 1); }; - gl_FragColor = vec4(f_1); + highp vec4 tmpvar_3; + tmpvar_3 = vec4(f_1); + gl_FragColor = tmpvar_3; } + +// inputs: 1, stats: 7 alu 0 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt index 20a2ef647..8b124f39d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-irES.txt @@ -2,10 +2,10 @@ struct v2f { highp vec2 uv; highp vec3 nl; }; -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; lowp vec4 xlat_main ( in v2f i_1 ) @@ -33,7 +33,9 @@ lowp vec4 xlat_main ( break; }; highp vec3 tmpvar_11; - tmpvar_11 = (light_4 + ((col_5.xyz * i_1.nl[j_2]) * _TerrainTreeLightColors[j_2].xyz)); + tmpvar_11 = (light_4 + ((col_5.xyz * + i_1.nl[j_2] + ) * _TerrainTreeLightColors[j_2].xyz)); light_4 = tmpvar_11; int tmpvar_12; tmpvar_12 = (j_2 + 1); diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt index d8308f337..2d1b55a5a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt @@ -1,13 +1,12 @@ -varying highp vec3 xlv_nl; -varying highp vec2 xlv_uv; -uniform highp vec4 _TerrainTreeLightColors[4]; uniform sampler2D _MainTex; +uniform highp vec4 _TerrainTreeLightColors[4]; +varying highp vec2 xlv_uv; +varying highp vec3 xlv_nl; void main () { lowp vec4 tmpvar_1; highp vec3 tmpvar_2; tmpvar_2 = xlv_nl; - int j_3; int loopCount_4; mediump vec3 light_5; lowp vec4 col_6; @@ -16,15 +15,12 @@ void main () col_6 = tmpvar_7; light_5 = vec3(0.0, 0.0, 0.0); loopCount_4 = int((tmpvar_7.w * 10.0)); - j_3 = 0; - while (true) { - if ((j_3 >= loopCount_4)) { - break; - }; + for (int j_3; j_3 < loopCount_4; j_3++) { highp vec3 tmpvar_8; - tmpvar_8 = (light_5 + ((col_6.xyz * tmpvar_2[j_3]) * _TerrainTreeLightColors[j_3].xyz)); + tmpvar_8 = (light_5 + ((col_6.xyz * + tmpvar_2[j_3] + ) * _TerrainTreeLightColors[j_3].xyz)); light_5 = tmpvar_8; - j_3 = (j_3 + 1); }; mediump vec4 tmpvar_9; tmpvar_9.w = 1.0; @@ -33,3 +29,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 11 alu 1 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt new file mode 100644 index 000000000..c150f0535 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt @@ -0,0 +1,21 @@ +uniform sampler2D mainTex; +varying vec2 uv; + +void main() +{ + vec4 c = vec4(0.0); + + // various loop forms + for (int i = 0; i < 100; ++i) + c.x += texture2D (mainTex, uv + vec2(i,i)).r; + for (int i = 0; i <= 100; i += 3) + c.x += texture2D (mainTex, uv + vec2(i,i)).r; + for (int i = 100; i >= 0; --i) + c.x += texture2D (mainTex, uv + vec2(i,i)).r; + int n = int(c.x * 10.0); + for (int i = 3; i < n; ++i) + c.x += texture2D (mainTex, uv + vec2(i,i)).r; + for (int i = 1, j = 2; i < 100 && j < 50; i += 2, j += 3) + c.x += texture2D (mainTex, uv + vec2(i,j)).r; + gl_FragColor = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt new file mode 100644 index 000000000..f0c3d5125 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-ir.txt @@ -0,0 +1,124 @@ +uniform sampler2D mainTex; +varying vec2 uv; +void main () +{ + int j_1; + int i_2; + int i_3; + int n_4; + int i_5; + int i_6; + int i_7; + vec4 c_8; + vec4 tmpvar_9; + tmpvar_9 = vec4(0.0, 0.0, 0.0, 0.0); + c_8 = tmpvar_9; + int tmpvar_10; + tmpvar_10 = 0; + i_7 = tmpvar_10; + while (true) { + if (!((i_7 < 100))) { + break; + }; + vec2 tmpvar_11; + tmpvar_11.x = float(i_7); + tmpvar_11.y = float(i_7); + vec4 tmpvar_12; + tmpvar_12 = texture2D (mainTex, (uv + tmpvar_11)); + float tmpvar_13; + tmpvar_13 = (c_8.x + tmpvar_12.x); + c_8.x = tmpvar_13; + int tmpvar_14; + tmpvar_14 = (i_7 + 1); + i_7 = tmpvar_14; + }; + int tmpvar_15; + tmpvar_15 = 0; + i_6 = tmpvar_15; + while (true) { + if (!((i_6 <= 100))) { + break; + }; + vec2 tmpvar_16; + tmpvar_16.x = float(i_6); + tmpvar_16.y = float(i_6); + vec4 tmpvar_17; + tmpvar_17 = texture2D (mainTex, (uv + tmpvar_16)); + float tmpvar_18; + tmpvar_18 = (c_8.x + tmpvar_17.x); + c_8.x = tmpvar_18; + int tmpvar_19; + tmpvar_19 = (i_6 + 3); + i_6 = tmpvar_19; + }; + int tmpvar_20; + tmpvar_20 = 100; + i_5 = tmpvar_20; + while (true) { + if (!((i_5 >= 0))) { + break; + }; + vec2 tmpvar_21; + tmpvar_21.x = float(i_5); + tmpvar_21.y = float(i_5); + vec4 tmpvar_22; + tmpvar_22 = texture2D (mainTex, (uv + tmpvar_21)); + float tmpvar_23; + tmpvar_23 = (c_8.x + tmpvar_22.x); + c_8.x = tmpvar_23; + int tmpvar_24; + tmpvar_24 = (i_5 - 1); + i_5 = tmpvar_24; + }; + int tmpvar_25; + tmpvar_25 = int((c_8.x * 10.0)); + n_4 = tmpvar_25; + int tmpvar_26; + tmpvar_26 = 3; + i_3 = tmpvar_26; + while (true) { + if (!((i_3 < n_4))) { + break; + }; + vec2 tmpvar_27; + tmpvar_27.x = float(i_3); + tmpvar_27.y = float(i_3); + vec4 tmpvar_28; + tmpvar_28 = texture2D (mainTex, (uv + tmpvar_27)); + float tmpvar_29; + tmpvar_29 = (c_8.x + tmpvar_28.x); + c_8.x = tmpvar_29; + int tmpvar_30; + tmpvar_30 = (i_3 + 1); + i_3 = tmpvar_30; + }; + int tmpvar_31; + tmpvar_31 = 1; + i_2 = tmpvar_31; + int tmpvar_32; + tmpvar_32 = 2; + j_1 = tmpvar_32; + while (true) { + if (!(((i_2 < 100) && (j_1 < 50)))) { + break; + }; + vec2 tmpvar_33; + tmpvar_33.x = float(i_2); + tmpvar_33.y = float(j_1); + vec4 tmpvar_34; + tmpvar_34 = texture2D (mainTex, (uv + tmpvar_33)); + float tmpvar_35; + tmpvar_35 = (c_8.x + tmpvar_34.x); + c_8.x = tmpvar_35; + int tmpvar_36; + tmpvar_36 = (i_2 + 2); + i_2 = tmpvar_36; + int tmpvar_37; + tmpvar_37 = (j_1 + 3); + j_1 = tmpvar_37; + }; + vec4 tmpvar_38; + tmpvar_38 = c_8; + gl_FragColor = tmpvar_38; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt new file mode 100644 index 000000000..98c65ad0e --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt @@ -0,0 +1,47 @@ +uniform sampler2D mainTex; +varying vec2 uv; +void main () +{ + int j_1; + int i_2; + int n_4; + vec4 c_8; + c_8 = vec4(0.0, 0.0, 0.0, 0.0); + for (int i_7 = 0; i_7 < 100; i_7++) { + vec2 tmpvar_9; + tmpvar_9.x = float(i_7); + tmpvar_9.y = float(i_7); + c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_9)).x); + }; + for (int i_6 = 0; i_6 <= 100; i_6 += 3) { + vec2 tmpvar_10; + tmpvar_10.x = float(i_6); + tmpvar_10.y = float(i_6); + c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_10)).x); + }; + for (int i_5 = 100; i_5 >= 0; i_5 = (i_5 - 1)) { + vec2 tmpvar_11; + tmpvar_11.x = float(i_5); + tmpvar_11.y = float(i_5); + c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_11)).x); + }; + n_4 = int((c_8.x * 10.0)); + for (int i_3; i_3 < n_4; i_3++) { + vec2 tmpvar_12; + tmpvar_12.x = float(i_3); + tmpvar_12.y = float(i_3); + c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_12)).x); + }; + i_2 = 1; + j_1 = 2; + for (; ((i_2 < 100) && (j_1 < 50)); i_2 += 2, j_1 += 3) { + vec2 tmpvar_13; + tmpvar_13.x = float(i_2); + tmpvar_13.y = float(j_1); + c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_13)).x); + }; + gl_FragColor = c_8; +} + + +// inputs: 1, stats: 43 alu 5 tex 10 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt b/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt index b54d27d45..9f9e134f5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt @@ -18,3 +18,5 @@ void main () }; } + +// inputs: 0, stats: 7 alu 2 tex 3 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt index 1526ea490..70f13e362 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt @@ -4,3 +4,5 @@ void main () gl_FragColor = vec4(abs(var)); } + +// inputs: 1, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt index d3a3f9e4f..51aaecc0d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-ir.txt @@ -1,5 +1,5 @@ -uniform sampler2D tex; varying vec2 uv; +uniform sampler2D tex; void main () { vec4 v_1; diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt index 12780b6df..bfb04e2ee 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D tex; varying vec2 uv; +uniform sampler2D tex; void main () { vec4 v_1; @@ -11,3 +11,5 @@ void main () gl_FragColor = v_1; } + +// inputs: 1, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt index 71563d7a3..865ddec57 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt @@ -8,3 +8,5 @@ void main () gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5); } + +// inputs: 1, stats: 2 alu 1 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt index 8eb3bd8ea..ab5e3aace 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt @@ -3,3 +3,5 @@ void main () gl_FragColor = vec4((((gl_FragCoord.x * 2.0) + gl_FragCoord.x) + (gl_FragCoord.x * 4.0))); } + +// inputs: 1, stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt index 8c6cc4992..d53e69fd2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt @@ -3,3 +3,5 @@ void main () gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt index da3f43bb4..97e3f2b1e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-irES.txt @@ -1,6 +1,6 @@ -uniform mediump float specPower; -varying lowp vec3 halfDir; varying lowp vec3 normal; +varying lowp vec3 halfDir; +uniform mediump float specPower; void main () { lowp vec4 c_1; diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt index 45c2a2736..35c09b895 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt @@ -1,6 +1,6 @@ -uniform mediump float specPower; -varying lowp vec3 halfDir; varying lowp vec3 normal; +varying lowp vec3 halfDir; +uniform mediump float specPower; void main () { lowp vec4 c_1; @@ -12,3 +12,5 @@ void main () gl_FragColor = c_1; } + +// inputs: 2, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt new file mode 100644 index 000000000..2b9351049 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt @@ -0,0 +1,11 @@ +void main() { + vec4 c = vec4(0.0); + + // nested ifs + if (gl_FragCoord.x > 0.5) { + if (gl_FragCoord.y > 0.5) { + c = vec4(0.5); + } + } + gl_FragColor = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt new file mode 100644 index 000000000..274569d79 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-ir.txt @@ -0,0 +1,18 @@ +void main () +{ + vec4 c_1; + vec4 tmpvar_2; + tmpvar_2 = vec4(0.0, 0.0, 0.0, 0.0); + c_1 = tmpvar_2; + if ((gl_FragCoord.x > 0.5)) { + if ((gl_FragCoord.y > 0.5)) { + vec4 tmpvar_3; + tmpvar_3 = vec4(0.5, 0.5, 0.5, 0.5); + c_1 = tmpvar_3; + }; + }; + vec4 tmpvar_4; + tmpvar_4 = c_1; + gl_FragColor = tmpvar_4; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt new file mode 100644 index 000000000..19cad2477 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt @@ -0,0 +1,12 @@ +void main () +{ + vec4 c_1; + c_1 = vec4(0.0, 0.0, 0.0, 0.0); + if (((gl_FragCoord.x > 0.5) && (gl_FragCoord.y > 0.5))) { + c_1 = vec4(0.5, 0.5, 0.5, 0.5); + }; + gl_FragColor = c_1; +} + + +// inputs: 1, stats: 5 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt index 8c6cc4992..d53e69fd2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt @@ -3,3 +3,5 @@ void main () gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt index c42f73e58..cf5c2881d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt @@ -15,3 +15,5 @@ void main () gl_FragColor = tmpvar_3; } + +// inputs: 1, stats: 5 alu 1 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt index 1f3e4a54f..2c896f3d2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt @@ -2,27 +2,22 @@ varying lowp float xx; void main () { lowp float c_1; - int i_2; int tmpvar_3; if ((xx > 0.5)) { tmpvar_3 = 2; } else { tmpvar_3 = 4; }; - i_2 = tmpvar_3; if ((tmpvar_3 < 2)) { discard; }; c_1 = 0.0; - while (true) { - if ((i_2 >= 4)) { - break; - }; - c_1 = (c_1 + xx); - i_2 = (i_2 + 1); + for (int i_2 = tmpvar_3; i_2 < 4; i_2++, c_1 = (c_1 + xx)) { }; lowp vec4 tmpvar_4; tmpvar_4 = vec4(c_1); gl_FragColor = tmpvar_4; } + +// inputs: 1, stats: 8 alu 1 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt index cc19ff469..e96ff95e6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt @@ -13,3 +13,5 @@ void main () gl_FragColor = tmpvar_2; } + +// inputs: 1, stats: 4 alu 1 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt index a87465638..2cbd19398 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt @@ -6,3 +6,5 @@ void main () gl_FragColor = tmpvar_1; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt new file mode 100644 index 000000000..ff6b005de --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt @@ -0,0 +1,14 @@ +uniform sampler2D maintex; +uniform float factor; +varying vec2 uv; +void main() +{ + vec4 c = texture2D (maintex, uv); + vec2 coord = c.xy; + bool cond = c.w >= 0.5; + if (!cond) + coord.x += factor; + if (cond) + coord.y += factor; + gl_FragColor = vec4(coord,0,0); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt new file mode 100644 index 000000000..fabffa72a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-ir.txt @@ -0,0 +1,37 @@ +uniform sampler2D maintex; +uniform float factor; +varying vec2 uv; +void main () +{ + bool cond_1; + vec2 coord_2; + vec4 c_3; + vec4 tmpvar_4; + tmpvar_4 = texture2D (maintex, uv); + vec4 tmpvar_5; + tmpvar_5 = tmpvar_4; + c_3 = tmpvar_5; + vec2 tmpvar_6; + tmpvar_6 = c_3.xy; + coord_2 = tmpvar_6; + bool tmpvar_7; + tmpvar_7 = (c_3.w >= 0.5); + cond_1 = tmpvar_7; + if (!(cond_1)) { + float tmpvar_8; + tmpvar_8 = (coord_2.x + factor); + coord_2.x = tmpvar_8; + }; + if (cond_1) { + float tmpvar_9; + tmpvar_9 = (coord_2.y + factor); + coord_2.y = vec2(tmpvar_9).y; + }; + vec4 tmpvar_10; + tmpvar_10.zw = vec2(0.0, 0.0); + tmpvar_10.xy = coord_2.xy; + vec4 tmpvar_11; + tmpvar_11 = tmpvar_10; + gl_FragColor = tmpvar_11; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt new file mode 100644 index 000000000..b408f934f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt @@ -0,0 +1,25 @@ +uniform sampler2D maintex; +uniform float factor; +varying vec2 uv; +void main () +{ + vec2 coord_1; + vec4 tmpvar_2; + tmpvar_2 = texture2D (maintex, uv); + coord_1 = tmpvar_2.xy; + bool tmpvar_3; + tmpvar_3 = (tmpvar_2.w >= 0.5); + if (!(tmpvar_3)) { + coord_1.x = (tmpvar_2.x + factor); + }; + if (tmpvar_3) { + coord_1.y = (tmpvar_2.y + factor); + }; + vec4 tmpvar_4; + tmpvar_4.zw = vec2(0.0, 0.0); + tmpvar_4.xy = coord_1; + gl_FragColor = tmpvar_4; +} + + +// inputs: 1, stats: 5 alu 1 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt new file mode 100644 index 000000000..7adaba4b5 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt @@ -0,0 +1,14 @@ +uniform sampler2D maintex; +uniform float factor; +varying vec2 uv; +void main() { + vec4 c = texture2D(maintex, uv); + vec4 r; + // when these become vectorized, they need to turn scalar + // arguments into proper types as well + r.x = max(0.123, c.x); + r.y = max(0.123, c.y); + r.z = min(c.z, factor); + r.w = min(c.w, factor); + gl_FragColor = r; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt new file mode 100644 index 000000000..5c6ce1912 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-ir.txt @@ -0,0 +1,37 @@ +uniform sampler2D maintex; +uniform float factor; +varying vec2 uv; +void main () +{ + vec4 r_1; + vec4 c_2; + vec4 tmpvar_3; + tmpvar_3 = texture2D (maintex, uv); + vec4 tmpvar_4; + tmpvar_4 = tmpvar_3; + c_2 = tmpvar_4; + float tmpvar_5; + tmpvar_5 = max (0.123, c_2.x); + float tmpvar_6; + tmpvar_6 = tmpvar_5; + r_1.x = tmpvar_6; + float tmpvar_7; + tmpvar_7 = max (0.123, c_2.y); + float tmpvar_8; + tmpvar_8 = tmpvar_7; + r_1.y = vec2(tmpvar_8).y; + float tmpvar_9; + tmpvar_9 = min (c_2.z, factor); + float tmpvar_10; + tmpvar_10 = tmpvar_9; + r_1.z = vec3(tmpvar_10).z; + float tmpvar_11; + tmpvar_11 = min (c_2.w, factor); + float tmpvar_12; + tmpvar_12 = tmpvar_11; + r_1.w = vec4(tmpvar_12).w; + vec4 tmpvar_13; + tmpvar_13 = r_1; + gl_FragColor = tmpvar_13; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt new file mode 100644 index 000000000..d898f49f1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt @@ -0,0 +1,15 @@ +uniform sampler2D maintex; +uniform float factor; +varying vec2 uv; +void main () +{ + vec4 r_1; + vec4 tmpvar_2; + tmpvar_2 = texture2D (maintex, uv); + r_1.xy = max (vec2(0.123, 0.123), tmpvar_2.xy); + r_1.zw = min (tmpvar_2.zw, vec2(factor)); + gl_FragColor = r_1; +} + + +// inputs: 1, stats: 2 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt index c41789ad6..486073c7c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt index 7a122cfd4..fc873606c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt @@ -1,6 +1,12 @@ precision highp float; precision lowp int; +struct MyStruct { + float f; + int i; +}; +uniform MyStruct s1; + uniform float fh1; uniform highp float fh2; uniform mediump float fm; @@ -11,7 +17,7 @@ uniform mediump int im; void main() { - lowp float f = fh1 + fh2 + fm; - highp int i = il1 + il2 + im; + lowp float f = fh1 + fh2 + fm + s1.f; + highp int i = il1 + il2 + im + s1.i; gl_FragColor = vec4(f, i, 0.0, 0.0); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt index 434cf79e7..e93b8927f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-default-irES.txt @@ -1,20 +1,25 @@ precision lowp int; precision highp float; -uniform int im; -uniform int il2; -uniform int il1; -uniform mediump float fm; -uniform highp float fh2; +struct MyStruct { + float f; + int i; +}; +uniform MyStruct s1; uniform float fh1; +uniform highp float fh2; +uniform mediump float fm; +uniform int il1; +uniform int il2; +uniform int im; void main () { int i_1; lowp float f_2; highp float tmpvar_3; - tmpvar_3 = ((fh1 + fh2) + fm); + tmpvar_3 = (((fh1 + fh2) + fm) + s1.f); f_2 = tmpvar_3; int tmpvar_4; - tmpvar_4 = ((il1 + il2) + im); + tmpvar_4 = (((il1 + il2) + im) + s1.i); i_1 = tmpvar_4; highp vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt index d9529c739..d4527c299 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt @@ -1,20 +1,25 @@ precision lowp int; precision highp float; -uniform int im; -uniform int il2; -uniform int il1; -uniform mediump float fm; -uniform highp float fh2; +struct MyStruct { + float f; + int i; +}; +uniform MyStruct s1; uniform float fh1; +uniform highp float fh2; +uniform mediump float fm; +uniform int il1; +uniform int il2; +uniform int im; void main () { int i_1; lowp float f_2; highp float tmpvar_3; - tmpvar_3 = ((fh1 + fh2) + fm); + tmpvar_3 = (((fh1 + fh2) + fm) + s1.f); f_2 = tmpvar_3; int tmpvar_4; - tmpvar_4 = ((il1 + il2) + im); + tmpvar_4 = (((il1 + il2) + im) + s1.i); i_1 = tmpvar_4; highp vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); @@ -23,3 +28,5 @@ void main () gl_FragColor = tmpvar_5; } + +// inputs: 0, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt index 4f1acc8d1..c2dd417bb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-irES.txt @@ -1,8 +1,8 @@ -varying mediump vec2 xlv_TEXCOORD0; -uniform mediump float _EmberFadeStart; -uniform mediump float _EmberFadeEnd; -uniform sampler2D _BurntTex; uniform sampler2D _MainTex; +uniform sampler2D _BurntTex; +uniform mediump float _EmberFadeEnd; +uniform mediump float _EmberFadeStart; +varying mediump vec2 xlv_TEXCOORD0; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt index cc261932f..3e98ac2a4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt @@ -1,8 +1,8 @@ -varying mediump vec2 xlv_TEXCOORD0; -uniform mediump float _EmberFadeStart; -uniform mediump float _EmberFadeEnd; -uniform sampler2D _BurntTex; uniform sampler2D _MainTex; +uniform sampler2D _BurntTex; +uniform mediump float _EmberFadeEnd; +uniform mediump float _EmberFadeStart; +varying mediump vec2 xlv_TEXCOORD0; void main () { lowp float t_1; @@ -15,3 +15,5 @@ void main () gl_FragColor = tmpvar_3; } + +// inputs: 1, stats: 6 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt index d4550c8b3..3c57b69de 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-irES.txt @@ -1,8 +1,8 @@ -varying mediump vec2 xlv_TEXCOORD0; -uniform mediump float _EmberFadeStart; -uniform mediump float _EmberFadeEnd; -uniform sampler2D _BurntTex; uniform sampler2D _MainTex; +uniform sampler2D _BurntTex; +uniform mediump float _EmberFadeEnd; +uniform mediump float _EmberFadeStart; +varying mediump vec2 xlv_TEXCOORD0; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt index 52c57e8e1..f6f0c7679 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt @@ -1,8 +1,8 @@ -varying mediump vec2 xlv_TEXCOORD0; -uniform mediump float _EmberFadeStart; -uniform mediump float _EmberFadeEnd; -uniform sampler2D _BurntTex; uniform sampler2D _MainTex; +uniform sampler2D _BurntTex; +uniform mediump float _EmberFadeEnd; +uniform mediump float _EmberFadeStart; +varying mediump vec2 xlv_TEXCOORD0; void main () { lowp vec3 t_1; @@ -15,3 +15,5 @@ void main () gl_FragColor = tmpvar_3; } + +// inputs: 1, stats: 6 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt index d5a7f5db6..732b20ed7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-irES.txt @@ -5,14 +5,14 @@ struct v2f_surf { lowp vec3 lightDir; lowp vec3 vlight; }; -varying lowp vec3 xlv_TEXCOORD3; -varying lowp vec3 xlv_TEXCOORD2; -varying lowp vec3 xlv_TEXCOORD1; -varying lowp vec2 xlv_TEXCOORD0; -uniform lowp float _Shininess; -uniform sampler2D _MainTex; -uniform lowp vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform lowp vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform lowp float _Shininess; +varying lowp vec2 xlv_TEXCOORD0; +varying lowp vec3 xlv_TEXCOORD1; +varying lowp vec3 xlv_TEXCOORD2; +varying lowp vec3 xlv_TEXCOORD3; lowp vec4 frag_surf ( in v2f_surf IN_1 ) @@ -55,7 +55,9 @@ lowp vec4 frag_surf ( lowp vec3 tmpvar_20; tmpvar_20 = tex_7.xyz; lowp vec3 tmpvar_21; - tmpvar_21 = ((tmpvar_20 * ((_LightColor0.xyz * diff_5) + IN_1.vlight)) + (_LightColor0.xyz * spec_3)); + tmpvar_21 = ((tmpvar_20 * ( + (_LightColor0.xyz * diff_5) + + IN_1.vlight)) + (_LightColor0.xyz * spec_3)); c_2.xyz = tmpvar_21.xyz.xyz; float tmpvar_22; tmpvar_22 = 0.0; diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt index 06c5a0e31..c4523b7a4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt @@ -1,11 +1,11 @@ -varying lowp vec3 xlv_TEXCOORD3; -varying lowp vec3 xlv_TEXCOORD2; -varying lowp vec3 xlv_TEXCOORD1; -varying lowp vec2 xlv_TEXCOORD0; -uniform lowp float _Shininess; -uniform sampler2D _MainTex; -uniform lowp vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform lowp vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform lowp float _Shininess; +varying lowp vec2 xlv_TEXCOORD0; +varying lowp vec3 xlv_TEXCOORD1; +varying lowp vec3 xlv_TEXCOORD2; +varying lowp vec3 xlv_TEXCOORD3; void main () { lowp vec4 c_1; @@ -13,8 +13,14 @@ void main () tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0); lowp vec3 tmpvar_3; tmpvar_3 = ((texture2D (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0); - c_1.xyz = ((tmpvar_2.xyz * ((_LightColor0.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + xlv_TEXCOORD3)) + (_LightColor0.xyz * (pow (max (0.0, dot (tmpvar_3, xlv_TEXCOORD1)), _Shininess) * tmpvar_2.w))); + c_1.xyz = ((tmpvar_2.xyz * ( + (_LightColor0.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + + xlv_TEXCOORD3)) + (_LightColor0.xyz * ( + pow (max (0.0, dot (tmpvar_3, xlv_TEXCOORD1)), _Shininess) + * tmpvar_2.w))); c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 4, stats: 14 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt index 1696073f5..d0b66a2ac 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-irES.txt @@ -1,8 +1,8 @@ -varying mediump vec2 var_mediump; -varying lowp vec2 var_lowp; -uniform highp sampler2D tex_highp; -uniform sampler2D tex_lowp; uniform sampler2D tex_def; +uniform sampler2D tex_lowp; +uniform highp sampler2D tex_highp; +varying lowp vec2 var_lowp; +varying mediump vec2 var_mediump; void main () { lowp vec4 a1_1; @@ -36,7 +36,9 @@ void main () tmpvar_15 = tmpvar_14; a1_1 = tmpvar_15; lowp vec4 tmpvar_16; - tmpvar_16 = ((((c1_5 + c2_4) + c3_3) + c4_2) + a1_1); + tmpvar_16 = ((( + (c1_5 + c2_4) + + c3_3) + c4_2) + a1_1); gl_FragColor = tmpvar_16; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt index 360c7b9f8..f2da020aa 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt @@ -1,8 +1,8 @@ -varying mediump vec2 var_mediump; -varying lowp vec2 var_lowp; -uniform highp sampler2D tex_highp; -uniform sampler2D tex_lowp; uniform sampler2D tex_def; +uniform sampler2D tex_lowp; +uniform highp sampler2D tex_highp; +varying lowp vec2 var_lowp; +varying mediump vec2 var_mediump; void main () { lowp vec4 c3_1; @@ -12,7 +12,11 @@ void main () tmpvar_3 = (tmpvar_2 * 2.0); c3_1 = tmpvar_3; lowp vec4 tmpvar_4; - tmpvar_4 = (((((texture2D (tex_def, var_lowp) * 2.0) + (texture2D (tex_def, var_mediump) * 2.0)) + c3_1) + (texture2D (tex_lowp, var_mediump) * 2.0)) + abs(var_lowp.xxxx)); + tmpvar_4 = ((( + ((texture2D (tex_def, var_lowp) * 2.0) + (texture2D (tex_def, var_mediump) * 2.0)) + + c3_1) + (texture2D (tex_lowp, var_mediump) * 2.0)) + abs(var_lowp.xxxx)); gl_FragColor = tmpvar_4; } + +// inputs: 2, stats: 9 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt index 8b2b1da6c..c26a04452 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-irES.txt @@ -1,6 +1,6 @@ -uniform lowp float low_c; -uniform mediump float med_b; uniform mediump float med_a; +uniform mediump float med_b; +uniform lowp float low_c; void main () { lowp vec4 c_1; diff --git a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt index 839155c52..6ef22f5f8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt @@ -1,6 +1,6 @@ -uniform lowp float low_c; -uniform mediump float med_b; uniform mediump float med_a; +uniform mediump float med_b; +uniform lowp float low_c; void main () { lowp float t_1; @@ -12,3 +12,5 @@ void main () gl_FragColor = tmpvar_3; } + +// inputs: 0, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt new file mode 100644 index 000000000..111dcc773 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt @@ -0,0 +1,13 @@ +#version 300 es +precision mediump float; + +layout(location=0) out vec4 final_color0; +layout(location=1) out vec4 final_color1; +layout(location=2) out vec4 final_color2; + +void main() +{ + final_color0 = vec4(1,0,0,1); + final_color1 = vec4(0,1,0,1); + final_color2 = vec4(0,0,1,1); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt new file mode 100644 index 000000000..7d84a6f40 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-irES3.txt @@ -0,0 +1,18 @@ +#version 300 es +precision mediump float; +layout(location=0) out vec4 final_color0; +layout(location=1) out vec4 final_color1; +layout(location=2) out vec4 final_color2; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = vec4(1.0, 0.0, 0.0, 1.0); + final_color0 = tmpvar_1; + vec4 tmpvar_2; + tmpvar_2 = vec4(0.0, 1.0, 0.0, 1.0); + final_color1 = tmpvar_2; + vec4 tmpvar_3; + tmpvar_3 = vec4(0.0, 0.0, 1.0, 1.0); + final_color2 = tmpvar_3; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt new file mode 100644 index 000000000..40cf3b32e --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt @@ -0,0 +1,14 @@ +#version 300 es +precision mediump float; +layout(location=0) out vec4 final_color0; +layout(location=1) out vec4 final_color1; +layout(location=2) out vec4 final_color2; +void main () +{ + final_color0 = vec4(1.0, 0.0, 0.0, 1.0); + final_color1 = vec4(0.0, 1.0, 0.0, 1.0); + final_color2 = vec4(0.0, 0.0, 1.0, 1.0); +} + + +// inputs: 0, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt index b5a14395f..0ea51b88c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-irES.txt @@ -1,10 +1,10 @@ -varying highp vec4 varUV; -uniform highp samplerCube cubehigh; -uniform mediump samplerCube cubemed; -uniform samplerCube cubelow; -uniform highp sampler2D texhigh; -uniform mediump sampler2D texmed; uniform sampler2D texlow; +uniform mediump sampler2D texmed; +uniform highp sampler2D texhigh; +uniform samplerCube cubelow; +uniform mediump samplerCube cubemed; +uniform highp samplerCube cubehigh; +varying highp vec4 varUV; mediump vec4 xlat_main ( in highp vec4 uv_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt index 0e35d3f89..80e341bda 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt @@ -1,10 +1,10 @@ -varying highp vec4 varUV; -uniform highp samplerCube cubehigh; -uniform mediump samplerCube cubemed; -uniform samplerCube cubelow; -uniform highp sampler2D texhigh; -uniform mediump sampler2D texmed; uniform sampler2D texlow; +uniform mediump sampler2D texmed; +uniform highp sampler2D texhigh; +uniform samplerCube cubelow; +uniform mediump samplerCube cubemed; +uniform highp samplerCube cubehigh; +varying highp vec4 varUV; void main () { mediump vec4 c_1; @@ -34,3 +34,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 1, stats: 5 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt b/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt index 2c606a55b..adae965e8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt @@ -4,3 +4,5 @@ void main () gl_FragColor = vec4((inFloat * 4.36e-06)); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt index 78deab76f..03b6487fc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt @@ -3,3 +3,5 @@ void main () gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt new file mode 100644 index 000000000..19c2ff727 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt @@ -0,0 +1,78 @@ +// From https://gitorious.org/wikibooks-opengl/modern-tutorials/source/mini-portal/phong-shading.f.glsl + +/** +* This file is in the public domain. +* Contributors: Martin Kraus, Sylvain Beucler +*/ +varying vec4 position; // position of the vertex (and fragment) in world space +varying vec3 varyingNormalDirection; // surface normal vector in world space +uniform mat4 m, v, p; +uniform mat4 v_inv; + +struct lightSource +{ + vec4 position; + vec4 diffuse; + vec4 specular; + float invLinearAttenuation; + float spotCutoff, spotExponent; + vec3 spotDirection; +}; +lightSource light0 = lightSource( + vec4(0.0, 3.0, 0.0, 1.0), + vec4(1.0, 1.0, 1.0, 1.0), + vec4(1.0, 1.0, 1.0, 1.0), + 2.0, + 180.0, 0.0, + vec3(0.0, 0.0, 0.0) +); +vec4 scene_ambient = vec4(0.2, 0.2, 0.2, 1.0); + +struct material +{ + vec4 ambient; + vec4 diffuse; + vec4 specular; + float shininess; +}; +material frontMaterial = material( + vec4(0.2, 0.2, 0.2, 1.0), + vec4(1.0, 0.8, 0.8, 1.0), + vec4(1.0, 1.0, 1.0, 1.0), + 5.0 +); + +void main() +{ + vec3 normalDirection = normalize(varyingNormalDirection); + vec3 viewDirection = normalize(vec3(v_inv * vec4(0.0, 0.0, 0.0, 1.0) - position)); + vec3 lightDirection; + float attenuation; + + // initialize total lighting with ambient lighting + vec3 totalLighting = vec3(scene_ambient) * vec3(frontMaterial.ambient); + + vec3 positionToLightSource = vec3(light0.position - position); + float distanceSqr = dot(positionToLightSource, positionToLightSource); + lightDirection = inversesqrt(distanceSqr) * positionToLightSource; + attenuation = light0.invLinearAttenuation * inversesqrt(distanceSqr); + + vec3 diffuseReflection = attenuation + * vec3(light0.diffuse) * vec3(frontMaterial.diffuse) + * max(0.0, dot(normalDirection, lightDirection)); + + vec3 specularReflection; + if (dot(normalDirection, lightDirection) < 0.0) // light source on the wrong side? + { + specularReflection = vec3(0.0, 0.0, 0.0); // no specular reflection + } + else // light source on the right side + { + specularReflection = attenuation * vec3(light0.specular) * vec3(frontMaterial.specular) + * pow(max(0.0, dot(reflect(-lightDirection, normalDirection), viewDirection)), frontMaterial.shininess); + } + + totalLighting = totalLighting + diffuseReflection + specularReflection; + + gl_FragColor = vec4(totalLighting, 1.0); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt new file mode 100644 index 000000000..efb0a2413 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-ir.txt @@ -0,0 +1,134 @@ +struct lightSource { + vec4 position; + vec4 diffuse; + vec4 specular; + float invLinearAttenuation; + float spotCutoff; + float spotExponent; + vec3 spotDirection; +}; +struct material { + vec4 ambient; + vec4 diffuse; + vec4 specular; + float shininess; +}; +material tmpvar_1; +vec4 tmpvar_2; +lightSource tmpvar_3; +varying vec4 position; +varying vec3 varyingNormalDirection; +uniform mat4 m; +uniform mat4 v; +uniform mat4 p; +uniform mat4 v_inv; +lightSource light0; +vec4 scene_ambient; +material frontMaterial; +//; +//; +//; +//; +//; +//; +void main () +{ +tmpvar_3 = lightSource(vec4(0.0, 3.0, 0.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0), 2.0, 180.0, 0.0, vec3(0.0, 0.0, 0.0)); +light0 = tmpvar_3; +tmpvar_2 = vec4(0.2, 0.2, 0.2, 1.0); +scene_ambient = tmpvar_2; +tmpvar_1 = material(vec4(0.2, 0.2, 0.2, 1.0), vec4(1.0, 0.8, 0.8, 1.0), vec4(1.0, 1.0, 1.0, 1.0), 5.0); +frontMaterial = tmpvar_1; + vec3 specularReflection_4; + vec3 diffuseReflection_5; + float distanceSqr_6; + vec3 positionToLightSource_7; + vec3 totalLighting_8; + float attenuation_9; + vec3 lightDirection_10; + vec3 viewDirection_11; + vec3 normalDirection_12; + vec3 tmpvar_13; + tmpvar_13 = normalize (varyingNormalDirection); + vec3 tmpvar_14; + tmpvar_14 = tmpvar_13; + normalDirection_12 = tmpvar_14; + vec3 tmpvar_15; + tmpvar_15 = ((v_inv * vec4(0.0, 0.0, 0.0, 1.0)) - position).xyz; + vec3 tmpvar_16; + tmpvar_16 = normalize (tmpvar_15); + vec3 tmpvar_17; + tmpvar_17 = tmpvar_16; + viewDirection_11 = tmpvar_17; + vec3 tmpvar_18; + tmpvar_18 = scene_ambient.xyz; + vec3 tmpvar_19; + tmpvar_19 = frontMaterial.ambient.xyz; + vec3 tmpvar_20; + tmpvar_20 = (tmpvar_18 * tmpvar_19); + totalLighting_8 = tmpvar_20; + vec3 tmpvar_21; + tmpvar_21 = (light0.position - position).xyz; + vec3 tmpvar_22; + tmpvar_22 = tmpvar_21; + positionToLightSource_7 = tmpvar_22; + float tmpvar_23; + tmpvar_23 = dot (positionToLightSource_7, positionToLightSource_7); + float tmpvar_24; + tmpvar_24 = tmpvar_23; + distanceSqr_6 = tmpvar_24; + float tmpvar_25; + tmpvar_25 = inversesqrt (distanceSqr_6); + vec3 tmpvar_26; + tmpvar_26 = (tmpvar_25 * positionToLightSource_7); + lightDirection_10 = tmpvar_26; + float tmpvar_27; + tmpvar_27 = inversesqrt (distanceSqr_6); + float tmpvar_28; + tmpvar_28 = (light0.invLinearAttenuation * tmpvar_27); + attenuation_9 = tmpvar_28; + vec3 tmpvar_29; + tmpvar_29 = light0.diffuse.xyz; + vec3 tmpvar_30; + tmpvar_30 = frontMaterial.diffuse.xyz; + float tmpvar_31; + tmpvar_31 = dot (normalDirection_12, lightDirection_10); + float tmpvar_32; + tmpvar_32 = max (0.0, tmpvar_31); + vec3 tmpvar_33; + tmpvar_33 = (((attenuation_9 * tmpvar_29) * tmpvar_30) * tmpvar_32); + diffuseReflection_5 = tmpvar_33; + float tmpvar_34; + tmpvar_34 = dot (normalDirection_12, lightDirection_10); + if ((tmpvar_34 < 0.0)) { + vec3 tmpvar_35; + tmpvar_35 = vec3(0.0, 0.0, 0.0); + specularReflection_4 = tmpvar_35; + } else { + vec3 tmpvar_36; + tmpvar_36 = light0.specular.xyz; + vec3 tmpvar_37; + tmpvar_37 = frontMaterial.specular.xyz; + vec3 tmpvar_38; + tmpvar_38 = reflect (-(lightDirection_10), normalDirection_12); + float tmpvar_39; + tmpvar_39 = dot (tmpvar_38, viewDirection_11); + float tmpvar_40; + tmpvar_40 = max (0.0, tmpvar_39); + float tmpvar_41; + tmpvar_41 = pow (tmpvar_40, frontMaterial.shininess); + vec3 tmpvar_42; + tmpvar_42 = (((attenuation_9 * tmpvar_36) * tmpvar_37) * tmpvar_41); + specularReflection_4 = tmpvar_42; + }; + vec3 tmpvar_43; + tmpvar_43 = ((totalLighting_8 + diffuseReflection_5) + specularReflection_4); + totalLighting_8 = tmpvar_43; + vec4 tmpvar_44; + tmpvar_44.w = 1.0; + tmpvar_44.xyz = totalLighting_8.xyz; + vec4 tmpvar_45; + tmpvar_45 = tmpvar_44; + gl_FragColor = tmpvar_45; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt new file mode 100644 index 000000000..907fec59b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt @@ -0,0 +1,41 @@ +varying vec4 position; +varying vec3 varyingNormalDirection; +uniform mat4 v_inv; +void main () +{ + vec3 specularReflection_1; + vec3 tmpvar_2; + tmpvar_2 = normalize(varyingNormalDirection); + vec3 tmpvar_3; + tmpvar_3 = normalize(((v_inv * vec4(0.0, 0.0, 0.0, 1.0)) - position).xyz); + vec3 tmpvar_4; + tmpvar_4 = (vec4(0.0, 3.0, 0.0, 1.0) - position).xyz; + float tmpvar_5; + tmpvar_5 = dot (tmpvar_4, tmpvar_4); + vec3 tmpvar_6; + tmpvar_6 = (inversesqrt(tmpvar_5) * tmpvar_4); + float tmpvar_7; + tmpvar_7 = (2.0 * inversesqrt(tmpvar_5)); + vec3 tmpvar_8; + tmpvar_8 = ((vec3(tmpvar_7) * vec3(1.0, 0.8, 0.8)) * max (0.0, dot (tmpvar_2, tmpvar_6))); + float tmpvar_9; + tmpvar_9 = dot (tmpvar_2, tmpvar_6); + if ((tmpvar_9 < 0.0)) { + specularReflection_1 = vec3(0.0, 0.0, 0.0); + } else { + vec3 I_10; + I_10 = -(tmpvar_6); + specularReflection_1 = (vec3(tmpvar_7) * pow (max (0.0, + dot ((I_10 - (2.0 * ( + dot (tmpvar_2, I_10) + * tmpvar_2))), tmpvar_3) + ), 5.0)); + }; + vec4 tmpvar_11; + tmpvar_11.w = 1.0; + tmpvar_11.xyz = ((vec3(0.04, 0.04, 0.04) + tmpvar_8) + specularReflection_1); + gl_FragColor = tmpvar_11; +} + + +// inputs: 2, stats: 29 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt b/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt index 78deab76f..03b6487fc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt @@ -3,3 +3,5 @@ void main () gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt b/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt index 877c64f3a..e10c9bf50 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt @@ -6,3 +6,5 @@ void main () gl_FragColor = c_1; } + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt index 21852db5c..42552b096 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt @@ -11,5 +11,5 @@ mediump vec4 xlat_main( ) { void main() { mediump vec4 xl_retval; xl_retval = xlat_main( ); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt index ee9713d03..0abc2593e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = vec4(100007.0, 100007.0, 100007.0, 100007.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt index 1e8e8ad72..c68e42826 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt @@ -3,15 +3,15 @@ mediump vec4 xlat_main( in highp vec4 uv ) { mediump vec4 c; c = vec4( 0.000000); c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 ); - c += ( (uv.x > 0.500000) ) ? ( highp vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( highp vec4( 0.100000, 0.100000, 0.100000, 0.100000) ); - c.xyz += ( (uv.x > 0.500000) ) ? ( highp vec3( 0.900000, 0.900000, 0.900000) ) : ( highp vec3( 0.100000, 0.100000, 0.100000) ); - c.xy += ( (uv.x > 0.500000) ) ? ( highp vec2( 0.900000, 0.900000) ) : ( highp vec2( 0.100000, 0.100000) ); + c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) ); + c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) ); + c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) ); c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 ); return c; } varying highp vec4 xlv_TEXCOORD0; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp vec4(xlv_TEXCOORD0)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt index 5ba89cc47..a2518d280 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt @@ -45,3 +45,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 1, stats: 21 alu 0 tex 5 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt index 39577ce43..e3e29601f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt @@ -45,3 +45,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 1, stats: 21 alu 0 tex 5 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt index a777b2a4b..1f6ceb853 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt @@ -11,16 +11,16 @@ mediump vec4 xlat_main( in highp vec4 uv ); mediump vec4 xlat_main( in highp vec4 uv ) { highp vec4 a; a = vec4( 0.000000); - a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), highp vec4( 1.00000, 2.00000, 3.00000, 4.00000), highp vec4( 5.00000, 6.00000, 7.00000, 8.00000)); - a += xll_vecTSel (greaterThan( uv, highp vec4( 0.500000, 0.500000, 0.500000, 0.500000)), highp vec4( 1.00000, 2.00000, 3.00000, 4.00000), highp vec4( 5.00000, 6.00000, 7.00000, 8.00000)); - a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), highp vec4( 1.00000, 1.00000, 1.00000, 1.00000), highp vec4( 2.00000, 2.00000, 2.00000, 2.00000)); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000)); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000)); + a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000)); a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2)); - a += xll_vecTSel (bvec4( fract( uv ) ), highp vec4( 1.00000, 1.00000, 1.00000, 1.00000), highp vec4( 2.00000, 2.00000, 2.00000, 2.00000)); + a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000)); return a; } varying highp vec4 xlv_TEXCOORD0; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp vec4(xlv_TEXCOORD0)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt index 83517cfe6..a1888e750 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt @@ -165,3 +165,5 @@ void main () gl_FragData[0] = (tmpvar_27 + tmpvar_33); } + +// inputs: 1, stats: 50 alu 0 tex 20 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt index 655b55b38..186a62810 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt @@ -169,3 +169,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 50 alu 0 tex 20 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt new file mode 100644 index 000000000..5c0d7a65a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt @@ -0,0 +1,7 @@ +#extension GL_ARB_shader_texture_lod : require +uniform sampler2D tex; +uniform samplerCube cub; +varying vec3 uv; +void main() { + gl_FragColor = texture2DGradARB(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureCubeGradARB(cub,uv,dFdx(uv),dFdy(uv)); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt new file mode 100644 index 000000000..8bbfa7329 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt @@ -0,0 +1,8 @@ +#extension GL_EXT_shader_texture_lod : require +#extension GL_OES_standard_derivatives : require +uniform sampler2D tex; +uniform samplerCube cub; +varying vec3 uv; +void main() { + gl_FragColor = texture2DGradEXT(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureCubeGradEXT(cub,uv,dFdx(uv),dFdy(uv)); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt new file mode 100644 index 000000000..cc4f73ec0 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt @@ -0,0 +1,9 @@ +#version 300 es +precision mediump float; +uniform sampler2D tex; +uniform samplerCube cub; +in vec3 uv; +out vec4 _fragColor; +void main() { + _fragColor = textureGrad(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureGrad(cub,uv,dFdx(uv),dFdy(uv)); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt new file mode 100644 index 000000000..343f20ea1 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-ir.txt @@ -0,0 +1,23 @@ +#extension GL_ARB_shader_texture_lod : enable +uniform sampler2D tex; +uniform samplerCube cub; +varying vec3 uv; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = dFdx (uv.xy); + vec2 tmpvar_2; + tmpvar_2 = dFdy (uv.xy); + vec4 tmpvar_3; + tmpvar_3 = texture2DGradARB (tex, uv.xy, tmpvar_1, tmpvar_2); + vec3 tmpvar_4; + tmpvar_4 = dFdx (uv); + vec3 tmpvar_5; + tmpvar_5 = dFdy (uv); + vec4 tmpvar_6; + tmpvar_6 = textureCubeGradARB (cub, uv, tmpvar_4, tmpvar_5); + vec4 tmpvar_7; + tmpvar_7 = (tmpvar_3 + tmpvar_6); + gl_FragColor = tmpvar_7; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt new file mode 100644 index 000000000..3e95db988 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES.txt @@ -0,0 +1,24 @@ +#extension GL_EXT_shader_texture_lod : enable +#extension GL_OES_standard_derivatives : enable +uniform sampler2D tex; +uniform samplerCube cub; +varying vec3 uv; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = dFdx (uv.xy); + vec2 tmpvar_2; + tmpvar_2 = dFdy (uv.xy); + lowp vec4 tmpvar_3; + tmpvar_3 = texture2DGradEXT (tex, uv.xy, tmpvar_1, tmpvar_2); + vec3 tmpvar_4; + tmpvar_4 = dFdx (uv); + vec3 tmpvar_5; + tmpvar_5 = dFdy (uv); + lowp vec4 tmpvar_6; + tmpvar_6 = textureCubeGradEXT (cub, uv, tmpvar_4, tmpvar_5); + lowp vec4 tmpvar_7; + tmpvar_7 = (tmpvar_3 + tmpvar_6); + gl_FragColor = tmpvar_7; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt new file mode 100644 index 000000000..6d4d4436c --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-irES3.txt @@ -0,0 +1,25 @@ +#version 300 es +precision mediump float; +uniform sampler2D tex; +uniform samplerCube cub; +in vec3 uv; +out lowp vec4 _fragColor; +void main () +{ + vec2 tmpvar_1; + tmpvar_1 = dFdx (uv.xy); + vec2 tmpvar_2; + tmpvar_2 = dFdy (uv.xy); + lowp vec4 tmpvar_3; + tmpvar_3 = textureGrad (tex, uv.xy, tmpvar_1, tmpvar_2); + vec3 tmpvar_4; + tmpvar_4 = dFdx (uv); + vec3 tmpvar_5; + tmpvar_5 = dFdy (uv); + lowp vec4 tmpvar_6; + tmpvar_6 = textureGrad (cub, uv, tmpvar_4, tmpvar_5); + lowp vec4 tmpvar_7; + tmpvar_7 = (tmpvar_3 + tmpvar_6); + _fragColor = tmpvar_7; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt new file mode 100644 index 000000000..f30b864fa --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt @@ -0,0 +1,11 @@ +#extension GL_ARB_shader_texture_lod : enable +uniform sampler2D tex; +uniform samplerCube cub; +varying vec3 uv; +void main () +{ + gl_FragColor = (texture2DGradARB (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureCubeGradARB (cub, uv, dFdx(uv), dFdy(uv))); +} + + +// inputs: 1, stats: 5 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt new file mode 100644 index 000000000..9cc294318 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt @@ -0,0 +1,14 @@ +#extension GL_EXT_shader_texture_lod : enable +#extension GL_OES_standard_derivatives : enable +uniform sampler2D tex; +uniform samplerCube cub; +varying vec3 uv; +void main () +{ + lowp vec4 tmpvar_1; + tmpvar_1 = (texture2DGradEXT (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureCubeGradEXT (cub, uv, dFdx(uv), dFdy(uv))); + gl_FragColor = tmpvar_1; +} + + +// inputs: 1, stats: 5 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt new file mode 100644 index 000000000..343fd29e3 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt @@ -0,0 +1,13 @@ +#version 300 es +precision mediump float; +uniform sampler2D tex; +uniform samplerCube cub; +in vec3 uv; +out lowp vec4 _fragColor; +void main () +{ + _fragColor = (textureGrad (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureGrad (cub, uv, dFdx(uv), dFdy(uv))); +} + + +// inputs: 1, stats: 5 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt new file mode 100644 index 000000000..380d35888 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt @@ -0,0 +1,18 @@ +#version 300 es +precision mediump float; + +vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { + return textureLod( s, coord.xy, coord.w); +} +uniform sampler2D tex; +mediump vec4 xlat_main( in highp vec4 uv ); +mediump vec4 xlat_main( in highp vec4 uv ) { + return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0)); +} +in highp vec4 xlv_TEXCOORD0; +out vec4 _fragColor; +void main() { + mediump vec4 xl_retval; + xl_retval = xlat_main(xlv_TEXCOORD0); + _fragColor = xl_retval; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt index 286f504e5..4275f6b11 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-ir.txt @@ -1,6 +1,6 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec4 xlv_TEXCOORD0; uniform sampler2D tex; +varying vec4 xlv_TEXCOORD0; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt index f1c10d5fc..f69b0ce26 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES.txt @@ -1,6 +1,6 @@ #extension GL_EXT_shader_texture_lod : enable -varying highp vec4 xlv_TEXCOORD0; uniform sampler2D tex; +varying highp vec4 xlv_TEXCOORD0; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt new file mode 100644 index 000000000..33caa817b --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-irES3.txt @@ -0,0 +1,40 @@ +#version 300 es +precision mediump float; +uniform sampler2D tex; +in highp vec4 xlv_TEXCOORD0; +out mediump vec4 _fragColor; +vec4 xll_tex2Dlod ( + in sampler2D s_1, + in vec4 coord_2 +) +{ + lowp vec4 tmpvar_3; + tmpvar_3 = textureLod (s_1, coord_2.xy, coord_2.w); + return tmpvar_3; +} + +mediump vec4 xlat_main ( + in highp vec4 uv_4 +) +{ + highp vec4 tmpvar_5; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = uv_4.xy.xy; + vec4 tmpvar_6; + tmpvar_6 = xll_tex2Dlod (tex, tmpvar_5); + return tmpvar_6; +} + +void main () +{ + mediump vec4 xl_retval_7; + mediump vec4 tmpvar_8; + tmpvar_8 = xlat_main (xlv_TEXCOORD0); + mediump vec4 tmpvar_9; + tmpvar_9 = tmpvar_8; + xl_retval_7 = tmpvar_9; + mediump vec4 tmpvar_10; + tmpvar_10 = xl_retval_7; + _fragColor = tmpvar_10; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt index 5c0127b6d..b29139859 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt @@ -1,8 +1,10 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec4 xlv_TEXCOORD0; uniform sampler2D tex; +varying vec4 xlv_TEXCOORD0; void main () { gl_FragData[0] = texture2DLod (tex, xlv_TEXCOORD0.xy, 0.0); } + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt index 21239e329..84661d2f8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt @@ -1,6 +1,6 @@ #extension GL_EXT_shader_texture_lod : enable -varying highp vec4 xlv_TEXCOORD0; uniform sampler2D tex; +varying highp vec4 xlv_TEXCOORD0; void main () { mediump vec4 tmpvar_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt new file mode 100644 index 000000000..4ce72de7f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt @@ -0,0 +1,16 @@ +#version 300 es +precision mediump float; +uniform sampler2D tex; +in highp vec4 xlv_TEXCOORD0; +out mediump vec4 _fragColor; +void main () +{ + mediump vec4 tmpvar_1; + lowp vec4 tmpvar_2; + tmpvar_2 = textureLod (tex, xlv_TEXCOORD0.xy, 0.0); + tmpvar_1 = tmpvar_2; + _fragColor = tmpvar_1; +} + + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt new file mode 100644 index 000000000..0fdd8e624 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt @@ -0,0 +1,23 @@ +#version 300 es +precision mediump float; + +float xll_shadow2D(sampler2DShadow s, vec3 coord) { return texture (s, coord); } +float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return textureProj (s, coord); } +uniform sampler2DShadow shadowmap; +lowp vec4 xlat_main( in highp vec4 uv ); +#line 4 +lowp vec4 xlat_main( in highp vec4 uv ) { + lowp float s1; + lowp float s2; + s1 = xll_shadow2D( shadowmap, uv.xyz); + s2 = xll_shadow2Dproj( shadowmap, uv); + #line 8 + return vec4( (s1 + s2)); +} +in highp vec4 xlv_TEXCOORD0; +out vec4 _fragColor; +void main() { + lowp vec4 xl_retval; + xl_retval = xlat_main( vec4(xlv_TEXCOORD0)); + _fragColor = vec4( xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt index 10d823aaf..b44712614 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-ir.txt @@ -1,5 +1,5 @@ -varying vec4 xlv_TEXCOORD0; uniform sampler2DShadow shadowmap; +varying vec4 xlv_TEXCOORD0; float xll_shadow2D ( in sampler2DShadow s_1, in vec3 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt index 974d66ab5..71f49f438 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES.txt @@ -1,8 +1,8 @@ #extension GL_EXT_shadow_samplers : enable +uniform lowp sampler2DShadow shadowmap; varying highp vec4 xlv_TEXCOORD0; -uniform sampler2DShadow shadowmap; float xll_shadow2D ( - in sampler2DShadow s_1, + in lowp sampler2DShadow s_1, in vec3 coord_2 ) { @@ -12,7 +12,7 @@ float xll_shadow2D ( } float xll_shadow2Dproj ( - in sampler2DShadow s_4, + in lowp sampler2DShadow s_4, in vec4 coord_5 ) { diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt new file mode 100644 index 000000000..ff01fc0af --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-irES3.txt @@ -0,0 +1,63 @@ +#version 300 es +precision mediump float; +uniform lowp sampler2DShadow shadowmap; +in highp vec4 xlv_TEXCOORD0; +out lowp vec4 _fragColor; +float xll_shadow2D ( + in lowp sampler2DShadow s_1, + in vec3 coord_2 +) +{ + lowp float tmpvar_3; + tmpvar_3 = texture (s_1, coord_2); + return tmpvar_3; +} + +float xll_shadow2Dproj ( + in lowp sampler2DShadow s_4, + in vec4 coord_5 +) +{ + lowp float tmpvar_6; + tmpvar_6 = textureProj (s_4, coord_5); + return tmpvar_6; +} + +lowp vec4 xlat_main ( + in highp vec4 uv_7 +) +{ + lowp float s2_8; + lowp float s1_9; + float tmpvar_10; + tmpvar_10 = xll_shadow2D (shadowmap, uv_7.xyz); + float tmpvar_11; + tmpvar_11 = tmpvar_10; + s1_9 = tmpvar_11; + float tmpvar_12; + tmpvar_12 = xll_shadow2Dproj (shadowmap, uv_7); + float tmpvar_13; + tmpvar_13 = tmpvar_12; + s2_8 = tmpvar_13; + lowp vec4 tmpvar_14; + tmpvar_14 = vec4((s1_9 + s2_8)); + return tmpvar_14; +} + +void main () +{ + lowp vec4 xl_retval_15; + highp vec4 tmpvar_16; + tmpvar_16 = xlv_TEXCOORD0.xyzw; + lowp vec4 tmpvar_17; + tmpvar_17 = xlat_main (tmpvar_16); + lowp vec4 tmpvar_18; + tmpvar_18 = tmpvar_17; + xl_retval_15 = tmpvar_18; + lowp vec4 tmpvar_19; + tmpvar_19 = xl_retval_15.xyzw; + lowp vec4 tmpvar_20; + tmpvar_20 = tmpvar_19; + _fragColor = tmpvar_20; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt index 3c5699eca..1e990a240 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt @@ -1,7 +1,9 @@ -varying vec4 xlv_TEXCOORD0; uniform sampler2DShadow shadowmap; +varying vec4 xlv_TEXCOORD0; void main () { gl_FragData[0] = vec4((shadow2D (shadowmap, xlv_TEXCOORD0.xyz).x + shadow2DProj (shadowmap, xlv_TEXCOORD0).x)); } + +// inputs: 1, stats: 1 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt index d0ee138b6..d72186464 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt @@ -1,8 +1,12 @@ #extension GL_EXT_shadow_samplers : enable +uniform lowp sampler2DShadow shadowmap; varying highp vec4 xlv_TEXCOORD0; -uniform sampler2DShadow shadowmap; void main () { - gl_FragData[0] = vec4((shadow2DEXT (shadowmap, xlv_TEXCOORD0.xyz) + shadow2DProjEXT (shadowmap, xlv_TEXCOORD0))); + lowp vec4 tmpvar_1; + tmpvar_1 = vec4((shadow2DEXT (shadowmap, xlv_TEXCOORD0.xyz) + shadow2DProjEXT (shadowmap, xlv_TEXCOORD0))); + gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 1 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt new file mode 100644 index 000000000..cf21d50a2 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt @@ -0,0 +1,12 @@ +#version 300 es +precision mediump float; +uniform lowp sampler2DShadow shadowmap; +in highp vec4 xlv_TEXCOORD0; +out lowp vec4 _fragColor; +void main () +{ + _fragColor = vec4((texture (shadowmap, xlv_TEXCOORD0.xyz) + textureProj (shadowmap, xlv_TEXCOORD0))); +} + + +// inputs: 1, stats: 1 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt new file mode 100644 index 000000000..b4e68980f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt @@ -0,0 +1,5 @@ +uniform sampler3D tex; +varying vec3 uv; +void main() { + gl_FragColor = texture3D(tex, uv); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt new file mode 100644 index 000000000..412d0174a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt @@ -0,0 +1,8 @@ +#version 300 es +precision mediump float; +uniform sampler3D tex; +in vec3 uv; +out vec4 _fragColor; +void main() { + _fragColor = texture(tex, uv); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt new file mode 100644 index 000000000..afe393d86 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt @@ -0,0 +1,7 @@ +#extension GL_OES_texture_3D : require + +uniform sampler3D tex; +varying vec3 uv; +void main() { + gl_FragColor = texture3D(tex, uv); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt new file mode 100644 index 000000000..f09f3e7c5 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-ir.txt @@ -0,0 +1,11 @@ +uniform sampler3D tex; +varying vec3 uv; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = texture3D (tex, uv); + vec4 tmpvar_2; + tmpvar_2 = tmpvar_1; + gl_FragColor = tmpvar_2; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt new file mode 100644 index 000000000..1ae5558ca --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-irES3.txt @@ -0,0 +1,14 @@ +#version 300 es +precision mediump float; +uniform sampler3D tex; +in vec3 uv; +out lowp vec4 _fragColor; +void main () +{ + lowp vec4 tmpvar_1; + tmpvar_1 = texture (tex, uv); + lowp vec4 tmpvar_2; + tmpvar_2 = tmpvar_1; + _fragColor = tmpvar_2; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt new file mode 100644 index 000000000..3e807e995 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt @@ -0,0 +1,9 @@ +uniform sampler3D tex; +varying vec3 uv; +void main () +{ + gl_FragColor = texture3D (tex, uv); +} + + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt new file mode 100644 index 000000000..757de747e --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt @@ -0,0 +1,12 @@ +#version 300 es +precision mediump float; +uniform sampler3D tex; +in vec3 uv; +out lowp vec4 _fragColor; +void main () +{ + _fragColor = texture (tex, uv); +} + + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt new file mode 100644 index 000000000..e0f2b29c4 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt @@ -0,0 +1,13 @@ +#version 300 es +precision mediump float; + +uniform samplerCubeShadow shadowmap; + +in mediump vec4 uv; +out mediump vec4 _fragColor; + +void main() +{ + float s = texture (shadowmap, uv); + _fragColor = vec4(s); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt new file mode 100644 index 000000000..139158aec --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-irES3.txt @@ -0,0 +1,20 @@ +#version 300 es +precision mediump float; +uniform lowp samplerCubeShadow shadowmap; +in mediump vec4 uv; +out mediump vec4 _fragColor; +void main () +{ + lowp float s_1; + lowp float tmpvar_2; + tmpvar_2 = texture (shadowmap, uv); + lowp float tmpvar_3; + tmpvar_3 = tmpvar_2; + s_1 = tmpvar_3; + lowp vec4 tmpvar_4; + tmpvar_4 = vec4(s_1); + lowp vec4 tmpvar_5; + tmpvar_5 = tmpvar_4; + _fragColor = tmpvar_5; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt new file mode 100644 index 000000000..387783a49 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt @@ -0,0 +1,14 @@ +#version 300 es +precision mediump float; +uniform lowp samplerCubeShadow shadowmap; +in mediump vec4 uv; +out mediump vec4 _fragColor; +void main () +{ + lowp vec4 tmpvar_1; + tmpvar_1 = vec4(texture (shadowmap, uv)); + _fragColor = tmpvar_1; +} + + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt new file mode 100644 index 000000000..2e7bd28ed --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt @@ -0,0 +1,23 @@ +#version 300 es +in mediump vec3 uv; +out lowp vec4 outColor; +uniform sampler2D tex; +uniform sampler3D vol; +void main() +{ + lowp vec4 c; + + // texture offset forms + c = textureOffset (tex, uv.xy, ivec2(-2,-3)); + c += textureOffset (tex, uv.xy, ivec2(4,5), 0.5); + c += textureOffset (vol, uv.xyz, ivec3(-2,-3,-4)); + c += textureOffset (vol, uv.xyz, ivec3(4,5,6), -0.5); + + // texelFetch forms + c += texelFetch (tex, ivec2(1,2), 1); + c += texelFetch (vol, ivec3(1,2,3), 2); + c += texelFetchOffset (tex, ivec2(1,2), 3, ivec2(-2,-3)); + c += texelFetchOffset (vol, ivec3(1,2,3), 0, ivec3(-2,-3,-4)); + + outColor = c; +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt new file mode 100644 index 000000000..dc4246769 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texOffset-irES3.txt @@ -0,0 +1,53 @@ +#version 300 es +in mediump vec3 uv; +out lowp vec4 outColor; +uniform sampler2D tex; +uniform sampler3D vol; +void main () +{ + lowp vec4 c_1; + lowp vec4 tmpvar_2; + tmpvar_2 = textureOffset (tex, uv.xy, ivec2(-2, -3)); + lowp vec4 tmpvar_3; + tmpvar_3 = tmpvar_2; + c_1 = tmpvar_3; + lowp vec4 tmpvar_4; + tmpvar_4 = textureOffset (tex, uv.xy, ivec2(4, 5), 0.5); + lowp vec4 tmpvar_5; + tmpvar_5 = (c_1 + tmpvar_4); + c_1 = tmpvar_5; + lowp vec4 tmpvar_6; + tmpvar_6 = textureOffset (vol, uv.xyz, ivec3(-2, -3, -4)); + lowp vec4 tmpvar_7; + tmpvar_7 = (c_1 + tmpvar_6); + c_1 = tmpvar_7; + lowp vec4 tmpvar_8; + tmpvar_8 = textureOffset (vol, uv.xyz, ivec3(4, 5, 6), -0.5); + lowp vec4 tmpvar_9; + tmpvar_9 = (c_1 + tmpvar_8); + c_1 = tmpvar_9; + lowp vec4 tmpvar_10; + tmpvar_10 = texelFetch (tex, ivec2(1, 2), 1); + lowp vec4 tmpvar_11; + tmpvar_11 = (c_1 + tmpvar_10); + c_1 = tmpvar_11; + lowp vec4 tmpvar_12; + tmpvar_12 = texelFetch (vol, ivec3(1, 2, 3), 2); + lowp vec4 tmpvar_13; + tmpvar_13 = (c_1 + tmpvar_12); + c_1 = tmpvar_13; + lowp vec4 tmpvar_14; + tmpvar_14 = texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3)); + lowp vec4 tmpvar_15; + tmpvar_15 = (c_1 + tmpvar_14); + c_1 = tmpvar_15; + lowp vec4 tmpvar_16; + tmpvar_16 = texelFetchOffset (vol, ivec3(1, 2, 3), 0, ivec3(-2, -3, -4)); + lowp vec4 tmpvar_17; + tmpvar_17 = (c_1 + tmpvar_16); + c_1 = tmpvar_17; + lowp vec4 tmpvar_18; + tmpvar_18 = c_1; + outColor = tmpvar_18; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt new file mode 100644 index 000000000..32bc22db5 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt @@ -0,0 +1,14 @@ +#version 300 es +in mediump vec3 uv; +out lowp vec4 outColor; +uniform sampler2D tex; +uniform sampler3D vol; +void main () +{ + outColor = ((( + ((((textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, 0.5, ivec2(4, 5))) + textureOffset (vol, uv, ivec3(-2, -3, -4))) + textureOffset (vol, uv, -0.5, ivec3(4, 5, 6))) + texelFetch (tex, ivec2(1, 2), 1)) + + texelFetch (vol, ivec3(1, 2, 3), 2)) + texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3))) + texelFetchOffset (vol, ivec3(1, 2, 3), 0, ivec3(-2, -3, -4))); +} + + +// inputs: 1, stats: 7 alu 8 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt index d8923f11b..ebb9c3a2d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/texProj-irES.txt @@ -1,8 +1,8 @@ #extension GL_EXT_shader_texture_lod : enable #extension GL_EXT_shadow_samplers : enable -varying highp vec4 uv; -uniform sampler2DShadow shadowmap; uniform sampler2D tex; +uniform lowp sampler2DShadow shadowmap; +varying highp vec4 uv; void main () { lowp vec4 c_1; diff --git a/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt index 75cd06e8c..e29334be7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt @@ -1,12 +1,16 @@ #extension GL_EXT_shader_texture_lod : enable #extension GL_EXT_shadow_samplers : enable -varying highp vec4 uv; -uniform sampler2DShadow shadowmap; uniform sampler2D tex; +uniform lowp sampler2DShadow shadowmap; +varying highp vec4 uv; void main () { lowp vec4 tmpvar_1; - tmpvar_1 = (((((texture2DProj (tex, uv) + texture2DProj (tex, uv.xyz)) + texture2DProjLodEXT (tex, uv, 1.0)) + texture2DProjLodEXT (tex, uv.xyz, 1.0)) + vec4(shadow2DEXT (shadowmap, uv.xyz))) + vec4(shadow2DProjEXT (shadowmap, uv))); + tmpvar_1 = ((( + ((texture2DProj (tex, uv) + texture2DProj (tex, uv.xyz)) + texture2DProjLodEXT (tex, uv, 1.0)) + + texture2DProjLodEXT (tex, uv.xyz, 1.0)) + vec4(shadow2DEXT (shadowmap, uv.xyz))) + vec4(shadow2DProjEXT (shadowmap, uv))); gl_FragColor = tmpvar_1; } + +// inputs: 1, stats: 5 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt b/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt index 60c5041f7..11d170a3d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt @@ -6,3 +6,5 @@ void main () gl_FragColor = c_1; } + +// inputs: 1, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt index 904a5862f..a81e16c35 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt @@ -8,6 +8,6 @@ varying highp vec4 xlv_TEXCOORD0; varying highp vec4 xlv_TEXCOORD1; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp vec4(xlv_TEXCOORD0), highp vec4(xlv_TEXCOORD1)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( vec4(xlv_TEXCOORD0), vec4(xlv_TEXCOORD1)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt index afd2bd934..dcf684f00 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-ir.txt @@ -1,5 +1,5 @@ -varying vec4 xlv_TEXCOORD1; varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; vec4 xlat_main ( in vec4 uv_1, in vec4 foobar_xlv_foo_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt index 23fb3c42f..79742b82f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-irES.txt @@ -1,5 +1,5 @@ -varying highp vec4 xlv_TEXCOORD1; varying highp vec4 xlv_TEXCOORD0; +varying highp vec4 xlv_TEXCOORD1; mediump vec4 xlat_main ( in highp vec4 uv_1, in highp vec4 foobar_xlv_foo_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt index 8e5694df1..0c6e5c40f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt index 8e5694df1..0c6e5c40f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 0, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt index 99f9acd47..807922ae9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt @@ -5,6 +5,6 @@ mediump vec4 xlat_main( in highp float face ) { varying highp float xlv_VFACE; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp float(xlv_VFACE)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( float(xlv_VFACE)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt index 24d1b04a5..22f52bf7f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = vec4(xlv_VFACE); } + +// inputs: 1, stats: 0 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt index d02e6f2f4..3314343e6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt @@ -8,3 +8,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 0 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt index 4bac40367..829b18d38 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt @@ -5,6 +5,6 @@ mediump vec4 xlat_main( in highp vec2 pos ) { varying highp vec2 xlv_VPOS; void main() { mediump vec4 xl_retval; - xl_retval = xlat_main( highp vec2(xlv_VPOS)); - gl_FragData[0] = mediump vec4( xl_retval); + xl_retval = xlat_main( vec2(xlv_VPOS)); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt index dd3489c7f..e75eb9c04 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt @@ -7,3 +7,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt index 3fda16fc1..ba7d29bd6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt @@ -9,3 +9,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt index abf75c161..fcd4853cb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-ir.txt @@ -18,13 +18,13 @@ struct v2f_surf { vec3 lightDir; vec3 vlight; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -112,10 +112,16 @@ vec4 LightingBlinnPhong ( tmpvar_37 = (tmpvar_36 * s_19.Gloss); spec_24 = tmpvar_37; vec3 tmpvar_38; - tmpvar_38 = ((((s_19.Albedo * _LightColor0.xyz) * diff_26) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_24)) * (atten_22 * 2.0)); + tmpvar_38 = ((( + (s_19.Albedo * _LightColor0.xyz) + * diff_26) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_24)) * (atten_22 * 2.0)); c_23.xyz = tmpvar_38.xyz.xyz; float tmpvar_39; - tmpvar_39 = (s_19.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_24) * atten_22)); + tmpvar_39 = (s_19.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_24) * atten_22)); c_23.w = vec4(tmpvar_39).w; return c_23; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt index ae6fb642b..5f052ca4a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt @@ -1,9 +1,9 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -19,14 +19,26 @@ void main () tmpvar_6 = (tmpvar_4.w * _Color.w); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y))); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); vec4 c_8; float tmpvar_9; - tmpvar_9 = (pow (max (0.0, dot (normal_7.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_8.xyz = ((((tmpvar_5 * _LightColor0.xyz) * max (0.0, dot (normal_7.xyz, tmpvar_2))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_9)) * 2.0); + tmpvar_9 = (pow (max (0.0, + dot (normal_7.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_8.xyz = ((( + (tmpvar_5 * _LightColor0.xyz) + * + max (0.0, dot (normal_7.xyz, tmpvar_2)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_9)) * 2.0); c_8.w = (tmpvar_6 + ((_LightColor0.w * _SpecColor.w) * tmpvar_9)); c_3.xyz = (c_8.xyz + (tmpvar_5 * gl_TexCoord[3].xyz)); c_3.w = tmpvar_6; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 30 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt index a9da4c652..0414adb18 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt @@ -71,9 +71,9 @@ varying highp vec3 xlv_TEXCOORD1; void main() { mediump vec4 xl_retval; v2f xlt_i; - xlt_i.pos = highp vec4(0.0); - xlt_i.uv = highp vec2( xlv_TEXCOORD0); - xlt_i.ray = highp vec3( xlv_TEXCOORD1); + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2( xlv_TEXCOORD0); + xlt_i.ray = vec3( xlv_TEXCOORD1); xl_retval = xlat_main( xlt_i); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt index e99e4b44f..d603e78ab 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-ir.txt @@ -3,16 +3,16 @@ struct v2f { vec2 uv; vec3 ray; }; -uniform vec4 _ZBufferParams; -uniform mat4 _View2Shadow3; -uniform mat4 _View2Shadow2; -uniform mat4 _View2Shadow1; -uniform mat4 _View2Shadow; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform mat4 _View2Shadow; +uniform mat4 _View2Shadow1; +uniform mat4 _View2Shadow2; +uniform mat4 _View2Shadow3; +uniform vec4 _ZBufferParams; float unitySampleShadow ( in vec4 eyePos_1 ) @@ -65,7 +65,11 @@ float unitySampleShadow ( weights_4 = tmpvar_25; vec4 tmpvar_26; tmpvar_26.w = 1.0; - tmpvar_26.xyz = ((((sc0_11 * weights_4.x) + (sc1_10 * weights_4.y)) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; + tmpvar_26.xyz = ((( + (sc0_11 * weights_4.x) + + + (sc1_10 * weights_4.y) + ) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; vec4 tmpvar_27; tmpvar_27 = tmpvar_26; coord_3 = tmpvar_27; diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt index 1d7a10e0b..997281abe 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-irES.txt @@ -3,18 +3,18 @@ struct v2f { highp vec2 uv; highp vec3 ray; }; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -uniform highp vec4 _ZBufferParams; -uniform highp mat4 _View2Shadow3; -uniform highp mat4 _View2Shadow2; -uniform highp mat4 _View2Shadow1; -uniform highp mat4 _View2Shadow; -uniform sampler2D _ShadowMapTexture; -uniform highp vec4 _LightSplitsNear; -uniform highp vec4 _LightSplitsFar; -uniform highp vec4 _LightShadowData; uniform sampler2D _CameraDepthTexture; +uniform highp vec4 _LightShadowData; +uniform highp vec4 _LightSplitsFar; +uniform highp vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform highp mat4 _View2Shadow; +uniform highp mat4 _View2Shadow1; +uniform highp mat4 _View2Shadow2; +uniform highp mat4 _View2Shadow3; +uniform highp vec4 _ZBufferParams; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; mediump float unitySampleShadow ( in highp vec4 eyePos_1 ) @@ -67,7 +67,11 @@ mediump float unitySampleShadow ( weights_4 = tmpvar_25; highp vec4 tmpvar_26; tmpvar_26.w = 1.0; - tmpvar_26.xyz = ((((sc0_11 * weights_4.x) + (sc1_10 * weights_4.y)) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; + tmpvar_26.xyz = ((( + (sc0_11 * weights_4.x) + + + (sc1_10 * weights_4.y) + ) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; highp vec4 tmpvar_27; tmpvar_27 = tmpvar_26; coord_3 = tmpvar_27; diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt index cc27c68fd..3aff1f667 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt @@ -1,13 +1,13 @@ -uniform vec4 _ZBufferParams; -uniform mat4 _View2Shadow3; -uniform mat4 _View2Shadow2; -uniform mat4 _View2Shadow1; -uniform mat4 _View2Shadow; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform mat4 _View2Shadow; +uniform mat4 _View2Shadow1; +uniform mat4 _View2Shadow2; +uniform mat4 _View2Shadow3; +uniform vec4 _ZBufferParams; void main () { vec4 res_1; @@ -20,7 +20,13 @@ void main () tmpvar_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); vec4 tmpvar_5; tmpvar_5.w = 1.0; - tmpvar_5.xyz = (((((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x) + ((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y)) + ((_View2Shadow2 * tmpvar_3).xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w)); + tmpvar_5.xyz = ((( + ((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x) + + + ((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y) + ) + ( + (_View2Shadow2 * tmpvar_3) + .xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w)); vec4 tmpvar_6; tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy); float tmpvar_7; @@ -40,3 +46,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 30 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt index 9c7b5e804..1d143ff1e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt @@ -1,15 +1,15 @@ -varying highp vec3 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -uniform highp vec4 _ZBufferParams; -uniform highp mat4 _View2Shadow3; -uniform highp mat4 _View2Shadow2; -uniform highp mat4 _View2Shadow1; -uniform highp mat4 _View2Shadow; -uniform sampler2D _ShadowMapTexture; -uniform highp vec4 _LightSplitsNear; -uniform highp vec4 _LightSplitsFar; -uniform highp vec4 _LightShadowData; uniform sampler2D _CameraDepthTexture; +uniform highp vec4 _LightShadowData; +uniform highp vec4 _LightSplitsFar; +uniform highp vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform highp mat4 _View2Shadow; +uniform highp mat4 _View2Shadow1; +uniform highp mat4 _View2Shadow2; +uniform highp mat4 _View2Shadow3; +uniform highp vec4 _ZBufferParams; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; void main () { mediump vec4 tmpvar_1; @@ -41,7 +41,13 @@ void main () tmpvar_14 = (near_9 * far_8); highp vec4 tmpvar_15; tmpvar_15.w = 1.0; - tmpvar_15.xyz = (((((_View2Shadow * tmpvar_6).xyz * tmpvar_14.x) + ((_View2Shadow1 * tmpvar_6).xyz * tmpvar_14.y)) + ((_View2Shadow2 * tmpvar_6).xyz * tmpvar_14.z)) + ((_View2Shadow3 * tmpvar_6).xyz * tmpvar_14.w)); + tmpvar_15.xyz = ((( + ((_View2Shadow * tmpvar_6).xyz * tmpvar_14.x) + + + ((_View2Shadow1 * tmpvar_6).xyz * tmpvar_14.y) + ) + ( + (_View2Shadow2 * tmpvar_6) + .xyz * tmpvar_14.z)) + ((_View2Shadow3 * tmpvar_6).xyz * tmpvar_14.w)); lowp vec4 tmpvar_16; tmpvar_16 = texture2D (_ShadowMapTexture, tmpvar_15.xy); highp float tmpvar_17; @@ -63,3 +69,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 30 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt index 5640c2c78..08dba66de 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-flare-irES.txt @@ -1,6 +1,6 @@ -varying highp vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; uniform sampler2D _FlareTexture; +varying lowp vec4 xlv_COLOR; +varying highp vec2 xlv_TEXCOORD0; lowp vec4 xlat_main ( in lowp vec4 color_1, in highp vec2 texcoord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt index 0e864f605..913b3f085 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = (texture2D (_FlareTexture, gl_TexCoord[0].xy) * gl_Color); } + +// inputs: 2, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt index 9f5ac17df..2b10bd0c2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt @@ -1,8 +1,12 @@ -varying highp vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; uniform sampler2D _FlareTexture; +varying lowp vec4 xlv_COLOR; +varying highp vec2 xlv_TEXCOORD0; void main () { - gl_FragData[0] = (texture2D (_FlareTexture, xlv_TEXCOORD0) * xlv_COLOR); + lowp vec4 tmpvar_1; + tmpvar_1 = (texture2D (_FlareTexture, xlv_TEXCOORD0) * xlv_COLOR); + gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt index 4e5305b3e..b0411dcef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-ir.txt @@ -1,7 +1,7 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 @@ -238,10 +238,14 @@ vec3 FxaaPixelShader ( return tmpvar_114; }; vec3 tmpvar_115; - tmpvar_115 = ((((rgbN_78 + rgbW_77) + rgbM_76) + rgbE_75) + rgbS_74); + tmpvar_115 = ((( + (rgbN_78 + rgbW_77) + + rgbM_76) + rgbE_75) + rgbS_74); rgbL_65 = tmpvar_115; float tmpvar_116; - tmpvar_116 = ((((lumaN_73 + lumaW_72) + lumaE_70) + lumaS_69) * 0.25); + tmpvar_116 = ((( + (lumaN_73 + lumaW_72) + + lumaE_70) + lumaS_69) * 0.25); lumaL_64 = tmpvar_116; float tmpvar_117; tmpvar_117 = abs ((lumaL_64 - lumaM_71)); @@ -279,7 +283,9 @@ vec3 FxaaPixelShader ( tmpvar_130 = tmpvar_129.xyz; rgbSE_58 = tmpvar_130; vec3 tmpvar_131; - tmpvar_131 = (rgbL_65 + (((rgbNW_61 + rgbNE_60) + rgbSW_59) + rgbSE_58)); + tmpvar_131 = (rgbL_65 + (( + (rgbNW_61 + rgbNE_60) + + rgbSW_59) + rgbSE_58)); rgbL_65 = tmpvar_131; vec3 tmpvar_132; tmpvar_132 = (rgbL_65 * vec3(0.111111, 0.111111, 0.111111)); @@ -305,20 +311,32 @@ vec3 FxaaPixelShader ( tmpvar_140 = tmpvar_139; lumaSE_54 = tmpvar_140; float tmpvar_141; - tmpvar_141 = abs ((((0.25 * lumaNW_57) + (-(0.5) * lumaN_73)) + (0.25 * lumaNE_56))); + tmpvar_141 = abs ((((0.25 * lumaNW_57) + ( + -(0.5) + * lumaN_73)) + (0.25 * lumaNE_56))); float tmpvar_142; - tmpvar_142 = abs ((((0.5 * lumaW_72) + (-(1.0) * lumaM_71)) + (0.5 * lumaE_70))); + tmpvar_142 = abs ((((0.5 * lumaW_72) + ( + -(1.0) + * lumaM_71)) + (0.5 * lumaE_70))); float tmpvar_143; - tmpvar_143 = abs ((((0.25 * lumaSW_55) + (-(0.5) * lumaS_69)) + (0.25 * lumaSE_54))); + tmpvar_143 = abs ((((0.25 * lumaSW_55) + ( + -(0.5) + * lumaS_69)) + (0.25 * lumaSE_54))); float tmpvar_144; tmpvar_144 = ((tmpvar_141 + tmpvar_142) + tmpvar_143); edgeVert_53 = tmpvar_144; float tmpvar_145; - tmpvar_145 = abs ((((0.25 * lumaNW_57) + (-(0.5) * lumaW_72)) + (0.25 * lumaSW_55))); + tmpvar_145 = abs ((((0.25 * lumaNW_57) + ( + -(0.5) + * lumaW_72)) + (0.25 * lumaSW_55))); float tmpvar_146; - tmpvar_146 = abs ((((0.5 * lumaN_73) + (-(1.0) * lumaM_71)) + (0.5 * lumaS_69))); + tmpvar_146 = abs ((((0.5 * lumaN_73) + ( + -(1.0) + * lumaM_71)) + (0.5 * lumaS_69))); float tmpvar_147; - tmpvar_147 = abs ((((0.25 * lumaNE_56) + (-(0.5) * lumaE_70)) + (0.25 * lumaSE_54))); + tmpvar_147 = abs ((((0.25 * lumaNE_56) + ( + -(0.5) + * lumaE_70)) + (0.25 * lumaSE_54))); float tmpvar_148; tmpvar_148 = ((tmpvar_145 + tmpvar_146) + tmpvar_147); edgeHorz_52 = tmpvar_148; @@ -543,7 +561,9 @@ vec3 FxaaPixelShader ( tmpvar_205 = tmpvar_204; dstN_38 = tmpvar_205; float tmpvar_206; - tmpvar_206 = ((0.5 + (dstN_38 * (-(1.0) / spanLength_35))) * lengthSign_50); + tmpvar_206 = ((0.5 + (dstN_38 * + (-(1.0) / spanLength_35) + )) * lengthSign_50); subPixelOffset_34 = tmpvar_206; float tmpvar_207; if (horzSpan_51) { diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt index 6a4d1ce8a..9e4ba45da 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt @@ -1,13 +1,12 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; void main () { vec2 rcpFrame_1; rcpFrame_1 = _MainTex_TexelSize.xy; vec3 tmpvar_2; - int i_3; bool doneP_4; bool doneN_5; float lumaEndP_6; @@ -21,7 +20,6 @@ void main () float lumaN_14; doneN_5 = bool(0); doneP_4 = bool(0); - i_3 = 0; vec4 tmpvar_15; tmpvar_15.zw = vec2(0.0, 0.0); tmpvar_15.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy)); @@ -59,17 +57,25 @@ void main () float tmpvar_29; tmpvar_29 = max (tmpvar_26, max (max (tmpvar_24, tmpvar_25), max (tmpvar_28, tmpvar_27))); float tmpvar_30; - tmpvar_30 = (tmpvar_29 - min (tmpvar_26, min (min (tmpvar_24, tmpvar_25), min (tmpvar_28, tmpvar_27)))); + tmpvar_30 = (tmpvar_29 - min (tmpvar_26, min ( + min (tmpvar_24, tmpvar_25) + , + min (tmpvar_28, tmpvar_27) + ))); float tmpvar_31; tmpvar_31 = max (0.0625, (tmpvar_29 * 0.125)); if ((tmpvar_30 < tmpvar_31)) { tmpvar_2 = tmpvar_19.xyz; } else { float tmpvar_32; - tmpvar_32 = min (0.75, (max (0.0, ((abs((((((tmpvar_24 + tmpvar_25) + tmpvar_27) + tmpvar_28) * 0.25) - tmpvar_26)) / tmpvar_30) - 0.25)) * 1.33333)); + tmpvar_32 = min (0.75, (max (0.0, + ((abs(( + ((((tmpvar_24 + tmpvar_25) + tmpvar_27) + tmpvar_28) * 0.25) + - tmpvar_26)) / tmpvar_30) - 0.25) + ) * 1.33333)); vec4 tmpvar_33; tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = (xlv_TEXCOORD0 + (vec2(-1.0, -1.0) * _MainTex_TexelSize.xy)); + tmpvar_33.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); vec4 tmpvar_34; tmpvar_34 = texture2DLod (_MainTex, tmpvar_33.xy, 0.0); vec4 tmpvar_35; @@ -88,7 +94,11 @@ void main () vec4 tmpvar_40; tmpvar_40 = texture2DLod (_MainTex, tmpvar_39.xy, 0.0); vec3 tmpvar_41; - tmpvar_41 = ((((((tmpvar_16.xyz + tmpvar_18.xyz) + tmpvar_19.xyz) + tmpvar_21.xyz) + tmpvar_23.xyz) + (((tmpvar_34.xyz + tmpvar_36.xyz) + tmpvar_38.xyz) + tmpvar_40.xyz)) * vec3(0.111111, 0.111111, 0.111111)); + tmpvar_41 = ((( + (((tmpvar_16.xyz + tmpvar_18.xyz) + tmpvar_19.xyz) + tmpvar_21.xyz) + + tmpvar_23.xyz) + ( + ((tmpvar_34.xyz + tmpvar_36.xyz) + tmpvar_38.xyz) + + tmpvar_40.xyz)) * vec3(0.111111, 0.111111, 0.111111)); float tmpvar_42; tmpvar_42 = ((tmpvar_34.y * 1.96321) + tmpvar_34.x); float tmpvar_43; @@ -98,7 +108,19 @@ void main () float tmpvar_45; tmpvar_45 = ((tmpvar_40.y * 1.96321) + tmpvar_40.x); bool tmpvar_46; - tmpvar_46 = (((abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_44))) + abs((((0.5 * tmpvar_24) + (-1.0 * tmpvar_26)) + (0.5 * tmpvar_28)))) + abs((((0.25 * tmpvar_43) + (-0.5 * tmpvar_27)) + (0.25 * tmpvar_45)))) >= ((abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_24)) + (0.25 * tmpvar_43))) + abs((((0.5 * tmpvar_25) + (-1.0 * tmpvar_26)) + (0.5 * tmpvar_27)))) + abs((((0.25 * tmpvar_44) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45))))); + tmpvar_46 = ((( + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_44))) + + + abs((((0.5 * tmpvar_24) - tmpvar_26) + (0.5 * tmpvar_28))) + ) + abs( + (((0.25 * tmpvar_43) + (-0.5 * tmpvar_27)) + (0.25 * tmpvar_45)) + )) >= (( + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_24)) + (0.25 * tmpvar_43))) + + + abs((((0.5 * tmpvar_25) - tmpvar_26) + (0.5 * tmpvar_27))) + ) + abs( + (((0.25 * tmpvar_44) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45)) + ))); float tmpvar_47; if (tmpvar_46) { tmpvar_47 = -(_MainTex_TexelSize.y); @@ -130,7 +152,7 @@ void main () gradientN_11 = tmpvar_49; }; if (!(tmpvar_51)) { - lengthSign_12 = (tmpvar_47 * -1.0); + lengthSign_12 = -(tmpvar_47); }; float tmpvar_52; if (tmpvar_46) { @@ -165,18 +187,15 @@ void main () posN_10 = (posN_10 + (tmpvar_54 * vec2(-2.0, -2.0))); posP_9 = (posP_9 + (tmpvar_54 * vec2(2.0, 2.0))); offNP_8 = (tmpvar_54 * vec2(3.0, 3.0)); - while (true) { - if ((i_3 >= 4)) { - break; - }; + for (int i_3; i_3 < 4; i_3++) { if (!(doneN_5)) { vec4 tmpvar_57; - tmpvar_57 = texture2D (_MainTex, posN_10); + tmpvar_57 = texture2DGradARB (_MainTex, posN_10, offNP_8, offNP_8); lumaEndN_7 = ((tmpvar_57.y * 1.96321) + tmpvar_57.x); }; if (!(doneP_4)) { vec4 tmpvar_58; - tmpvar_58 = texture2D (_MainTex, posP_9); + tmpvar_58 = texture2DGradARB (_MainTex, posP_9, offNP_8, offNP_8); lumaEndP_6 = ((tmpvar_58.y * 1.96321) + tmpvar_58.x); }; bool tmpvar_59; @@ -202,7 +221,6 @@ void main () if (!(tmpvar_60)) { posP_9 = (posP_9 + offNP_8); }; - i_3 = (i_3 + 1); }; float tmpvar_61; if (tmpvar_46) { @@ -237,7 +255,9 @@ void main () tmpvar_66 = tmpvar_62; }; float tmpvar_67; - tmpvar_67 = ((0.5 + (tmpvar_66 * (-1.0 / tmpvar_65))) * lengthSign_12); + tmpvar_67 = ((0.5 + (tmpvar_66 * + (-1.0 / tmpvar_65) + )) * lengthSign_12); float tmpvar_68; if (tmpvar_46) { tmpvar_68 = 0.0; @@ -267,3 +287,5 @@ void main () gl_FragData[0] = tmpvar_73; } + +// inputs: 1, stats: 194 alu 12 tex 26 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt index fac426778..a2a9c3b2e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-ir.txt @@ -1,7 +1,7 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 @@ -206,10 +206,14 @@ vec3 FxaaPixelShader ( return tmpvar_102; }; vec3 tmpvar_103; - tmpvar_103 = ((((rgbN_69 + rgbW_68) + rgbM_67) + rgbE_66) + rgbS_65); + tmpvar_103 = ((( + (rgbN_69 + rgbW_68) + + rgbM_67) + rgbE_66) + rgbS_65); rgbL_56 = tmpvar_103; float tmpvar_104; - tmpvar_104 = ((((lumaN_64 + lumaW_63) + lumaE_61) + lumaS_60) * 0.25); + tmpvar_104 = ((( + (lumaN_64 + lumaW_63) + + lumaE_61) + lumaS_60) * 0.25); lumaL_55 = tmpvar_104; float tmpvar_105; tmpvar_105 = abs ((lumaL_55 - lumaM_62)); @@ -219,7 +223,9 @@ vec3 FxaaPixelShader ( float tmpvar_107; tmpvar_107 = max (0.0, ((rangeL_54 / range_57) - (1.0 / 4.0))); float tmpvar_108; - tmpvar_108 = (tmpvar_107 * (1.0 / (1.0 - (1.0 / 4.0)))); + tmpvar_108 = (tmpvar_107 * (1.0 / (1.0 - + (1.0 / 4.0) + ))); blendL_53 = tmpvar_108; float tmpvar_109; tmpvar_109 = min (0.75, blendL_53); @@ -247,7 +253,9 @@ vec3 FxaaPixelShader ( tmpvar_118 = tmpvar_117.xyz; rgbSE_49 = tmpvar_118; vec3 tmpvar_119; - tmpvar_119 = (rgbL_56 + (((rgbNW_52 + rgbNE_51) + rgbSW_50) + rgbSE_49)); + tmpvar_119 = (rgbL_56 + (( + (rgbNW_52 + rgbNE_51) + + rgbSW_50) + rgbSE_49)); rgbL_56 = tmpvar_119; vec3 tmpvar_120; tmpvar_120 = (rgbL_56 * vec3(0.111111, 0.111111, 0.111111)); @@ -273,20 +281,32 @@ vec3 FxaaPixelShader ( tmpvar_128 = tmpvar_127; lumaSE_45 = tmpvar_128; float tmpvar_129; - tmpvar_129 = abs ((((0.25 * lumaNW_48) + (-(0.5) * lumaN_64)) + (0.25 * lumaNE_47))); + tmpvar_129 = abs ((((0.25 * lumaNW_48) + ( + -(0.5) + * lumaN_64)) + (0.25 * lumaNE_47))); float tmpvar_130; - tmpvar_130 = abs ((((0.5 * lumaW_63) + (-(1.0) * lumaM_62)) + (0.5 * lumaE_61))); + tmpvar_130 = abs ((((0.5 * lumaW_63) + ( + -(1.0) + * lumaM_62)) + (0.5 * lumaE_61))); float tmpvar_131; - tmpvar_131 = abs ((((0.25 * lumaSW_46) + (-(0.5) * lumaS_60)) + (0.25 * lumaSE_45))); + tmpvar_131 = abs ((((0.25 * lumaSW_46) + ( + -(0.5) + * lumaS_60)) + (0.25 * lumaSE_45))); float tmpvar_132; tmpvar_132 = ((tmpvar_129 + tmpvar_130) + tmpvar_131); edgeVert_44 = tmpvar_132; float tmpvar_133; - tmpvar_133 = abs ((((0.25 * lumaNW_48) + (-(0.5) * lumaW_63)) + (0.25 * lumaSW_46))); + tmpvar_133 = abs ((((0.25 * lumaNW_48) + ( + -(0.5) + * lumaW_63)) + (0.25 * lumaSW_46))); float tmpvar_134; - tmpvar_134 = abs ((((0.5 * lumaN_64) + (-(1.0) * lumaM_62)) + (0.5 * lumaS_60))); + tmpvar_134 = abs ((((0.5 * lumaN_64) + ( + -(1.0) + * lumaM_62)) + (0.5 * lumaS_60))); float tmpvar_135; - tmpvar_135 = abs ((((0.25 * lumaNE_47) + (-(0.5) * lumaE_61)) + (0.25 * lumaSE_45))); + tmpvar_135 = abs ((((0.25 * lumaNE_47) + ( + -(0.5) + * lumaE_61)) + (0.25 * lumaSE_45))); float tmpvar_136; tmpvar_136 = ((tmpvar_133 + tmpvar_134) + tmpvar_135); edgeHorz_43 = tmpvar_136; @@ -517,7 +537,9 @@ vec3 FxaaPixelShader ( tmpvar_195 = tmpvar_194; dstN_29 = tmpvar_195; float tmpvar_196; - tmpvar_196 = ((0.5 + (dstN_29 * (-(1.0) / spanLength_26))) * lengthSign_41); + tmpvar_196 = ((0.5 + (dstN_29 * + (-(1.0) / spanLength_26) + )) * lengthSign_41); subPixelOffset_25 = tmpvar_196; float tmpvar_197; if (horzSpan_42) { diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt index 5f19016ec..5c45413d4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt @@ -1,13 +1,12 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; void main () { vec2 rcpFrame_1; rcpFrame_1 = _MainTex_TexelSize.xy; vec3 tmpvar_2; - int i_3; bool doneP_4; bool doneN_5; float lumaEndP_6; @@ -56,17 +55,25 @@ void main () float tmpvar_29; tmpvar_29 = max (tmpvar_26, max (max (tmpvar_24, tmpvar_25), max (tmpvar_28, tmpvar_27))); float tmpvar_30; - tmpvar_30 = (tmpvar_29 - min (tmpvar_26, min (min (tmpvar_24, tmpvar_25), min (tmpvar_28, tmpvar_27)))); + tmpvar_30 = (tmpvar_29 - min (tmpvar_26, min ( + min (tmpvar_24, tmpvar_25) + , + min (tmpvar_28, tmpvar_27) + ))); float tmpvar_31; tmpvar_31 = max (0.0416667, (tmpvar_29 * 0.125)); if ((tmpvar_30 < tmpvar_31)) { tmpvar_2 = tmpvar_19.xyz; } else { float tmpvar_32; - tmpvar_32 = min (0.75, (max (0.0, ((abs((((((tmpvar_24 + tmpvar_25) + tmpvar_27) + tmpvar_28) * 0.25) - tmpvar_26)) / tmpvar_30) - 0.25)) * 1.33333)); + tmpvar_32 = min (0.75, (max (0.0, + ((abs(( + ((((tmpvar_24 + tmpvar_25) + tmpvar_27) + tmpvar_28) * 0.25) + - tmpvar_26)) / tmpvar_30) - 0.25) + ) * 1.33333)); vec4 tmpvar_33; tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = (xlv_TEXCOORD0 + (vec2(-1.0, -1.0) * _MainTex_TexelSize.xy)); + tmpvar_33.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); vec4 tmpvar_34; tmpvar_34 = texture2DLod (_MainTex, tmpvar_33.xy, 0.0); vec4 tmpvar_35; @@ -85,7 +92,11 @@ void main () vec4 tmpvar_40; tmpvar_40 = texture2DLod (_MainTex, tmpvar_39.xy, 0.0); vec3 tmpvar_41; - tmpvar_41 = ((((((tmpvar_16.xyz + tmpvar_18.xyz) + tmpvar_19.xyz) + tmpvar_21.xyz) + tmpvar_23.xyz) + (((tmpvar_34.xyz + tmpvar_36.xyz) + tmpvar_38.xyz) + tmpvar_40.xyz)) * vec3(0.111111, 0.111111, 0.111111)); + tmpvar_41 = ((( + (((tmpvar_16.xyz + tmpvar_18.xyz) + tmpvar_19.xyz) + tmpvar_21.xyz) + + tmpvar_23.xyz) + ( + ((tmpvar_34.xyz + tmpvar_36.xyz) + tmpvar_38.xyz) + + tmpvar_40.xyz)) * vec3(0.111111, 0.111111, 0.111111)); float tmpvar_42; tmpvar_42 = ((tmpvar_34.y * 1.96321) + tmpvar_34.x); float tmpvar_43; @@ -95,7 +106,19 @@ void main () float tmpvar_45; tmpvar_45 = ((tmpvar_40.y * 1.96321) + tmpvar_40.x); bool tmpvar_46; - tmpvar_46 = (((abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_44))) + abs((((0.5 * tmpvar_24) + (-1.0 * tmpvar_26)) + (0.5 * tmpvar_28)))) + abs((((0.25 * tmpvar_43) + (-0.5 * tmpvar_27)) + (0.25 * tmpvar_45)))) >= ((abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_24)) + (0.25 * tmpvar_43))) + abs((((0.5 * tmpvar_25) + (-1.0 * tmpvar_26)) + (0.5 * tmpvar_27)))) + abs((((0.25 * tmpvar_44) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45))))); + tmpvar_46 = ((( + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_44))) + + + abs((((0.5 * tmpvar_24) - tmpvar_26) + (0.5 * tmpvar_28))) + ) + abs( + (((0.25 * tmpvar_43) + (-0.5 * tmpvar_27)) + (0.25 * tmpvar_45)) + )) >= (( + abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_24)) + (0.25 * tmpvar_43))) + + + abs((((0.5 * tmpvar_25) - tmpvar_26) + (0.5 * tmpvar_27))) + ) + abs( + (((0.25 * tmpvar_44) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45)) + ))); float tmpvar_47; if (tmpvar_46) { tmpvar_47 = -(_MainTex_TexelSize.y); @@ -127,7 +150,7 @@ void main () gradientN_11 = tmpvar_49; }; if (!(tmpvar_51)) { - lengthSign_12 = (tmpvar_47 * -1.0); + lengthSign_12 = -(tmpvar_47); }; float tmpvar_52; if (tmpvar_46) { @@ -162,10 +185,9 @@ void main () lumaEndP_6 = lumaN_14; doneN_5 = bool(0); doneP_4 = bool(0); - posN_10 = (posN_10 + (tmpvar_54 * vec2(-1.0, -1.0))); + posN_10 = (posN_10 - tmpvar_54); posP_9 = (posP_9 + tmpvar_54); - i_3 = 0; - for (int i_3 = 0; i_3 < 16; ) { + for (int i_3 = 0; i_3 < 16; i_3++) { if (!(doneN_5)) { vec4 tmpvar_57; tmpvar_57 = texture2DLod (_MainTex, posN_10, 0.0); @@ -199,7 +221,6 @@ void main () if (!(tmpvar_60)) { posP_9 = (posP_9 + offNP_8); }; - i_3 = (i_3 + 1); }; float tmpvar_61; if (tmpvar_46) { @@ -234,7 +255,9 @@ void main () tmpvar_66 = tmpvar_62; }; float tmpvar_67; - tmpvar_67 = ((0.5 + (tmpvar_66 * (-1.0 / tmpvar_65))) * lengthSign_12); + tmpvar_67 = ((0.5 + (tmpvar_66 * + (-1.0 / tmpvar_65) + )) * lengthSign_12); float tmpvar_68; if (tmpvar_46) { tmpvar_68 = 0.0; @@ -264,3 +287,5 @@ void main () gl_FragData[0] = tmpvar_73; } + +// inputs: 1, stats: 191 alu 12 tex 26 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt index cffe987fc..12d3b3d75 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-ir.txt @@ -4,11 +4,11 @@ struct v2f { vec2 uv; vec4 uvPosPos; }; -varying vec4 xlv_TEXCOORD1; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_SV_POSITION; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec4 xlv_SV_POSITION; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt index 2d891b3d9..8a45c379e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-irES.txt @@ -4,10 +4,10 @@ struct v2f { highp vec2 uv; highp vec4 uvPosPos; }; -varying highp vec4 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -uniform highp vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_TexelSize; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_TEXCOORD1; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt index 2098d178a..ea75909d2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt @@ -1,8 +1,8 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec4 xlv_TEXCOORD1; -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; void main () { vec4 fxaaConsoleRcpFrameOpt_1; @@ -48,7 +48,9 @@ void main () tmpvar_19.zw = vec2(0.0, 0.0); tmpvar_19.xy = (xlv_TEXCOORD0 + (tmpvar_17 * fxaaConsoleRcpFrameOpt_1.zw)); vec2 tmpvar_20; - tmpvar_20 = clamp ((tmpvar_17 / (min (abs(tmpvar_17.x), abs(tmpvar_17.y)) * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0)); + tmpvar_20 = clamp ((tmpvar_17 / ( + min (abs(tmpvar_17.x), abs(tmpvar_17.y)) + * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0)); vec4 tmpvar_21; tmpvar_21.zw = vec2(0.0, 0.0); tmpvar_21.xy = (xlv_TEXCOORD0 - (tmpvar_20 * fxaaConsoleRcpFrameOpt2_2.zw)); @@ -68,3 +70,5 @@ void main () gl_FragData[0] = tmpvar_3; } + +// inputs: 2, stats: 47 alu 9 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt index 15bc3fb02..62bdbb272 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt @@ -1,8 +1,8 @@ #extension GL_EXT_shader_texture_lod : enable -varying highp vec4 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -uniform highp vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_TexelSize; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_TEXCOORD1; void main () { highp vec4 fxaaConsoleRcpFrameOpt_1; @@ -62,7 +62,9 @@ void main () tmpvar_26.zw = vec2(0.0, 0.0); tmpvar_26.xy = (xlv_TEXCOORD0 + (tmpvar_24 * fxaaConsoleRcpFrameOpt_1.zw)); highp vec2 tmpvar_27; - tmpvar_27 = clamp ((tmpvar_24 / (min (abs(tmpvar_24.x), abs(tmpvar_24.y)) * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0)); + tmpvar_27 = clamp ((tmpvar_24 / ( + min (abs(tmpvar_24.x), abs(tmpvar_24.y)) + * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0)); highp vec4 tmpvar_28; tmpvar_28.zw = vec2(0.0, 0.0); tmpvar_28.xy = (xlv_TEXCOORD0 - (tmpvar_27 * fxaaConsoleRcpFrameOpt2_2.zw)); @@ -82,3 +84,5 @@ void main () gl_FragData[0] = tmpvar_3; } + +// inputs: 2, stats: 47 alu 9 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt index dcc2c170e..d8b022f75 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-ir.txt @@ -4,11 +4,11 @@ struct v2f { vec2 uv; vec4 uvPosPos; }; -varying vec4 xlv_TEXCOORD1; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_SV_POSITION; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec4 xlv_SV_POSITION; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt index 68e7e9efe..6376cb38e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-irES.txt @@ -4,11 +4,11 @@ struct v2f { highp vec2 uv; highp vec4 uvPosPos; }; -varying highp vec4 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_SV_POSITION; -uniform highp vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_TexelSize; +varying highp vec4 xlv_SV_POSITION; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_TEXCOORD1; vec4 xll_tex2Dlod ( in sampler2D s_1, in vec4 coord_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt index 5e6425152..c7156f18a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt @@ -1,7 +1,7 @@ #extension GL_ARB_shader_texture_lod : enable -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; void main () { vec2 fxaaQualityRcpFrame_1; @@ -19,8 +19,7 @@ void main () float lumaN_12; float lumaS_13; vec2 posM_14; - posM_14.x = xlv_TEXCOORD0.x; - posM_14.y = xlv_TEXCOORD0.y; + posM_14 = xlv_TEXCOORD0; vec4 tmpvar_15; tmpvar_15 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0); vec4 tmpvar_16; @@ -52,13 +51,15 @@ void main () float tmpvar_26; tmpvar_26 = max (max (tmpvar_22.w, tmpvar_24.w), max (tmpvar_19.w, max (tmpvar_17.w, tmpvar_15.w))); float tmpvar_27; - tmpvar_27 = (tmpvar_26 - min (min (tmpvar_22.w, tmpvar_24.w), min (tmpvar_19.w, min (tmpvar_17.w, tmpvar_15.w)))); + tmpvar_27 = (tmpvar_26 - min (min (tmpvar_22.w, tmpvar_24.w), min (tmpvar_19.w, + min (tmpvar_17.w, tmpvar_15.w) + ))); if ((tmpvar_27 < max (0.0833, (tmpvar_26 * 0.166)))) { tmpvar_2 = tmpvar_15; } else { vec4 tmpvar_28; tmpvar_28.zw = vec2(0.0, 0.0); - tmpvar_28.xy = (xlv_TEXCOORD0 + (vec2(-1.0, -1.0) * _MainTex_TexelSize.xy)); + tmpvar_28.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); vec4 tmpvar_29; tmpvar_29 = texture2DLod (_MainTex, tmpvar_28.xy, 0.0); vec4 tmpvar_30; @@ -88,7 +89,19 @@ void main () tmpvar_40 = (tmpvar_29.w + tmpvar_35.w); lengthSign_11 = fxaaQualityRcpFrame_1.x; bool tmpvar_41; - tmpvar_41 = ((abs(((-2.0 * tmpvar_24.w) + tmpvar_40)) + ((abs(((-2.0 * tmpvar_15.w) + tmpvar_36)) * 2.0) + abs(((-2.0 * tmpvar_19.w) + tmpvar_39)))) >= (abs(((-2.0 * tmpvar_17.w) + (tmpvar_35.w + tmpvar_31.w))) + ((abs(((-2.0 * tmpvar_15.w) + tmpvar_37)) * 2.0) + abs(((-2.0 * tmpvar_22.w) + (tmpvar_29.w + tmpvar_33.w)))))); + tmpvar_41 = ((abs( + ((-2.0 * tmpvar_24.w) + tmpvar_40) + ) + ( + (abs(((-2.0 * tmpvar_15.w) + tmpvar_36)) * 2.0) + + + abs(((-2.0 * tmpvar_19.w) + tmpvar_39)) + )) >= (abs( + ((-2.0 * tmpvar_17.w) + (tmpvar_35.w + tmpvar_31.w)) + ) + ( + (abs(((-2.0 * tmpvar_15.w) + tmpvar_37)) * 2.0) + + + abs(((-2.0 * tmpvar_22.w) + (tmpvar_29.w + tmpvar_33.w))) + ))); float tmpvar_42; tmpvar_42 = (((tmpvar_36 + tmpvar_37) * 2.0) + (tmpvar_40 + tmpvar_39)); if (!(tmpvar_41)) { @@ -118,8 +131,7 @@ void main () }; float tmpvar_49; tmpvar_49 = clamp ((abs(tmpvar_43) * tmpvar_38), 0.0, 1.0); - posB_9.x = posM_14.x; - posB_9.y = posM_14.y; + posB_9 = xlv_TEXCOORD0; float tmpvar_50; if (!(tmpvar_41)) { tmpvar_50 = 0.0; @@ -178,7 +190,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_51); }; bool tmpvar_63; - tmpvar_63 = (!(tmpvar_61) || !(tmpvar_62)); + tmpvar_63 = !((tmpvar_61 && tmpvar_62)); if (!(tmpvar_62)) { posP_7.x = (posP_7.x + tmpvar_50); }; @@ -209,7 +221,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_51); }; bool tmpvar_66; - tmpvar_66 = (!(tmpvar_64) || !(tmpvar_65)); + tmpvar_66 = !((tmpvar_64 && tmpvar_65)); if (!(tmpvar_65)) { posP_7.x = (posP_7.x + tmpvar_50); }; @@ -240,7 +252,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_51); }; bool tmpvar_69; - tmpvar_69 = (!(tmpvar_67) || !(tmpvar_68)); + tmpvar_69 = !((tmpvar_67 && tmpvar_68)); if (!(tmpvar_68)) { posP_7.x = (posP_7.x + tmpvar_50); }; @@ -271,7 +283,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_51); }; bool tmpvar_72; - tmpvar_72 = (!(tmpvar_70) || !(tmpvar_71)); + tmpvar_72 = !((tmpvar_70 && tmpvar_71)); if (!(tmpvar_71)) { posP_7.x = (posP_7.x + tmpvar_50); }; @@ -302,7 +314,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_51 * 1.5)); }; bool tmpvar_75; - tmpvar_75 = (!(tmpvar_73) || !(tmpvar_74)); + tmpvar_75 = !((tmpvar_73 && tmpvar_74)); if (!(tmpvar_74)) { posP_7.x = (posP_7.x + (tmpvar_50 * 1.5)); }; @@ -333,7 +345,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); }; bool tmpvar_78; - tmpvar_78 = (!(tmpvar_76) || !(tmpvar_77)); + tmpvar_78 = !((tmpvar_76 && tmpvar_77)); if (!(tmpvar_77)) { posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); }; @@ -364,7 +376,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); }; bool tmpvar_81; - tmpvar_81 = (!(tmpvar_79) || !(tmpvar_80)); + tmpvar_81 = !((tmpvar_79 && tmpvar_80)); if (!(tmpvar_80)) { posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); }; @@ -395,7 +407,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); }; bool tmpvar_84; - tmpvar_84 = (!(tmpvar_82) || !(tmpvar_83)); + tmpvar_84 = !((tmpvar_82 && tmpvar_83)); if (!(tmpvar_83)) { posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); }; @@ -426,7 +438,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_51 * 2.0)); }; bool tmpvar_87; - tmpvar_87 = (!(tmpvar_85) || !(tmpvar_86)); + tmpvar_87 = !((tmpvar_85 && tmpvar_86)); if (!(tmpvar_86)) { posP_7.x = (posP_7.x + (tmpvar_50 * 2.0)); }; @@ -457,7 +469,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_51 * 4.0)); }; bool tmpvar_90; - tmpvar_90 = (!(tmpvar_88) || !(tmpvar_89)); + tmpvar_90 = !((tmpvar_88 && tmpvar_89)); if (!(tmpvar_89)) { posP_7.x = (posP_7.x + (tmpvar_50 * 4.0)); }; @@ -551,3 +563,5 @@ void main () gl_FragData[0] = tmpvar_2; } + +// inputs: 1, stats: 399 alu 32 tex 110 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt index 4ed63efd8..eb9c323c2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt @@ -1,7 +1,7 @@ #extension GL_EXT_shader_texture_lod : enable -varying highp vec2 xlv_TEXCOORD0; -uniform highp vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform highp vec4 _MainTex_TexelSize; +varying highp vec2 xlv_TEXCOORD0; void main () { highp vec2 fxaaQualityRcpFrame_1; @@ -20,8 +20,7 @@ void main () highp float lumaS_13; highp vec4 rgbyM_14; highp vec2 posM_15; - posM_15.x = xlv_TEXCOORD0.x; - posM_15.y = xlv_TEXCOORD0.y; + posM_15 = xlv_TEXCOORD0; lowp vec4 tmpvar_16; tmpvar_16 = texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0); rgbyM_14 = tmpvar_16; @@ -62,13 +61,15 @@ void main () highp float tmpvar_31; tmpvar_31 = max (max (rgba_26.w, rgba_30.w), max (rgba_23.w, max (rgba_19.w, rgbyM_14.w))); highp float tmpvar_32; - tmpvar_32 = (tmpvar_31 - min (min (rgba_26.w, rgba_30.w), min (rgba_23.w, min (rgba_19.w, rgbyM_14.w)))); + tmpvar_32 = (tmpvar_31 - min (min (rgba_26.w, rgba_30.w), min (rgba_23.w, + min (rgba_19.w, rgbyM_14.w) + ))); if ((tmpvar_32 < max (0.0833, (tmpvar_31 * 0.166)))) { tmpvar_2 = rgbyM_14; } else { highp vec4 tmpvar_33; tmpvar_33.zw = vec2(0.0, 0.0); - tmpvar_33.xy = (xlv_TEXCOORD0 + (vec2(-1.0, -1.0) * _MainTex_TexelSize.xy)); + tmpvar_33.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy); lowp vec4 tmpvar_34; tmpvar_34 = texture2DLodEXT (_MainTex, tmpvar_33.xy, 0.0); highp vec4 rgba_35; @@ -106,7 +107,19 @@ void main () tmpvar_49 = (rgba_35.w + rgba_44.w); lengthSign_11 = fxaaQualityRcpFrame_1.x; bool tmpvar_50; - tmpvar_50 = ((abs(((-2.0 * rgba_30.w) + tmpvar_49)) + ((abs(((-2.0 * rgbyM_14.w) + tmpvar_45)) * 2.0) + abs(((-2.0 * rgba_23.w) + tmpvar_48)))) >= (abs(((-2.0 * rgba_19.w) + (rgba_44.w + rgba_38.w))) + ((abs(((-2.0 * rgbyM_14.w) + tmpvar_46)) * 2.0) + abs(((-2.0 * rgba_26.w) + (rgba_35.w + rgba_41.w)))))); + tmpvar_50 = ((abs( + ((-2.0 * rgba_30.w) + tmpvar_49) + ) + ( + (abs(((-2.0 * rgbyM_14.w) + tmpvar_45)) * 2.0) + + + abs(((-2.0 * rgba_23.w) + tmpvar_48)) + )) >= (abs( + ((-2.0 * rgba_19.w) + (rgba_44.w + rgba_38.w)) + ) + ( + (abs(((-2.0 * rgbyM_14.w) + tmpvar_46)) * 2.0) + + + abs(((-2.0 * rgba_26.w) + (rgba_35.w + rgba_41.w))) + ))); highp float tmpvar_51; tmpvar_51 = (((tmpvar_45 + tmpvar_46) * 2.0) + (tmpvar_49 + tmpvar_48)); if (!(tmpvar_50)) { @@ -136,8 +149,7 @@ void main () }; highp float tmpvar_58; tmpvar_58 = clamp ((abs(tmpvar_52) * tmpvar_47), 0.0, 1.0); - posB_9.x = posM_15.x; - posB_9.y = posM_15.y; + posB_9 = xlv_TEXCOORD0; highp float tmpvar_59; if (!(tmpvar_50)) { tmpvar_59 = 0.0; @@ -200,7 +212,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_60); }; bool tmpvar_74; - tmpvar_74 = (!(tmpvar_72) || !(tmpvar_73)); + tmpvar_74 = !((tmpvar_72 && tmpvar_73)); if (!(tmpvar_73)) { posP_7.x = (posP_7.x + tmpvar_59); }; @@ -239,7 +251,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_60); }; bool tmpvar_81; - tmpvar_81 = (!(tmpvar_79) || !(tmpvar_80)); + tmpvar_81 = !((tmpvar_79 && tmpvar_80)); if (!(tmpvar_80)) { posP_7.x = (posP_7.x + tmpvar_59); }; @@ -278,7 +290,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_60); }; bool tmpvar_88; - tmpvar_88 = (!(tmpvar_86) || !(tmpvar_87)); + tmpvar_88 = !((tmpvar_86 && tmpvar_87)); if (!(tmpvar_87)) { posP_7.x = (posP_7.x + tmpvar_59); }; @@ -317,7 +329,7 @@ void main () posN_8.y = (posN_8.y - tmpvar_60); }; bool tmpvar_95; - tmpvar_95 = (!(tmpvar_93) || !(tmpvar_94)); + tmpvar_95 = !((tmpvar_93 && tmpvar_94)); if (!(tmpvar_94)) { posP_7.x = (posP_7.x + tmpvar_59); }; @@ -356,7 +368,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_60 * 1.5)); }; bool tmpvar_102; - tmpvar_102 = (!(tmpvar_100) || !(tmpvar_101)); + tmpvar_102 = !((tmpvar_100 && tmpvar_101)); if (!(tmpvar_101)) { posP_7.x = (posP_7.x + (tmpvar_59 * 1.5)); }; @@ -395,7 +407,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); }; bool tmpvar_109; - tmpvar_109 = (!(tmpvar_107) || !(tmpvar_108)); + tmpvar_109 = !((tmpvar_107 && tmpvar_108)); if (!(tmpvar_108)) { posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); }; @@ -434,7 +446,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); }; bool tmpvar_116; - tmpvar_116 = (!(tmpvar_114) || !(tmpvar_115)); + tmpvar_116 = !((tmpvar_114 && tmpvar_115)); if (!(tmpvar_115)) { posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); }; @@ -473,7 +485,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); }; bool tmpvar_123; - tmpvar_123 = (!(tmpvar_121) || !(tmpvar_122)); + tmpvar_123 = !((tmpvar_121 && tmpvar_122)); if (!(tmpvar_122)) { posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); }; @@ -512,7 +524,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_60 * 2.0)); }; bool tmpvar_130; - tmpvar_130 = (!(tmpvar_128) || !(tmpvar_129)); + tmpvar_130 = !((tmpvar_128 && tmpvar_129)); if (!(tmpvar_129)) { posP_7.x = (posP_7.x + (tmpvar_59 * 2.0)); }; @@ -551,7 +563,7 @@ void main () posN_8.y = (posN_8.y - (tmpvar_60 * 4.0)); }; bool tmpvar_137; - tmpvar_137 = (!(tmpvar_135) || !(tmpvar_136)); + tmpvar_137 = !((tmpvar_135 && tmpvar_136)); if (!(tmpvar_136)) { posP_7.x = (posP_7.x + (tmpvar_59 * 4.0)); }; @@ -655,3 +667,5 @@ void main () gl_FragData[0] = tmpvar_2; } + +// inputs: 1, stats: 399 alu 32 tex 110 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt index 258de5200..3e6360d9d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-particle-ir.txt @@ -3,9 +3,9 @@ struct v2f { vec4 color; vec2 texcoord; }; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR; uniform sampler2D _MainTex; +varying vec4 xlv_COLOR; +varying vec2 xlv_TEXCOORD0; vec4 xlat_main ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt index 5a33bf487..8d5c675db 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-particle-irES.txt @@ -3,9 +3,9 @@ struct v2f { lowp vec4 color; mediump vec2 texcoord; }; -varying mediump vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; uniform sampler2D _MainTex; +varying lowp vec4 xlv_COLOR; +varying mediump vec2 xlv_TEXCOORD0; lowp vec4 xlat_main ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt index ea8caea49..0322d1e5f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt @@ -1,8 +1,10 @@ -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR; uniform sampler2D _MainTex; +varying vec4 xlv_COLOR; +varying vec2 xlv_TEXCOORD0; void main () { gl_FragData[0] = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0)); } + +// inputs: 2, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt index 629618c39..d717abc92 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt @@ -1,8 +1,12 @@ -varying mediump vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; uniform sampler2D _MainTex; +varying lowp vec4 xlv_COLOR; +varying mediump vec2 xlv_TEXCOORD0; void main () { - gl_FragData[0] = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0)); + lowp vec4 tmpvar_1; + tmpvar_1 = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0)); + gl_FragData[0] = tmpvar_1; } + +// inputs: 2, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt index f0bd8867c..c2e519fba 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt @@ -56,7 +56,7 @@ mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ); mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv ); mediump vec4 xlat_main( in v2f i ); mediump float Luminance( in mediump vec3 c ) { - return dot( c, mediump vec3( 0.220000, 0.707000, 0.0710000)); + return dot( c, vec3( 0.220000, 0.707000, 0.0710000)); } highp float Linear01Depth( in highp float z ) { return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y )); @@ -137,9 +137,9 @@ varying highp vec3 xlv_TEXCOORD1; void main() { mediump vec4 xl_retval; v2f xlt_i; - xlt_i.pos = highp vec4(0.0); - xlt_i.uv = highp vec4( xlv_TEXCOORD0); - xlt_i.ray = highp vec3( xlv_TEXCOORD1); + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec4( xlv_TEXCOORD0); + xlt_i.ray = vec3( xlv_TEXCOORD1); xl_retval = xlat_main( xlt_i); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt index de991e078..309717b6e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-ir.txt @@ -3,23 +3,23 @@ struct v2f { vec4 uv; vec3 ray; }; -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform vec4 unity_LightmapFade; -uniform vec4 _ZBufferParams; -uniform vec3 _WorldSpaceCameraPos; -uniform samplerCube _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightShadowData; -uniform vec4 _LightPositionRange; -uniform vec4 _LightPos; -uniform mat4 _LightMatrix0; -uniform vec4 _LightColor; -uniform mat4 _CameraToWorld; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform mat4 _CameraToWorld; +uniform vec4 _LightColor; +uniform mat4 _LightMatrix0; +uniform vec4 _LightPos; +uniform vec4 _LightPositionRange; +uniform vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ZBufferParams; +uniform vec4 unity_LightmapFade; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt index d64551241..f8d3b32ea 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-irES.txt @@ -3,23 +3,23 @@ struct v2f { highp vec4 uv; highp vec3 ray; }; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_TEXCOORD0; -uniform highp vec4 unity_LightmapFade; -uniform highp vec4 _ZBufferParams; -uniform highp vec3 _WorldSpaceCameraPos; -uniform samplerCube _ShadowMapTexture; -uniform highp vec4 _ProjectionParams; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform highp vec4 _LightShadowData; -uniform highp vec4 _LightPositionRange; -uniform highp vec4 _LightPos; -uniform highp mat4 _LightMatrix0; -uniform highp vec4 _LightColor; -uniform highp mat4 _CameraToWorld; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform highp mat4 _CameraToWorld; +uniform highp vec4 _LightColor; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _LightPos; +uniform highp vec4 _LightPositionRange; +uniform highp vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform highp vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 unity_LightmapFade; +varying highp vec4 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt index ca810e6a4..64a308c05 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt @@ -1,20 +1,20 @@ -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform vec4 unity_LightmapFade; -uniform vec4 _ZBufferParams; -uniform vec3 _WorldSpaceCameraPos; -uniform samplerCube _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightShadowData; -uniform vec4 _LightPositionRange; -uniform vec4 _LightPos; -uniform mat4 _LightMatrix0; -uniform vec4 _LightColor; -uniform mat4 _CameraToWorld; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform mat4 _CameraToWorld; +uniform vec4 _LightColor; +uniform mat4 _LightMatrix0; +uniform vec4 _LightPos; +uniform vec4 _LightPositionRange; +uniform vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ZBufferParams; +uniform vec4 unity_LightmapFade; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; void main () { vec4 res_1; @@ -28,7 +28,9 @@ void main () normal_4 = normalize(((tmpvar_6.xyz * 2.0) - 1.0)); vec4 tmpvar_7; tmpvar_7.w = 1.0; - tmpvar_7.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_5).x) + _ZBufferParams.y)))); + tmpvar_7.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_5).x) + + _ZBufferParams.y)))); vec3 tmpvar_8; tmpvar_8 = (_CameraToWorld * tmpvar_7).xyz; vec3 tmpvar_9; @@ -41,7 +43,9 @@ void main () shadowVals_10.z = dot (textureCube (_ShadowMapTexture, (tmpvar_9 + vec3(-0.0078125, 0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); shadowVals_10.w = dot (textureCube (_ShadowMapTexture, (tmpvar_9 + vec3(0.0078125, -0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); bvec4 tmpvar_11; - tmpvar_11 = lessThan (shadowVals_10, vec4(((sqrt(dot (tmpvar_9, tmpvar_9)) * _LightPositionRange.w) * 0.97))); + tmpvar_11 = lessThan (shadowVals_10, vec4((( + sqrt(dot (tmpvar_9, tmpvar_9)) + * _LightPositionRange.w) * 0.97))); vec4 tmpvar_12; tmpvar_12 = _LightShadowData.xxxx; float tmpvar_13; @@ -79,11 +83,23 @@ void main () float tmpvar_19; tmpvar_19 = ((atten_2 * dot (tmpvar_17, vec4(0.25, 0.25, 0.25, 0.25))) * textureCube (_LightTexture0, (_LightMatrix0 * tmpvar_18).xyz).w); atten_2 = tmpvar_19; - res_1.xyz = (_LightColor.xyz * (max (0.0, dot (lightDir_3, normal_4)) * tmpvar_19)); - res_1.w = ((pow (max (0.0, dot (normalize((lightDir_3 - normalize((tmpvar_8 - _WorldSpaceCameraPos)))), normal_4)), (tmpvar_6.w * 128.0)) * clamp (tmpvar_19, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); + res_1.xyz = (_LightColor.xyz * (max (0.0, + dot (lightDir_3, normal_4) + ) * tmpvar_19)); + res_1.w = ((pow ( + max (0.0, dot (normalize((lightDir_3 - + normalize((tmpvar_8 - _WorldSpaceCameraPos)) + )), normal_4)) + , + (tmpvar_6.w * 128.0) + ) * clamp (tmpvar_19, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); vec4 tmpvar_20; - tmpvar_20 = (res_1 * clamp ((1.0 - ((tmpvar_7.z * unity_LightmapFade.z) + unity_LightmapFade.w)), 0.0, 1.0)); + tmpvar_20 = (res_1 * clamp ((1.0 - + ((tmpvar_7.z * unity_LightmapFade.z) + unity_LightmapFade.w) + ), 0.0, 1.0)); res_1 = tmpvar_20; gl_FragData[0] = exp2(-(tmpvar_20)); } + +// inputs: 2, stats: 62 alu 8 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt index 3ed273412..e31d453dd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt @@ -1,20 +1,20 @@ -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_TEXCOORD0; -uniform highp vec4 unity_LightmapFade; -uniform highp vec4 _ZBufferParams; -uniform highp vec3 _WorldSpaceCameraPos; -uniform samplerCube _ShadowMapTexture; -uniform highp vec4 _ProjectionParams; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform highp vec4 _LightShadowData; -uniform highp vec4 _LightPositionRange; -uniform highp vec4 _LightPos; -uniform highp mat4 _LightMatrix0; -uniform highp vec4 _LightColor; -uniform highp mat4 _CameraToWorld; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform highp mat4 _CameraToWorld; +uniform highp vec4 _LightColor; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _LightPos; +uniform highp vec4 _LightPositionRange; +uniform highp vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform highp vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _ZBufferParams; +uniform highp vec4 unity_LightmapFade; +varying highp vec4 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; void main () { mediump vec4 res_1; @@ -53,7 +53,9 @@ void main () tmpvar_18 = texture2D (_LightTextureB0, tmpvar_17).w; atten_4 = tmpvar_18; highp float tmpvar_19; - tmpvar_19 = ((sqrt(dot (tmpvar_15, tmpvar_15)) * _LightPositionRange.w) * 0.97); + tmpvar_19 = ((sqrt( + dot (tmpvar_15, tmpvar_15) + ) * _LightPositionRange.w) * 0.97); mediump vec4 shadows_20; highp vec4 shadowVals_21; highp vec3 vec_22; @@ -133,7 +135,9 @@ void main () mediump float tmpvar_46; tmpvar_46 = max (0.0, dot (lightDir_5, normal_7)); highp vec3 tmpvar_47; - tmpvar_47 = normalize((lightDir_5 - normalize((tmpvar_14 - _WorldSpaceCameraPos)))); + tmpvar_47 = normalize((lightDir_5 - normalize( + (tmpvar_14 - _WorldSpaceCameraPos) + ))); h_3 = tmpvar_47; mediump float tmpvar_48; tmpvar_48 = pow (max (0.0, dot (h_3, normal_7)), (nspec_8.w * 128.0)); @@ -152,10 +156,14 @@ void main () tmpvar_53 = (tmpvar_49 * tmpvar_52); res_1.w = tmpvar_53; highp float tmpvar_54; - tmpvar_54 = clamp ((1.0 - ((tmpvar_13.z * unity_LightmapFade.z) + unity_LightmapFade.w)), 0.0, 1.0); + tmpvar_54 = clamp ((1.0 - ( + (tmpvar_13.z * unity_LightmapFade.z) + + unity_LightmapFade.w)), 0.0, 1.0); mediump vec4 tmpvar_55; tmpvar_55 = (res_1 * tmpvar_54); res_1 = tmpvar_55; gl_FragData[0] = exp2(-(tmpvar_55)); } + +// inputs: 2, stats: 62 alu 8 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt index 09154477a..ee09ebc7b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt @@ -126,12 +126,12 @@ varying highp vec2 xlv_TEXCOORD3; void main() { mediump vec4 xl_retval; v2f_surf xlt_IN; - xlt_IN.pos = highp vec4(0.0); - xlt_IN.hip_pack0 = highp vec2( xlv_TEXCOORD0); - xlt_IN.lop_color = highp vec4( xlv_COLOR0); - xlt_IN.lightDir = highp vec3( xlv_TEXCOORD1); - xlt_IN.viewDir = highp vec3( xlv_TEXCOORD2); - xlt_IN._LightCoord = highp vec2( xlv_TEXCOORD3); + xlt_IN.pos = vec4(0.0); + xlt_IN.hip_pack0 = vec2( xlv_TEXCOORD0); + xlt_IN.lop_color = vec4( xlv_COLOR0); + xlt_IN.lightDir = vec3( xlv_TEXCOORD1); + xlt_IN.viewDir = vec3( xlv_TEXCOORD2); + xlt_IN._LightCoord = vec2( xlv_TEXCOORD3); xl_retval = xlat_main( xlt_IN); - gl_FragData[0] = mediump vec4( xl_retval); + gl_FragData[0] = vec4( xl_retval); } diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt index 275aab3c6..9c2477b9a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-ir.txt @@ -20,21 +20,21 @@ struct v2f_surf { vec3 viewDir; vec2 _LightCoord; }; -varying vec2 xlv_TEXCOORD3; -varying vec3 xlv_TEXCOORD2; -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_COLOR0; -varying vec2 xlv_TEXCOORD0; -uniform float _TranslucencyViewDependency; -uniform sampler2D _TranslucencyMap; -uniform vec3 _TranslucencyColor; -uniform float _ShadowStrength; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpSpecMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _ShadowStrength; +uniform vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +uniform float _TranslucencyViewDependency; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_COLOR0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec2 xlv_TEXCOORD3; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt index cced8621b..33213a69c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-irES.txt @@ -20,21 +20,21 @@ struct v2f_surf { highp vec3 viewDir; highp vec2 _LightCoord; }; -varying highp vec2 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_COLOR0; -varying highp vec2 xlv_TEXCOORD0; -uniform mediump float _TranslucencyViewDependency; -uniform sampler2D _TranslucencyMap; -uniform mediump vec3 _TranslucencyColor; -uniform mediump float _ShadowStrength; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform highp vec4 _LightColor0; -uniform highp float _Cutoff; -uniform highp vec4 _Color; uniform sampler2D _BumpSpecMap; +uniform highp vec4 _Color; +uniform highp float _Cutoff; +uniform highp vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform mediump float _ShadowStrength; +uniform mediump vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +uniform mediump float _TranslucencyViewDependency; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR0; +varying highp vec3 xlv_TEXCOORD1; +varying highp vec3 xlv_TEXCOORD2; +varying highp vec2 xlv_TEXCOORD3; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt index 815059631..c615751d1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt @@ -1,18 +1,18 @@ -varying vec2 xlv_TEXCOORD3; -varying vec3 xlv_TEXCOORD2; -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_COLOR0; -varying vec2 xlv_TEXCOORD0; -uniform float _TranslucencyViewDependency; -uniform sampler2D _TranslucencyMap; -uniform vec3 _TranslucencyColor; -uniform float _ShadowStrength; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpSpecMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _ShadowStrength; +uniform vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +uniform float _TranslucencyViewDependency; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_COLOR0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec2 xlv_TEXCOORD3; void main () { vec4 c_1; @@ -24,7 +24,9 @@ void main () tmpvar_4 = texture2D (_BumpSpecMap, xlv_TEXCOORD0); vec4 normal_5; normal_5.xy = ((tmpvar_4.wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); float x_6; x_6 = (tmpvar_2.w - _Cutoff); if ((x_6 < 0.0)) { @@ -35,11 +37,25 @@ void main () vec4 c_8; float tmpvar_9; tmpvar_9 = dot (normal_5.xyz, xlv_TEXCOORD1); - c_8.xyz = (((tmpvar_2.xyz * _Color.xyz) * xlv_COLOR0.w) * ((((mix (clamp (-(tmpvar_9), 0.0, 1.0), clamp (dot (tmpvar_7, -(xlv_TEXCOORD1)), 0.0, 1.0), _TranslucencyViewDependency) * tmpvar_3.z) * _TranslucencyColor) * 2.0) + max (0.0, ((tmpvar_9 * 0.6) + 0.4)))); - c_8.xyz = ((c_8.xyz * _LightColor0.xyz) + (pow (max (0.0, dot (normal_5.xyz, normalize((xlv_TEXCOORD1 + tmpvar_7)))), (tmpvar_4.x * 128.0)) * (tmpvar_3.w * _Color.x))); + c_8.xyz = (((tmpvar_2.xyz * _Color.xyz) * xlv_COLOR0.w) * (( + ((mix (clamp ( + -(tmpvar_9) + , 0.0, 1.0), clamp ( + dot (tmpvar_7, -(xlv_TEXCOORD1)) + , 0.0, 1.0), _TranslucencyViewDependency) * tmpvar_3.z) * _TranslucencyColor) + * 2.0) + max (0.0, + ((tmpvar_9 * 0.6) + 0.4) + ))); + c_8.xyz = ((c_8.xyz * _LightColor0.xyz) + (pow ( + max (0.0, dot (normal_5.xyz, normalize((xlv_TEXCOORD1 + tmpvar_7)))) + , + (tmpvar_4.x * 128.0) + ) * (tmpvar_3.w * _Color.x))); c_8.xyz = (c_8.xyz * mix (2.0, (texture2D (_LightTexture0, xlv_TEXCOORD3).w * 2.0), _ShadowStrength)); c_1.xyz = c_8.xyz; c_1.w = tmpvar_2.w; gl_FragData[0] = c_1; } + +// inputs: 5, stats: 40 alu 5 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt index 6502ef51b..951831c2e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt @@ -1,18 +1,18 @@ -varying highp vec2 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_COLOR0; -varying highp vec2 xlv_TEXCOORD0; -uniform mediump float _TranslucencyViewDependency; -uniform sampler2D _TranslucencyMap; -uniform mediump vec3 _TranslucencyColor; -uniform mediump float _ShadowStrength; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform highp vec4 _LightColor0; -uniform highp float _Cutoff; -uniform highp vec4 _Color; uniform sampler2D _BumpSpecMap; +uniform highp vec4 _Color; +uniform highp float _Cutoff; +uniform highp vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform mediump float _ShadowStrength; +uniform mediump vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +uniform mediump float _TranslucencyViewDependency; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR0; +varying highp vec3 xlv_TEXCOORD1; +varying highp vec3 xlv_TEXCOORD2; +varying highp vec2 xlv_TEXCOORD3; void main () { mediump vec4 c_1; @@ -39,7 +39,9 @@ void main () norspc_5 = tmpvar_12; mediump vec4 normal_13; normal_13.xy = ((norspc_5.wy * 2.0) - 1.0); - normal_13.z = sqrt(((1.0 - (normal_13.x * normal_13.x)) - (normal_13.y * normal_13.y))); + normal_13.z = sqrt(((1.0 - + (normal_13.x * normal_13.x) + ) - (normal_13.y * normal_13.y))); highp float x_14; x_14 = (c_7.w - _Cutoff); if ((x_14 < 0.0)) { @@ -58,8 +60,18 @@ void main () mediump float tmpvar_20; tmpvar_20 = dot (normal_13.xyz, lightDir_2); mediump float tmpvar_21; - tmpvar_21 = (pow (max (0.0, dot (normal_13.xyz, normalize((lightDir_2 + viewDir_17)))), (norspc_5.x * 128.0)) * tmpvar_4); - c_19.xyz = (tmpvar_3 * ((((mix (clamp (-(tmpvar_20), 0.0, 1.0), clamp (dot (viewDir_17, -(lightDir_2)), 0.0, 1.0), _TranslucencyViewDependency) * trngls_6.z) * _TranslucencyColor) * 2.0) + max (0.0, ((tmpvar_20 * 0.6) + 0.4)))); + tmpvar_21 = (pow (max (0.0, + dot (normal_13.xyz, normalize((lightDir_2 + viewDir_17))) + ), (norspc_5.x * 128.0)) * tmpvar_4); + c_19.xyz = (tmpvar_3 * (( + ((mix (clamp ( + -(tmpvar_20) + , 0.0, 1.0), clamp ( + dot (viewDir_17, -(lightDir_2)) + , 0.0, 1.0), _TranslucencyViewDependency) * trngls_6.z) * _TranslucencyColor) + * 2.0) + max (0.0, + ((tmpvar_20 * 0.6) + 0.4) + ))); highp vec3 tmpvar_22; tmpvar_22 = ((c_19.xyz * _LightColor0.xyz) + tmpvar_21); c_19.xyz = tmpvar_22; @@ -69,3 +81,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 5, stats: 40 alu 5 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt index ec0b08733..e3b882889 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-irES.txt @@ -6,20 +6,20 @@ struct v2f { highp vec3 nl; highp vec3 nh; }; -varying highp vec3 xlv_TEXCOORD4; -varying highp vec3 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_SV_POSITION; -uniform sampler2D _TranslucencyMap; -uniform lowp vec3 _TranslucencyColor; -uniform highp vec4 _TerrainTreeLightColors[4]; -uniform lowp vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform lowp float _Cutoff; -uniform sampler2D _BumpSpecMap; uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT; +uniform sampler2D _BumpSpecMap; +uniform lowp float _Cutoff; +uniform sampler2D _MainTex; +uniform lowp vec4 _SpecColor; +uniform highp vec4 _TerrainTreeLightColors[4]; +uniform lowp vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +varying highp vec4 xlv_SV_POSITION; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; +varying highp vec3 xlv_TEXCOORD2; +varying highp vec3 xlv_TEXCOORD3; +varying highp vec3 xlv_TEXCOORD4; void xll_clip ( in float x_1 ) @@ -102,7 +102,11 @@ lowp vec4 xlat_main ( tmpvar_34 = (tmpvar_33 * gloss_12); spec_4 = tmpvar_34; mediump vec3 tmpvar_35; - tmpvar_35 = (light_11 + (((albedo_15 * (translucencyColor_7 + nl_6)) + (_SpecColor.xyz * spec_4)) * lightColor_8)); + tmpvar_35 = (light_11 + (( + (albedo_15 * (translucencyColor_7 + nl_6)) + + + (_SpecColor.xyz * spec_4) + ) * lightColor_8)); light_11 = tmpvar_35; int _post_incdec_tmp_36; _post_incdec_tmp_36 = j_9; diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt index 7421628de..a98e6af87 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt @@ -1,16 +1,16 @@ -varying highp vec3 xlv_TEXCOORD4; -varying highp vec3 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -uniform sampler2D _TranslucencyMap; -uniform lowp vec3 _TranslucencyColor; -uniform highp vec4 _TerrainTreeLightColors[4]; -uniform lowp vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform lowp float _Cutoff; -uniform sampler2D _BumpSpecMap; uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT; +uniform sampler2D _BumpSpecMap; +uniform lowp float _Cutoff; +uniform sampler2D _MainTex; +uniform lowp vec4 _SpecColor; +uniform highp vec4 _TerrainTreeLightColors[4]; +uniform lowp vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; +varying highp vec3 xlv_TEXCOORD2; +varying highp vec3 xlv_TEXCOORD3; +varying highp vec3 xlv_TEXCOORD4; void main () { lowp vec4 c_1; @@ -55,7 +55,11 @@ void main () highp float tmpvar_20; tmpvar_20 = xlv_TEXCOORD4.x; nh_2 = tmpvar_20; - light_6 = (light_6 + (((albedo_9 * ((backContribs_5.x * _TranslucencyColor) + nl_3)) + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))) * lightColor_4)); + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.x * _TranslucencyColor) + nl_3)) + + + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); highp vec3 tmpvar_21; tmpvar_21 = _TerrainTreeLightColors[1].xyz; lightColor_4 = tmpvar_21; @@ -65,7 +69,11 @@ void main () highp float tmpvar_23; tmpvar_23 = xlv_TEXCOORD4.y; nh_2 = tmpvar_23; - light_6 = (light_6 + (((albedo_9 * ((backContribs_5.y * _TranslucencyColor) + nl_3)) + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))) * lightColor_4)); + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.y * _TranslucencyColor) + nl_3)) + + + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); highp vec3 tmpvar_24; tmpvar_24 = _TerrainTreeLightColors[2].xyz; lightColor_4 = tmpvar_24; @@ -75,7 +83,11 @@ void main () highp float tmpvar_26; tmpvar_26 = xlv_TEXCOORD4.z; nh_2 = tmpvar_26; - light_6 = (light_6 + (((albedo_9 * ((backContribs_5.z * _TranslucencyColor) + nl_3)) + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))) * lightColor_4)); + light_6 = (light_6 + (( + (albedo_9 * ((backContribs_5.z * _TranslucencyColor) + nl_3)) + + + (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7)) + ) * lightColor_4)); mediump vec3 tmpvar_27; tmpvar_27 = (light_6 * 2.0); c_1.xyz = tmpvar_27; @@ -83,3 +95,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 5, stats: 35 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt new file mode 100644 index 000000000..e6094a056 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt @@ -0,0 +1,258 @@ +#extension GL_ARB_shader_texture_lod : require + +vec4 xll_texCUBElod(samplerCube s, vec4 coord) { + return textureCubeLod( s, coord.xyz, coord.w); +} +mat3 xll_transpose_mf3x3(mat3 m) { + return mat3( m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2]); +} +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +vec3 xll_saturate_vf3( vec3 x) { + return clamp( x, 0.0, 1.0); +} +vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; } +struct VertexOutput { + vec4 pos; + vec4 tex; + vec4 posWorld; + vec3 normalWorld; + vec4 tangentWorld; + vec3 extra; + vec4 _ShadowCoord; + vec3 lightDir; +}; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ScreenParams; +uniform vec4 _ZBufferParams; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHC; +uniform vec4 _LightShadowData; + + +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 unity_Scale; +uniform mat4 glstate_matrix_transpose_modelview0; + + + + +uniform mat4 unity_MatrixV; +uniform mat4 unity_MatrixVP; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _MainTex_ST; +uniform sampler2D _DetailAlbedoMap; +uniform vec4 _DetailAlbedoMap_ST; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform vec4 _DetailNormalMap_ST; +uniform float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform float _Exposure; +uniform float _DetailBumpScale; +uniform float _AlphaTestRef; +uniform float _DetailBumpTiling; +uniform vec4 _Color; +uniform vec4 _SpecularColor; +uniform sampler2D _SpecGlossMap; +uniform float _Glossiness; + +uniform vec4 unity_ColorSpaceGrey; + +uniform sampler2D _ShadowMapTexture; +uniform vec4 _LightColor0; + +uniform samplerCube _SpecCube; +uniform vec4 unity_LightmapST; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform float _SelfIllumScale; +uniform sampler2D _SelfIllum; + +vec3 Albedo( in vec4 texcoords ) { + vec3 albedo = (_Color.xyz * texture2D( _MainTex, texcoords.xy).xyz); + albedo *= (2.0 * texture2D( _DetailAlbedoMap, texcoords.zw).xyz); + return albedo; +} +float Alpha( in vec2 uv ) { + return (texture2D( _AlphaMap, uv).w * _Color.w); +} +float BlinnPhongTerm( in float roughness, in float NdotH ) { + float m = (pow( roughness, 4.0) + 1e-05); + float n = ((1.0 / m) - 2.0); + float normTerm = ((n + 1.0) / 6.28318); + float specTerm = pow( NdotH, n); + return (specTerm * normTerm); +} +float BlinnTerm( in vec3 normal, in vec3 halfDir ) { + return max( 0.0, dot( normal, halfDir)); +} +float FresnelTerm( in float F0, in float cosA ) { + float _Falloff = 5.0; + float t = pow( abs((1.0 - cosA)), _Falloff); + return (F0 + ((1.0 - F0) * t)); +} +float CTGeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH ) { + VdotH += 1e-05; + return min( 1.0, min( (((2.0 * NdotH) * NdotV) / VdotH), (((2.0 * NdotH) * NdotL) / VdotH))); +} +float GeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH, in float LdotV ) { + return CTGeometricTerm( NdotL, NdotH, NdotV, VdotH); +} +float LambertTerm( in vec3 normal, in vec3 lightDir ) { + return max( 0.0, dot( normal, lightDir)); +} +float RGBToLuminance( in vec3 color ) { + vec3 lumSensitivity = vec3( 0.299, 0.587, 0.114); + float luminance = dot( color, lumSensitivity); + return luminance; +} +vec3 BRDF_Disney_PBS( in vec3 baseColor, in vec3 lightColor, in vec3 specColor, in float specular, in float roughness, in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 ambient, in vec3 env ) { + vec3 halfDir = normalize((lightDir + viewDir)); + float nl = LambertTerm( normal, lightDir); + float nh = BlinnTerm( normal, halfDir); + float nv = max( 0.0, dot( normal, viewDir)); + float vh = max( 0.0, dot( viewDir, halfDir)); + float lv = max( 0.0, dot( lightDir, viewDir)); + float lh = max( 0.0, dot( lightDir, halfDir)); + float F = FresnelTerm( specular, vh); + float G = GeometricTerm( nl, nh, nv, vh, lv); + float R = BlinnPhongTerm( roughness, nh); + R = max( 0.0, R); + float Fd90 = (0.5 + ((2.0 * pow( lh, 2.0)) * roughness)); + float nlPow = pow( (1.00001 - nl), 5.0); + float nvPow = pow( (1.00001 - nv), 5.0); + float disneyDiffuse = ((1.0 + ((Fd90 - 1.0) * nlPow)) * (1.0 + ((Fd90 - 1.0) * nvPow))); + float specularTerm = max( 0.0, (((F * G) * R) / ((4.0 * nv) + 1e-05))); + float diffuseTerm = (disneyDiffuse * nl); + vec3 diffuseColor = baseColor; + vec3 color = (((diffuseColor * (ambient + (diffuseTerm * lightColor))) + (specColor * (env + (lightColor * specularTerm)))) + ((((1.0 - RGBToLuminance( specColor)) * (1.0 - roughness)) * FresnelTerm( 0.0, nv)) * env)); + return color; +} +vec3 DecodeLightmap( in vec4 color ) { + return ((8.0 * color.w) * color.xyz); +} +vec3 DirLightmapDiffuse( in mat3 dirBasis, in vec4 color, in vec4 scale, in vec3 normal, in bool surfFuncWritesNormal, out vec3 scalePerBasisVector ) { + vec3 lm = DecodeLightmap( color); + scalePerBasisVector = DecodeLightmap( scale); + if (surfFuncWritesNormal){ + vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal)); + lm *= dot( normalInRnmBasis, scalePerBasisVector); + } + return lm; +} +void DecodeDirLightmap( in vec3 normal, in vec4 colorLM, in vec4 scaleLM, out vec3 lightColor, out vec3 lightDir ) { + mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.816497, 0.0, 0.57735), vec3( -0.408248, 0.707107, 0.57735), vec3( -0.408248, -0.707107, 0.57735))); + vec3 scalePerBasisVector; + lightColor = DirLightmapDiffuse( unity_DirBasis, colorLM, scaleLM, normal, true, scalePerBasisVector); + lightDir = normalize((((scalePerBasisVector.x * xll_matrixindex_mf3x3_i (unity_DirBasis, 0)) + (scalePerBasisVector.y * xll_matrixindex_mf3x3_i (unity_DirBasis, 1))) + (scalePerBasisVector.z * xll_matrixindex_mf3x3_i (unity_DirBasis, 2)))); +} +vec3 EnergyCalculator( in vec3 specColor, in float specular, in vec3 baseColor ) { + return min( baseColor, (vec3( 1.0, 1.0, 1.0) - specular)); +} +float toLinearFast1( in float c ) { + float c2 = (c * c); + return dot( vec2( 0.7532, 0.2468), vec2( c2, (c * c2))); +} +vec3 fromRGBM( in vec4 c ) { + return ((c.xyz * toLinearFast1( c.w)) * _Exposure); +} +vec3 EnvMap( in vec4 worldNormal ) { + vec4 envTexel = xll_texCUBElod( _SpecCube, vec4( worldNormal.xyz, worldNormal.w)); + return fromRGBM( envTexel); +} +float Occlusion( in vec2 uv ) { + return texture2D( _Occlusion, uv).x; +} +vec4 SpecularGloss( in vec2 uv ) { + vec4 specGloss = texture2D( _SpecGlossMap, uv); + return vec4( specGloss.xyz, specGloss.w); +} +vec3 BlendNormals( in vec3 n1, in vec3 n2 ) { + return normalize(vec3( (n1.xy + n2.xy), (n1.z * n2.z))); +} +vec3 UnpackScaleNormal( in vec4 packednormal, in float bumpScale ) { + vec3 normal; + normal.xy = ((packednormal.wy * 2.0) - 1.0); + normal.xy *= bumpScale; + normal.z = sqrt((1.0 - xll_saturate_f(dot( normal.xy, normal.xy)))); + return normal; +} +vec3 TangentNormal( in vec4 texcoords ) { + vec3 normalTangent = UnpackScaleNormal( texture2D( _BumpMap, texcoords.xy), _BumpScale); + vec3 detailNormalTangent = UnpackScaleNormal( texture2D( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale); + normalTangent = BlendNormals( normalTangent, detailNormalTangent); + return normalTangent; +} +mat3 TangentToWorld( in vec3 normal, in vec3 tangent, in vec3 flip ) { + vec3 binormal = (cross( normal, tangent) * flip); + return xll_transpose_mf3x3(mat3( tangent, binormal, normal)); +} +float unitySampleShadow( in vec4 shadowCoord ) { + float shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x; + return shadow; +} +vec4 frag( in VertexOutput i ) { + float atten = unitySampleShadow( i._ShadowCoord); + mat3 tanToWorld = TangentToWorld( i.normalWorld, i.tangentWorld.xyz, vec3( i.tangentWorld.w)); + i.normalWorld = normalize(i.normalWorld); + vec3 normalTangent = TangentNormal( i.tex); + vec3 normalWorld = (normalTangent * tanToWorld); + vec3 eyeVec = normalize((i.posWorld.xyz - _WorldSpaceCameraPos)); + vec4 specGloss = SpecularGloss( i.tex.xy); + vec3 specColor = specGloss.xyz; + float specular = RGBToLuminance( specGloss.xyz); + float roughness = (1.0 - specGloss.w); + vec3 env = vec3( 0.0); + env = (EnvMap( vec4( reflect( eyeVec, normalWorld), (roughness * 5.0))) * Occlusion( i.tex.xy)); + vec3 lightColor = (_LightColor0.xyz * 2.0); + vec3 lightDir = _WorldSpaceLightPos0.xyz; + float subsurface = 1.0; + vec3 ambient = vec3( 0.0); + vec4 lmtex = texture2D( unity_Lightmap, i.extra.xy); + vec4 lmIndTex = texture2D( unity_LightmapInd, i.extra.xy); + vec3 lightDirTangent; + DecodeDirLightmap( normalTangent, lmtex, lmIndTex, lightColor, lightDirTangent); + lightDir = (lightDirTangent * tanToWorld); + lightDir = normalize(lightDir); + vec3 baseColor = EnergyCalculator( specColor, specular, Albedo( i.tex)); + vec3 color = BRDF_Disney_PBS( baseColor, (atten * lightColor), specColor, specular, roughness, normalWorld, lightDir, (-eyeVec), ambient, env); + color += (texture2D( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale); + float alpha = Alpha( i.tex.xy); + return vec4( color, alpha); +} +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +varying vec3 xlv_TEXCOORD7; +void main() { + vec4 xl_retval; + VertexOutput xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.tex = vec4(xlv_TEXCOORD0); + xlt_i.posWorld = vec4(xlv_TEXCOORD1); + xlt_i.normalWorld = vec3(xlv_TEXCOORD2); + xlt_i.tangentWorld = vec4(xlv_TEXCOORD3); + xlt_i.extra = vec3(xlv_TEXCOORD4); + xlt_i._ShadowCoord = vec4(xlv_TEXCOORD5); + xlt_i.lightDir = vec3(xlv_TEXCOORD7); + xl_retval = frag( xlt_i); + gl_FragData[0] = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt new file mode 100644 index 000000000..72e73936a --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-ir.txt @@ -0,0 +1,894 @@ +#extension GL_ARB_shader_texture_lod : enable +struct VertexOutput { + vec4 pos; + vec4 tex; + vec4 posWorld; + vec3 normalWorld; + vec4 tangentWorld; + vec3 extra; + vec4 _ShadowCoord; + vec3 lightDir; +}; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _ProjectionParams; +uniform vec4 _ScreenParams; +uniform vec4 _ZBufferParams; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHC; +uniform vec4 _LightShadowData; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 unity_Scale; +uniform mat4 glstate_matrix_transpose_modelview0; +uniform mat4 unity_MatrixV; +uniform mat4 unity_MatrixVP; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _MainTex_ST; +uniform sampler2D _DetailAlbedoMap; +uniform vec4 _DetailAlbedoMap_ST; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform vec4 _DetailNormalMap_ST; +uniform float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform float _Exposure; +uniform float _DetailBumpScale; +uniform float _AlphaTestRef; +uniform float _DetailBumpTiling; +uniform vec4 _Color; +uniform vec4 _SpecularColor; +uniform sampler2D _SpecGlossMap; +uniform float _Glossiness; +uniform vec4 unity_ColorSpaceGrey; +uniform sampler2D _ShadowMapTexture; +uniform vec4 _LightColor0; +uniform samplerCube _SpecCube; +uniform vec4 unity_LightmapST; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform float _SelfIllumScale; +uniform sampler2D _SelfIllum; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +varying vec3 xlv_TEXCOORD7; +vec4 xll_texCUBElod ( + in samplerCube s_1, + in vec4 coord_2 +) +{ + vec4 tmpvar_3; + tmpvar_3 = textureCubeLod (s_1, coord_2.xyz, coord_2.w); + return tmpvar_3; +} + +mat3 xll_transpose_mf3x3 ( + in mat3 m_4 +) +{ + mat3 tmpvar_5; + float tmpvar_6; + tmpvar_6 = m_4[0][0]; + tmpvar_5[0].x = tmpvar_6; + float tmpvar_7; + tmpvar_7 = m_4[1][0]; + tmpvar_5[0].y = tmpvar_7; + float tmpvar_8; + tmpvar_8 = m_4[2][0]; + tmpvar_5[0].z = tmpvar_8; + float tmpvar_9; + tmpvar_9 = m_4[0][1]; + tmpvar_5[1].x = tmpvar_9; + float tmpvar_10; + tmpvar_10 = m_4[1][1]; + tmpvar_5[1].y = tmpvar_10; + float tmpvar_11; + tmpvar_11 = m_4[2][1]; + tmpvar_5[1].z = tmpvar_11; + float tmpvar_12; + tmpvar_12 = m_4[0][2]; + tmpvar_5[2].x = tmpvar_12; + float tmpvar_13; + tmpvar_13 = m_4[1][2]; + tmpvar_5[2].y = tmpvar_13; + float tmpvar_14; + tmpvar_14 = m_4[2][2]; + tmpvar_5[2].z = tmpvar_14; + return tmpvar_5; +} + +float xll_saturate_f ( + in float x_15 +) +{ + float tmpvar_16; + tmpvar_16 = clamp (x_15, 0.0, 1.0); + return tmpvar_16; +} + +vec3 xll_saturate_vf3 ( + in vec3 x_17 +) +{ + vec3 tmpvar_18; + tmpvar_18 = clamp (x_17, 0.0, 1.0); + return tmpvar_18; +} + +vec3 xll_matrixindex_mf3x3_i ( + in mat3 m_19, + in int i_20 +) +{ + vec3 v_21; + float tmpvar_22; + tmpvar_22 = m_19[0][i_20]; + v_21.x = tmpvar_22; + float tmpvar_23; + tmpvar_23 = m_19[1][i_20]; + v_21.y = vec2(tmpvar_23).y; + float tmpvar_24; + tmpvar_24 = m_19[2][i_20]; + v_21.z = vec3(tmpvar_24).z; + return v_21; +} + +vec3 Albedo ( + in vec4 texcoords_25 +) +{ + vec3 albedo_26; + vec4 tmpvar_27; + tmpvar_27 = texture2D (_MainTex, texcoords_25.xy); + vec3 tmpvar_28; + tmpvar_28 = (_Color.xyz * tmpvar_27.xyz); + albedo_26 = tmpvar_28; + vec4 tmpvar_29; + tmpvar_29 = texture2D (_DetailAlbedoMap, texcoords_25.zw); + vec3 tmpvar_30; + tmpvar_30 = (albedo_26 * (2.0 * tmpvar_29.xyz)); + albedo_26 = tmpvar_30; + return albedo_26; +} + +float Alpha ( + in vec2 uv_31 +) +{ + vec4 tmpvar_32; + tmpvar_32 = texture2D (_AlphaMap, uv_31); + return (tmpvar_32.w * _Color.w); +} + +float BlinnPhongTerm ( + in float roughness_33, + in float NdotH_34 +) +{ + float specTerm_35; + float normTerm_36; + float n_37; + float m_38; + float tmpvar_39; + tmpvar_39 = pow (roughness_33, 4.0); + float tmpvar_40; + tmpvar_40 = (tmpvar_39 + 1e-05); + m_38 = tmpvar_40; + float tmpvar_41; + tmpvar_41 = ((1.0 / m_38) - 2.0); + n_37 = tmpvar_41; + float tmpvar_42; + tmpvar_42 = ((n_37 + 1.0) / 6.28318); + normTerm_36 = tmpvar_42; + float tmpvar_43; + tmpvar_43 = pow (NdotH_34, n_37); + float tmpvar_44; + tmpvar_44 = tmpvar_43; + specTerm_35 = tmpvar_44; + return (specTerm_35 * normTerm_36); +} + +float BlinnTerm ( + in vec3 normal_45, + in vec3 halfDir_46 +) +{ + float tmpvar_47; + tmpvar_47 = dot (normal_45, halfDir_46); + float tmpvar_48; + tmpvar_48 = max (0.0, tmpvar_47); + return tmpvar_48; +} + +float FresnelTerm ( + in float F0_49, + in float cosA_50 +) +{ + float t_51; + float _Falloff_52; + float tmpvar_53; + tmpvar_53 = 5.0; + _Falloff_52 = tmpvar_53; + float tmpvar_54; + tmpvar_54 = abs ((1.0 - cosA_50)); + float tmpvar_55; + tmpvar_55 = pow (tmpvar_54, _Falloff_52); + float tmpvar_56; + tmpvar_56 = tmpvar_55; + t_51 = tmpvar_56; + return (F0_49 + ((1.0 - F0_49) * t_51)); +} + +float CTGeometricTerm ( + in float NdotL_57, + in float NdotH_58, + in float NdotV_59, + in float VdotH_60 +) +{ + float tmpvar_61; + tmpvar_61 = (VdotH_60 + 1e-05); + VdotH_60 = tmpvar_61; + float tmpvar_62; + tmpvar_62 = min ((((2.0 * NdotH_58) * NdotV_59) / VdotH_60), (((2.0 * NdotH_58) * NdotL_57) / VdotH_60)); + float tmpvar_63; + tmpvar_63 = min (1.0, tmpvar_62); + return tmpvar_63; +} + +float GeometricTerm ( + in float NdotL_64, + in float NdotH_65, + in float NdotV_66, + in float VdotH_67, + in float LdotV_68 +) +{ + float tmpvar_69; + tmpvar_69 = CTGeometricTerm (NdotL_64, NdotH_65, NdotV_66, VdotH_67); + return tmpvar_69; +} + +float LambertTerm ( + in vec3 normal_70, + in vec3 lightDir_71 +) +{ + float tmpvar_72; + tmpvar_72 = dot (normal_70, lightDir_71); + float tmpvar_73; + tmpvar_73 = max (0.0, tmpvar_72); + return tmpvar_73; +} + +float RGBToLuminance ( + in vec3 color_74 +) +{ + float luminance_75; + vec3 lumSensitivity_76; + vec3 tmpvar_77; + tmpvar_77 = vec3(0.299, 0.587, 0.114); + lumSensitivity_76 = tmpvar_77; + float tmpvar_78; + tmpvar_78 = dot (color_74, lumSensitivity_76); + float tmpvar_79; + tmpvar_79 = tmpvar_78; + luminance_75 = tmpvar_79; + return luminance_75; +} + +vec3 BRDF_Disney_PBS ( + in vec3 baseColor_80, + in vec3 lightColor_81, + in vec3 specColor_82, + in float specular_83, + in float roughness_84, + in vec3 normal_85, + in vec3 lightDir_86, + in vec3 viewDir_87, + in vec3 ambient_88, + in vec3 env_89 +) +{ + vec3 color_90; + vec3 diffuseColor_91; + float diffuseTerm_92; + float specularTerm_93; + float disneyDiffuse_94; + float nvPow_95; + float nlPow_96; + float Fd90_97; + float R_98; + float G_99; + float F_100; + float lh_101; + float lv_102; + float vh_103; + float nv_104; + float nh_105; + float nl_106; + vec3 halfDir_107; + vec3 tmpvar_108; + tmpvar_108 = normalize ((lightDir_86 + viewDir_87)); + vec3 tmpvar_109; + tmpvar_109 = tmpvar_108; + halfDir_107 = tmpvar_109; + float tmpvar_110; + tmpvar_110 = LambertTerm (normal_85, lightDir_86); + float tmpvar_111; + tmpvar_111 = tmpvar_110; + nl_106 = tmpvar_111; + float tmpvar_112; + tmpvar_112 = BlinnTerm (normal_85, halfDir_107); + float tmpvar_113; + tmpvar_113 = tmpvar_112; + nh_105 = tmpvar_113; + float tmpvar_114; + tmpvar_114 = dot (normal_85, viewDir_87); + float tmpvar_115; + tmpvar_115 = max (0.0, tmpvar_114); + float tmpvar_116; + tmpvar_116 = tmpvar_115; + nv_104 = tmpvar_116; + float tmpvar_117; + tmpvar_117 = dot (viewDir_87, halfDir_107); + float tmpvar_118; + tmpvar_118 = max (0.0, tmpvar_117); + float tmpvar_119; + tmpvar_119 = tmpvar_118; + vh_103 = tmpvar_119; + float tmpvar_120; + tmpvar_120 = dot (lightDir_86, viewDir_87); + float tmpvar_121; + tmpvar_121 = max (0.0, tmpvar_120); + float tmpvar_122; + tmpvar_122 = tmpvar_121; + lv_102 = tmpvar_122; + float tmpvar_123; + tmpvar_123 = dot (lightDir_86, halfDir_107); + float tmpvar_124; + tmpvar_124 = max (0.0, tmpvar_123); + float tmpvar_125; + tmpvar_125 = tmpvar_124; + lh_101 = tmpvar_125; + float tmpvar_126; + tmpvar_126 = FresnelTerm (specular_83, vh_103); + float tmpvar_127; + tmpvar_127 = tmpvar_126; + F_100 = tmpvar_127; + float tmpvar_128; + tmpvar_128 = GeometricTerm (nl_106, nh_105, nv_104, vh_103, lv_102); + float tmpvar_129; + tmpvar_129 = tmpvar_128; + G_99 = tmpvar_129; + float tmpvar_130; + tmpvar_130 = BlinnPhongTerm (roughness_84, nh_105); + float tmpvar_131; + tmpvar_131 = tmpvar_130; + R_98 = tmpvar_131; + float tmpvar_132; + tmpvar_132 = max (0.0, R_98); + float tmpvar_133; + tmpvar_133 = tmpvar_132; + R_98 = tmpvar_133; + float tmpvar_134; + tmpvar_134 = pow (lh_101, 2.0); + float tmpvar_135; + tmpvar_135 = (0.5 + ((2.0 * tmpvar_134) * roughness_84)); + Fd90_97 = tmpvar_135; + float tmpvar_136; + tmpvar_136 = pow ((1.00001 - nl_106), 5.0); + float tmpvar_137; + tmpvar_137 = tmpvar_136; + nlPow_96 = tmpvar_137; + float tmpvar_138; + tmpvar_138 = pow ((1.00001 - nv_104), 5.0); + float tmpvar_139; + tmpvar_139 = tmpvar_138; + nvPow_95 = tmpvar_139; + float tmpvar_140; + tmpvar_140 = ((1.0 + ( + (Fd90_97 - 1.0) + * nlPow_96)) * (1.0 + ( + (Fd90_97 - 1.0) + * nvPow_95))); + disneyDiffuse_94 = tmpvar_140; + float tmpvar_141; + tmpvar_141 = max (0.0, (((F_100 * G_99) * R_98) / ((4.0 * nv_104) + 1e-05))); + float tmpvar_142; + tmpvar_142 = tmpvar_141; + specularTerm_93 = tmpvar_142; + float tmpvar_143; + tmpvar_143 = (disneyDiffuse_94 * nl_106); + diffuseTerm_92 = tmpvar_143; + vec3 tmpvar_144; + tmpvar_144 = baseColor_80; + diffuseColor_91 = tmpvar_144; + float tmpvar_145; + tmpvar_145 = RGBToLuminance (specColor_82); + float tmpvar_146; + tmpvar_146 = FresnelTerm (0.0, nv_104); + vec3 tmpvar_147; + tmpvar_147 = (((diffuseColor_91 * + (ambient_88 + (diffuseTerm_92 * lightColor_81)) + ) + (specColor_82 * + (env_89 + (lightColor_81 * specularTerm_93)) + )) + (( + ((1.0 - tmpvar_145) * (1.0 - roughness_84)) + * tmpvar_146) * env_89)); + color_90 = tmpvar_147; + return color_90; +} + +vec3 DecodeLightmap ( + in vec4 color_148 +) +{ + return ((8.0 * color_148.w) * color_148.xyz); +} + +vec3 DirLightmapDiffuse ( + in mat3 dirBasis_149, + in vec4 color_150, + in vec4 scale_151, + in vec3 normal_152, + in bool surfFuncWritesNormal_153, + out vec3 scalePerBasisVector_154 +) +{ + vec3 lm_155; + vec3 tmpvar_156; + tmpvar_156 = DecodeLightmap (color_150); + vec3 tmpvar_157; + tmpvar_157 = tmpvar_156; + lm_155 = tmpvar_157; + vec3 tmpvar_158; + tmpvar_158 = DecodeLightmap (scale_151); + vec3 tmpvar_159; + tmpvar_159 = tmpvar_158; + scalePerBasisVector_154 = tmpvar_159; + if (surfFuncWritesNormal_153) { + vec3 normalInRnmBasis_160; + vec3 tmpvar_161; + tmpvar_161 = xll_saturate_vf3 ((dirBasis_149 * normal_152)); + vec3 tmpvar_162; + tmpvar_162 = tmpvar_161; + normalInRnmBasis_160 = tmpvar_162; + float tmpvar_163; + tmpvar_163 = dot (normalInRnmBasis_160, scalePerBasisVector_154); + vec3 tmpvar_164; + tmpvar_164 = (lm_155 * tmpvar_163); + lm_155 = tmpvar_164; + }; + return lm_155; +} + +void DecodeDirLightmap ( + in vec3 normal_165, + in vec4 colorLM_166, + in vec4 scaleLM_167, + out vec3 lightColor_168, + out vec3 lightDir_169 +) +{ + vec3 scalePerBasisVector_170; + mat3 unity_DirBasis_171; + mat3 tmpvar_172; + tmpvar_172 = xll_transpose_mf3x3 (mat3(0.816497, 0.0, 0.57735, -0.408248, 0.707107, 0.57735, -0.408248, -0.707107, 0.57735)); + mat3 tmpvar_173; + tmpvar_173 = tmpvar_172; + unity_DirBasis_171 = tmpvar_173; + vec3 tmpvar_174; + tmpvar_174 = DirLightmapDiffuse (unity_DirBasis_171, colorLM_166, scaleLM_167, normal_165, bool(1), scalePerBasisVector_170); + vec3 tmpvar_175; + tmpvar_175 = tmpvar_174; + lightColor_168 = tmpvar_175; + vec3 tmpvar_176; + tmpvar_176 = xll_matrixindex_mf3x3_i (unity_DirBasis_171, 0); + vec3 tmpvar_177; + tmpvar_177 = xll_matrixindex_mf3x3_i (unity_DirBasis_171, 1); + vec3 tmpvar_178; + tmpvar_178 = xll_matrixindex_mf3x3_i (unity_DirBasis_171, 2); + vec3 tmpvar_179; + tmpvar_179 = normalize ((((scalePerBasisVector_170.x * tmpvar_176) + (scalePerBasisVector_170.y * tmpvar_177)) + (scalePerBasisVector_170.z * tmpvar_178))); + vec3 tmpvar_180; + tmpvar_180 = tmpvar_179; + lightDir_169 = tmpvar_180; +} + +vec3 EnergyCalculator ( + in vec3 specColor_181, + in float specular_182, + in vec3 baseColor_183 +) +{ + vec3 tmpvar_184; + tmpvar_184 = min (baseColor_183, (vec3(1.0, 1.0, 1.0) - specular_182)); + return tmpvar_184; +} + +float toLinearFast1 ( + in float c_185 +) +{ + float c2_186; + float tmpvar_187; + tmpvar_187 = (c_185 * c_185); + c2_186 = tmpvar_187; + vec2 tmpvar_188; + tmpvar_188.x = c2_186; + tmpvar_188.y = (c_185 * c2_186); + float tmpvar_189; + tmpvar_189 = dot (vec2(0.7532, 0.2468), tmpvar_188); + return tmpvar_189; +} + +vec3 fromRGBM ( + in vec4 c_190 +) +{ + float tmpvar_191; + tmpvar_191 = toLinearFast1 (c_190.w); + return ((c_190.xyz * tmpvar_191) * _Exposure); +} + +vec3 EnvMap ( + in vec4 worldNormal_192 +) +{ + vec4 envTexel_193; + vec4 tmpvar_194; + tmpvar_194.xyz = worldNormal_192.xyz.xyz; + tmpvar_194.w = worldNormal_192.w; + vec4 tmpvar_195; + tmpvar_195 = xll_texCUBElod (_SpecCube, tmpvar_194); + vec4 tmpvar_196; + tmpvar_196 = tmpvar_195; + envTexel_193 = tmpvar_196; + vec3 tmpvar_197; + tmpvar_197 = fromRGBM (envTexel_193); + return tmpvar_197; +} + +float Occlusion ( + in vec2 uv_198 +) +{ + vec4 tmpvar_199; + tmpvar_199 = texture2D (_Occlusion, uv_198); + return tmpvar_199.x; +} + +vec4 SpecularGloss ( + in vec2 uv_200 +) +{ + vec4 specGloss_201; + vec4 tmpvar_202; + tmpvar_202 = texture2D (_SpecGlossMap, uv_200); + vec4 tmpvar_203; + tmpvar_203 = tmpvar_202; + specGloss_201 = tmpvar_203; + vec4 tmpvar_204; + tmpvar_204.xyz = specGloss_201.xyz.xyz; + tmpvar_204.w = specGloss_201.w; + return tmpvar_204; +} + +vec3 BlendNormals ( + in vec3 n1_205, + in vec3 n2_206 +) +{ + vec3 tmpvar_207; + tmpvar_207.xy = (n1_205.xy + n2_206.xy).xy; + tmpvar_207.z = (n1_205.z * n2_206.z); + vec3 tmpvar_208; + tmpvar_208 = normalize (tmpvar_207); + return tmpvar_208; +} + +vec3 UnpackScaleNormal ( + in vec4 packednormal_209, + in float bumpScale_210 +) +{ + vec3 normal_211; + vec2 tmpvar_212; + tmpvar_212 = ((packednormal_209.wy * 2.0) - 1.0); + normal_211.xy = tmpvar_212.xy.xy; + vec2 tmpvar_213; + tmpvar_213 = (normal_211.xy * bumpScale_210); + normal_211.xy = tmpvar_213.xy.xy; + float tmpvar_214; + tmpvar_214 = dot (normal_211.xy, normal_211.xy); + float tmpvar_215; + tmpvar_215 = xll_saturate_f (tmpvar_214); + float tmpvar_216; + tmpvar_216 = sqrt ((1.0 - tmpvar_215)); + float tmpvar_217; + tmpvar_217 = tmpvar_216; + normal_211.z = vec3(tmpvar_217).z; + return normal_211; +} + +vec3 TangentNormal ( + in vec4 texcoords_218 +) +{ + vec3 detailNormalTangent_219; + vec3 normalTangent_220; + vec4 tmpvar_221; + tmpvar_221 = texture2D (_BumpMap, texcoords_218.xy); + vec3 tmpvar_222; + tmpvar_222 = UnpackScaleNormal (tmpvar_221, _BumpScale); + vec3 tmpvar_223; + tmpvar_223 = tmpvar_222; + normalTangent_220 = tmpvar_223; + vec4 tmpvar_224; + tmpvar_224 = texture2D (_DetailNormalMap, texcoords_218.zw); + vec3 tmpvar_225; + tmpvar_225 = UnpackScaleNormal (tmpvar_224, _DetailNormalMapScale); + vec3 tmpvar_226; + tmpvar_226 = tmpvar_225; + detailNormalTangent_219 = tmpvar_226; + vec3 tmpvar_227; + tmpvar_227 = BlendNormals (normalTangent_220, detailNormalTangent_219); + vec3 tmpvar_228; + tmpvar_228 = tmpvar_227; + normalTangent_220 = tmpvar_228; + return normalTangent_220; +} + +mat3 TangentToWorld ( + in vec3 normal_229, + in vec3 tangent_230, + in vec3 flip_231 +) +{ + vec3 binormal_232; + vec3 tmpvar_233; + tmpvar_233 = cross (normal_229, tangent_230); + vec3 tmpvar_234; + tmpvar_234 = (tmpvar_233 * flip_231); + binormal_232 = tmpvar_234; + mat3 tmpvar_235; + vec3 tmpvar_236; + tmpvar_236 = tangent_230; + tmpvar_235[0] = tmpvar_236; + vec3 tmpvar_237; + tmpvar_237 = binormal_232; + tmpvar_235[1] = tmpvar_237; + vec3 tmpvar_238; + tmpvar_238 = normal_229; + tmpvar_235[2] = tmpvar_238; + mat3 tmpvar_239; + tmpvar_239 = xll_transpose_mf3x3 (tmpvar_235); + return tmpvar_239; +} + +float unitySampleShadow ( + in vec4 shadowCoord_240 +) +{ + float shadow_241; + vec4 tmpvar_242; + tmpvar_242 = texture2DProj (_ShadowMapTexture, shadowCoord_240); + float tmpvar_243; + tmpvar_243 = tmpvar_242.x; + shadow_241 = tmpvar_243; + return shadow_241; +} + +vec4 frag ( + in VertexOutput i_244 +) +{ + float alpha_245; + vec3 color_246; + vec3 baseColor_247; + vec3 lightDirTangent_248; + vec4 lmIndTex_249; + vec4 lmtex_250; + vec3 ambient_251; + float subsurface_252; + vec3 lightDir_253; + vec3 lightColor_254; + vec3 env_255; + float roughness_256; + float specular_257; + vec3 specColor_258; + vec4 specGloss_259; + vec3 eyeVec_260; + vec3 normalWorld_261; + vec3 normalTangent_262; + mat3 tanToWorld_263; + float atten_264; + float tmpvar_265; + tmpvar_265 = unitySampleShadow (i_244._ShadowCoord); + float tmpvar_266; + tmpvar_266 = tmpvar_265; + atten_264 = tmpvar_266; + vec3 tmpvar_267; + tmpvar_267 = vec3(i_244.tangentWorld.w); + mat3 tmpvar_268; + tmpvar_268 = TangentToWorld (i_244.normalWorld, i_244.tangentWorld.xyz, tmpvar_267); + mat3 tmpvar_269; + tmpvar_269 = tmpvar_268; + tanToWorld_263 = tmpvar_269; + vec3 tmpvar_270; + tmpvar_270 = normalize (i_244.normalWorld); + vec3 tmpvar_271; + tmpvar_271 = tmpvar_270; + i_244.normalWorld = tmpvar_271; + vec3 tmpvar_272; + tmpvar_272 = TangentNormal (i_244.tex); + vec3 tmpvar_273; + tmpvar_273 = tmpvar_272; + normalTangent_262 = tmpvar_273; + vec3 tmpvar_274; + tmpvar_274 = (normalTangent_262 * tanToWorld_263); + normalWorld_261 = tmpvar_274; + vec3 tmpvar_275; + tmpvar_275 = normalize ((i_244.posWorld.xyz - _WorldSpaceCameraPos)); + vec3 tmpvar_276; + tmpvar_276 = tmpvar_275; + eyeVec_260 = tmpvar_276; + vec4 tmpvar_277; + tmpvar_277 = SpecularGloss (i_244.tex.xy); + vec4 tmpvar_278; + tmpvar_278 = tmpvar_277; + specGloss_259 = tmpvar_278; + vec3 tmpvar_279; + tmpvar_279 = specGloss_259.xyz; + specColor_258 = tmpvar_279; + float tmpvar_280; + tmpvar_280 = RGBToLuminance (specGloss_259.xyz); + float tmpvar_281; + tmpvar_281 = tmpvar_280; + specular_257 = tmpvar_281; + float tmpvar_282; + tmpvar_282 = (1.0 - specGloss_259.w); + roughness_256 = tmpvar_282; + vec3 tmpvar_283; + tmpvar_283 = vec3(0.0, 0.0, 0.0); + env_255 = tmpvar_283; + vec3 tmpvar_284; + tmpvar_284 = reflect (eyeVec_260, normalWorld_261); + vec4 tmpvar_285; + tmpvar_285.xyz = tmpvar_284.xyz; + tmpvar_285.w = (roughness_256 * 5.0); + vec3 tmpvar_286; + tmpvar_286 = EnvMap (tmpvar_285); + float tmpvar_287; + tmpvar_287 = Occlusion (i_244.tex.xy); + vec3 tmpvar_288; + tmpvar_288 = (tmpvar_286 * tmpvar_287); + env_255 = tmpvar_288; + vec3 tmpvar_289; + tmpvar_289 = (_LightColor0.xyz * 2.0); + lightColor_254 = tmpvar_289; + vec3 tmpvar_290; + tmpvar_290 = _WorldSpaceLightPos0.xyz; + lightDir_253 = tmpvar_290; + float tmpvar_291; + tmpvar_291 = 1.0; + subsurface_252 = tmpvar_291; + vec3 tmpvar_292; + tmpvar_292 = vec3(0.0, 0.0, 0.0); + ambient_251 = tmpvar_292; + vec4 tmpvar_293; + tmpvar_293 = texture2D (unity_Lightmap, i_244.extra.xy); + vec4 tmpvar_294; + tmpvar_294 = tmpvar_293; + lmtex_250 = tmpvar_294; + vec4 tmpvar_295; + tmpvar_295 = texture2D (unity_LightmapInd, i_244.extra.xy); + vec4 tmpvar_296; + tmpvar_296 = tmpvar_295; + lmIndTex_249 = tmpvar_296; + DecodeDirLightmap (normalTangent_262, lmtex_250, lmIndTex_249, lightColor_254, lightDirTangent_248); + vec3 tmpvar_297; + tmpvar_297 = (lightDirTangent_248 * tanToWorld_263); + lightDir_253 = tmpvar_297; + vec3 tmpvar_298; + tmpvar_298 = normalize (lightDir_253); + vec3 tmpvar_299; + tmpvar_299 = tmpvar_298; + lightDir_253 = tmpvar_299; + vec3 tmpvar_300; + tmpvar_300 = Albedo (i_244.tex); + vec3 tmpvar_301; + tmpvar_301 = EnergyCalculator (specColor_258, specular_257, tmpvar_300); + vec3 tmpvar_302; + tmpvar_302 = tmpvar_301; + baseColor_247 = tmpvar_302; + vec3 tmpvar_303; + tmpvar_303 = BRDF_Disney_PBS (baseColor_247, (atten_264 * lightColor_254), specColor_258, specular_257, roughness_256, normalWorld_261, lightDir_253, -(eyeVec_260), ambient_251, env_255); + vec3 tmpvar_304; + tmpvar_304 = tmpvar_303; + color_246 = tmpvar_304; + vec4 tmpvar_305; + tmpvar_305 = texture2D (_SelfIllum, i_244.tex.xy); + vec3 tmpvar_306; + tmpvar_306 = (color_246 + (tmpvar_305.xyz * _SelfIllumScale)); + color_246 = tmpvar_306; + float tmpvar_307; + tmpvar_307 = Alpha (i_244.tex.xy); + float tmpvar_308; + tmpvar_308 = tmpvar_307; + alpha_245 = tmpvar_308; + vec4 tmpvar_309; + tmpvar_309.xyz = color_246.xyz; + tmpvar_309.w = alpha_245; + return tmpvar_309; +} + +void main () +{ + VertexOutput xlt_i_310; + vec4 xl_retval_311; + vec4 tmpvar_312; + tmpvar_312 = vec4(0.0, 0.0, 0.0, 0.0); + xlt_i_310.pos = tmpvar_312; + vec4 tmpvar_313; + tmpvar_313 = xlv_TEXCOORD0.xyzw; + vec4 tmpvar_314; + tmpvar_314 = tmpvar_313; + xlt_i_310.tex = tmpvar_314; + vec4 tmpvar_315; + tmpvar_315 = xlv_TEXCOORD1.xyzw; + vec4 tmpvar_316; + tmpvar_316 = tmpvar_315; + xlt_i_310.posWorld = tmpvar_316; + vec3 tmpvar_317; + tmpvar_317 = xlv_TEXCOORD2.xyz; + vec3 tmpvar_318; + tmpvar_318 = tmpvar_317; + xlt_i_310.normalWorld = tmpvar_318; + vec4 tmpvar_319; + tmpvar_319 = xlv_TEXCOORD3.xyzw; + vec4 tmpvar_320; + tmpvar_320 = tmpvar_319; + xlt_i_310.tangentWorld = tmpvar_320; + vec3 tmpvar_321; + tmpvar_321 = xlv_TEXCOORD4.xyz; + vec3 tmpvar_322; + tmpvar_322 = tmpvar_321; + xlt_i_310.extra = tmpvar_322; + vec4 tmpvar_323; + tmpvar_323 = xlv_TEXCOORD5.xyzw; + vec4 tmpvar_324; + tmpvar_324 = tmpvar_323; + xlt_i_310._ShadowCoord = tmpvar_324; + vec3 tmpvar_325; + tmpvar_325 = xlv_TEXCOORD7.xyz; + vec3 tmpvar_326; + tmpvar_326 = tmpvar_325; + xlt_i_310.lightDir = tmpvar_326; + vec4 tmpvar_327; + tmpvar_327 = frag (xlt_i_310); + vec4 tmpvar_328; + tmpvar_328 = tmpvar_327; + xl_retval_311 = tmpvar_328; + vec4 tmpvar_329; + tmpvar_329 = xl_retval_311.xyzw; + vec4 tmpvar_330; + tmpvar_330 = tmpvar_329; + gl_FragData[0] = tmpvar_330; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt new file mode 100644 index 000000000..089668de6 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt @@ -0,0 +1,172 @@ +#extension GL_ARB_shader_texture_lod : enable +uniform vec3 _WorldSpaceCameraPos; +uniform sampler2D _MainTex; +uniform sampler2D _DetailAlbedoMap; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform float _Exposure; +uniform vec4 _Color; +uniform sampler2D _SpecGlossMap; +uniform sampler2D _ShadowMapTexture; +uniform samplerCube _SpecCube; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform float _SelfIllumScale; +uniform sampler2D _SelfIllum; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +void main () +{ + vec3 tmpvar_1; + vec3 tmpvar_2; + tmpvar_1 = xlv_TEXCOORD3.xyz; + tmpvar_2 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www); + mat3 tmpvar_3; + tmpvar_3[0].x = tmpvar_1.x; + tmpvar_3[0].y = tmpvar_2.x; + tmpvar_3[0].z = xlv_TEXCOORD2.x; + tmpvar_3[1].x = tmpvar_1.y; + tmpvar_3[1].y = tmpvar_2.y; + tmpvar_3[1].z = xlv_TEXCOORD2.y; + tmpvar_3[2].x = tmpvar_1.z; + tmpvar_3[2].y = tmpvar_2.z; + tmpvar_3[2].z = xlv_TEXCOORD2.z; + vec3 normal_4; + normal_4.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0); + normal_4.xy = (normal_4.xy * _BumpScale); + normal_4.z = sqrt((1.0 - clamp ( + dot (normal_4.xy, normal_4.xy) + , 0.0, 1.0))); + vec3 normal_5; + normal_5.xy = ((texture2D (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0); + normal_5.xy = (normal_5.xy * _DetailNormalMapScale); + normal_5.z = sqrt((1.0 - clamp ( + dot (normal_5.xy, normal_5.xy) + , 0.0, 1.0))); + vec3 tmpvar_6; + tmpvar_6.xy = (normal_4.xy + normal_5.xy); + tmpvar_6.z = (normal_4.z * normal_5.z); + vec3 tmpvar_7; + tmpvar_7 = normalize(tmpvar_6); + vec3 tmpvar_8; + tmpvar_8 = (tmpvar_7 * tmpvar_3); + vec3 tmpvar_9; + tmpvar_9 = normalize((xlv_TEXCOORD1.xyz - _WorldSpaceCameraPos)); + vec4 tmpvar_10; + tmpvar_10 = texture2D (_SpecGlossMap, xlv_TEXCOORD0.xy); + float tmpvar_11; + tmpvar_11 = dot (tmpvar_10.xyz, vec3(0.299, 0.587, 0.114)); + float tmpvar_12; + tmpvar_12 = (1.0 - tmpvar_10.w); + vec4 tmpvar_13; + tmpvar_13.xyz = (tmpvar_9 - (2.0 * ( + dot (tmpvar_8, tmpvar_9) + * tmpvar_8))); + tmpvar_13.w = (tmpvar_12 * 5.0); + vec4 tmpvar_14; + tmpvar_14 = textureCubeLod (_SpecCube, tmpvar_13.xyz, tmpvar_13.w); + float tmpvar_15; + tmpvar_15 = (tmpvar_14.w * tmpvar_14.w); + vec2 tmpvar_16; + tmpvar_16.x = tmpvar_15; + tmpvar_16.y = (tmpvar_14.w * tmpvar_15); + vec3 tmpvar_17; + tmpvar_17 = (((tmpvar_14.xyz * + dot (vec2(0.7532, 0.2468), tmpvar_16) + ) * _Exposure) * texture2D (_Occlusion, xlv_TEXCOORD0.xy).x); + vec4 tmpvar_18; + tmpvar_18 = texture2D (unity_Lightmap, xlv_TEXCOORD4.xy); + vec4 tmpvar_19; + tmpvar_19 = texture2D (unity_LightmapInd, xlv_TEXCOORD4.xy); + mat3 tmpvar_20; + tmpvar_20[0].x = 0.816497; + tmpvar_20[0].y = -0.408248; + tmpvar_20[0].z = -0.408248; + tmpvar_20[1].x = 0.0; + tmpvar_20[1].y = 0.707107; + tmpvar_20[1].z = -0.707107; + tmpvar_20[2].x = 0.57735; + tmpvar_20[2].y = 0.57735; + tmpvar_20[2].z = 0.57735; + vec3 tmpvar_21; + tmpvar_21 = ((8.0 * tmpvar_19.w) * tmpvar_19.xyz); + vec3 v_22; + v_22.x = tmpvar_20[0].x; + v_22.y = tmpvar_20[1].x; + v_22.z = tmpvar_20[2].x; + vec3 v_23; + v_23.x = tmpvar_20[0].y; + v_23.y = tmpvar_20[1].y; + v_23.z = tmpvar_20[2].y; + vec3 v_24; + v_24.x = tmpvar_20[0].z; + v_24.y = tmpvar_20[1].z; + v_24.z = tmpvar_20[2].z; + vec3 tmpvar_25; + tmpvar_25 = normalize((normalize( + (((tmpvar_21.x * v_22) + (tmpvar_21.y * v_23)) + (tmpvar_21.z * v_24)) + ) * tmpvar_3)); + vec3 lightColor_26; + lightColor_26 = (texture2DProj (_ShadowMapTexture, xlv_TEXCOORD5).x * (( + (8.0 * tmpvar_18.w) + * tmpvar_18.xyz) * dot ( + clamp ((tmpvar_20 * tmpvar_7), 0.0, 1.0) + , tmpvar_21))); + vec3 viewDir_27; + viewDir_27 = -(tmpvar_9); + vec3 tmpvar_28; + tmpvar_28 = normalize((tmpvar_25 + viewDir_27)); + float tmpvar_29; + tmpvar_29 = max (0.0, dot (tmpvar_8, tmpvar_25)); + float tmpvar_30; + tmpvar_30 = max (0.0, dot (tmpvar_8, tmpvar_28)); + float tmpvar_31; + tmpvar_31 = max (0.0, dot (tmpvar_8, viewDir_27)); + float tmpvar_32; + tmpvar_32 = max (0.0, dot (viewDir_27, tmpvar_28)); + float tmpvar_33; + tmpvar_33 = (tmpvar_32 + 1e-05); + float tmpvar_34; + tmpvar_34 = ((1.0/(( + pow (tmpvar_12, 4.0) + + 1e-05))) - 2.0); + float tmpvar_35; + tmpvar_35 = (0.5 + ((2.0 * + pow (max (0.0, dot (tmpvar_25, tmpvar_28)), 2.0) + ) * tmpvar_12)); + vec4 tmpvar_36; + tmpvar_36.xyz = ((( + (min (((_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz) * (2.0 * texture2D (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz)), (vec3(1.0, 1.0, 1.0) - tmpvar_11)) * ((( + (1.0 + ((tmpvar_35 - 1.0) * pow ((1.00001 - tmpvar_29), 5.0))) + * + (1.0 + ((tmpvar_35 - 1.0) * pow ((1.00001 - tmpvar_31), 5.0))) + ) * tmpvar_29) * lightColor_26)) + + + (tmpvar_10.xyz * (tmpvar_17 + (lightColor_26 * max (0.0, + ((((tmpvar_11 + + ((1.0 - tmpvar_11) * pow (abs((1.0 - tmpvar_32)), 5.0)) + ) * min (1.0, + min ((((2.0 * tmpvar_30) * tmpvar_31) / tmpvar_33), (((2.0 * tmpvar_30) * tmpvar_29) / tmpvar_33)) + )) * max (0.0, ( + pow (tmpvar_30, tmpvar_34) + * + ((tmpvar_34 + 1.0) / 6.28318) + ))) / ((4.0 * tmpvar_31) + 1e-05)) + )))) + ) + ( + (((1.0 - dot (tmpvar_10.xyz, vec3(0.299, 0.587, 0.114))) * (1.0 - tmpvar_12)) * pow (abs((1.0 - tmpvar_31)), 5.0)) + * tmpvar_17)) + (texture2D (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale)); + tmpvar_36.w = (texture2D (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w); + gl_FragData[0] = tmpvar_36; +} + + +// inputs: 6, stats: 146 alu 12 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt index 4e2304d1b..c38972047 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-ir.txt @@ -17,9 +17,9 @@ struct v2f_surf { vec3 TtoV1; vec3 TtoV2; }; -uniform sampler2D _MainTex; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _MainTex; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt index 7a6802800..0632599f9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt @@ -5,7 +5,9 @@ void main () vec3 viewN_2; vec4 normal_3; normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); - normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); + normal_3.z = sqrt(((1.0 - + (normal_3.x * normal_3.x) + ) - (normal_3.y * normal_3.y))); viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz); viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz); viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz); @@ -14,3 +16,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 13 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt index 8b4dc7cf7..8aee560c2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-ir.txt @@ -16,12 +16,12 @@ struct v2f_surf { vec2 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt index 68573698f..f4e6c20e7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt @@ -1,8 +1,8 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 light_1; @@ -11,7 +11,9 @@ void main () tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 tmpvar_5; tmpvar_5 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_1.w = tmpvar_5.w; @@ -22,3 +24,5 @@ void main () gl_FragData[0] = c_6; } + +// inputs: 1, stats: 12 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt index 512df207b..9aaf1127a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-ir.txt @@ -19,14 +19,14 @@ struct v2f_surf { vec3 vlight; vec4 _ShadowCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _ShadowMapTexture; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; float unitySampleShadow ( in vec4 shadowCoord_1 ) @@ -127,10 +127,16 @@ vec4 LightingBlinnPhong ( tmpvar_41 = (tmpvar_40 * s_23.Gloss); spec_28 = tmpvar_41; vec3 tmpvar_42; - tmpvar_42 = ((((s_23.Albedo * _LightColor0.xyz) * diff_30) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_28)) * (atten_26 * 2.0)); + tmpvar_42 = ((( + (s_23.Albedo * _LightColor0.xyz) + * diff_30) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_28)) * (atten_26 * 2.0)); c_27.xyz = tmpvar_42.xyz.xyz; float tmpvar_43; - tmpvar_43 = (s_23.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_28) * atten_26)); + tmpvar_43 = (s_23.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_28) * atten_26)); c_27.w = vec4(tmpvar_43).w; return c_27; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt index e179df7d0..536d1545e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt @@ -1,10 +1,10 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _ShadowMapTexture; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -18,16 +18,30 @@ void main () tmpvar_5 = (tmpvar_4.xyz * _Color.xyz); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_6.z = sqrt(((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); + normal_6.z = sqrt(((1.0 - + (normal_6.x * normal_6.x) + ) - (normal_6.y * normal_6.y))); vec4 tmpvar_7; tmpvar_7 = texture2DProj (_ShadowMapTexture, gl_TexCoord[4]); vec4 c_8; float tmpvar_9; - tmpvar_9 = (pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_8.xyz = ((((tmpvar_5 * _LightColor0.xyz) * max (0.0, dot (normal_6.xyz, tmpvar_2))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_9)) * (tmpvar_7.x * 2.0)); - c_8.w = ((tmpvar_4.w * _Color.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_9) * tmpvar_7.x)); + tmpvar_9 = (pow (max (0.0, + dot (normal_6.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_8.xyz = ((( + (tmpvar_5 * _LightColor0.xyz) + * + max (0.0, dot (normal_6.xyz, tmpvar_2)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_9)) * (tmpvar_7.x * 2.0)); + c_8.w = ((tmpvar_4.w * _Color.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_9) * tmpvar_7.x)); c_3.w = c_8.w; c_3.xyz = (c_8.xyz + (tmpvar_5 * gl_TexCoord[3].xyz)); gl_FragData[0] = c_3; } + +// inputs: 1, stats: 32 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt index c2fe16f98..b573869f7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-ir.txt @@ -18,14 +18,14 @@ struct v2f_surf { vec3 viewDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -113,10 +113,16 @@ vec4 LightingBlinnPhong ( tmpvar_37 = (tmpvar_36 * s_19.Gloss); spec_24 = tmpvar_37; vec3 tmpvar_38; - tmpvar_38 = ((((s_19.Albedo * _LightColor0.xyz) * diff_26) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_24)) * (atten_22 * 2.0)); + tmpvar_38 = ((( + (s_19.Albedo * _LightColor0.xyz) + * diff_26) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_24)) * (atten_22 * 2.0)); c_23.xyz = tmpvar_38.xyz.xyz; float tmpvar_39; - tmpvar_39 = (s_19.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_24) * atten_22)); + tmpvar_39 = (s_19.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_24) * atten_22)); c_23.w = vec4(tmpvar_39).w; return c_23; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt index e08302b46..ca5246f34 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt @@ -1,10 +1,10 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -16,16 +16,30 @@ void main () tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy); vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); float atten_6; atten_6 = texture2D (_LightTexture0, gl_TexCoord[3].xy).w; vec4 c_7; float tmpvar_8; - tmpvar_8 = (pow (max (0.0, dot (normal_5.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_7.xyz = (((((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_5.xyz, tmpvar_2))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = ((tmpvar_4.w * _Color.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_8) * atten_6)); + tmpvar_8 = (pow (max (0.0, + dot (normal_5.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_7.xyz = ((( + ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_5.xyz, tmpvar_2)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_8)) * (atten_6 * 2.0)); + c_7.w = ((tmpvar_4.w * _Color.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_8) * atten_6)); c_3.xyz = c_7.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 31 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt index ba2eb2586..bbddfca69 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-ir.txt @@ -17,15 +17,15 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt index e6327cfa7..b8fb26fbe 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -15,7 +15,9 @@ void main () tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_3).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); vec4 tmpvar_6; tmpvar_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_2.w = tmpvar_6.w; @@ -28,3 +30,5 @@ void main () gl_FragData[0] = c_7; } + +// inputs: 1, stats: 23 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt index e6dcf2dca..ddbefb603 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec3 normal; vec3 lightDir; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform sampler2D _DecalTex; uniform vec4 _Color; +uniform sampler2D _DecalTex; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt index 4fc02e823..12ee52057 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform sampler2D _DecalTex; uniform vec4 _Color; +uniform sampler2D _DecalTex; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -18,10 +18,14 @@ void main () tmpvar_6 = (c_3 * _Color); c_3 = tmpvar_6; vec4 c_7; - c_7.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * 2.0)); + c_7.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (max (0.0, + dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) + ) * 2.0)); c_7.w = tmpvar_6.w; c_2.xyz = c_7.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 8 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt index d6076da51..accc55705 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-ir.txt @@ -18,12 +18,12 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _DecalTex; uniform vec4 _Color; +uniform sampler2D _DecalTex; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt index c0fc85fc5..ac45166fd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _DecalTex; uniform vec4 _Color; +uniform sampler2D _DecalTex; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -19,10 +19,14 @@ void main () tmpvar_6 = (c_3 * _Color); c_3 = tmpvar_6; vec4 c_7; - c_7.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_7.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_7.w = tmpvar_6.w; c_2.xyz = c_7.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 9 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt index 4220ef4f3..b9771ed57 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-ir.txt @@ -16,12 +16,12 @@ struct v2f_surf { vec4 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _DecalTex; uniform vec4 _Color; +uniform sampler2D _DecalTex; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt index 994c4f5b8..99e176816 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt @@ -1,8 +1,8 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _DecalTex; uniform vec4 _Color; +uniform sampler2D _DecalTex; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -28,3 +28,5 @@ void main () gl_FragData[0] = c_8; } + +// inputs: 1, stats: 6 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt index 73814d60c..236014434 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt index 581b5fac5..6f4aa9c58 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec3 tmpvar_1; @@ -10,10 +10,16 @@ void main () vec4 tmpvar_3; tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_4; - c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * texture2D (_LightTexture0, vec2(dot (tmpvar_1, tmpvar_1))).w) * 2.0)); + c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * texture2D (_LightTexture0, vec2( + dot (tmpvar_1, tmpvar_1) + )).w) * 2.0)); c_4.w = tmpvar_3.w; c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 10 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt index 5121ba047..f6081b646 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-ir.txt @@ -13,8 +13,8 @@ struct v2f_surf { vec4 pos; vec3 normal; }; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt index d5e6cd110..a366de427 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt index daffc9e85..e8dda9816 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-ir.txt @@ -16,12 +16,12 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt index e5face3eb..e4c7bac32 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -20,3 +20,5 @@ void main () gl_FragData[0] = c_5; } + +// inputs: 1, stats: 9 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt index 863e515b8..d9aef597a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt @@ -16,11 +16,11 @@ struct v2f_surf { vec3 normal; vec3 vlight; }; -varying vec4 xlv_FOG; -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform vec4 _WorldSpaceLightPos0; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt index 624130064..dda9cc1dc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt @@ -1,7 +1,7 @@ -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; @@ -10,10 +10,14 @@ void main () float tmpvar_3; tmpvar_3 = tmpvar_2.w; vec4 c_4; - c_4.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) * 2.0)); + c_4.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0, + dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz) + ) * 2.0)); c_4.w = tmpvar_3; c_1.xyz = (c_4.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); c_1.w = tmpvar_3; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 8 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt index e9155cb87..f054a4322 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-ir.txt @@ -18,13 +18,13 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Detail; uniform vec4 _Color; +uniform sampler2D _Detail; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -143,7 +143,9 @@ vec4 frag_surf ( float tmpvar_44; tmpvar_44 = UnitySpotAttenuate (IN_27._LightCoord.xyz); vec4 tmpvar_45; - tmpvar_45 = LightingLambert (o_30, lightDir_29, ((float((IN_27._LightCoord.z > 0.0)) * tmpvar_43) * tmpvar_44)); + tmpvar_45 = LightingLambert (o_30, lightDir_29, ((float( + (IN_27._LightCoord.z > 0.0) + ) * tmpvar_43) * tmpvar_44)); vec4 tmpvar_46; tmpvar_46 = tmpvar_45; c_28 = tmpvar_46; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt index 0c948cbda..a22a84b58 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Detail; uniform vec4 _Color; +uniform sampler2D _Detail; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -17,10 +17,16 @@ void main () c_4.w = tmpvar_5.w; c_4.xyz = (tmpvar_5.xyz * (texture2D (_Detail, tmpvar_1.zw).xyz * 2.0)); vec4 c_6; - c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_6.w = c_4.w; c_3.xyz = c_6.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 18 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt index 6e5984571..2fc6a0d59 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-ir.txt @@ -14,9 +14,9 @@ struct v2f_surf { vec4 pos; vec3 normal; }; -uniform sampler2D _MainTex; -uniform sampler2D _Detail; uniform vec4 _Color; +uniform sampler2D _Detail; +uniform sampler2D _MainTex; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt index d5e6cd110..a366de427 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt index bb6e76eff..ce9ab432e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-ir.txt @@ -4,11 +4,11 @@ struct v2f { vec2 uvbump; vec2 uvmain; }; -uniform sampler2D _MainTex; -uniform vec4 _GrabTexture_TexelSize; -uniform sampler2D _GrabTexture; -uniform sampler2D _BumpMap; uniform float _BumpAmt; +uniform sampler2D _BumpMap; +uniform sampler2D _GrabTexture; +uniform vec4 _GrabTexture_TexelSize; +uniform sampler2D _MainTex; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt index 193164a9f..1240ceb86 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform vec4 _GrabTexture_TexelSize; -uniform sampler2D _GrabTexture; -uniform sampler2D _BumpMap; uniform float _BumpAmt; +uniform sampler2D _BumpMap; +uniform sampler2D _GrabTexture; +uniform vec4 _GrabTexture_TexelSize; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -11,8 +11,14 @@ void main () tmpvar_2.zw = tmpvar_1.zw; vec4 normal_3; normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0); - normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); - tmpvar_2.xy = ((((normal_3.xy * _BumpAmt) * _GrabTexture_TexelSize.xy) * tmpvar_1.z) + tmpvar_1.xy); + normal_3.z = sqrt(((1.0 - + (normal_3.x * normal_3.x) + ) - (normal_3.y * normal_3.y))); + tmpvar_2.xy = ((( + (normal_3.xy * _BumpAmt) + * _GrabTexture_TexelSize.xy) * tmpvar_1.z) + tmpvar_1.xy); gl_FragData[0] = (texture2DProj (_GrabTexture, tmpvar_2) * texture2D (_MainTex, gl_TexCoord[2].xy)); } + +// inputs: 1, stats: 12 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt index 539d8a67d..63c0b2f89 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-ir.txt @@ -4,10 +4,10 @@ struct v2f { vec2 bumpuv[2]; vec3 viewDir; }; -varying vec4 xlv_FOG; -uniform vec4 _horizonColor; -uniform sampler2D _ColorControl; uniform sampler2D _BumpMap; +uniform sampler2D _ColorControl; +uniform vec4 _horizonColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt index 24ae5042d..ce1756df6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt @@ -1,15 +1,19 @@ -uniform vec4 _horizonColor; -uniform sampler2D _ColorControl; uniform sampler2D _BumpMap; +uniform sampler2D _ColorControl; +uniform vec4 _horizonColor; void main () { vec4 col_1; vec4 normal_2; normal_2.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); - normal_2.z = sqrt(((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); + normal_2.z = sqrt(((1.0 - + (normal_2.x * normal_2.x) + ) - (normal_2.y * normal_2.y))); vec4 normal_3; normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0); - normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); + normal_3.z = sqrt(((1.0 - + (normal_3.x * normal_3.x) + ) - (normal_3.y * normal_3.y))); vec4 tmpvar_4; tmpvar_4 = texture2D (_ColorControl, vec2(dot (gl_TexCoord[2].xyz, ((normal_2.xyz + normal_3.xyz) * 0.5)))); col_1.xyz = mix (tmpvar_4.xyz, _horizonColor.xyz, tmpvar_4.www); @@ -17,3 +21,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 18 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt index c4590c1e4..dab414b98 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = (1.0 - texture2DProj (_GrabTexture, gl_TexCoord[0])); } + +// inputs: 1, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt index e80df5e94..642479bdd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-ir.txt @@ -3,8 +3,8 @@ struct v2f { vec2 uv; vec4 nz; }; -uniform sampler2D _MainTex; uniform float _Cutoff; +uniform sampler2D _MainTex; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt index d8e61bdaf..03941296f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform float _Cutoff; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -10,7 +10,9 @@ void main () discard; }; vec4 enc_3; - enc_3.xy = ((((tmpvar_1.xy / (tmpvar_1.z + 1.0)) / 1.7777) * 0.5) + 0.5); + enc_3.xy = ((( + (tmpvar_1.xy / (tmpvar_1.z + 1.0)) + / 1.7777) * 0.5) + 0.5); vec2 enc_4; vec2 tmpvar_5; tmpvar_5 = fract((vec2(1.0, 255.0) * tmpvar_1.w)); @@ -20,3 +22,5 @@ void main () gl_FragData[0] = enc_3; } + +// inputs: 1, stats: 11 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt index e80df5e94..642479bdd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-ir.txt @@ -3,8 +3,8 @@ struct v2f { vec2 uv; vec4 nz; }; -uniform sampler2D _MainTex; uniform float _Cutoff; +uniform sampler2D _MainTex; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt index d8e61bdaf..03941296f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform float _Cutoff; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -10,7 +10,9 @@ void main () discard; }; vec4 enc_3; - enc_3.xy = ((((tmpvar_1.xy / (tmpvar_1.z + 1.0)) / 1.7777) * 0.5) + 0.5); + enc_3.xy = ((( + (tmpvar_1.xy / (tmpvar_1.z + 1.0)) + / 1.7777) * 0.5) + 0.5); vec2 enc_4; vec2 tmpvar_5; tmpvar_5 = fract((vec2(1.0, 255.0) * tmpvar_1.w)); @@ -20,3 +22,5 @@ void main () gl_FragData[0] = enc_3; } + +// inputs: 1, stats: 11 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt index 04f9c826c..ae0f7e096 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt @@ -9,3 +9,5 @@ void main () gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 1, stats: 3 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt index 824b1756c..80a8dde38 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-ir.txt @@ -2,8 +2,8 @@ struct v2f_img { vec4 pos; vec2 uv; }; -uniform sampler2D _RampTex; uniform sampler2D _MainTex; +uniform sampler2D _RampTex; vec4 frag ( in v2f_img i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt index be855f505..35e6a896e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _RampTex; uniform sampler2D _MainTex; +uniform sampler2D _RampTex; void main () { vec4 tmpvar_1; @@ -12,3 +12,5 @@ void main () gl_FragData[0] = tmpvar_2; } + +// inputs: 1, stats: 3 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt index 61a4a5c2f..a69cee14a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 pos; vec2 uv[3]; }; -uniform float _Treshold; uniform sampler2D _MainTex; +uniform float _Treshold; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt index 931052d44..a1b8ac3e1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt @@ -1,5 +1,5 @@ -uniform float _Treshold; uniform sampler2D _MainTex; +uniform float _Treshold; void main () { vec4 original_1; @@ -16,3 +16,5 @@ void main () gl_FragData[0] = original_1; } + +// inputs: 1, stats: 6 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt index db2316634..24b2e437f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 pos; vec4 uv[2]; }; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt index a2c4a9ed3..88ab8e6a9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -14,3 +14,5 @@ void main () gl_FragData[0] = (c_3 * _Color.w); } + +// inputs: 1, stats: 5 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt index 8746d8f8c..a31a60d5c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 pos; vec4 uv[4]; }; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt index cf5547f4e..acad309e4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt @@ -1,10 +1,12 @@ -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; void main () { vec4 c_1; vec4 tmpvar_2; - tmpvar_2 = ((((texture2D (_MainTex, gl_TexCoord[0].xy) + texture2D (_MainTex, gl_TexCoord[1].xy)) + texture2D (_MainTex, gl_TexCoord[2].xy)) + texture2D (_MainTex, gl_TexCoord[3].xy)) / 4.0); + tmpvar_2 = ((( + (texture2D (_MainTex, gl_TexCoord[0].xy) + texture2D (_MainTex, gl_TexCoord[1].xy)) + + texture2D (_MainTex, gl_TexCoord[2].xy)) + texture2D (_MainTex, gl_TexCoord[3].xy)) / 4.0); c_1.w = tmpvar_2.w; c_1.xyz = (tmpvar_2.xyz * _Color.xyz); c_1.xyz = (c_1.xyz * (tmpvar_2.w + _Color.w)); @@ -12,3 +14,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 1, stats: 8 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt index c4519bf4d..d3443d5b2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-ir.txt @@ -2,9 +2,9 @@ struct v2f_img { vec4 pos; vec2 uv; }; -uniform sampler2D _RampTex; -uniform float _RampOffset; uniform sampler2D _MainTex; +uniform float _RampOffset; +uniform sampler2D _RampTex; float Luminance ( in vec3 c_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt index d7f329860..203cd64b1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt @@ -1,6 +1,6 @@ -uniform sampler2D _RampTex; -uniform float _RampOffset; uniform sampler2D _MainTex; +uniform float _RampOffset; +uniform sampler2D _RampTex; void main () { vec4 xlat_var_output_1; @@ -14,3 +14,5 @@ void main () gl_FragData[0] = xlat_var_output_1; } + +// inputs: 1, stats: 3 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt index 337f11855..6c18448e2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-ir.txt @@ -2,9 +2,9 @@ struct v2f { vec4 pos; vec2 uv; }; -uniform vec4 _ZBufferParams; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform vec4 _ZBufferParams; float Linear01Depth ( in float z_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt index 2b2b42cbd..bc5fc0219 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt @@ -1,6 +1,6 @@ -uniform vec4 _ZBufferParams; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform vec4 _ZBufferParams; void main () { vec2 tmpvar_1; @@ -16,7 +16,9 @@ void main () vec4 tmpvar_5; if ((tmpvar_4 < 0.999985)) { vec4 enc_6; - enc_6.xy = ((((n_2.xy / (n_2.z + 1.0)) / 1.7777) * 0.5) + 0.5); + enc_6.xy = ((( + (n_2.xy / (n_2.z + 1.0)) + / 1.7777) * 0.5) + 0.5); vec2 enc_7; vec2 tmpvar_8; tmpvar_8 = fract((vec2(1.0, 255.0) * tmpvar_4)); @@ -30,3 +32,5 @@ void main () gl_FragData[0] = tmpvar_5; } + +// inputs: 1, stats: 17 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt index 80d940d9f..63e06f7ab 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-ir.txt @@ -4,8 +4,8 @@ struct v2f { vec2 texcoord; vec2 texgencoord; }; -uniform sampler2D _MainTex; uniform sampler2D _GUIClipTexture; +uniform sampler2D _MainTex; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt index db89d2e19..611354331 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform sampler2D _GUIClipTexture; +uniform sampler2D _MainTex; void main () { vec4 col_1; @@ -8,3 +8,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 2, stats: 2 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt index 24d20cfb3..20df87619 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-ir.txt @@ -4,8 +4,8 @@ struct v2f { vec2 texcoord; vec2 texgencoord; }; -uniform sampler2D _MainTex; uniform sampler2D _GUIClipTexture; +uniform sampler2D _MainTex; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt index f4d36dc29..806304a48 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform sampler2D _GUIClipTexture; +uniform sampler2D _MainTex; void main () { vec4 col_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 2, stats: 2 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt index dbb65dee0..3ecae8fb9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt @@ -9,3 +9,5 @@ void main () gl_FragData[0] = tmpvar_2; } + +// inputs: 2, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt index 4eddc7dca..2b955aeef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-ir.txt @@ -3,16 +3,16 @@ struct v2f { vec2 uv; vec3 ray; }; -uniform vec4 _ZBufferParams; -uniform mat4 _View2Shadow3; -uniform mat4 _View2Shadow2; -uniform mat4 _View2Shadow1; -uniform mat4 _View2Shadow; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform mat4 _View2Shadow; +uniform mat4 _View2Shadow1; +uniform mat4 _View2Shadow2; +uniform mat4 _View2Shadow3; +uniform vec4 _ZBufferParams; float unitySampleShadow ( in vec4 eyePos_1 ) @@ -65,7 +65,11 @@ float unitySampleShadow ( weights_4 = tmpvar_25; vec4 tmpvar_26; tmpvar_26.w = 1.0; - tmpvar_26.xyz = ((((sc0_11 * weights_4.x) + (sc1_10 * weights_4.y)) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; + tmpvar_26.xyz = ((( + (sc0_11 * weights_4.x) + + + (sc1_10 * weights_4.y) + ) + (sc2_9 * weights_4.z)) + (sc3_8 * weights_4.w)).xyz; vec4 tmpvar_27; tmpvar_27 = tmpvar_26; coord_3 = tmpvar_27; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt index cc27c68fd..3aff1f667 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt @@ -1,13 +1,13 @@ -uniform vec4 _ZBufferParams; -uniform mat4 _View2Shadow3; -uniform mat4 _View2Shadow2; -uniform mat4 _View2Shadow1; -uniform mat4 _View2Shadow; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; uniform sampler2D _CameraDepthTexture; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _ShadowMapTexture; +uniform mat4 _View2Shadow; +uniform mat4 _View2Shadow1; +uniform mat4 _View2Shadow2; +uniform mat4 _View2Shadow3; +uniform vec4 _ZBufferParams; void main () { vec4 res_1; @@ -20,7 +20,13 @@ void main () tmpvar_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar))); vec4 tmpvar_5; tmpvar_5.w = 1.0; - tmpvar_5.xyz = (((((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x) + ((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y)) + ((_View2Shadow2 * tmpvar_3).xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w)); + tmpvar_5.xyz = ((( + ((_View2Shadow * tmpvar_3).xyz * tmpvar_4.x) + + + ((_View2Shadow1 * tmpvar_3).xyz * tmpvar_4.y) + ) + ( + (_View2Shadow2 * tmpvar_3) + .xyz * tmpvar_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * tmpvar_4.w)); vec4 tmpvar_6; tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy); float tmpvar_7; @@ -40,3 +46,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 30 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt index 136897886..8621f8409 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-ir.txt @@ -3,20 +3,20 @@ struct v2f { vec4 uv; vec3 ray; }; -uniform vec4 unity_LightmapFade; -uniform vec4 _ZBufferParams; -uniform mat4 _ViewToCookie; -uniform mat4 _View2Shadow; -uniform samplerCube _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightShadowData; -uniform vec4 _LightPositionRange; -uniform vec4 _LightPos; -uniform vec4 _LightColor; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform vec4 _LightColor; +uniform vec4 _LightPos; +uniform vec4 _LightPositionRange; +uniform vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform mat4 _View2Shadow; +uniform mat4 _ViewToCookie; +uniform vec4 _ZBufferParams; +uniform vec4 unity_LightmapFade; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt index c6c42ce7a..b62383c3c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt @@ -1,17 +1,17 @@ -uniform vec4 unity_LightmapFade; -uniform vec4 _ZBufferParams; -uniform mat4 _ViewToCookie; -uniform mat4 _View2Shadow; -uniform samplerCube _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightShadowData; -uniform vec4 _LightPositionRange; -uniform vec4 _LightPos; -uniform vec4 _LightColor; -uniform sampler2D _CameraNormalsTexture; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _CameraNormalsTexture; +uniform vec4 _LightColor; +uniform vec4 _LightPos; +uniform vec4 _LightPositionRange; +uniform vec4 _LightShadowData; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform vec4 _ProjectionParams; +uniform samplerCube _ShadowMapTexture; +uniform mat4 _View2Shadow; +uniform mat4 _ViewToCookie; +uniform vec4 _ZBufferParams; +uniform vec4 unity_LightmapFade; void main () { vec4 tmpvar_1; @@ -28,7 +28,9 @@ void main () tmpvar_8 = texture2D (_CameraNormalsTexture, tmpvar_7); normal_6 = normalize(((tmpvar_8.xyz * 2.0) - 1.0)); vec3 tmpvar_9; - tmpvar_9 = ((tmpvar_2 * (_ProjectionParams.z / tmpvar_2.z)) * (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_7).x) + _ZBufferParams.y)))); + tmpvar_9 = ((tmpvar_2 * (_ProjectionParams.z / tmpvar_2.z)) * (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_7).x) + + _ZBufferParams.y)))); vec3 tmpvar_10; tmpvar_10 = (_LightPos.xyz - tmpvar_9); lightDir_5 = normalize(tmpvar_10); @@ -43,7 +45,9 @@ void main () tmpvar_13 = (tmpvar_12 * vec_11); vec_11 = tmpvar_13; float tmpvar_14; - tmpvar_14 = ((sqrt(dot (tmpvar_13, tmpvar_13)) * _LightPositionRange.w) * 0.97); + tmpvar_14 = ((sqrt( + dot (tmpvar_13, tmpvar_13) + ) * _LightPositionRange.w) * 0.97); float tmpvar_15; tmpvar_15 = dot (textureCube (_ShadowMapTexture, tmpvar_13), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09)); float tmpvar_16; @@ -58,11 +62,23 @@ void main () float tmpvar_18; tmpvar_18 = ((atten_4 * tmpvar_16) * textureCube (_LightTexture0, (_ViewToCookie * tmpvar_17).xyz).w); atten_4 = tmpvar_18; - res_3.xyz = (_LightColor.xyz * (max (0.0, dot (lightDir_5, normal_6)) * tmpvar_18)); - res_3.w = ((pow (max (0.0, dot (normalize((lightDir_5 - normalize(tmpvar_9))), normal_6)), (tmpvar_8.w * 128.0)) * clamp (tmpvar_18, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); + res_3.xyz = (_LightColor.xyz * (max (0.0, + dot (lightDir_5, normal_6) + ) * tmpvar_18)); + res_3.w = ((pow ( + max (0.0, dot (normalize((lightDir_5 - + normalize(tmpvar_9) + )), normal_6)) + , + (tmpvar_8.w * 128.0) + ) * clamp (tmpvar_18, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071))); vec4 tmpvar_19; - tmpvar_19 = (res_3 * clamp ((1.0 - ((tmpvar_9.z * unity_LightmapFade.z) + unity_LightmapFade.w)), 0.0, 1.0)); + tmpvar_19 = (res_3 * clamp ((1.0 - + ((tmpvar_9.z * unity_LightmapFade.z) + unity_LightmapFade.w) + ), 0.0, 1.0)); res_3 = tmpvar_19; gl_FragData[0] = exp2(-(tmpvar_19)); } + +// inputs: 1, stats: 49 alu 5 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt index 93e89164c..c217c02a7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-ir.txt @@ -4,10 +4,10 @@ struct v2f { vec2 uvg; vec2 uvs; }; -uniform sampler2D _ScratchTex; -uniform sampler2D _MainTex; -uniform vec4 _Intensity; uniform sampler2D _GrainTex; +uniform vec4 _Intensity; +uniform sampler2D _MainTex; +uniform sampler2D _ScratchTex; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt index 1d735bf72..ca51394ab 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt @@ -1,15 +1,21 @@ -uniform sampler2D _ScratchTex; -uniform sampler2D _MainTex; -uniform vec4 _Intensity; uniform sampler2D _GrainTex; +uniform vec4 _Intensity; +uniform sampler2D _MainTex; +uniform sampler2D _ScratchTex; void main () { vec4 col_1; vec4 tmpvar_2; tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy); col_1.w = tmpvar_2.w; - col_1.xyz = (tmpvar_2.xyz + (((texture2D (_GrainTex, gl_TexCoord[1].xy).xyz * 2.0) - 1.0) * _Intensity.x)); - col_1.xyz = (col_1.xyz + (((texture2D (_ScratchTex, gl_TexCoord[2].xy).xyz * 2.0) - 1.0) * _Intensity.y)); + col_1.xyz = (tmpvar_2.xyz + (( + (texture2D (_GrainTex, gl_TexCoord[1].xy).xyz * 2.0) + - 1.0) * _Intensity.x)); + col_1.xyz = (col_1.xyz + (( + (texture2D (_ScratchTex, gl_TexCoord[2].xy).xyz * 2.0) + - 1.0) * _Intensity.y)); gl_FragData[0] = col_1; } + +// inputs: 1, stats: 8 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt index 524345021..15d6b1ab3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-ir.txt @@ -4,10 +4,10 @@ struct v2f { vec2 uvg; vec2 uvs; }; -uniform sampler2D _ScratchTex; -uniform sampler2D _MainTex; -uniform vec4 _Intensity; uniform sampler2D _GrainTex; +uniform vec4 _Intensity; +uniform sampler2D _MainTex; +uniform sampler2D _ScratchTex; vec4 frag ( in v2f i_1 ) @@ -44,7 +44,11 @@ vec4 frag ( tmpvar_15 = ((yuv_4.z * 1.14) + yuv_4.x); col_5.x = tmpvar_15; float tmpvar_16; - tmpvar_16 = (((yuv_4.z * -(0.581)) + (yuv_4.y * -(0.395))) + yuv_4.x); + tmpvar_16 = (((yuv_4.z * + -(0.581) + ) + (yuv_4.y * + -(0.395) + )) + yuv_4.x); col_5.y = vec2(tmpvar_16).y; float tmpvar_17; tmpvar_17 = ((yuv_4.y * 2.032) + yuv_4.x); diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt index acdb091e7..adb3c03cb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _ScratchTex; -uniform sampler2D _MainTex; -uniform vec4 _Intensity; uniform sampler2D _GrainTex; +uniform vec4 _Intensity; +uniform sampler2D _MainTex; +uniform sampler2D _ScratchTex; void main () { vec3 yuv_1; @@ -12,11 +12,17 @@ void main () yuv_1.x = dot (tmpvar_3.xyz, vec3(0.299, 0.587, 0.114)); yuv_1.y = ((tmpvar_3.z - yuv_1.x) * 0.492); yuv_1.z = ((tmpvar_3.x - yuv_1.x) * 0.877); - yuv_1 = (yuv_1 + (((texture2D (_GrainTex, gl_TexCoord[1].xy).xyz * 2.0) - 1.0) * _Intensity.x)); + yuv_1 = (yuv_1 + (( + (texture2D (_GrainTex, gl_TexCoord[1].xy).xyz * 2.0) + - 1.0) * _Intensity.x)); col_2.x = ((yuv_1.z * 1.14) + yuv_1.x); col_2.y = (((yuv_1.z * -0.581) + (yuv_1.y * -0.395)) + yuv_1.x); col_2.z = ((yuv_1.y * 2.032) + yuv_1.x); - col_2.xyz = (col_2.xyz + (((texture2D (_ScratchTex, gl_TexCoord[2].xy).xyz * 2.0) - 1.0) * _Intensity.y)); + col_2.xyz = (col_2.xyz + (( + (texture2D (_ScratchTex, gl_TexCoord[2].xy).xyz * 2.0) + - 1.0) * _Intensity.y)); gl_FragData[0] = col_2; } + +// inputs: 1, stats: 21 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt index 3df91ce13..de268818f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt @@ -9,3 +9,5 @@ void main () gl_FragData[0] = xlat_var_output_1; } + +// inputs: 1, stats: 2 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt index fd092e11f..d3477054e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-ir.txt @@ -2,9 +2,9 @@ struct v2f_img { vec4 pos; vec2 uv; }; -uniform vec4 unity_ShadowBlurParams; -uniform sampler2D _MainTex; uniform vec4 _BlurOffsets[8]; +uniform sampler2D _MainTex; +uniform vec4 unity_ShadowBlurParams; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt index 94d6b3c63..93384e27f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt @@ -1,6 +1,6 @@ -uniform vec4 unity_ShadowBlurParams; -uniform sampler2D _MainTex; uniform vec4 _BlurOffsets[8]; +uniform sampler2D _MainTex; +uniform vec4 unity_ShadowBlurParams; void main () { float radius_1; @@ -17,28 +17,62 @@ void main () mask_2.xy = (tmpvar_4.xy * unity_ShadowBlurParams.x); vec4 tmpvar_6; tmpvar_6 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[0])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_6.z + (tmpvar_6.w / 255.0))))), 0.0, 1.0) * tmpvar_6.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_6.z + + (tmpvar_6.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_6.xy)); vec4 tmpvar_7; tmpvar_7 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[1])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_7.z + (tmpvar_7.w / 255.0))))), 0.0, 1.0) * tmpvar_7.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_7.z + + (tmpvar_7.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_7.xy)); vec4 tmpvar_8; tmpvar_8 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[2])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_8.z + (tmpvar_8.w / 255.0))))), 0.0, 1.0) * tmpvar_8.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_8.z + + (tmpvar_8.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_8.xy)); vec4 tmpvar_9; tmpvar_9 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[3])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_9.z + (tmpvar_9.w / 255.0))))), 0.0, 1.0) * tmpvar_9.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_9.z + + (tmpvar_9.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_9.xy)); vec4 tmpvar_10; tmpvar_10 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[4])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_10.z + (tmpvar_10.w / 255.0))))), 0.0, 1.0) * tmpvar_10.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_10.z + + (tmpvar_10.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_10.xy)); vec4 tmpvar_11; tmpvar_11 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[5])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_11.z + (tmpvar_11.w / 255.0))))), 0.0, 1.0) * tmpvar_11.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_11.z + + (tmpvar_11.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_11.xy)); vec4 tmpvar_12; tmpvar_12 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[6])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_12.z + (tmpvar_12.w / 255.0))))), 0.0, 1.0) * tmpvar_12.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_12.z + + (tmpvar_12.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_12.xy)); vec4 tmpvar_13; tmpvar_13 = texture2D (_MainTex, (tmpvar_3 + (radius_1 * _BlurOffsets[7])).xy); - mask_2.xy = (mask_2.xy + (clamp ((unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_13.z + (tmpvar_13.w / 255.0))))), 0.0, 1.0) * tmpvar_13.xy)); + mask_2.xy = (mask_2.xy + (clamp ( + (unity_ShadowBlurParams.x - abs((tmpvar_5 - (tmpvar_13.z + + (tmpvar_13.w / 255.0) + )))) + , 0.0, 1.0) * tmpvar_13.xy)); gl_FragData[0] = vec4((mask_2.x / mask_2.y)); } + +// inputs: 1, stats: 88 alu 9 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt index f313fc5b7..1df8f1328 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-ir.txt @@ -2,8 +2,8 @@ struct v2f_img { vec4 pos; vec2 uv; }; -uniform sampler2D _MainTex; uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _MainTex; vec3 DecodeViewNormalStereo ( in vec4 enc4_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt index 533af0d7a..a73ccc327 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _MainTex; void main () { vec2 tmpvar_1; @@ -21,3 +21,5 @@ void main () gl_FragData[0] = col_2; } + +// inputs: 1, stats: 11 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt index 152809b83..3fb607477 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-ir.txt @@ -2,9 +2,9 @@ struct v2f_img { vec4 pos; vec2 uv; }; -uniform vec4 _ZBufferParams; -uniform sampler2D _MainTex; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _MainTex; +uniform vec4 _ZBufferParams; float LinearEyeDepth ( in float z_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt index dc02f31bd..4f4da1da4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt @@ -1,13 +1,17 @@ -uniform vec4 _ZBufferParams; -uniform sampler2D _MainTex; uniform sampler2D _CameraDepthTexture; +uniform sampler2D _MainTex; +uniform vec4 _ZBufferParams; void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; vec4 col_2; col_2.zw = texture2D (_MainTex, tmpvar_1).zw; - col_2.xy = vec2(((1.0/(((_ZBufferParams.z * texture2D (_CameraDepthTexture, tmpvar_1).x) + _ZBufferParams.w))) * 0.01)); + col_2.xy = vec2(((1.0/(( + (_ZBufferParams.z * texture2D (_CameraDepthTexture, tmpvar_1).x) + + _ZBufferParams.w))) * 0.01)); gl_FragData[0] = col_2; } + +// inputs: 1, stats: 4 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt index 919dc19f5..59d49f2f5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-ir.txt @@ -4,8 +4,8 @@ struct v2f { vec4 color; vec2 uv; }; -varying vec4 xlv_FOG; uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt index ceb7d2ceb..1ab28bd21 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt @@ -12,3 +12,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 2, stats: 2 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt index b1acf42fe..8b40ad19e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt @@ -18,11 +18,11 @@ struct v2f_surf { vec3 normal; vec3 vlight; }; -varying vec4 xlv_FOG; -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform vec4 _WorldSpaceLightPos0; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt index 1b73f59cf..703c370f3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt @@ -1,7 +1,7 @@ -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; @@ -15,10 +15,14 @@ void main () discard; }; vec4 c_5; - c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) * 2.0)); + c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (max (0.0, + dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz) + ) * 2.0)); c_5.w = tmpvar_3; c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); c_1.w = tmpvar_3; gl_FragData[0] = c_1; } + +// inputs: 2, stats: 10 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt index f86fd2b24..6262968b9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt @@ -19,12 +19,12 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt index 203352cc1..45c70c9d5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec3 tmpvar_1; @@ -18,10 +18,16 @@ void main () discard; }; vec4 c_6; - c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)) * 2.0)); + c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w) + ) * 2.0)); c_6.w = tmpvar_4; c_2.xyz = c_6.xyz; c_2.w = tmpvar_4; gl_FragData[0] = c_2; } + +// inputs: 2, stats: 12 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt index b93c1fef1..7ec658b09 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt @@ -15,8 +15,8 @@ struct v2f_surf { vec2 hip_pack0; vec4 lop_color; }; -uniform sampler2D _MainTex; uniform float _Cutoff; +uniform sampler2D _MainTex; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt index fd96e5996..ff80a6956 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform float _Cutoff; +uniform sampler2D _MainTex; void main () { float x_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 2, stats: 4 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt index f13b66952..06b1f13f5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-ir.txt @@ -19,10 +19,10 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt index f3ce85015..9554b5a81 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt @@ -1,6 +1,6 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec3 tmpvar_1; @@ -9,10 +9,16 @@ void main () vec4 tmpvar_3; tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color); vec4 c_4; - c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * texture2D (_LightTexture0, vec2(dot (tmpvar_1, tmpvar_1))).w) * 2.0)); + c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * texture2D (_LightTexture0, vec2( + dot (tmpvar_1, tmpvar_1) + )).w) * 2.0)); c_4.w = tmpvar_3.w; c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 2, stats: 10 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt index c1a123c23..182fd6f9e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-ir.txt @@ -18,11 +18,11 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt index 3b695733e..a36c3503e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -19,3 +19,5 @@ void main () gl_FragData[0] = c_5; } + +// inputs: 2, stats: 9 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt index fab3f35a0..a80e9d92a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-ir.txt @@ -19,12 +19,12 @@ struct v2f_surf { vec3 vlight; vec4 _ShadowCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _ShadowMapTexture; +uniform vec4 _WorldSpaceLightPos0; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt index a8751c661..266b4eb02 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt @@ -1,8 +1,8 @@ -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _ShadowMapTexture; +uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; @@ -16,10 +16,14 @@ void main () discard; }; vec4 c_5; - c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); + c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) + * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); c_5.w = tmpvar_3; c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); c_1.w = tmpvar_3; gl_FragData[0] = c_1; } + +// inputs: 2, stats: 11 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt index b9056810e..cb8f9d2d6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt @@ -19,12 +19,12 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) @@ -148,7 +148,9 @@ vec4 frag_surf ( float tmpvar_43; tmpvar_43 = UnitySpotAttenuate (IN_26._LightCoord.xyz); vec4 tmpvar_44; - tmpvar_44 = LightingLambert (o_29, lightDir_28, ((float((IN_26._LightCoord.z > 0.0)) * tmpvar_42) * tmpvar_43)); + tmpvar_44 = LightingLambert (o_29, lightDir_28, ((float( + (IN_26._LightCoord.z > 0.0) + ) * tmpvar_42) * tmpvar_43)); vec4 tmpvar_45; tmpvar_45 = tmpvar_44; c_27 = tmpvar_45; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt index a6c1169f2..c0402c6e0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -18,10 +18,16 @@ void main () discard; }; vec4 c_6; - c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)) * 2.0)); + c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) + ) * 2.0)); c_6.w = tmpvar_4; c_2.xyz = c_6.xyz; c_2.w = tmpvar_4; gl_FragData[0] = c_2; } + +// inputs: 2, stats: 17 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt index 6ba50cd97..36ffe0d87 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec4 lop_color; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt index 5901cd45f..314d722d8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt @@ -1,7 +1,7 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 light_1; @@ -22,3 +22,5 @@ void main () gl_FragData[0] = c_5; } + +// inputs: 2, stats: 7 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt index 4a7488099..15dcb5100 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * vec4(1.0, 0.0, 0.0, 1.0)); } + +// inputs: 1, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt index 35b70cb30..32e58a0af 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt @@ -4,8 +4,8 @@ struct v2f { vec4 uv; vec4 color; }; -varying vec4 xlv_FOG; uniform sampler2D _MainTex; +varying vec4 xlv_FOG; vec4 frag ( in v2f xlat_var_input_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt index 985175b0b..616a8aee7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt @@ -7,3 +7,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 2, stats: 2 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt index 8394eeaff..361e01a58 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt @@ -4,9 +4,9 @@ struct v2f { vec4 uv; vec4 color; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; uniform float _HalfOverCutoff; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt index 47e2ef743..ccab03524 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform float _HalfOverCutoff; +uniform sampler2D _MainTex; void main () { vec4 col_1; @@ -15,3 +15,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 2, stats: 6 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt index 2f923e2d0..86fbacc28 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt @@ -23,15 +23,15 @@ struct v2f_surf { vec3 vlight; vec4 _ShadowCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightColor0; uniform sampler2D _Control; +uniform vec4 _LightColor0; +uniform sampler2D _ShadowMapTexture; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform vec4 _WorldSpaceLightPos0; +varying vec4 xlv_FOG; float unitySampleShadow ( in vec4 shadowCoord_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt index eda6b4971..e2d7abab5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt @@ -1,11 +1,11 @@ -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightColor0; uniform sampler2D _Control; +uniform vec4 _LightColor0; +uniform sampler2D _ShadowMapTexture; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform vec4 _WorldSpaceLightPos0; void main () { vec4 tmpvar_1; @@ -16,12 +16,20 @@ void main () vec4 tmpvar_4; tmpvar_4 = texture2D (_Control, tmpvar_1.xy); vec3 tmpvar_5; - tmpvar_5 = ((((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); + tmpvar_5 = ((( + (tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + + + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz) + ) + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)); vec4 c_6; - c_6.xyz = ((tmpvar_5 * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[3].xyz, _WorldSpaceLightPos0.xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[5]).x) * 2.0)); + c_6.xyz = ((tmpvar_5 * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[3].xyz, _WorldSpaceLightPos0.xyz)) + * texture2DProj (_ShadowMapTexture, gl_TexCoord[5]).x) * 2.0)); c_6.w = 0.0; c_3.w = c_6.w; c_3.xyz = (c_6.xyz + (tmpvar_5 * gl_TexCoord[4].xyz)); gl_FragData[0] = c_3; } + +// inputs: 1, stats: 16 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt index c296ac0cb..4d0a5db3e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-ir.txt @@ -21,14 +21,14 @@ struct v2f_surf { vec2 hip_pack2; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _LightBuffer; uniform sampler2D _Control; +uniform sampler2D _LightBuffer; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt index 0bcdd4d40..49dce375d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _LightBuffer; uniform sampler2D _Control; +uniform sampler2D _LightBuffer; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -19,8 +19,14 @@ void main () light_3.w = tmpvar_5.w; light_3.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); vec4 c_6; - c_6.xyz = (((((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_3.xyz); + c_6.xyz = ((( + ((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + + + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz) + ) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_3.xyz); c_6.w = 0.0; gl_FragData[0] = c_6; } + +// inputs: 1, stats: 12 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt index c296ac0cb..4d0a5db3e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-ir.txt @@ -21,14 +21,14 @@ struct v2f_surf { vec2 hip_pack2; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _LightBuffer; uniform sampler2D _Control; +uniform sampler2D _LightBuffer; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt index 0bcdd4d40..49dce375d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _LightBuffer; uniform sampler2D _Control; +uniform sampler2D _LightBuffer; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -19,8 +19,14 @@ void main () light_3.w = tmpvar_5.w; light_3.xyz = (tmpvar_5.xyz + unity_Ambient.xyz); vec4 c_6; - c_6.xyz = (((((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_3.xyz); + c_6.xyz = ((( + ((tmpvar_4.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_4.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + + + (tmpvar_4.z * texture2D (_Splat2, tmpvar_2.zw).xyz) + ) + (tmpvar_4.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_3.xyz); c_6.w = 0.0; gl_FragData[0] = c_6; } + +// inputs: 1, stats: 12 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt index 34db9f2ff..192ae411a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt @@ -22,15 +22,15 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _LightBuffer; uniform sampler2D _Control; +uniform sampler2D _LightBuffer; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt index 3b402ee23..58d383722 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt @@ -1,11 +1,11 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _Splat3; -uniform sampler2D _Splat2; -uniform sampler2D _Splat1; -uniform sampler2D _Splat0; -uniform sampler2D _LightBuffer; uniform sampler2D _Control; +uniform sampler2D _LightBuffer; +uniform sampler2D _Splat0; +uniform sampler2D _Splat1; +uniform sampler2D _Splat2; +uniform sampler2D _Splat3; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec4 tmpvar_1; @@ -22,8 +22,14 @@ void main () light_4.w = tmpvar_6.w; light_4.xyz = (tmpvar_6.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_3.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_3.xy).xyz), vec3(clamp (tmpvar_3.z, 0.0, 1.0)))); vec4 c_7; - c_7.xyz = (((((tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz)) + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_4.xyz); + c_7.xyz = ((( + ((tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz) + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz)) + + + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz) + ) + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz)) * light_4.xyz); c_7.w = 0.0; gl_FragData[0] = c_7; } + +// inputs: 1, stats: 16 alu 8 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt index d815c9bda..1f0afebe1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt @@ -7,3 +7,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 3 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt index e26fa9217..ebcb56318 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt @@ -3,8 +3,8 @@ struct v2f { vec2 uv; vec3 color; }; -uniform sampler2D _MainTex; uniform float _HalfOverCutoff; +uniform sampler2D _MainTex; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt index 5b402ef30..ec1cc5cd9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _MainTex; uniform float _HalfOverCutoff; +uniform sampler2D _MainTex; void main () { vec4 col_1; @@ -15,3 +15,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 6 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt index 58e6f464e..33a9ff973 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt @@ -19,13 +19,13 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _BumpSpecMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -123,7 +123,9 @@ vec4 LightingTreeBark ( tmpvar_42 = (tmpvar_41 * s_24.Gloss); spec_29 = tmpvar_42; vec3 tmpvar_43; - tmpvar_43 = ((((s_24.Albedo * _LightColor0.xyz) * diff_31) + (_LightColor0.xyz * spec_29)) * (atten_27 * 2.0)); + tmpvar_43 = ((( + (s_24.Albedo * _LightColor0.xyz) + * diff_31) + (_LightColor0.xyz * spec_29)) * (atten_27 * 2.0)); c_28.xyz = tmpvar_43.xyz.xyz; float tmpvar_44; tmpvar_44 = (((_LightColor0.w * spec_29) * atten_27) * s_24.Alpha); diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt index 0a915d3b9..5771505be 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _BumpSpecMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; void main () { vec2 tmpvar_1; @@ -15,18 +15,28 @@ void main () tmpvar_4 = texture2D (_BumpSpecMap, tmpvar_1); vec4 normal_5; normal_5.xy = ((tmpvar_4.wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); vec3 tmpvar_6; tmpvar_6 = normalize(gl_TexCoord[1].xyz); float atten_7; atten_7 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_8; float tmpvar_9; - tmpvar_9 = (pow (max (0.0, dot (normal_5.xyz, normalize((tmpvar_6 + normalize(gl_TexCoord[2].xyz))))), (tmpvar_4.x * 128.0)) * texture2D (_TranslucencyMap, tmpvar_1).w); - c_8.xyz = (((((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_5.xyz, tmpvar_6))) + (_LightColor0.xyz * tmpvar_9)) * (atten_7 * 2.0)); + tmpvar_9 = (pow (max (0.0, + dot (normal_5.xyz, normalize((tmpvar_6 + normalize(gl_TexCoord[2].xyz)))) + ), (tmpvar_4.x * 128.0)) * texture2D (_TranslucencyMap, tmpvar_1).w); + c_8.xyz = ((( + ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_5.xyz, tmpvar_6)) + ) + (_LightColor0.xyz * tmpvar_9)) * (atten_7 * 2.0)); c_8.w = (((_LightColor0.w * tmpvar_9) * atten_7) * gl_Color.w); c_3.xyz = c_8.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 2, stats: 31 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt index 16bcf2748..f05c9bbb1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt @@ -13,9 +13,9 @@ struct Input { struct v2f_surf { vec4 pos; }; -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; uniform sampler2D _BumpSpecMap; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt index 475808ad2..79c959c26 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt @@ -4,7 +4,11 @@ void main () vec2 tmpvar_1; vec4 normal_2; normal_2.xy = ((texture2D (_BumpSpecMap, tmpvar_1).wy * 2.0) - 1.0); - normal_2.z = sqrt(((1.0 - (normal_2.x * normal_2.x)) - (normal_2.y * normal_2.y))); + normal_2.z = sqrt(((1.0 - + (normal_2.x * normal_2.x) + ) - (normal_2.y * normal_2.y))); gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0); } + +// inputs: 0, stats: 8 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt index 9b0335cb3..8308c57d5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt @@ -19,12 +19,12 @@ struct v2f_surf { vec3 lightDir; vec3 viewDir; }; -varying vec4 xlv_FOG; -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform sampler2D _BumpSpecMap; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt index 79e051b0b..0f76fecfc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform sampler2D _BumpSpecMap; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; void main () { vec2 tmpvar_1; @@ -20,7 +20,9 @@ void main () tmpvar_7 = texture2D (_BumpSpecMap, tmpvar_1); vec4 normal_8; normal_8.xy = ((tmpvar_7.wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x)) - (normal_8.y * normal_8.y))); + normal_8.z = sqrt(((1.0 - + (normal_8.x * normal_8.x) + ) - (normal_8.y * normal_8.y))); float x_9; x_9 = (tmpvar_6 - _Cutoff); if ((x_9 < 0.0)) { @@ -31,9 +33,19 @@ void main () tmpvar_11 = dot (normal_8.xyz, tmpvar_2); float tmpvar_12; tmpvar_12 = max (0.0, -(tmpvar_11)); - c_10.xyz = (((((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ((tmpvar_11 * 0.5) + 0.5)) + ((tmpvar_5.xyz * tmpvar_12) * 2.0))) + ((pow (max (0.0, dot (normal_8.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz))))), (tmpvar_7.x * 128.0)) * tmpvar_5.w) * (1.0 - clamp (ceil(tmpvar_12), 0.0, 1.0)))) * _LightColor0.xyz) * 2.0); + c_10.xyz = ((( + ((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ( + (tmpvar_11 * 0.5) + + 0.5)) + ((tmpvar_5.xyz * tmpvar_12) * 2.0))) + + + ((pow (max (0.0, + dot (normal_8.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz)))) + ), (tmpvar_7.x * 128.0)) * tmpvar_5.w) * (1.0 - clamp (ceil(tmpvar_12), 0.0, 1.0))) + ) * _LightColor0.xyz) * 2.0); c_3.xyz = c_10.xyz; c_3.w = tmpvar_6; gl_FragData[0] = c_3; } + +// inputs: 2, stats: 36 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt index c88dd5272..1801333b4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt @@ -20,14 +20,14 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform sampler2D _BumpSpecMap; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt index 3f7eba912..a0fb410cc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D _TranslucencyMap; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform sampler2D _BumpSpecMap; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform sampler2D _TranslucencyMap; void main () { vec2 tmpvar_1; @@ -22,7 +22,9 @@ void main () tmpvar_7 = texture2D (_BumpSpecMap, tmpvar_1); vec4 normal_8; normal_8.xy = ((tmpvar_7.wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x)) - (normal_8.y * normal_8.y))); + normal_8.z = sqrt(((1.0 - + (normal_8.x * normal_8.x) + ) - (normal_8.y * normal_8.y))); float x_9; x_9 = (tmpvar_6 - _Cutoff); if ((x_9 < 0.0)) { @@ -35,9 +37,21 @@ void main () tmpvar_12 = dot (normal_8.xyz, tmpvar_10); float tmpvar_13; tmpvar_13 = max (0.0, -(tmpvar_12)); - c_11.xyz = (((((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ((tmpvar_12 * 0.5) + 0.5)) + ((tmpvar_5.xyz * tmpvar_13) * 2.0))) + ((pow (max (0.0, dot (normal_8.xyz, normalize((tmpvar_10 + normalize(gl_TexCoord[2].xyz))))), (tmpvar_7.x * 128.0)) * tmpvar_5.w) * (1.0 - clamp (ceil(tmpvar_13), 0.0, 1.0)))) * _LightColor0.xyz) * ((texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0)); + c_11.xyz = ((( + ((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ( + (tmpvar_12 * 0.5) + + 0.5)) + ((tmpvar_5.xyz * tmpvar_13) * 2.0))) + + + ((pow (max (0.0, + dot (normal_8.xyz, normalize((tmpvar_10 + normalize(gl_TexCoord[2].xyz)))) + ), (tmpvar_7.x * 128.0)) * tmpvar_5.w) * (1.0 - clamp (ceil(tmpvar_13), 0.0, 1.0))) + ) * _LightColor0.xyz) * ((texture2D (_LightTextureB0, vec2( + dot (tmpvar_2, tmpvar_2) + )).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0)); c_3.xyz = c_11.xyz; c_3.w = tmpvar_6; gl_FragData[0] = c_3; } + +// inputs: 2, stats: 40 alu 6 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt index d6b077fd9..c56def237 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-ir.txt @@ -2,9 +2,9 @@ struct v2f { vec4 pos; vec2 uv; }; -uniform mat4 _RotationMatrix; -uniform sampler2D _MainTex; uniform vec4 _CenterRadius; +uniform sampler2D _MainTex; +uniform mat4 _RotationMatrix; vec2 MultiplyUV ( in mat4 mat_1, in vec2 inUV_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt index a42d555ff..9d9f6b39a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt @@ -1,16 +1,19 @@ -uniform mat4 _RotationMatrix; -uniform sampler2D _MainTex; uniform vec4 _CenterRadius; +uniform sampler2D _MainTex; +uniform mat4 _RotationMatrix; void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; vec4 tmpvar_2; tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.x = tmpvar_1.x; - tmpvar_2.y = tmpvar_1.y; + tmpvar_2.xy = tmpvar_1; vec2 tmpvar_3; tmpvar_3 = (tmpvar_1 / _CenterRadius.zw); - gl_FragData[0] = texture2D (_MainTex, (mix ((_RotationMatrix * tmpvar_2).xy, tmpvar_1, vec2(min (1.0, sqrt(dot (tmpvar_3, tmpvar_3))))) + _CenterRadius.xy)); + gl_FragData[0] = texture2D (_MainTex, (mix ((_RotationMatrix * tmpvar_2).xy, tmpvar_1, vec2(min (1.0, + sqrt(dot (tmpvar_3, tmpvar_3)) + ))) + _CenterRadius.xy)); } + +// inputs: 1, stats: 8 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt index bb8dac9b8..0c9aadafe 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-ir.txt @@ -3,9 +3,9 @@ struct v2f { vec2 uv; vec2 uvOrig; }; -uniform sampler2D _MainTex; -uniform vec4 _CenterRadius; uniform float _Angle; +uniform vec4 _CenterRadius; +uniform sampler2D _MainTex; void xll_sincos ( in float x_1, out float s_2, @@ -96,8 +96,8 @@ void xll_sincos ( tmpvar_36 = tmpvar_33; tmpvar_34[1] = tmpvar_36; mat2 tmpvar_37; - tmpvar_37 = (tmpvar_34); - s_30 = (tmpvar_37); + tmpvar_37 = tmpvar_34; + s_30 = tmpvar_37; vec2 tmpvar_38; tmpvar_38 = cos (x_29[0]); vec2 tmpvar_39; @@ -110,8 +110,8 @@ void xll_sincos ( tmpvar_42 = tmpvar_39; tmpvar_40[1] = tmpvar_42; mat2 tmpvar_43; - tmpvar_43 = (tmpvar_40); - c_31 = (tmpvar_43); + tmpvar_43 = tmpvar_40; + c_31 = tmpvar_43; } void xll_sincos ( @@ -137,8 +137,8 @@ void xll_sincos ( tmpvar_53 = tmpvar_49; tmpvar_50[2] = tmpvar_53; mat3 tmpvar_54; - tmpvar_54 = (tmpvar_50); - s_45 = (tmpvar_54); + tmpvar_54 = tmpvar_50; + s_45 = tmpvar_54; vec3 tmpvar_55; tmpvar_55 = cos (x_44[0]); vec3 tmpvar_56; @@ -156,8 +156,8 @@ void xll_sincos ( tmpvar_61 = tmpvar_57; tmpvar_58[2] = tmpvar_61; mat3 tmpvar_62; - tmpvar_62 = (tmpvar_58); - c_46 = (tmpvar_62); + tmpvar_62 = tmpvar_58; + c_46 = tmpvar_62; } void xll_sincos ( @@ -188,8 +188,8 @@ void xll_sincos ( tmpvar_74 = tmpvar_69; tmpvar_70[3] = tmpvar_74; mat4 tmpvar_75; - tmpvar_75 = (tmpvar_70); - s_64 = (tmpvar_75); + tmpvar_75 = tmpvar_70; + s_64 = tmpvar_75; vec4 tmpvar_76; tmpvar_76 = cos (x_63[0]); vec4 tmpvar_77; @@ -212,8 +212,8 @@ void xll_sincos ( tmpvar_84 = tmpvar_79; tmpvar_80[3] = tmpvar_84; mat4 tmpvar_85; - tmpvar_85 = (tmpvar_80); - c_65 = (tmpvar_85); + tmpvar_85 = tmpvar_80; + c_65 = tmpvar_85; } vec4 frag ( diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt index b55b0fa19..456781266 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt @@ -1,15 +1,17 @@ -uniform sampler2D _MainTex; -uniform vec4 _CenterRadius; uniform float _Angle; +uniform vec4 _CenterRadius; +uniform sampler2D _MainTex; void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[1].xy; vec2 uv_2; - vec2 arg0_3; - arg0_3 = (tmpvar_1 / _CenterRadius.zw); + vec2 x_3; + x_3 = (tmpvar_1 / _CenterRadius.zw); float tmpvar_4; - tmpvar_4 = max (0.0, (1.0 - sqrt(dot (arg0_3, arg0_3)))); + tmpvar_4 = max (0.0, (1.0 - sqrt( + dot (x_3, x_3) + ))); float tmpvar_5; tmpvar_5 = ((tmpvar_4 * tmpvar_4) * _Angle); float tmpvar_6; @@ -24,3 +26,5 @@ void main () gl_FragData[0] = texture2D (_MainTex, tmpvar_8); } + +// inputs: 1, stats: 16 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt index 69b556ddf..103d0f072 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt @@ -18,13 +18,13 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightMap; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightMap; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt index 5e7cc66fd..376cd7e5f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightMap; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightMap; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -12,12 +12,18 @@ void main () vec2 tmpvar_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 c_5; - c_5.xyz = (((texture2D (_MainTex, tmpvar_1.xy).xyz * _Color.xyz) * _LightColor0.xyz) * ((max (0.0, dot (normal_4.xyz, gl_TexCoord[1].xyz)) * texture2D (_LightTexture0, gl_TexCoord[2].xy).w) * 2.0)); + c_5.xyz = (((texture2D (_MainTex, tmpvar_1.xy).xyz * _Color.xyz) * _LightColor0.xyz) * (( + max (0.0, dot (normal_4.xyz, gl_TexCoord[1].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[2].xy).w) * 2.0)); c_5.w = (texture2D (_LightMap, tmpvar_3).w * _Color.w); c_2.xyz = c_5.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 16 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt index 54e774928..4ea542106 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec4 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightMap; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _LightMap; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt index ddf3065d0..57de1d2e6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt @@ -1,9 +1,9 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightMap; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _LightMap; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -17,7 +17,9 @@ void main () tmpvar_6 = texture2D (_LightMap, tmpvar_1.zw); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y))); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); vec4 tmpvar_8; tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_3.w = tmpvar_8.w; @@ -30,3 +32,5 @@ void main () gl_FragData[0] = col_2; } + +// inputs: 1, stats: 15 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt index 8df41372d..1ad3ec9b5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-ir.txt @@ -18,13 +18,13 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightMap; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightMap; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -142,7 +142,9 @@ vec4 frag_surf ( float tmpvar_44; tmpvar_44 = UnitySpotAttenuate (IN_28._LightCoord.xyz); vec4 tmpvar_45; - tmpvar_45 = LightingLambert (o_31, lightDir_30, ((float((IN_28._LightCoord.z > 0.0)) * tmpvar_43) * tmpvar_44)); + tmpvar_45 = LightingLambert (o_31, lightDir_30, ((float( + (IN_28._LightCoord.z > 0.0) + ) * tmpvar_43) * tmpvar_44)); vec4 tmpvar_46; tmpvar_46 = tmpvar_45; c_29 = tmpvar_46; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt index 11d8f415c..ea2c26c56 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform sampler2D _LightMap; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightMap; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -11,10 +11,16 @@ void main () vec4 c_2; vec2 tmpvar_3; vec4 c_4; - c_4.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _Color.xyz) * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)) * 2.0)); + c_4.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _Color.xyz) * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) + ) * 2.0)); c_4.w = (texture2D (_LightMap, tmpvar_3).w * _Color.w); c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 17 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt index 310c4830d..d05ffa309 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-irES.txt @@ -16,14 +16,14 @@ struct v2f_surf { lowp vec3 lightDir; lowp vec3 vlight; }; -varying lowp vec3 xlv_TEXCOORD3; -varying lowp vec3 xlv_TEXCOORD2; -varying mediump vec3 xlv_TEXCOORD1; -varying mediump vec2 xlv_TEXCOORD0; -uniform mediump float _Shininess; -uniform sampler2D _MainTex; -uniform lowp vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform lowp vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform mediump float _Shininess; +varying mediump vec2 xlv_TEXCOORD0; +varying mediump vec3 xlv_TEXCOORD1; +varying lowp vec3 xlv_TEXCOORD2; +varying lowp vec3 xlv_TEXCOORD3; lowp vec3 UnpackNormal ( in lowp vec4 packednormal_1 ) @@ -94,7 +94,9 @@ lowp vec4 LightingMobileBlinnPhong ( tmpvar_29 = (tmpvar_28 * s_14.Gloss); spec_19 = tmpvar_29; lowp vec3 tmpvar_30; - tmpvar_30 = ((((s_14.Albedo * diff_21) + spec_19) * _LightColor0.xyz) * (atten_17 * 2.0)); + tmpvar_30 = ((( + (s_14.Albedo * diff_21) + + spec_19) * _LightColor0.xyz) * (atten_17 * 2.0)); c_18.xyz = tmpvar_30.xyz.xyz; float tmpvar_31; tmpvar_31 = 0.0; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt index 870b2f631..551da9b57 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt @@ -1,11 +1,11 @@ -varying lowp vec3 xlv_TEXCOORD3; -varying lowp vec3 xlv_TEXCOORD2; -varying mediump vec3 xlv_TEXCOORD1; -varying mediump vec2 xlv_TEXCOORD0; -uniform mediump float _Shininess; -uniform sampler2D _MainTex; -uniform lowp vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform lowp vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform mediump float _Shininess; +varying mediump vec2 xlv_TEXCOORD0; +varying mediump vec3 xlv_TEXCOORD1; +varying lowp vec3 xlv_TEXCOORD2; +varying lowp vec3 xlv_TEXCOORD3; void main () { lowp vec4 c_1; @@ -22,10 +22,14 @@ void main () mediump float tmpvar_8; tmpvar_8 = (pow (tmpvar_7, (_Shininess * 128.0)) * tmpvar_2.w); spec_6 = tmpvar_8; - c_5.xyz = ((((tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + spec_6) * _LightColor0.xyz) * 2.0); + c_5.xyz = ((( + (tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2))) + + spec_6) * _LightColor0.xyz) * 2.0); c_5.w = 0.0; c_1.w = c_5.w; c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * xlv_TEXCOORD3)); gl_FragData[0] = c_1; } + +// inputs: 4, stats: 16 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt index 4a7488099..15dcb5100 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * vec4(1.0, 0.0, 0.0, 1.0)); } + +// inputs: 1, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt index 6600c88e8..5f5cff675 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-ir.txt @@ -17,12 +17,12 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -133,7 +133,9 @@ vec4 frag_surf ( float tmpvar_41; tmpvar_41 = UnitySpotAttenuate (IN_25._LightCoord.xyz); vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_28, lightDir_27, ((float((IN_25._LightCoord.z > 0.0)) * tmpvar_40) * tmpvar_41)); + tmpvar_42 = LightingLambert (o_28, lightDir_27, ((float( + (IN_25._LightCoord.z > 0.0) + ) * tmpvar_40) * tmpvar_41)); vec4 tmpvar_43; tmpvar_43 = tmpvar_42; c_26 = tmpvar_43; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt index f13bdcedc..aae3545a9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -11,10 +11,16 @@ void main () vec4 tmpvar_3; tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_4; - c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)) * 2.0)); + c_4.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) + ) * 2.0)); c_4.w = tmpvar_3.w; c_2.xyz = c_4.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 16 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt index 33e291825..22bb6e1dc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt index 68e3f5404..b701346f5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt @@ -1,17 +1,21 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec4 c_1; vec4 tmpvar_2; tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_3; - c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_3.w = tmpvar_2.w; c_1.xyz = c_3.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 8 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt index 9f693d115..d0dd49134 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-ir.txt @@ -13,9 +13,9 @@ struct v2f_surf { vec4 pos; vec3 vec; }; -uniform sampler2D _MainTex; -uniform vec4 _LightPositionRange; uniform vec4 _Color; +uniform vec4 _LightPositionRange; +uniform sampler2D _MainTex; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt index 1cc2b331d..58c7cf154 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt @@ -4,7 +4,11 @@ void main () vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xyz; vec4 tmpvar_2; - tmpvar_2 = fract((vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt(dot (tmpvar_1, tmpvar_1)) * _LightPositionRange.w))); + tmpvar_2 = fract((vec4(1.0, 255.0, 65025.0, 1.60581e+08) * ( + sqrt(dot (tmpvar_1, tmpvar_1)) + * _LightPositionRange.w))); gl_FragData[0] = (tmpvar_2 - (tmpvar_2.yzww * 0.00392157)); } + +// inputs: 1, stats: 7 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt index 0bceaae70..c7b716586 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec3 _ShadowCoord3; vec2 _ShadowZFade; }; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _MainTex; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; uniform vec4 _Color; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _MainTex; +uniform vec4 _ProjectionParams; +uniform sampler2D _ShadowMapTexture; float xll_saturate ( in float x_1 ) @@ -229,7 +229,11 @@ vec4 frag_surf ( weights_55 = tmpvar_74; vec4 tmpvar_75; tmpvar_75.w = 1.0; - tmpvar_75.xyz = ((((IN_50._ShadowCoord0 * weights_55.x) + (IN_50._ShadowCoord1 * weights_55.y)) + (IN_50._ShadowCoord2 * weights_55.z)) + (IN_50._ShadowCoord3 * weights_55.w)).xyz; + tmpvar_75.xyz = ((( + (IN_50._ShadowCoord0 * weights_55.x) + + + (IN_50._ShadowCoord1 * weights_55.y) + ) + (IN_50._ShadowCoord2 * weights_55.z)) + (IN_50._ShadowCoord3 * weights_55.w)).xyz; vec4 tmpvar_76; tmpvar_76 = tmpvar_75; coord_54 = tmpvar_76; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt index f3246ca48..88a35c392 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform vec4 _ProjectionParams; +uniform sampler2D _ShadowMapTexture; void main () { vec2 tmpvar_1; @@ -12,7 +12,11 @@ void main () tmpvar_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); vec4 tmpvar_4; tmpvar_4.w = 1.0; - tmpvar_4.xyz = ((((gl_TexCoord[0].xyz * tmpvar_3.x) + (gl_TexCoord[1].xyz * tmpvar_3.y)) + (gl_TexCoord[2].xyz * tmpvar_3.z)) + (gl_TexCoord[3].xyz * tmpvar_3.w)); + tmpvar_4.xyz = ((( + (gl_TexCoord[0].xyz * tmpvar_3.x) + + + (gl_TexCoord[1].xyz * tmpvar_3.y) + ) + (gl_TexCoord[2].xyz * tmpvar_3.z)) + (gl_TexCoord[3].xyz * tmpvar_3.w)); vec4 tmpvar_5; tmpvar_5 = texture2D (_ShadowMapTexture, tmpvar_4.xy); float tmpvar_6; @@ -25,10 +29,14 @@ void main () res_2.y = 1.0; vec2 enc_7; vec2 tmpvar_8; - tmpvar_8 = fract((vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x)); + tmpvar_8 = fract((vec2(1.0, 255.0) * (1.0 - + (tmpvar_1.xxxx * _ProjectionParams.w) + ).x)); enc_7.y = tmpvar_8.y; enc_7.x = (tmpvar_8.x - (tmpvar_8.y * 0.00392157)); res_2.zw = enc_7; gl_FragData[0] = res_2; } + +// inputs: 1, stats: 25 alu 1 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt index 1a0b3acfe..6580bc8dd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec3 vlight; vec4 _ShadowCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _ShadowMapTexture; +uniform vec4 _WorldSpaceLightPos0; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt index 723512800..adf045171 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt @@ -1,9 +1,9 @@ -uniform vec4 _WorldSpaceLightPos0; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform sampler2D _ShadowMapTexture; +uniform vec4 _WorldSpaceLightPos0; void main () { vec4 c_1; @@ -17,10 +17,14 @@ void main () discard; }; vec4 c_5; - c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); + c_5.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)) + * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); c_5.w = tmpvar_3; c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * gl_TexCoord[2].xyz)); c_1.w = tmpvar_3; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 11 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt index 9deaeab4c..b1496bc1e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-ir.txt @@ -15,12 +15,12 @@ struct v2f_surf { vec2 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt index db7c24bcf..df218baa0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt @@ -1,8 +1,8 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 light_1; @@ -23,3 +23,5 @@ void main () gl_FragData[0] = c_5; } + +// inputs: 1, stats: 7 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt index 1bc77ad26..83eeb8455 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-ir.txt @@ -16,13 +16,13 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt index ba929b1d2..adcaf05df 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -26,3 +26,5 @@ void main () gl_FragData[0] = c_6; } + +// inputs: 1, stats: 11 alu 5 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt index d9e314ad9..07f99befb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-ir.txt @@ -14,10 +14,10 @@ struct v2f_surf { vec3 vec; vec2 hip_pack0; }; -uniform sampler2D _MainTex; -uniform vec4 _LightPositionRange; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightPositionRange; +uniform sampler2D _MainTex; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt index d7ec7de10..c06591080 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _MainTex; -uniform vec4 _LightPositionRange; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightPositionRange; +uniform sampler2D _MainTex; void main () { vec3 tmpvar_1; @@ -12,7 +12,11 @@ void main () discard; }; vec4 tmpvar_3; - tmpvar_3 = fract((vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt(dot (tmpvar_1, tmpvar_1)) * _LightPositionRange.w))); + tmpvar_3 = fract((vec4(1.0, 255.0, 65025.0, 1.60581e+08) * ( + sqrt(dot (tmpvar_1, tmpvar_1)) + * _LightPositionRange.w))); gl_FragData[0] = (tmpvar_3 - (tmpvar_3.yzww * 0.00392157)); } + +// inputs: 1, stats: 10 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt index 4db73ab7c..148c61d6f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-ir.txt @@ -3,9 +3,9 @@ struct v2f { vec4 color; vec2 texcoord; }; -uniform sampler2D _MainTex; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _MainTex; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt index e2218a9cc..63b179661 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt @@ -1,6 +1,6 @@ -uniform sampler2D _MainTex; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -13,3 +13,5 @@ void main () gl_FragData[0] = tmpvar_1; } + +// inputs: 1, stats: 3 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt index 661183fe2..b6997bedb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-ir.txt @@ -20,14 +20,14 @@ struct v2f_surf { vec3 vlight; vec4 _ShadowCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform sampler2D _ShadowMapTexture; +varying vec4 xlv_FOG; float unitySampleShadow ( in vec4 shadowCoord_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt index f6ae0c87d..8b605758c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D _ShadowMapTexture; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform sampler2D _ShadowMapTexture; void main () { vec4 tmpvar_1; @@ -21,12 +21,18 @@ void main () tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y))); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); vec4 c_8; - c_8.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[4]).x) * 2.0)); + c_8.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz)) + * texture2DProj (_ShadowMapTexture, gl_TexCoord[4]).x) * 2.0)); c_8.w = tmpvar_6.w; c_2.w = c_8.w; c_2.xyz = (c_8.xyz + (tmpvar_6.xyz * gl_TexCoord[3].xyz)); gl_FragData[0] = c_2; } + +// inputs: 1, stats: 25 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt index f7332b57b..a0411dad4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-ir.txt @@ -18,14 +18,14 @@ struct v2f_surf { vec3 viewDir; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt index 975f628ae..52d16e489 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -21,7 +21,9 @@ void main () tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y))); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); vec4 tmpvar_8; tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); light_2.w = tmpvar_8.w; @@ -32,3 +34,5 @@ void main () gl_FragData[0] = c_9; } + +// inputs: 1, stats: 21 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt index b10235121..bfbf7d801 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-ir.txt @@ -19,15 +19,15 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt index 82050c49a..23d402cd9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt @@ -1,11 +1,11 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec4 tmpvar_1; @@ -24,7 +24,9 @@ void main () tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); vec4 normal_8; normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x)) - (normal_8.y * normal_8.y))); + normal_8.z = sqrt(((1.0 - + (normal_8.x * normal_8.x) + ) - (normal_8.y * normal_8.y))); vec4 tmpvar_9; tmpvar_9 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); light_3.w = tmpvar_9.w; @@ -35,3 +37,5 @@ void main () gl_FragData[0] = c_10; } + +// inputs: 1, stats: 25 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt index 755fab4fe..4bedcd983 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-ir.txt @@ -19,17 +19,17 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -180,10 +180,16 @@ vec4 LightingBlinnPhong ( tmpvar_60 = (tmpvar_59 * s_42.Gloss); spec_47 = tmpvar_60; vec3 tmpvar_61; - tmpvar_61 = ((((s_42.Albedo * _LightColor0.xyz) * diff_49) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_47)) * (atten_45 * 2.0)); + tmpvar_61 = ((( + (s_42.Albedo * _LightColor0.xyz) + * diff_49) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_47)) * (atten_45 * 2.0)); c_46.xyz = tmpvar_61.xyz.xyz; float tmpvar_62; - tmpvar_62 = (s_42.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_47) * atten_45)); + tmpvar_62 = (s_42.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_47) * atten_45)); c_46.w = vec4(tmpvar_62).w; return c_46; } @@ -238,7 +244,9 @@ vec4 frag_surf ( float tmpvar_82; tmpvar_82 = UnitySpotAttenuate (IN_63._LightCoord.xyz); vec4 tmpvar_83; - tmpvar_83 = LightingBlinnPhong (o_66, lightDir_65, tmpvar_80, ((float((IN_63._LightCoord.z > 0.0)) * tmpvar_81) * tmpvar_82)); + tmpvar_83 = LightingBlinnPhong (o_66, lightDir_65, tmpvar_80, ((float( + (IN_63._LightCoord.z > 0.0) + ) * tmpvar_81) * tmpvar_82)); vec4 tmpvar_84; tmpvar_84 = tmpvar_83; c_64 = tmpvar_84; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt index 403fc4717..6cda5cf4e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt @@ -1,13 +1,13 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -28,18 +28,36 @@ void main () tmpvar_8 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)); vec4 normal_9; normal_9.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); - normal_9.z = sqrt(((1.0 - (normal_9.x * normal_9.x)) - (normal_9.y * normal_9.y))); + normal_9.z = sqrt(((1.0 - + (normal_9.x * normal_9.x) + ) - (normal_9.y * normal_9.y))); vec3 tmpvar_10; tmpvar_10 = normalize(gl_TexCoord[2].xyz); float atten_11; - atten_11 = ((float((tmpvar_3.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_3.xy / tmpvar_3.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_3.xyz, tmpvar_3.xyz))).w); + atten_11 = ((float( + (tmpvar_3.z > 0.0) + ) * texture2D (_LightTexture0, ( + (tmpvar_3.xy / tmpvar_3.w) + + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_3.xyz, tmpvar_3.xyz))).w); vec4 c_12; float tmpvar_13; - tmpvar_13 = (pow (max (0.0, dot (normal_9.xyz, normalize((tmpvar_10 + normalize(tmpvar_2))))), (_Shininess * 128.0)) * tmpvar_8.w); - c_12.xyz = (((((tmpvar_8.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_9.xyz, tmpvar_10))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_13)) * (atten_11 * 2.0)); - c_12.w = ((tmpvar_8.w * _Color.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_13) * atten_11)); + tmpvar_13 = (pow (max (0.0, + dot (normal_9.xyz, normalize((tmpvar_10 + normalize(tmpvar_2)))) + ), (_Shininess * 128.0)) * tmpvar_8.w); + c_12.xyz = ((( + ((tmpvar_8.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_9.xyz, tmpvar_10)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_13)) * (atten_11 * 2.0)); + c_12.w = ((tmpvar_8.w * _Color.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_13) * atten_11)); c_4.xyz = c_12.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 48 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt index ee7b2c34b..44dc0543c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-ir.txt @@ -3,8 +3,8 @@ struct v2f { vec4 color; vec2 texcoord; }; -uniform vec4 _TintColor; uniform sampler2D _MainTex; +uniform vec4 _TintColor; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt index 4606b1906..6a78bf152 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt @@ -1,7 +1,9 @@ -uniform vec4 _TintColor; uniform sampler2D _MainTex; +uniform vec4 _TintColor; void main () { gl_FragData[0] = (((2.0 * gl_Color) * _TintColor) * texture2D (_MainTex, gl_TexCoord[0].xy)); } + +// inputs: 2, stats: 3 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt index b499932d9..40ba2fc7e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt @@ -9,3 +9,5 @@ void main () gl_FragData[0] = prev_1; } + +// inputs: 2, stats: 2 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt index 75d9a0add..d43bdda5d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = ((gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)) * gl_Color.w); } + +// inputs: 2, stats: 2 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt index 5965c6d92..8ffc071ef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = mix (vec4(1.0, 1.0, 1.0, 1.0), tmpvar_1, tmpvar_1.wwww); } + +// inputs: 2, stats: 2 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt index abdae9028..b18306340 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt @@ -9,3 +9,5 @@ void main () gl_FragData[0] = mix (vec4(0.5, 0.5, 0.5, 0.5), col_1, col_1.wwww); } + +// inputs: 2, stats: 4 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt index cb888f2ab..359a10120 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-ir.txt @@ -3,8 +3,8 @@ struct v2f { vec4 color; vec2 texcoord; }; -uniform vec4 _TintColor; uniform sampler2D _MainTex; +uniform vec4 _TintColor; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt index 78d7e5e50..f76520690 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt @@ -1,5 +1,5 @@ -uniform vec4 _TintColor; uniform sampler2D _MainTex; +uniform vec4 _TintColor; void main () { vec4 col_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 2, stats: 7 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt index 3aaa21a6f..44c698d47 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-ir.txt @@ -18,14 +18,14 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt index 0e3050a14..e97b46ebc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt @@ -1,10 +1,10 @@ -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; void main () { vec4 tmpvar_1; @@ -15,12 +15,18 @@ void main () tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy); vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); vec4 c_6; - c_6.xyz = (((tmpvar_4 * _Color).xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_5.xyz, gl_TexCoord[1].xyz)) * texture2D (_LightTexture0, gl_TexCoord[2].xy).w) * 2.0)); + c_6.xyz = (((tmpvar_4 * _Color).xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_5.xyz, gl_TexCoord[1].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[2].xy).w) * 2.0)); c_6.w = ((textureCube (_Cube, tmpvar_3) * tmpvar_4.w).w * _ReflectColor.w); c_2.xyz = c_6.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 17 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt index dfdb81b4a..a6d4818e8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-ir.txt @@ -24,15 +24,15 @@ struct v2f_surf { vec4 TtoW2; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt index 664ae297d..842494edb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt @@ -1,11 +1,11 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec4 tmpvar_1; @@ -28,13 +28,17 @@ void main () tmpvar_9 = texture2D (_MainTex, tmpvar_1.xy); vec4 normal_10; normal_10.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x)) - (normal_10.y * normal_10.y))); + normal_10.z = sqrt(((1.0 - + (normal_10.x * normal_10.x) + ) - (normal_10.y * normal_10.y))); vec3 tmpvar_11; tmpvar_11.x = dot (tmpvar_2.xyz, normal_10.xyz); tmpvar_11.y = dot (tmpvar_3.xyz, normal_10.xyz); tmpvar_11.z = dot (tmpvar_4.xyz, normal_10.xyz); vec4 tmpvar_12; - tmpvar_12 = (textureCube (_Cube, (tmpvar_8 - (2.0 * (dot (tmpvar_11, tmpvar_8) * tmpvar_11)))) * tmpvar_9.w); + tmpvar_12 = (textureCube (_Cube, (tmpvar_8 - (2.0 * + (dot (tmpvar_11, tmpvar_8) * tmpvar_11) + ))) * tmpvar_9.w); vec4 tmpvar_13; tmpvar_13 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_7.w = tmpvar_13.w; @@ -47,3 +51,5 @@ void main () gl_FragData[0] = col_6; } + +// inputs: 1, stats: 27 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt index 1daa6ff4f..ed92d3016 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-ir.txt @@ -19,16 +19,16 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -136,10 +136,16 @@ vec4 LightingBlinnPhong ( tmpvar_46 = (tmpvar_45 * s_28.Gloss); spec_33 = tmpvar_46; vec3 tmpvar_47; - tmpvar_47 = ((((s_28.Albedo * _LightColor0.xyz) * diff_35) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_33)) * (atten_31 * 2.0)); + tmpvar_47 = ((( + (s_28.Albedo * _LightColor0.xyz) + * diff_35) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_33)) * (atten_31 * 2.0)); c_32.xyz = tmpvar_47.xyz.xyz; float tmpvar_48; - tmpvar_48 = (s_28.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_33) * atten_31)); + tmpvar_48 = (s_28.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_33) * atten_31)); c_32.w = vec4(tmpvar_48).w; return c_32; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt index a46f8558b..41f842389 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt @@ -1,12 +1,12 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -19,18 +19,32 @@ void main () tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_6.z = sqrt(((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); + normal_6.z = sqrt(((1.0 - + (normal_6.x * normal_6.x) + ) - (normal_6.y * normal_6.y))); vec3 tmpvar_7; tmpvar_7 = normalize(gl_TexCoord[1].xyz); vec4 tmpvar_8; tmpvar_8 = texture2D (_LightTexture0, vec2(dot (tmpvar_2, tmpvar_2))); vec4 c_9; float tmpvar_10; - tmpvar_10 = (pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz))))), (_Shininess * 128.0)) * tmpvar_5.w); - c_9.xyz = (((((tmpvar_5 * _Color).xyz * _LightColor0.xyz) * max (0.0, dot (normal_6.xyz, tmpvar_7))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_10)) * (tmpvar_8.w * 2.0)); - c_9.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_10) * tmpvar_8.w)); + tmpvar_10 = (pow (max (0.0, + dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_5.w); + c_9.xyz = ((( + ((tmpvar_5 * _Color).xyz * _LightColor0.xyz) + * + max (0.0, dot (normal_6.xyz, tmpvar_7)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_10)) * (tmpvar_8.w * 2.0)); + c_9.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_10) * tmpvar_8.w)); c_3.xyz = c_9.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 34 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt index 39d6987ca..3f4c5e0d0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-ir.txt @@ -18,12 +18,12 @@ struct v2f_surf { vec3 TtoV1; vec3 TtoV2; }; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt index c58e34122..eabd6df20 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt @@ -1,12 +1,14 @@ -uniform float _Shininess; uniform sampler2D _BumpMap; +uniform float _Shininess; void main () { vec4 res_1; vec3 viewN_2; vec4 normal_3; normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); - normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); + normal_3.z = sqrt(((1.0 - + (normal_3.x * normal_3.x) + ) - (normal_3.y * normal_3.y))); viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz); viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz); viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz); @@ -15,3 +17,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 12 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt index 74b942921..cf0d31ff2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-ir.txt @@ -23,16 +23,16 @@ struct v2f_surf { vec4 TtoW1; vec4 TtoW2; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt index 4a8b764b7..2e874586c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt @@ -1,11 +1,11 @@ -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -26,13 +26,17 @@ void main () tmpvar_8 = texture2D (_MainTex, tmpvar_1.xy); vec4 normal_9; normal_9.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_9.z = sqrt(((1.0 - (normal_9.x * normal_9.x)) - (normal_9.y * normal_9.y))); + normal_9.z = sqrt(((1.0 - + (normal_9.x * normal_9.x) + ) - (normal_9.y * normal_9.y))); vec3 tmpvar_10; tmpvar_10.x = dot (tmpvar_2.xyz, normal_9.xyz); tmpvar_10.y = dot (tmpvar_3.xyz, normal_9.xyz); tmpvar_10.z = dot (tmpvar_4.xyz, normal_9.xyz); vec4 tmpvar_11; - tmpvar_11 = (textureCube (_Cube, (tmpvar_7 - (2.0 * (dot (tmpvar_10, tmpvar_7) * tmpvar_10)))) * tmpvar_8.w); + tmpvar_11 = (textureCube (_Cube, (tmpvar_7 - (2.0 * + (dot (tmpvar_10, tmpvar_7) * tmpvar_10) + ))) * tmpvar_8.w); vec4 tmpvar_12; tmpvar_12 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_6.w = tmpvar_12.w; @@ -47,3 +51,5 @@ void main () gl_FragData[0] = col_5; } + +// inputs: 1, stats: 29 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt index 261e53642..7701c7690 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-ir.txt @@ -8,11 +8,11 @@ struct v2f { vec3 TtoW1; vec3 TtoW2; }; -varying vec4 xlv_FOG; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform samplerCube _Cube; uniform sampler2D _BumpMap; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt index 656f4fa14..a4f2b3d37 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt @@ -1,7 +1,7 @@ -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform samplerCube _Cube; uniform sampler2D _BumpMap; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; void main () { vec3 tmpvar_1; @@ -10,7 +10,9 @@ void main () vec3 wn_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 tmpvar_5; tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy); wn_3.x = dot (gl_TexCoord[3].xyz, normal_4.xyz); @@ -20,8 +22,10 @@ void main () tmpvar_6 = (gl_LightModel.ambient * tmpvar_5); c_2.w = tmpvar_6.w; c_2.xyz = (tmpvar_6.xyz * 2.0); - vec4 tmpvar_7; - tmpvar_7 = ((textureCube (_Cube, (tmpvar_1 - (2.0 * (dot (wn_3, tmpvar_1) * wn_3)))) * _ReflectColor) * tmpvar_5.w); - gl_FragData[0] = (c_2 + tmpvar_7); + gl_FragData[0] = (c_2 + ((textureCube (_Cube, + (tmpvar_1 - (2.0 * (dot (wn_3, tmpvar_1) * wn_3))) + ) * _ReflectColor) * tmpvar_5.w)); } + +// inputs: 1, stats: 19 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt index 6a98d6394..f8aa39ecc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-ir.txt @@ -18,14 +18,14 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -152,7 +152,9 @@ vec4 frag_surf ( float tmpvar_48; tmpvar_48 = UnitySpotAttenuate (IN_32._LightCoord.xyz); vec4 tmpvar_49; - tmpvar_49 = LightingLambert (o_35, lightDir_34, ((float((IN_32._LightCoord.z > 0.0)) * tmpvar_47) * tmpvar_48)); + tmpvar_49 = LightingLambert (o_35, lightDir_34, ((float( + (IN_32._LightCoord.z > 0.0) + ) * tmpvar_47) * tmpvar_48)); vec4 tmpvar_50; tmpvar_50 = tmpvar_49; c_33 = tmpvar_50; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt index 67960f476..df9c84aa6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt @@ -1,10 +1,10 @@ -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; void main () { vec4 tmpvar_1; @@ -14,10 +14,16 @@ void main () vec4 tmpvar_4; tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy); vec4 c_5; - c_5.xyz = (((tmpvar_4 * _Color).xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)) * 2.0)); + c_5.xyz = (((tmpvar_4 * _Color).xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) + ) * 2.0)); c_5.w = ((textureCube (_Cube, tmpvar_3) * tmpvar_4.w).w * _ReflectColor.w); c_2.xyz = c_5.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 18 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt index 95702c395..09c5a6efe 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec3 worldRefl; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt index 4eb44eba5..1e5a91d8a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt @@ -1,9 +1,9 @@ -uniform vec4 unity_Ambient; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform vec4 unity_Ambient; void main () { vec4 col_1; @@ -24,3 +24,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 9 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt index 1d8a66ea3..4c743aeb7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-ir.txt @@ -20,17 +20,17 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -228,7 +228,9 @@ vec4 frag_surf ( float tmpvar_76; tmpvar_76 = UnitySpotAttenuate (IN_59._LightCoord.xyz); vec4 tmpvar_77; - tmpvar_77 = LightingLambert (o_62, lightDir_61, ((float((IN_59._LightCoord.z > 0.0)) * tmpvar_75) * tmpvar_76)); + tmpvar_77 = LightingLambert (o_62, lightDir_61, ((float( + (IN_59._LightCoord.z > 0.0) + ) * tmpvar_75) * tmpvar_76)); vec4 tmpvar_78; tmpvar_78 = tmpvar_77; c_60 = tmpvar_78; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt index 4b2380458..802b4a8a0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt @@ -1,13 +1,13 @@ -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; void main () { vec4 tmpvar_1; @@ -27,12 +27,20 @@ void main () tmpvar_8 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)); vec4 normal_9; normal_9.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); - normal_9.z = sqrt(((1.0 - (normal_9.x * normal_9.x)) - (normal_9.y * normal_9.y))); + normal_9.z = sqrt(((1.0 - + (normal_9.x * normal_9.x) + ) - (normal_9.y * normal_9.y))); vec4 c_10; - c_10.xyz = (((tmpvar_8 * _Color).xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_9.xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_10.xyz = (((tmpvar_8 * _Color).xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_9.xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_10.w = ((textureCube (_Cube, tmpvar_4) * tmpvar_8.w).w * _ReflectColor.w); c_3.xyz = c_10.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 34 alu 6 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt index f78ac0542..4f7be93ce 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-ir.txt @@ -25,16 +25,16 @@ struct v2f_surf { vec4 TtoW1; vec4 TtoW2; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt index ede616ed5..c5e5bfb9a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt @@ -1,12 +1,12 @@ -uniform vec4 unity_Ambient; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -34,13 +34,17 @@ void main () tmpvar_11 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_8)); vec4 normal_12; normal_12.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_8)).wy * 2.0) - 1.0); - normal_12.z = sqrt(((1.0 - (normal_12.x * normal_12.x)) - (normal_12.y * normal_12.y))); + normal_12.z = sqrt(((1.0 - + (normal_12.x * normal_12.x) + ) - (normal_12.y * normal_12.y))); vec3 tmpvar_13; tmpvar_13.x = dot (tmpvar_2.xyz, normal_12.xyz); tmpvar_13.y = dot (tmpvar_3.xyz, normal_12.xyz); tmpvar_13.z = dot (tmpvar_4.xyz, normal_12.xyz); vec4 tmpvar_14; - tmpvar_14 = (textureCube (_Cube, (tmpvar_7 - (2.0 * (dot (tmpvar_13, tmpvar_7) * tmpvar_13)))) * tmpvar_11.w); + tmpvar_14 = (textureCube (_Cube, (tmpvar_7 - (2.0 * + (dot (tmpvar_13, tmpvar_7) * tmpvar_13) + ))) * tmpvar_11.w); vec4 tmpvar_15; tmpvar_15 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2]))); light_6.w = tmpvar_15.w; @@ -53,3 +57,5 @@ void main () gl_FragData[0] = col_5; } + +// inputs: 1, stats: 32 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt index c46337253..b61dbffb1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-ir.txt @@ -20,18 +20,18 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -174,10 +174,16 @@ vec4 LightingBlinnPhong ( tmpvar_60 = (tmpvar_59 * s_42.Gloss); spec_47 = tmpvar_60; vec3 tmpvar_61; - tmpvar_61 = ((((s_42.Albedo * _LightColor0.xyz) * diff_49) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_47)) * (atten_45 * 2.0)); + tmpvar_61 = ((( + (s_42.Albedo * _LightColor0.xyz) + * diff_49) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_47)) * (atten_45 * 2.0)); c_46.xyz = tmpvar_61.xyz.xyz; float tmpvar_62; - tmpvar_62 = (s_42.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_47) * atten_45)); + tmpvar_62 = (s_42.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_47) * atten_45)); c_46.w = vec4(tmpvar_62).w; return c_46; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt index 2dec0648e..2ec649929 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt @@ -1,14 +1,14 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -30,18 +30,32 @@ void main () tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6)); vec4 normal_10; normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0); - normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x)) - (normal_10.y * normal_10.y))); + normal_10.z = sqrt(((1.0 - + (normal_10.x * normal_10.x) + ) - (normal_10.y * normal_10.y))); vec3 tmpvar_11; tmpvar_11 = normalize(gl_TexCoord[2].xyz); vec4 tmpvar_12; tmpvar_12 = texture2D (_LightTexture0, vec2(dot (tmpvar_3, tmpvar_3))); vec4 c_13; float tmpvar_14; - tmpvar_14 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2))))), (_Shininess * 128.0)) * tmpvar_9.w); - c_13.xyz = (((((tmpvar_9.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_10.xyz, tmpvar_11))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_14)) * (tmpvar_12.w * 2.0)); - c_13.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_14) * tmpvar_12.w)); + tmpvar_14 = (pow (max (0.0, + dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2)))) + ), (_Shininess * 128.0)) * tmpvar_9.w); + c_13.xyz = ((( + ((tmpvar_9.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_10.xyz, tmpvar_11)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_14)) * (tmpvar_12.w * 2.0)); + c_13.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_14) * tmpvar_12.w)); c_4.xyz = c_13.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 43 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt index 86b666d3f..4538e5f48 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-ir.txt @@ -20,18 +20,18 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -174,10 +174,16 @@ vec4 LightingBlinnPhong ( tmpvar_60 = (tmpvar_59 * s_42.Gloss); spec_47 = tmpvar_60; vec3 tmpvar_61; - tmpvar_61 = ((((s_42.Albedo * _LightColor0.xyz) * diff_49) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_47)) * (atten_45 * 2.0)); + tmpvar_61 = ((( + (s_42.Albedo * _LightColor0.xyz) + * diff_49) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_47)) * (atten_45 * 2.0)); c_46.xyz = tmpvar_61.xyz.xyz; float tmpvar_62; - tmpvar_62 = (s_42.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_47) * atten_45)); + tmpvar_62 = (s_42.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_47) * atten_45)); c_46.w = vec4(tmpvar_62).w; return c_46; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt index 8f0890192..59c2edf52 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt @@ -1,14 +1,14 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -30,16 +30,30 @@ void main () tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6)); vec4 normal_10; normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0); - normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x)) - (normal_10.y * normal_10.y))); + normal_10.z = sqrt(((1.0 - + (normal_10.x * normal_10.x) + ) - (normal_10.y * normal_10.y))); float atten_11; atten_11 = texture2D (_LightTexture0, gl_TexCoord[3].xy).w; vec4 c_12; float tmpvar_13; - tmpvar_13 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_3 + normalize(tmpvar_2))))), (_Shininess * 128.0)) * tmpvar_9.w); - c_12.xyz = (((((tmpvar_9.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_10.xyz, tmpvar_3))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_13)) * (atten_11 * 2.0)); - c_12.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_13) * atten_11)); + tmpvar_13 = (pow (max (0.0, + dot (normal_10.xyz, normalize((tmpvar_3 + normalize(tmpvar_2)))) + ), (_Shininess * 128.0)) * tmpvar_9.w); + c_12.xyz = ((( + ((tmpvar_9.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_10.xyz, tmpvar_3)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_13)) * (atten_11 * 2.0)); + c_12.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_13) * atten_11)); c_4.xyz = c_12.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 41 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt index 788a889de..32820727d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-ir.txt @@ -19,16 +19,16 @@ struct v2f_surf { vec3 viewDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -131,10 +131,16 @@ vec4 LightingBlinnPhong ( tmpvar_42 = (tmpvar_41 * s_24.Gloss); spec_29 = tmpvar_42; vec3 tmpvar_43; - tmpvar_43 = ((((s_24.Albedo * _LightColor0.xyz) * diff_31) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_29)) * (atten_27 * 2.0)); + tmpvar_43 = ((( + (s_24.Albedo * _LightColor0.xyz) + * diff_31) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_29)) * (atten_27 * 2.0)); c_28.xyz = tmpvar_43.xyz.xyz; float tmpvar_44; - tmpvar_44 = (s_24.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_29) * atten_27)); + tmpvar_44 = (s_24.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_29) * atten_27)); c_28.w = vec4(tmpvar_44).w; return c_28; } @@ -186,7 +192,9 @@ vec4 frag_surf ( float tmpvar_63; tmpvar_63 = UnitySpotAttenuate (IN_45._LightCoord.xyz); vec4 tmpvar_64; - tmpvar_64 = LightingBlinnPhong (o_48, lightDir_47, tmpvar_61, ((float((IN_45._LightCoord.z > 0.0)) * tmpvar_62) * tmpvar_63)); + tmpvar_64 = LightingBlinnPhong (o_48, lightDir_47, tmpvar_61, ((float( + (IN_45._LightCoord.z > 0.0) + ) * tmpvar_62) * tmpvar_63)); vec4 tmpvar_65; tmpvar_65 = tmpvar_64; c_46 = tmpvar_65; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt index 98825e492..20a10efc5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt @@ -1,12 +1,12 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec3 tmpvar_1; @@ -20,14 +20,30 @@ void main () vec3 tmpvar_6; tmpvar_6 = normalize(gl_TexCoord[2].xyz); float atten_7; - atten_7 = ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); + atten_7 = ((float( + (tmpvar_2.z > 0.0) + ) * texture2D (_LightTexture0, ( + (tmpvar_2.xy / tmpvar_2.w) + + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); vec4 c_8; float tmpvar_9; - tmpvar_9 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz))))), (_Shininess * 128.0)) * tmpvar_5.w); - c_8.xyz = (((((tmpvar_5 * _Color).xyz * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_6))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_9)) * (atten_7 * 2.0)); - c_8.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_9) * atten_7)); + tmpvar_9 = (pow (max (0.0, + dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_5.w); + c_8.xyz = ((( + ((tmpvar_5 * _Color).xyz * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_1, tmpvar_6)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_9)) * (atten_7 * 2.0)); + c_8.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_9) * atten_7)); c_3.xyz = c_8.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 33 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt index 721296470..04d120aa5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-ir.txt @@ -14,11 +14,11 @@ struct v2f_surf { vec4 pos; vec3 normal; }; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt index 28ed5f368..c5e34474e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt @@ -7,3 +7,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt index 51affdd37..246c1ffd3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-ir.txt @@ -17,15 +17,15 @@ struct v2f_surf { vec3 worldRefl; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt index 3b59c134c..b7a6a1aef 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform vec4 _ReflectColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform samplerCube _Cube; uniform vec4 _Color; +uniform samplerCube _Cube; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _ReflectColor; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; void main () { vec4 col_1; @@ -27,3 +27,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 15 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt index 1fa2fbd3a..49b0244ad 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 vertex; vec2 texcoord; }; -uniform sampler2D _UpTex; uniform vec4 _Tint; +uniform sampler2D _UpTex; vec4 skybox_frag ( in v2f i_1, in sampler2D smp_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt index e025373d5..1793291d5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt @@ -1,5 +1,5 @@ -uniform sampler2D _UpTex; uniform vec4 _Tint; +uniform sampler2D _UpTex; void main () { vec4 col_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 3 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt index 3a6c1352e..e7e6e8851 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 vertex; vec3 texcoord; }; -uniform vec4 _Tint; uniform samplerCube _Tex; +uniform vec4 _Tint; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt index a8db61a49..de7c4ea4e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt @@ -1,5 +1,5 @@ -uniform vec4 _Tint; uniform samplerCube _Tex; +uniform vec4 _Tint; void main () { vec4 col_1; @@ -10,3 +10,5 @@ void main () gl_FragData[0] = col_1; } + +// inputs: 1, stats: 3 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt new file mode 100644 index 000000000..39707292d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt @@ -0,0 +1,100 @@ +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +struct v2f_ao { + vec4 pos; + vec2 uv; + vec2 uvr; +}; +uniform vec4 _ProjectionParams; +uniform vec2 _NoiseScale; +uniform vec4 _CameraDepthNormalsTexture_ST; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform vec4 _Params; +float DecodeFloatRG( in vec2 enc ) { + vec2 kDecodeDot = vec2( 1.0, 0.00392157); + return dot( enc, kDecodeDot); +} +vec3 DecodeViewNormalStereo( in vec4 enc4 ) { + float kScale = 1.7777; + vec3 nn = ((enc4.xyz * vec3( (2.0 * kScale), (2.0 * kScale), 0.0)) + vec3( (-kScale), (-kScale), 1.0)); + float g = (2.0 / dot( nn.xyz, nn.xyz)); + vec3 n; + n.xy = (g * nn.xy); + n.z = (g - 1.0); + return n; +} +void DecodeDepthNormal( in vec4 enc, out float depth, out vec3 normal ) { + depth = DecodeFloatRG( enc.zw); + normal = DecodeViewNormalStereo( enc); +} +float frag_ao( in v2f_ao i, in int sampleCount, in vec3 samples[24] ) { + vec3 randN = ((texture2D( _RandomTexture, i.uvr).xyz * 2.0) - 1.0); + vec4 depthnormal = texture2D( _CameraDepthNormalsTexture, i.uv); + vec3 viewNorm; + float depth; + DecodeDepthNormal( depthnormal, depth, viewNorm); + depth *= _ProjectionParams.z; + float scale = (_Params.x / depth); + float occ = 0.0; + int s = 0; + for ( ; (s < sampleCount); (++s)) { + vec3 randomDir = reflect( samples[s], randN); + float flip = (( (dot( viewNorm, randomDir) < 0.0) ) ? ( 1.0 ) : ( -1.0 )); + randomDir *= (-flip); + randomDir += (viewNorm * 0.3); + vec2 offset = (randomDir.xy * scale); + float sD = (depth - (randomDir.z * _Params.x)); + vec4 sampleND = texture2D( _CameraDepthNormalsTexture, (i.uv + offset)); + float sampleD; + vec3 sampleN; + DecodeDepthNormal( sampleND, sampleD, sampleN); + sampleD *= _ProjectionParams.z; + float zd = xll_saturate_f((sD - sampleD)); + if ((zd > _Params.y)){ + occ += pow( (1.0 - zd), _Params.z); + } + } + occ /= float(sampleCount); + return (1.0 - occ); +} +vec4 frag( in v2f_ao i ) { + vec3 RAND_SAMPLES[24]; + RAND_SAMPLES[0] = vec3( 0.0130572, 0.587232, -0.119337); + RAND_SAMPLES[1] = vec3( 0.323078, 0.0220727, -0.418873); + RAND_SAMPLES[2] = vec3( -0.310725, -0.191367, 0.0561369); + RAND_SAMPLES[3] = vec3( -0.479646, 0.0939877, -0.580265); + RAND_SAMPLES[4] = vec3( 0.139999, -0.33577, 0.559679); + RAND_SAMPLES[5] = vec3( -0.248458, 0.255532, 0.348944); + RAND_SAMPLES[6] = vec3( 0.18719, -0.702764, -0.231748); + RAND_SAMPLES[7] = vec3( 0.884915, 0.284208, 0.368524); + RAND_SAMPLES[8] = vec3( 0.0130572, 0.587232, -0.119337); + RAND_SAMPLES[9] = vec3( 0.323078, 0.0220727, -0.418873); + RAND_SAMPLES[10] = vec3( -0.310725, -0.191367, 0.0561369); + RAND_SAMPLES[11] = vec3( -0.479646, 0.0939877, -0.580265); + RAND_SAMPLES[12] = vec3( 0.139999, -0.33577, 0.559679); + RAND_SAMPLES[13] = vec3( -0.248458, 0.255532, 0.348944); + RAND_SAMPLES[14] = vec3( 0.18719, -0.702764, -0.231748); + RAND_SAMPLES[15] = vec3( 0.884915, 0.284208, 0.368524); + RAND_SAMPLES[16] = vec3( 0.0130572, 0.587232, -0.119337); + RAND_SAMPLES[17] = vec3( 0.323078, 0.0220727, -0.418873); + RAND_SAMPLES[18] = vec3( -0.310725, -0.191367, 0.0561369); + RAND_SAMPLES[19] = vec3( -0.479646, 0.0939877, -0.580265); + RAND_SAMPLES[20] = vec3( 0.139999, -0.33577, 0.559679); + RAND_SAMPLES[21] = vec3( -0.248458, 0.255532, 0.348944); + RAND_SAMPLES[22] = vec3( 0.18719, -0.702764, -0.231748); + RAND_SAMPLES[23] = vec3( 0.884915, 0.284208, 0.368524); + return vec4( frag_ao( i, 24, RAND_SAMPLES)); +} +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +void main() { + vec4 xl_retval; + v2f_ao xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2(xlv_TEXCOORD0); + xlt_i.uvr = vec2(xlv_TEXCOORD1); + xl_retval = frag( xlt_i); + gl_FragData[0] = vec4(xl_retval); +} \ No newline at end of file diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt new file mode 100644 index 000000000..184a625e4 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt @@ -0,0 +1,79 @@ +#version 300 es +#define gl_FragData _glesFragData +layout(location = 0) out mediump vec4 _glesFragData[4]; +float xll_saturate_f( float x) { + return clamp( x, 0.0, 1.0); +} +struct v2f_ao { + highp vec4 pos; + highp vec2 uv; + highp vec2 uvr; +}; +uniform highp vec4 _ProjectionParams; +uniform highp vec2 _NoiseScale; +uniform highp vec4 _CameraDepthNormalsTexture_ST; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform highp vec4 _Params; +highp float DecodeFloatRG( in highp vec2 enc ) { + highp vec2 kDecodeDot = vec2( 1.0, 0.00392157); + return dot( enc, kDecodeDot); +} +highp vec3 DecodeViewNormalStereo( in highp vec4 enc4 ) { + highp float kScale = 1.7777; + highp vec3 nn = ((enc4.xyz * vec3( (2.0 * kScale), (2.0 * kScale), 0.0)) + vec3( (-kScale), (-kScale), 1.0)); + highp float g = (2.0 / dot( nn.xyz, nn.xyz)); + highp vec3 n; + n.xy = (g * nn.xy); + n.z = (g - 1.0); + return n; +} +void DecodeDepthNormal( in highp vec4 enc, out highp float depth, out highp vec3 normal ) { + depth = DecodeFloatRG( enc.zw); + normal = DecodeViewNormalStereo( enc); +} +mediump float frag_ao( in v2f_ao i, in highp int sampleCount, in highp vec3 samples[8] ) { + mediump vec3 randN = ((texture( _RandomTexture, i.uvr).xyz * 2.0) - 1.0); + highp vec4 depthnormal = texture( _CameraDepthNormalsTexture, i.uv); + highp vec3 viewNorm; + highp float depth; + DecodeDepthNormal( depthnormal, depth, viewNorm); + depth *= _ProjectionParams.z; + highp float scale = (_Params.x / depth); + highp float occ = 0.0; + highp int s = 0; + for ( ; (s < sampleCount); (++s)) { + mediump vec3 randomDir = reflect( samples[s], randN); + mediump float flip = (( (dot( viewNorm, randomDir) < 0.0) ) ? ( 1.0 ) : ( -1.0 )); + randomDir *= (-flip); + randomDir += (viewNorm * 0.3); + highp vec2 offset = (randomDir.xy * scale); + highp float sD = (depth - (randomDir.z * _Params.x)); + highp vec4 sampleND = texture( _CameraDepthNormalsTexture, (i.uv + offset)); + highp float sampleD; + highp vec3 sampleN; + DecodeDepthNormal( sampleND, sampleD, sampleN); + sampleD *= _ProjectionParams.z; + highp float zd = xll_saturate_f((sD - sampleD)); + if ((zd > _Params.y)){ + occ += pow( (1.0 - zd), _Params.z); + } + } + occ /= float(sampleCount); + return (1.0 - occ); +} +mediump vec4 frag( in v2f_ao i ) { + const highp vec3[8] RAND_SAMPLES = vec3[8]( vec3( 0.0130572, 0.587232, -0.119337), vec3( 0.323078, 0.0220727, -0.418873), vec3( -0.310725, -0.191367, 0.0561369), vec3( -0.479646, 0.0939877, -0.580265), vec3( 0.139999, -0.33577, 0.559679), vec3( -0.248458, 0.255532, 0.348944), vec3( 0.18719, -0.702764, -0.231748), vec3( 0.884915, 0.284208, 0.368524)); + return vec4( frag_ao( i, 8, RAND_SAMPLES)); +} +in highp vec2 xlv_TEXCOORD0; +in highp vec2 xlv_TEXCOORD1; +void main() { + mediump vec4 xl_retval; + v2f_ao xlt_i; + xlt_i.pos = vec4(0.0); + xlt_i.uv = vec2(xlv_TEXCOORD0); + xlt_i.uvr = vec2(xlv_TEXCOORD1); + xl_retval = frag( xlt_i); + gl_FragData[0] = vec4(xl_retval); +} diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt new file mode 100644 index 000000000..ec9eebddc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-ir.txt @@ -0,0 +1,309 @@ +struct v2f_ao { + vec4 pos; + vec2 uv; + vec2 uvr; +}; +uniform vec4 _ProjectionParams; +uniform vec2 _NoiseScale; +uniform vec4 _CameraDepthNormalsTexture_ST; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform vec4 _Params; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +float xll_saturate_f ( + in float x_1 +) +{ + float tmpvar_2; + tmpvar_2 = clamp (x_1, 0.0, 1.0); + return tmpvar_2; +} + +float DecodeFloatRG ( + in vec2 enc_3 +) +{ + vec2 kDecodeDot_4; + vec2 tmpvar_5; + tmpvar_5 = vec2(1.0, 0.00392157); + kDecodeDot_4 = tmpvar_5; + float tmpvar_6; + tmpvar_6 = dot (enc_3, kDecodeDot_4); + return tmpvar_6; +} + +vec3 DecodeViewNormalStereo ( + in vec4 enc4_7 +) +{ + vec3 n_8; + float g_9; + vec3 nn_10; + float kScale_11; + float tmpvar_12; + tmpvar_12 = 1.7777; + kScale_11 = tmpvar_12; + vec3 tmpvar_13; + tmpvar_13.z = 0.0; + tmpvar_13.x = (2.0 * kScale_11); + tmpvar_13.y = (2.0 * kScale_11); + vec3 tmpvar_14; + tmpvar_14.z = 1.0; + tmpvar_14.x = -(kScale_11); + tmpvar_14.y = -(kScale_11); + vec3 tmpvar_15; + tmpvar_15 = ((enc4_7.xyz * tmpvar_13) + tmpvar_14); + nn_10 = tmpvar_15; + float tmpvar_16; + tmpvar_16 = dot (nn_10.xyz, nn_10.xyz); + float tmpvar_17; + tmpvar_17 = (2.0 / tmpvar_16); + g_9 = tmpvar_17; + vec2 tmpvar_18; + tmpvar_18 = (g_9 * nn_10.xy); + n_8.xy = tmpvar_18.xy.xy; + float tmpvar_19; + tmpvar_19 = (g_9 - 1.0); + n_8.z = vec3(tmpvar_19).z; + return n_8; +} + +void DecodeDepthNormal ( + in vec4 enc_20, + out float depth_21, + out vec3 normal_22 +) +{ + float tmpvar_23; + tmpvar_23 = DecodeFloatRG (enc_20.zw); + float tmpvar_24; + tmpvar_24 = tmpvar_23; + depth_21 = tmpvar_24; + vec3 tmpvar_25; + tmpvar_25 = DecodeViewNormalStereo (enc_20); + vec3 tmpvar_26; + tmpvar_26 = tmpvar_25; + normal_22 = tmpvar_26; +} + +float frag_ao ( + in v2f_ao i_27, + in int sampleCount_28, + in vec3 samples_29[24] +) +{ + int s_30; + float occ_31; + float scale_32; + float depth_33; + vec3 viewNorm_34; + vec4 depthnormal_35; + vec3 randN_36; + vec4 tmpvar_37; + tmpvar_37 = texture2D (_RandomTexture, i_27.uvr); + vec3 tmpvar_38; + tmpvar_38 = ((tmpvar_37.xyz * 2.0) - 1.0); + randN_36 = tmpvar_38; + vec4 tmpvar_39; + tmpvar_39 = texture2D (_CameraDepthNormalsTexture, i_27.uv); + vec4 tmpvar_40; + tmpvar_40 = tmpvar_39; + depthnormal_35 = tmpvar_40; + DecodeDepthNormal (depthnormal_35, depth_33, viewNorm_34); + float tmpvar_41; + tmpvar_41 = (depth_33 * _ProjectionParams.z); + depth_33 = tmpvar_41; + float tmpvar_42; + tmpvar_42 = (_Params.x / depth_33); + scale_32 = tmpvar_42; + float tmpvar_43; + tmpvar_43 = 0.0; + occ_31 = tmpvar_43; + int tmpvar_44; + tmpvar_44 = 0; + s_30 = tmpvar_44; + while (true) { + float zd_45; + vec3 sampleN_46; + float sampleD_47; + vec4 sampleND_48; + float sD_49; + vec2 offset_50; + float flip_51; + vec3 randomDir_52; + if (!((s_30 < sampleCount_28))) { + break; + }; + vec3 tmpvar_53; + tmpvar_53 = reflect (samples_29[s_30], randN_36); + vec3 tmpvar_54; + tmpvar_54 = tmpvar_53; + randomDir_52 = tmpvar_54; + float tmpvar_55; + tmpvar_55 = dot (viewNorm_34, randomDir_52); + float tmpvar_56; + if ((tmpvar_55 < 0.0)) { + tmpvar_56 = 1.0; + } else { + tmpvar_56 = -(1.0); + }; + float tmpvar_57; + tmpvar_57 = tmpvar_56; + flip_51 = tmpvar_57; + vec3 tmpvar_58; + tmpvar_58 = (randomDir_52 * -(flip_51)); + randomDir_52 = tmpvar_58; + vec3 tmpvar_59; + tmpvar_59 = (randomDir_52 + (viewNorm_34 * 0.3)); + randomDir_52 = tmpvar_59; + vec2 tmpvar_60; + tmpvar_60 = (randomDir_52.xy * scale_32); + offset_50 = tmpvar_60; + float tmpvar_61; + tmpvar_61 = (depth_33 - (randomDir_52.z * _Params.x)); + sD_49 = tmpvar_61; + vec4 tmpvar_62; + tmpvar_62 = texture2D (_CameraDepthNormalsTexture, (i_27.uv + offset_50)); + vec4 tmpvar_63; + tmpvar_63 = tmpvar_62; + sampleND_48 = tmpvar_63; + DecodeDepthNormal (sampleND_48, sampleD_47, sampleN_46); + float tmpvar_64; + tmpvar_64 = (sampleD_47 * _ProjectionParams.z); + sampleD_47 = tmpvar_64; + float tmpvar_65; + tmpvar_65 = xll_saturate_f ((sD_49 - sampleD_47)); + float tmpvar_66; + tmpvar_66 = tmpvar_65; + zd_45 = tmpvar_66; + if ((zd_45 > _Params.y)) { + float tmpvar_67; + tmpvar_67 = pow ((1.0 - zd_45), _Params.z); + float tmpvar_68; + tmpvar_68 = (occ_31 + tmpvar_67); + occ_31 = tmpvar_68; + }; + int tmpvar_69; + tmpvar_69 = (s_30 + 1); + s_30 = tmpvar_69; + }; + float tmpvar_70; + tmpvar_70 = (occ_31 / float(sampleCount_28)); + occ_31 = tmpvar_70; + return (1.0 - occ_31); +} + +vec4 frag ( + in v2f_ao i_71 +) +{ + vec3 RAND_SAMPLES_72[24]; + vec3 tmpvar_73; + tmpvar_73 = vec3(0.0130572, 0.587232, -0.119337); + RAND_SAMPLES_72[0] = tmpvar_73; + vec3 tmpvar_74; + tmpvar_74 = vec3(0.323078, 0.0220727, -0.418873); + RAND_SAMPLES_72[1] = tmpvar_74; + vec3 tmpvar_75; + tmpvar_75 = vec3(-0.310725, -0.191367, 0.0561369); + RAND_SAMPLES_72[2] = tmpvar_75; + vec3 tmpvar_76; + tmpvar_76 = vec3(-0.479646, 0.0939877, -0.580265); + RAND_SAMPLES_72[3] = tmpvar_76; + vec3 tmpvar_77; + tmpvar_77 = vec3(0.139999, -0.33577, 0.559679); + RAND_SAMPLES_72[4] = tmpvar_77; + vec3 tmpvar_78; + tmpvar_78 = vec3(-0.248458, 0.255532, 0.348944); + RAND_SAMPLES_72[5] = tmpvar_78; + vec3 tmpvar_79; + tmpvar_79 = vec3(0.18719, -0.702764, -0.231748); + RAND_SAMPLES_72[6] = tmpvar_79; + vec3 tmpvar_80; + tmpvar_80 = vec3(0.884915, 0.284208, 0.368524); + RAND_SAMPLES_72[7] = tmpvar_80; + vec3 tmpvar_81; + tmpvar_81 = vec3(0.0130572, 0.587232, -0.119337); + RAND_SAMPLES_72[8] = tmpvar_81; + vec3 tmpvar_82; + tmpvar_82 = vec3(0.323078, 0.0220727, -0.418873); + RAND_SAMPLES_72[9] = tmpvar_82; + vec3 tmpvar_83; + tmpvar_83 = vec3(-0.310725, -0.191367, 0.0561369); + RAND_SAMPLES_72[10] = tmpvar_83; + vec3 tmpvar_84; + tmpvar_84 = vec3(-0.479646, 0.0939877, -0.580265); + RAND_SAMPLES_72[11] = tmpvar_84; + vec3 tmpvar_85; + tmpvar_85 = vec3(0.139999, -0.33577, 0.559679); + RAND_SAMPLES_72[12] = tmpvar_85; + vec3 tmpvar_86; + tmpvar_86 = vec3(-0.248458, 0.255532, 0.348944); + RAND_SAMPLES_72[13] = tmpvar_86; + vec3 tmpvar_87; + tmpvar_87 = vec3(0.18719, -0.702764, -0.231748); + RAND_SAMPLES_72[14] = tmpvar_87; + vec3 tmpvar_88; + tmpvar_88 = vec3(0.884915, 0.284208, 0.368524); + RAND_SAMPLES_72[15] = tmpvar_88; + vec3 tmpvar_89; + tmpvar_89 = vec3(0.0130572, 0.587232, -0.119337); + RAND_SAMPLES_72[16] = tmpvar_89; + vec3 tmpvar_90; + tmpvar_90 = vec3(0.323078, 0.0220727, -0.418873); + RAND_SAMPLES_72[17] = tmpvar_90; + vec3 tmpvar_91; + tmpvar_91 = vec3(-0.310725, -0.191367, 0.0561369); + RAND_SAMPLES_72[18] = tmpvar_91; + vec3 tmpvar_92; + tmpvar_92 = vec3(-0.479646, 0.0939877, -0.580265); + RAND_SAMPLES_72[19] = tmpvar_92; + vec3 tmpvar_93; + tmpvar_93 = vec3(0.139999, -0.33577, 0.559679); + RAND_SAMPLES_72[20] = tmpvar_93; + vec3 tmpvar_94; + tmpvar_94 = vec3(-0.248458, 0.255532, 0.348944); + RAND_SAMPLES_72[21] = tmpvar_94; + vec3 tmpvar_95; + tmpvar_95 = vec3(0.18719, -0.702764, -0.231748); + RAND_SAMPLES_72[22] = tmpvar_95; + vec3 tmpvar_96; + tmpvar_96 = vec3(0.884915, 0.284208, 0.368524); + RAND_SAMPLES_72[23] = tmpvar_96; + float tmpvar_97; + tmpvar_97 = frag_ao (i_71, 24, RAND_SAMPLES_72); + vec4 tmpvar_98; + tmpvar_98 = vec4(tmpvar_97); + return tmpvar_98; +} + +void main () +{ + v2f_ao xlt_i_99; + vec4 xl_retval_100; + vec4 tmpvar_101; + tmpvar_101 = vec4(0.0, 0.0, 0.0, 0.0); + xlt_i_99.pos = tmpvar_101; + vec2 tmpvar_102; + tmpvar_102 = xlv_TEXCOORD0.xy; + vec2 tmpvar_103; + tmpvar_103 = tmpvar_102; + xlt_i_99.uv = tmpvar_103; + vec2 tmpvar_104; + tmpvar_104 = xlv_TEXCOORD1.xy; + vec2 tmpvar_105; + tmpvar_105 = tmpvar_104; + xlt_i_99.uvr = tmpvar_105; + vec4 tmpvar_106; + tmpvar_106 = frag (xlt_i_99); + vec4 tmpvar_107; + tmpvar_107 = tmpvar_106; + xl_retval_100 = tmpvar_107; + vec4 tmpvar_108; + tmpvar_108 = xl_retval_100.xyzw; + vec4 tmpvar_109; + tmpvar_109 = tmpvar_108; + gl_FragData[0] = tmpvar_109; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt new file mode 100644 index 000000000..6740c2a7f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-irES3.txt @@ -0,0 +1,242 @@ +#version 300 es +struct v2f_ao { + highp vec4 pos; + highp vec2 uv; + highp vec2 uvr; +}; +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform highp vec4 _ProjectionParams; +uniform highp vec2 _NoiseScale; +uniform highp vec4 _CameraDepthNormalsTexture_ST; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform highp vec4 _Params; +in highp vec2 xlv_TEXCOORD0; +in highp vec2 xlv_TEXCOORD1; +float xll_saturate_f ( + in float x_1 +) +{ + float tmpvar_2; + tmpvar_2 = clamp (x_1, 0.0, 1.0); + return tmpvar_2; +} + +float DecodeFloatRG ( + in highp vec2 enc_3 +) +{ + highp vec2 kDecodeDot_4; + vec2 tmpvar_5; + tmpvar_5 = vec2(1.0, 0.00392157); + kDecodeDot_4 = tmpvar_5; + highp float tmpvar_6; + tmpvar_6 = dot (enc_3, kDecodeDot_4); + return tmpvar_6; +} + +vec3 DecodeViewNormalStereo ( + in highp vec4 enc4_7 +) +{ + highp vec3 n_8; + highp float g_9; + highp vec3 nn_10; + highp float kScale_11; + float tmpvar_12; + tmpvar_12 = 1.7777; + kScale_11 = tmpvar_12; + highp vec3 tmpvar_13; + tmpvar_13.z = 0.0; + tmpvar_13.x = (2.0 * kScale_11); + tmpvar_13.y = (2.0 * kScale_11); + highp vec3 tmpvar_14; + tmpvar_14.z = 1.0; + tmpvar_14.x = -(kScale_11); + tmpvar_14.y = -(kScale_11); + highp vec3 tmpvar_15; + tmpvar_15 = ((enc4_7.xyz * tmpvar_13) + tmpvar_14); + nn_10 = tmpvar_15; + highp float tmpvar_16; + tmpvar_16 = dot (nn_10.xyz, nn_10.xyz); + highp float tmpvar_17; + tmpvar_17 = (2.0 / tmpvar_16); + g_9 = tmpvar_17; + highp vec2 tmpvar_18; + tmpvar_18 = (g_9 * nn_10.xy); + n_8.xy = tmpvar_18.xy.xy; + highp float tmpvar_19; + tmpvar_19 = (g_9 - 1.0); + n_8.z = vec3(tmpvar_19).z; + return n_8; +} + +void DecodeDepthNormal ( + in highp vec4 enc_20, + out highp float depth_21, + out highp vec3 normal_22 +) +{ + highp float tmpvar_23; + tmpvar_23 = DecodeFloatRG (enc_20.zw); + highp float tmpvar_24; + tmpvar_24 = tmpvar_23; + depth_21 = tmpvar_24; + highp vec3 tmpvar_25; + tmpvar_25 = DecodeViewNormalStereo (enc_20); + highp vec3 tmpvar_26; + tmpvar_26 = tmpvar_25; + normal_22 = tmpvar_26; +} + +mediump float frag_ao ( + in v2f_ao i_27, + in int sampleCount_28, + in highp vec3 samples_29[8] +) +{ + int s_30; + highp float occ_31; + highp float scale_32; + highp float depth_33; + highp vec3 viewNorm_34; + highp vec4 depthnormal_35; + mediump vec3 randN_36; + lowp vec4 tmpvar_37; + tmpvar_37 = texture (_RandomTexture, i_27.uvr); + lowp vec3 tmpvar_38; + tmpvar_38 = ((tmpvar_37.xyz * 2.0) - 1.0); + randN_36 = tmpvar_38; + lowp vec4 tmpvar_39; + tmpvar_39 = texture (_CameraDepthNormalsTexture, i_27.uv); + lowp vec4 tmpvar_40; + tmpvar_40 = tmpvar_39; + depthnormal_35 = tmpvar_40; + DecodeDepthNormal (depthnormal_35, depth_33, viewNorm_34); + highp float tmpvar_41; + tmpvar_41 = (depth_33 * _ProjectionParams.z); + depth_33 = tmpvar_41; + highp float tmpvar_42; + tmpvar_42 = (_Params.x / depth_33); + scale_32 = tmpvar_42; + float tmpvar_43; + tmpvar_43 = 0.0; + occ_31 = tmpvar_43; + int tmpvar_44; + tmpvar_44 = 0; + s_30 = tmpvar_44; + while (true) { + highp float zd_45; + highp vec3 sampleN_46; + highp float sampleD_47; + highp vec4 sampleND_48; + highp float sD_49; + highp vec2 offset_50; + mediump float flip_51; + mediump vec3 randomDir_52; + if (!((s_30 < sampleCount_28))) { + break; + }; + highp vec3 tmpvar_53; + tmpvar_53 = reflect (samples_29[s_30], randN_36); + highp vec3 tmpvar_54; + tmpvar_54 = tmpvar_53; + randomDir_52 = tmpvar_54; + highp float tmpvar_55; + tmpvar_55 = dot (viewNorm_34, randomDir_52); + float tmpvar_56; + if ((tmpvar_55 < 0.0)) { + tmpvar_56 = 1.0; + } else { + tmpvar_56 = -(1.0); + }; + float tmpvar_57; + tmpvar_57 = tmpvar_56; + flip_51 = tmpvar_57; + mediump vec3 tmpvar_58; + tmpvar_58 = (randomDir_52 * -(flip_51)); + randomDir_52 = tmpvar_58; + highp vec3 tmpvar_59; + tmpvar_59 = (randomDir_52 + (viewNorm_34 * 0.3)); + randomDir_52 = tmpvar_59; + highp vec2 tmpvar_60; + tmpvar_60 = (randomDir_52.xy * scale_32); + offset_50 = tmpvar_60; + highp float tmpvar_61; + tmpvar_61 = (depth_33 - (randomDir_52.z * _Params.x)); + sD_49 = tmpvar_61; + lowp vec4 tmpvar_62; + tmpvar_62 = texture (_CameraDepthNormalsTexture, (i_27.uv + offset_50)); + lowp vec4 tmpvar_63; + tmpvar_63 = tmpvar_62; + sampleND_48 = tmpvar_63; + DecodeDepthNormal (sampleND_48, sampleD_47, sampleN_46); + highp float tmpvar_64; + tmpvar_64 = (sampleD_47 * _ProjectionParams.z); + sampleD_47 = tmpvar_64; + float tmpvar_65; + tmpvar_65 = xll_saturate_f ((sD_49 - sampleD_47)); + float tmpvar_66; + tmpvar_66 = tmpvar_65; + zd_45 = tmpvar_66; + if ((zd_45 > _Params.y)) { + highp float tmpvar_67; + tmpvar_67 = pow ((1.0 - zd_45), _Params.z); + highp float tmpvar_68; + tmpvar_68 = (occ_31 + tmpvar_67); + occ_31 = tmpvar_68; + }; + int tmpvar_69; + tmpvar_69 = (s_30 + 1); + s_30 = tmpvar_69; + }; + highp float tmpvar_70; + tmpvar_70 = (occ_31 / float(sampleCount_28)); + occ_31 = tmpvar_70; + return (1.0 - occ_31); +} + +mediump vec4 frag ( + in v2f_ao i_71 +) +{ + highp vec3 RAND_SAMPLES_72[8] = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524)); + vec3 tmpvar_73[8]; + tmpvar_73 = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524)); + RAND_SAMPLES_72 = tmpvar_73; + mediump float tmpvar_74; + tmpvar_74 = frag_ao (i_71, 8, vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524))); + mediump vec4 tmpvar_75; + tmpvar_75 = vec4(tmpvar_74); + return tmpvar_75; +} + +void main () +{ + v2f_ao xlt_i_76; + mediump vec4 xl_retval_77; + vec4 tmpvar_78; + tmpvar_78 = vec4(0.0, 0.0, 0.0, 0.0); + xlt_i_76.pos = tmpvar_78; + highp vec2 tmpvar_79; + tmpvar_79 = xlv_TEXCOORD0.xy; + highp vec2 tmpvar_80; + tmpvar_80 = tmpvar_79; + xlt_i_76.uv = tmpvar_80; + highp vec2 tmpvar_81; + tmpvar_81 = xlv_TEXCOORD1.xy; + highp vec2 tmpvar_82; + tmpvar_82 = tmpvar_81; + xlt_i_76.uvr = tmpvar_82; + mediump vec4 tmpvar_83; + tmpvar_83 = frag (xlt_i_76); + mediump vec4 tmpvar_84; + tmpvar_84 = tmpvar_83; + xl_retval_77 = tmpvar_84; + mediump vec4 tmpvar_85; + tmpvar_85 = xl_retval_77.xyzw; + mediump vec4 tmpvar_86; + tmpvar_86 = tmpvar_85; + _glesFragData[0] = tmpvar_86; +} + diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt new file mode 100644 index 000000000..098a5155f --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt @@ -0,0 +1,93 @@ +uniform vec4 _ProjectionParams; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform vec4 _Params; +varying vec2 xlv_TEXCOORD0; +varying vec2 xlv_TEXCOORD1; +void main () +{ + vec3 RAND_SAMPLES_1[24]; + RAND_SAMPLES_1[0] = vec3(0.0130572, 0.587232, -0.119337); + RAND_SAMPLES_1[1] = vec3(0.323078, 0.0220727, -0.418873); + RAND_SAMPLES_1[2] = vec3(-0.310725, -0.191367, 0.0561369); + RAND_SAMPLES_1[3] = vec3(-0.479646, 0.0939877, -0.580265); + RAND_SAMPLES_1[4] = vec3(0.139999, -0.33577, 0.559679); + RAND_SAMPLES_1[5] = vec3(-0.248458, 0.255532, 0.348944); + RAND_SAMPLES_1[6] = vec3(0.18719, -0.702764, -0.231748); + RAND_SAMPLES_1[7] = vec3(0.884915, 0.284208, 0.368524); + RAND_SAMPLES_1[8] = vec3(0.0130572, 0.587232, -0.119337); + RAND_SAMPLES_1[9] = vec3(0.323078, 0.0220727, -0.418873); + RAND_SAMPLES_1[10] = vec3(-0.310725, -0.191367, 0.0561369); + RAND_SAMPLES_1[11] = vec3(-0.479646, 0.0939877, -0.580265); + RAND_SAMPLES_1[12] = vec3(0.139999, -0.33577, 0.559679); + RAND_SAMPLES_1[13] = vec3(-0.248458, 0.255532, 0.348944); + RAND_SAMPLES_1[14] = vec3(0.18719, -0.702764, -0.231748); + RAND_SAMPLES_1[15] = vec3(0.884915, 0.284208, 0.368524); + RAND_SAMPLES_1[16] = vec3(0.0130572, 0.587232, -0.119337); + RAND_SAMPLES_1[17] = vec3(0.323078, 0.0220727, -0.418873); + RAND_SAMPLES_1[18] = vec3(-0.310725, -0.191367, 0.0561369); + RAND_SAMPLES_1[19] = vec3(-0.479646, 0.0939877, -0.580265); + RAND_SAMPLES_1[20] = vec3(0.139999, -0.33577, 0.559679); + RAND_SAMPLES_1[21] = vec3(-0.248458, 0.255532, 0.348944); + RAND_SAMPLES_1[22] = vec3(0.18719, -0.702764, -0.231748); + RAND_SAMPLES_1[23] = vec3(0.884915, 0.284208, 0.368524); + vec2 tmpvar_2; + tmpvar_2 = xlv_TEXCOORD0; + vec3 samples_3[24]; + samples_3[0]=RAND_SAMPLES_1[0];samples_3[1]=RAND_SAMPLES_1[1];samples_3[2]=RAND_SAMPLES_1[2];samples_3[3]=RAND_SAMPLES_1[3];samples_3[4]=RAND_SAMPLES_1[4];samples_3[5]=RAND_SAMPLES_1[5];samples_3[6]=RAND_SAMPLES_1[6];samples_3[7]=RAND_SAMPLES_1[7];samples_3[8]=RAND_SAMPLES_1[8];samples_3[9]=RAND_SAMPLES_1[9];samples_3[10]=RAND_SAMPLES_1[10];samples_3[11]=RAND_SAMPLES_1[11];samples_3[12]=RAND_SAMPLES_1[12];samples_3[13]=RAND_SAMPLES_1[13];samples_3[14]=RAND_SAMPLES_1[14];samples_3[15]=RAND_SAMPLES_1[15];samples_3[16]=RAND_SAMPLES_1[16];samples_3[17]=RAND_SAMPLES_1[17];samples_3[18]=RAND_SAMPLES_1[18];samples_3[19]=RAND_SAMPLES_1[19];samples_3[20]=RAND_SAMPLES_1[20];samples_3[21]=RAND_SAMPLES_1[21];samples_3[22]=RAND_SAMPLES_1[22];samples_3[23]=RAND_SAMPLES_1[23]; + float occ_5; + float scale_6; + float depth_7; + vec3 viewNorm_8; + vec3 randN_9; + randN_9 = ((texture2D (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0); + vec4 tmpvar_10; + tmpvar_10 = texture2D (_CameraDepthNormalsTexture, xlv_TEXCOORD0); + vec3 n_11; + vec3 tmpvar_12; + tmpvar_12 = ((tmpvar_10.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); + float tmpvar_13; + tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12)); + n_11.xy = (tmpvar_13 * tmpvar_12.xy); + n_11.z = (tmpvar_13 - 1.0); + viewNorm_8 = n_11; + float tmpvar_14; + tmpvar_14 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); + depth_7 = tmpvar_14; + scale_6 = (_Params.x / tmpvar_14); + occ_5 = 0.0; + for (int s_4 = 0; s_4 < 24; s_4++) { + vec3 tmpvar_15; + vec3 I_16; + I_16 = samples_3[s_4]; + tmpvar_15 = (I_16 - (2.0 * ( + dot (randN_9, I_16) + * randN_9))); + float tmpvar_17; + tmpvar_17 = dot (viewNorm_8, tmpvar_15); + float tmpvar_18; + if ((tmpvar_17 < 0.0)) { + tmpvar_18 = 1.0; + } else { + tmpvar_18 = -1.0; + }; + vec3 tmpvar_19; + tmpvar_19 = ((tmpvar_15 * -(tmpvar_18)) + (viewNorm_8 * 0.3)); + float tmpvar_20; + tmpvar_20 = clamp (((depth_7 - + (tmpvar_19.z * _Params.x) + ) - ( + dot (texture2D (_CameraDepthNormalsTexture, (tmpvar_2 + (tmpvar_19.xy * scale_6))).zw, vec2(1.0, 0.00392157)) + * _ProjectionParams.z)), 0.0, 1.0); + if ((tmpvar_20 > _Params.y)) { + occ_5 = (occ_5 + pow ((1.0 - tmpvar_20), _Params.z)); + }; + }; + float tmpvar_21; + tmpvar_21 = (occ_5 / 24.0); + occ_5 = tmpvar_21; + gl_FragData[0] = vec4((1.0 - tmpvar_21)); +} + + +// inputs: 2, stats: 65 alu 3 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt new file mode 100644 index 000000000..bae904683 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt @@ -0,0 +1,85 @@ +#version 300 es +layout(location=0) out mediump vec4 _glesFragData[4]; +uniform highp vec4 _ProjectionParams; +uniform sampler2D _CameraDepthNormalsTexture; +uniform sampler2D _RandomTexture; +uniform highp vec4 _Params; +in highp vec2 xlv_TEXCOORD0; +in highp vec2 xlv_TEXCOORD1; +void main () +{ + mediump float tmpvar_1; + highp vec2 tmpvar_2; + tmpvar_2 = xlv_TEXCOORD0; + highp float occ_4; + highp float scale_5; + highp float depth_6; + highp vec3 viewNorm_7; + highp vec4 depthnormal_8; + mediump vec3 randN_9; + lowp vec3 tmpvar_10; + tmpvar_10 = ((texture (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0); + randN_9 = tmpvar_10; + lowp vec4 tmpvar_11; + tmpvar_11 = texture (_CameraDepthNormalsTexture, xlv_TEXCOORD0); + depthnormal_8 = tmpvar_11; + highp vec3 n_12; + highp vec3 tmpvar_13; + tmpvar_13 = ((depthnormal_8.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0)); + highp float tmpvar_14; + tmpvar_14 = (2.0 / dot (tmpvar_13, tmpvar_13)); + n_12.xy = (tmpvar_14 * tmpvar_13.xy); + n_12.z = (tmpvar_14 - 1.0); + viewNorm_7 = n_12; + highp float tmpvar_15; + tmpvar_15 = (dot (depthnormal_8.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z); + depth_6 = tmpvar_15; + scale_5 = (_Params.x / tmpvar_15); + occ_4 = 0.0; + for (int s_3 = 0; s_3 < 8; s_3++) { + highp vec4 sampleND_16; + mediump vec3 randomDir_17; + highp vec3 tmpvar_18; + highp vec3 I_19; + I_19 = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524))[s_3]; + tmpvar_18 = (I_19 - (2.0 * ( + dot (randN_9, I_19) + * randN_9))); + randomDir_17 = tmpvar_18; + highp float tmpvar_20; + tmpvar_20 = dot (viewNorm_7, randomDir_17); + float tmpvar_21; + if ((tmpvar_20 < 0.0)) { + tmpvar_21 = 1.0; + } else { + tmpvar_21 = -1.0; + }; + mediump vec3 tmpvar_22; + tmpvar_22 = (randomDir_17 * -(tmpvar_21)); + highp vec3 tmpvar_23; + tmpvar_23 = (tmpvar_22 + (viewNorm_7 * 0.3)); + randomDir_17 = tmpvar_23; + lowp vec4 tmpvar_24; + highp vec2 P_25; + P_25 = (tmpvar_2 + (randomDir_17.xy * scale_5)); + tmpvar_24 = texture (_CameraDepthNormalsTexture, P_25); + sampleND_16 = tmpvar_24; + highp float tmpvar_26; + tmpvar_26 = clamp (((depth_6 - + (randomDir_17.z * _Params.x) + ) - ( + dot (sampleND_16.zw, vec2(1.0, 0.00392157)) + * _ProjectionParams.z)), 0.0, 1.0); + if ((tmpvar_26 > _Params.y)) { + occ_4 = (occ_4 + pow ((1.0 - tmpvar_26), _Params.z)); + }; + }; + highp float tmpvar_27; + tmpvar_27 = (occ_4 / 8.0); + occ_4 = tmpvar_27; + tmpvar_1 = (1.0 - tmpvar_27); + _glesFragData[0] = vec4(tmpvar_1); +} + + +// inputs: 2, stats: 41 alu 3 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt index 8e4026830..3546f8dd2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-ir.txt @@ -18,14 +18,14 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -170,7 +170,9 @@ vec4 frag_surf ( float tmpvar_54; tmpvar_54 = UnitySpotAttenuate (IN_38._LightCoord.xyz); vec4 tmpvar_55; - tmpvar_55 = LightingLambert (o_41, lightDir_40, ((float((IN_38._LightCoord.z > 0.0)) * tmpvar_53) * tmpvar_54)); + tmpvar_55 = LightingLambert (o_41, lightDir_40, ((float( + (IN_38._LightCoord.z > 0.0) + ) * tmpvar_53) * tmpvar_54)); vec4 tmpvar_56; tmpvar_56 = tmpvar_55; c_39 = tmpvar_56; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt index 4eec21e5f..a24e6143f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -15,12 +15,20 @@ void main () tmpvar_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); vec4 c_6; - c_6.xyz = ((tmpvar_4.xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_5.xyz, normalize(gl_TexCoord[1].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_6.xyz = ((tmpvar_4.xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_5.xyz, normalize(gl_TexCoord[1].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_6.w = tmpvar_4.w; c_3.xyz = c_6.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 23 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt index c32f6e36b..c5955e859 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-ir.txt @@ -18,10 +18,10 @@ struct v2f_surf { vec3 TtoV1; vec3 TtoV2; }; -uniform sampler2D _MainTex; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _MainTex; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt index 7a6802800..0632599f9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt @@ -5,7 +5,9 @@ void main () vec3 viewN_2; vec4 normal_3; normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); - normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); + normal_3.z = sqrt(((1.0 - + (normal_3.x * normal_3.x) + ) - (normal_3.y * normal_3.y))); viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz); viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz); viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz); @@ -14,3 +16,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 13 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt index 808e5c42e..3033cc4ae 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec4 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt index 098a3f286..298da8e6c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt @@ -1,9 +1,9 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -15,7 +15,9 @@ void main () tmpvar_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0); - normal_6.z = sqrt(((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); + normal_6.z = sqrt(((1.0 - + (normal_6.x * normal_6.x) + ) - (normal_6.y * normal_6.y))); vec4 tmpvar_7; tmpvar_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_3.w = tmpvar_7.w; @@ -28,3 +30,5 @@ void main () gl_FragData[0] = col_2; } + +// inputs: 1, stats: 14 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt index 091c8f918..36892b164 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-ir.txt @@ -18,11 +18,11 @@ struct v2f_surf { vec3 TtoV1; vec3 TtoV2; }; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _MainTex; +uniform float _Shininess; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt index c58e34122..eabd6df20 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt @@ -1,12 +1,14 @@ -uniform float _Shininess; uniform sampler2D _BumpMap; +uniform float _Shininess; void main () { vec4 res_1; vec3 viewN_2; vec4 normal_3; normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0); - normal_3.z = sqrt(((1.0 - (normal_3.x * normal_3.x)) - (normal_3.y * normal_3.y))); + normal_3.z = sqrt(((1.0 - + (normal_3.x * normal_3.x) + ) - (normal_3.y * normal_3.y))); viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz); viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz); viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz); @@ -15,3 +17,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 12 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt index f3493219f..030e02afb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-ir.txt @@ -17,15 +17,15 @@ struct v2f_surf { vec4 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt index 134a08458..818660f68 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -18,7 +18,9 @@ void main () tmpvar_6 = (tmpvar_5 * _Color); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, tmpvar_4).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y))); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); vec4 tmpvar_8; tmpvar_8 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1]))); light_3.w = tmpvar_8.w; @@ -33,3 +35,5 @@ void main () gl_FragData[0] = col_2; } + +// inputs: 1, stats: 20 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt index 763753b73..2efc15475 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt @@ -18,12 +18,12 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt index 68e3f5404..b701346f5 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt @@ -1,17 +1,21 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec4 c_1; vec4 tmpvar_2; tmpvar_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 c_3; - c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_3.xyz = ((tmpvar_2.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_3.w = tmpvar_2.w; c_1.xyz = c_3.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 8 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt index ab6a3a561..9e5778b1e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt index 2b064475d..b597fa4fd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec4 tmpvar_1; @@ -26,3 +26,5 @@ void main () gl_FragData[0] = col_3; } + +// inputs: 1, stats: 11 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt index 0bac53241..5480965dc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-ir.txt @@ -20,16 +20,16 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -215,7 +215,9 @@ vec4 frag_surf ( float tmpvar_70; tmpvar_70 = UnitySpotAttenuate (IN_53._LightCoord.xyz); vec4 tmpvar_71; - tmpvar_71 = LightingLambert (o_56, lightDir_55, ((float((IN_53._LightCoord.z > 0.0)) * tmpvar_69) * tmpvar_70)); + tmpvar_71 = LightingLambert (o_56, lightDir_55, ((float( + (IN_53._LightCoord.z > 0.0) + ) * tmpvar_69) * tmpvar_70)); vec4 tmpvar_72; tmpvar_72 = tmpvar_71; c_54 = tmpvar_72; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt index e6aa95594..469eaf426 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt @@ -1,11 +1,11 @@ -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; void main () { vec4 tmpvar_1; @@ -24,12 +24,20 @@ void main () tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); vec4 normal_8; normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x)) - (normal_8.y * normal_8.y))); + normal_8.z = sqrt(((1.0 - + (normal_8.x * normal_8.x) + ) - (normal_8.y * normal_8.y))); vec4 c_9; - c_9.xyz = ((tmpvar_7.xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_8.xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_9.xyz = ((tmpvar_7.xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_8.xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_9.w = tmpvar_7.w; c_3.xyz = c_9.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 32 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt index 00bf68d8f..407afa9fc 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-ir.txt @@ -20,15 +20,15 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt index 83fadc6c3..e84b28208 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; void main () { vec4 tmpvar_1; @@ -21,12 +21,18 @@ void main () tmpvar_6 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_3)) * _Color); vec4 normal_7; normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_3)).wy * 2.0) - 1.0); - normal_7.z = sqrt(((1.0 - (normal_7.x * normal_7.x)) - (normal_7.y * normal_7.y))); + normal_7.z = sqrt(((1.0 - + (normal_7.x * normal_7.x) + ) - (normal_7.y * normal_7.y))); vec4 c_8; - c_8.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_8.xyz = ((tmpvar_6.xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_8.w = tmpvar_6.w; c_2.xyz = c_8.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 24 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt index 1c22fbf35..3948d5e8c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-ir.txt @@ -20,15 +20,15 @@ struct v2f_surf { vec3 viewDir; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt index a5fab61ae..b03a3ed45 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt @@ -1,11 +1,11 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -23,7 +23,9 @@ void main () tmpvar_7 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color); vec4 normal_8; normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0); - normal_8.z = sqrt(((1.0 - (normal_8.x * normal_8.x)) - (normal_8.y * normal_8.y))); + normal_8.z = sqrt(((1.0 - + (normal_8.x * normal_8.x) + ) - (normal_8.y * normal_8.y))); vec4 tmpvar_9; tmpvar_9 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3]))); light_3.w = tmpvar_9.w; @@ -36,3 +38,5 @@ void main () gl_FragData[0] = col_2; } + +// inputs: 1, stats: 24 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt index 65a6ef632..bed74d6ee 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-ir.txt @@ -20,17 +20,17 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -169,10 +169,16 @@ vec4 LightingBlinnPhong ( tmpvar_58 = (tmpvar_57 * s_40.Gloss); spec_45 = tmpvar_58; vec3 tmpvar_59; - tmpvar_59 = ((((s_40.Albedo * _LightColor0.xyz) * diff_47) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_45)) * (atten_43 * 2.0)); + tmpvar_59 = ((( + (s_40.Albedo * _LightColor0.xyz) + * diff_47) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_45)) * (atten_43 * 2.0)); c_44.xyz = tmpvar_59.xyz.xyz; float tmpvar_60; - tmpvar_60 = (s_40.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_45) * atten_43)); + tmpvar_60 = (s_40.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_45) * atten_43)); c_44.w = vec4(tmpvar_60).w; return c_44; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt index 50e6b81d2..14f871752 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt @@ -1,12 +1,12 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -29,18 +29,32 @@ void main () tmpvar_9 = (tmpvar_8 * _Color); vec4 normal_10; normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); - normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x)) - (normal_10.y * normal_10.y))); + normal_10.z = sqrt(((1.0 - + (normal_10.x * normal_10.x) + ) - (normal_10.y * normal_10.y))); vec3 tmpvar_11; tmpvar_11 = normalize(gl_TexCoord[2].xyz); vec4 tmpvar_12; tmpvar_12 = texture2D (_LightTexture0, vec2(dot (tmpvar_3, tmpvar_3))); vec4 c_13; float tmpvar_14; - tmpvar_14 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2))))), (_Shininess * 128.0)) * tmpvar_8.w); - c_13.xyz = ((((tmpvar_9.xyz * _LightColor0.xyz) * max (0.0, dot (normal_10.xyz, tmpvar_11))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_14)) * (tmpvar_12.w * 2.0)); - c_13.w = (tmpvar_9.w + (((_LightColor0.w * _SpecColor.w) * tmpvar_14) * tmpvar_12.w)); + tmpvar_14 = (pow (max (0.0, + dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2)))) + ), (_Shininess * 128.0)) * tmpvar_8.w); + c_13.xyz = ((( + (tmpvar_9.xyz * _LightColor0.xyz) + * + max (0.0, dot (normal_10.xyz, tmpvar_11)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_14)) * (tmpvar_12.w * 2.0)); + c_13.w = (tmpvar_9.w + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_14) * tmpvar_12.w)); c_4.xyz = c_13.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 41 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt index 9e2df18cd..87f36083a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-ir.txt @@ -20,18 +20,18 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -170,10 +170,16 @@ vec4 LightingBlinnPhong ( tmpvar_58 = (tmpvar_57 * s_40.Gloss); spec_45 = tmpvar_58; vec3 tmpvar_59; - tmpvar_59 = ((((s_40.Albedo * _LightColor0.xyz) * diff_47) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_45)) * (atten_43 * 2.0)); + tmpvar_59 = ((( + (s_40.Albedo * _LightColor0.xyz) + * diff_47) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_45)) * (atten_43 * 2.0)); c_44.xyz = tmpvar_59.xyz.xyz; float tmpvar_60; - tmpvar_60 = (s_40.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_45) * atten_43)); + tmpvar_60 = (s_40.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_45) * atten_43)); c_44.w = vec4(tmpvar_60).w; return c_44; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt index 971ed211a..e1654262a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt @@ -1,13 +1,13 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _ParallaxMap; -uniform float _Parallax; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Parallax; +uniform sampler2D _ParallaxMap; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -30,18 +30,32 @@ void main () tmpvar_9 = (tmpvar_8 * _Color); vec4 normal_10; normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0); - normal_10.z = sqrt(((1.0 - (normal_10.x * normal_10.x)) - (normal_10.y * normal_10.y))); + normal_10.z = sqrt(((1.0 - + (normal_10.x * normal_10.x) + ) - (normal_10.y * normal_10.y))); vec3 tmpvar_11; tmpvar_11 = normalize(gl_TexCoord[2].xyz); float atten_12; atten_12 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_3, tmpvar_3))).w * textureCube (_LightTexture0, tmpvar_3).w); vec4 c_13; float tmpvar_14; - tmpvar_14 = (pow (max (0.0, dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2))))), (_Shininess * 128.0)) * tmpvar_8.w); - c_13.xyz = ((((tmpvar_9.xyz * _LightColor0.xyz) * max (0.0, dot (normal_10.xyz, tmpvar_11))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_14)) * (atten_12 * 2.0)); - c_13.w = (tmpvar_9.w + (((_LightColor0.w * _SpecColor.w) * tmpvar_14) * atten_12)); + tmpvar_14 = (pow (max (0.0, + dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2)))) + ), (_Shininess * 128.0)) * tmpvar_8.w); + c_13.xyz = ((( + (tmpvar_9.xyz * _LightColor0.xyz) + * + max (0.0, dot (normal_10.xyz, tmpvar_11)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_14)) * (atten_12 * 2.0)); + c_13.w = (tmpvar_9.w + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_14) * atten_12)); c_4.xyz = c_13.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 42 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt index 4f7da7027..287f5ce47 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-ir.txt @@ -19,15 +19,15 @@ struct v2f_surf { vec3 viewDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -123,10 +123,16 @@ vec4 LightingBlinnPhong ( tmpvar_39 = (tmpvar_38 * s_21.Gloss); spec_26 = tmpvar_39; vec3 tmpvar_40; - tmpvar_40 = ((((s_21.Albedo * _LightColor0.xyz) * diff_28) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_26)) * (atten_24 * 2.0)); + tmpvar_40 = ((( + (s_21.Albedo * _LightColor0.xyz) + * diff_28) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_26)) * (atten_24 * 2.0)); c_25.xyz = tmpvar_40.xyz.xyz; float tmpvar_41; - tmpvar_41 = (s_21.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_26) * atten_24)); + tmpvar_41 = (s_21.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_26) * atten_24)); c_25.w = vec4(tmpvar_41).w; return c_25; } @@ -178,7 +184,9 @@ vec4 frag_surf ( float tmpvar_60; tmpvar_60 = UnitySpotAttenuate (IN_42._LightCoord.xyz); vec4 tmpvar_61; - tmpvar_61 = LightingBlinnPhong (o_45, lightDir_44, tmpvar_58, ((float((IN_42._LightCoord.z > 0.0)) * tmpvar_59) * tmpvar_60)); + tmpvar_61 = LightingBlinnPhong (o_45, lightDir_44, tmpvar_58, ((float( + (IN_42._LightCoord.z > 0.0) + ) * tmpvar_59) * tmpvar_60)); vec4 tmpvar_62; tmpvar_62 = tmpvar_61; c_43 = tmpvar_62; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt index 5bc26807d..665bc8a1e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt @@ -1,10 +1,10 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec3 tmpvar_1; @@ -19,14 +19,30 @@ void main () vec3 tmpvar_6; tmpvar_6 = normalize(gl_TexCoord[2].xyz); float atten_7; - atten_7 = ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); + atten_7 = ((float( + (tmpvar_2.z > 0.0) + ) * texture2D (_LightTexture0, ( + (tmpvar_2.xy / tmpvar_2.w) + + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); vec4 c_8; float tmpvar_9; - tmpvar_9 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_8.xyz = ((((tmpvar_5.xyz * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_6))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_9)) * (atten_7 * 2.0)); - c_8.w = (tmpvar_5.w + (((_LightColor0.w * _SpecColor.w) * tmpvar_9) * atten_7)); + tmpvar_9 = (pow (max (0.0, + dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_8.xyz = ((( + (tmpvar_5.xyz * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_1, tmpvar_6)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_9)) * (atten_7 * 2.0)); + c_8.w = (tmpvar_5.w + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_9) * atten_7)); c_3.xyz = c_8.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 31 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt index 6648ed120..58e0d53c4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-ir.txt @@ -14,10 +14,10 @@ struct v2f_surf { vec4 pos; vec3 normal; }; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _MainTex; +uniform float _Shininess; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt index 28ed5f368..c5e34474e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt @@ -7,3 +7,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt index fe242fbbf..168712658 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-ir.txt @@ -17,15 +17,15 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt index 58d717337..99c40689a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform sampler2D _Illum; uniform vec4 _Color; +uniform sampler2D _Illum; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec4 tmpvar_1; @@ -31,3 +31,5 @@ void main () gl_FragData[0] = col_3; } + +// inputs: 1, stats: 17 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt index 9b222dcce..62a43a5f4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-ir.txt @@ -18,14 +18,14 @@ struct v2f_surf { vec3 viewDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -112,10 +112,16 @@ vec4 LightingBlinnPhong ( tmpvar_35 = (tmpvar_34 * s_17.Gloss); spec_22 = tmpvar_35; vec3 tmpvar_36; - tmpvar_36 = ((((s_17.Albedo * _LightColor0.xyz) * diff_24) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_22)) * (atten_20 * 2.0)); + tmpvar_36 = ((( + (s_17.Albedo * _LightColor0.xyz) + * diff_24) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_22)) * (atten_20 * 2.0)); c_21.xyz = tmpvar_36.xyz.xyz; float tmpvar_37; - tmpvar_37 = (s_17.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_22) * atten_20)); + tmpvar_37 = (s_17.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_22) * atten_20)); c_21.w = vec4(tmpvar_37).w; return c_21; } @@ -167,7 +173,9 @@ vec4 frag_surf ( float tmpvar_56; tmpvar_56 = UnitySpotAttenuate (IN_38._LightCoord.xyz); vec4 tmpvar_57; - tmpvar_57 = LightingBlinnPhong (o_41, lightDir_40, tmpvar_54, ((float((IN_38._LightCoord.z > 0.0)) * tmpvar_55) * tmpvar_56)); + tmpvar_57 = LightingBlinnPhong (o_41, lightDir_40, tmpvar_54, ((float( + (IN_38._LightCoord.z > 0.0) + ) * tmpvar_55) * tmpvar_56)); vec4 tmpvar_58; tmpvar_58 = tmpvar_57; c_39 = tmpvar_58; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt index 51824f70a..2df68886f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt @@ -1,10 +1,10 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec3 tmpvar_1; @@ -17,14 +17,30 @@ void main () vec3 tmpvar_5; tmpvar_5 = normalize(gl_TexCoord[2].xyz); float atten_6; - atten_6 = ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); + atten_6 = ((float( + (tmpvar_2.z > 0.0) + ) * texture2D (_LightTexture0, ( + (tmpvar_2.xy / tmpvar_2.w) + + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w); vec4 c_7; float tmpvar_8; - tmpvar_8 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_7.xyz = (((((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_5))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = ((tmpvar_4.w * _Color.w) + (((_LightColor0.w * _SpecColor.w) * tmpvar_8) * atten_6)); + tmpvar_8 = (pow (max (0.0, + dot (tmpvar_1, normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_7.xyz = ((( + ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_1, tmpvar_5)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_8)) * (atten_6 * 2.0)); + c_7.w = ((tmpvar_4.w * _Color.w) + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_8) * atten_6)); c_3.xyz = c_7.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 32 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt index 28aa8ed58..341fbce85 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt @@ -13,9 +13,9 @@ struct v2f_surf { vec4 pos; vec3 normal; }; -uniform float _Shininess; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; +uniform float _Shininess; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt index 28ed5f368..c5e34474e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt @@ -7,3 +7,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt index 418900589..ef081f681 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-ir.txt @@ -16,14 +16,14 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt index 8b761811b..847912d4d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform vec4 _Color; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -23,3 +23,5 @@ void main () gl_FragData[0] = c_5; } + +// inputs: 1, stats: 16 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt index abd37b8d7..b0c53b910 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-ir.txt @@ -18,12 +18,12 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _Detail; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -132,7 +132,9 @@ vec4 frag_surf ( float tmpvar_40; tmpvar_40 = UnitySpotAttenuate (IN_23._LightCoord.xyz); vec4 tmpvar_41; - tmpvar_41 = LightingLambert (o_26, lightDir_25, ((float((IN_23._LightCoord.z > 0.0)) * tmpvar_39) * tmpvar_40)); + tmpvar_41 = LightingLambert (o_26, lightDir_25, ((float( + (IN_23._LightCoord.z > 0.0) + ) * tmpvar_39) * tmpvar_40)); vec4 tmpvar_42; tmpvar_42 = tmpvar_41; c_24 = tmpvar_42; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt index c0db067ae..8fb3d7ab3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _Detail; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -11,10 +11,18 @@ void main () tmpvar_2 = gl_TexCoord[3]; vec4 c_3; vec4 c_4; - c_4.xyz = ((((texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) * 2.0) * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_4.xyz = ((( + (texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) + * 2.0) * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_4.w = 0.0; c_3.xyz = c_4.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 18 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt index 2667d1020..8b702e79f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-ir.txt @@ -16,11 +16,11 @@ struct v2f_surf { vec4 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform sampler2D _Detail; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt index 686949547..62b6bf995 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt @@ -1,7 +1,7 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; uniform sampler2D _Detail; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -17,3 +17,5 @@ void main () gl_FragData[0] = c_4; } + +// inputs: 1, stats: 7 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt index 3c3701e9f..28b8e5ee9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-ir.txt @@ -19,12 +19,12 @@ struct v2f_surf { vec3 viewDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _SpecMap; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform sampler2D _SpecMap; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout MySurfaceOutput o_2 @@ -114,7 +114,9 @@ vec4 LightingColoredSpecular ( tmpvar_37 = (spec_23 * s_17.GlossColor); specCol_22 = tmpvar_37; vec3 tmpvar_38; - tmpvar_38 = ((((s_17.Albedo * _LightColor0.xyz) * diff_25) + (_LightColor0.xyz * specCol_22)) * (atten_20 * 2.0)); + tmpvar_38 = ((( + (s_17.Albedo * _LightColor0.xyz) + * diff_25) + (_LightColor0.xyz * specCol_22)) * (atten_20 * 2.0)); c_21.xyz = tmpvar_38.xyz.xyz; float tmpvar_39; tmpvar_39 = s_17.Alpha; @@ -169,7 +171,9 @@ vec4 frag_surf ( float tmpvar_58; tmpvar_58 = UnitySpotAttenuate (IN_40._LightCoord.xyz); vec4 tmpvar_59; - tmpvar_59 = LightingColoredSpecular (o_43, lightDir_42, tmpvar_56, ((float((IN_40._LightCoord.z > 0.0)) * tmpvar_57) * tmpvar_58)); + tmpvar_59 = LightingColoredSpecular (o_43, lightDir_42, tmpvar_56, ((float( + (IN_40._LightCoord.z > 0.0) + ) * tmpvar_57) * tmpvar_58)); vec4 tmpvar_60; tmpvar_60 = tmpvar_59; c_41 = tmpvar_60; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt index 61f65e4a5..75e705d2d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _SpecMap; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform sampler2D _SpecMap; void main () { vec4 tmpvar_1; @@ -15,10 +15,24 @@ void main () vec3 tmpvar_5; tmpvar_5 = normalize(gl_TexCoord[2].xyz); vec4 c_6; - c_6.xyz = (((((texture2D (_MainTex, tmpvar_1.xy).xyz * 0.3) * _LightColor0.xyz) * max (0.0, dot (tmpvar_2, tmpvar_5))) + (_LightColor0.xyz * (pow (max (0.0, dot (tmpvar_2, normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz))))), 32.0) * texture2D (_SpecMap, tmpvar_1.zw).xyz))) * (((float((tmpvar_3.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_3.xy / tmpvar_3.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_3.xyz, tmpvar_3.xyz))).w) * 2.0)); + c_6.xyz = ((( + ((texture2D (_MainTex, tmpvar_1.xy).xyz * 0.3) * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_2, tmpvar_5)) + ) + (_LightColor0.xyz * + (pow (max (0.0, dot (tmpvar_2, + normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz))) + )), 32.0) * texture2D (_SpecMap, tmpvar_1.zw).xyz) + )) * (( + (float((tmpvar_3.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_3.xy / tmpvar_3.w) + 0.5)).w) + * texture2D (_LightTextureB0, vec2( + dot (tmpvar_3.xyz, tmpvar_3.xyz) + )).w) * 2.0)); c_6.w = 0.0; c_4.xyz = c_6.xyz; c_4.w = 0.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 26 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt index a819405b3..778d5d166 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-ir.txt @@ -14,8 +14,8 @@ struct v2f_surf { vec4 pos; vec3 normal; }; -uniform sampler2D _SpecMap; uniform sampler2D _MainTex; +uniform sampler2D _SpecMap; void surf ( in Input IN_1, inout MySurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt index 146d2a623..095032d26 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt index f33a8138e..a511692e1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-ir.txt @@ -17,10 +17,10 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt index 978a38da9..ceb57a55e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt @@ -1,16 +1,22 @@ -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; void main () { vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[3].xyz; vec4 c_2; vec4 c_3; - c_3.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)) * 2.0)); + c_3.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w) + ) * 2.0)); c_3.w = 0.0; c_2.xyz = c_3.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 11 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt index 6fb785a6f..9866eae89 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-ir.txt @@ -17,9 +17,9 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt index f90d1ff93..4e9383b5f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt @@ -1,13 +1,17 @@ -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; void main () { vec4 c_1; vec4 c_2; - c_2.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_2.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_2.w = 0.0; c_1.xyz = c_2.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 8 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt index 59b85f687..5928acbe8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-ir.txt @@ -16,10 +16,10 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; uniform sampler2D _LightBuffer; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt index 6041eef2b..71aea3660 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt @@ -1,6 +1,6 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; uniform sampler2D _LightBuffer; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -16,3 +16,5 @@ void main () gl_FragData[0] = c_4; } + +// inputs: 1, stats: 9 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt index a50257b62..52c363003 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-ir.txt @@ -17,10 +17,10 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt index cd015222b..c2b5ef940 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt @@ -1,14 +1,18 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec4 c_1; vec4 c_2; - c_2.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * 0.5) * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_2.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * 0.5) * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_2.w = 0.0; c_1.xyz = c_2.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 9 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt index 5aff9d570..e1b74e817 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-ir.txt @@ -18,11 +18,11 @@ struct v2f_surf { vec3 vlight; vec4 _ShadowCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightColor0; -uniform sampler2D _DecalBump; uniform sampler2D _Decal; +uniform sampler2D _DecalBump; +uniform vec4 _LightColor0; +uniform sampler2D _ShadowMapTexture; +varying vec4 xlv_FOG; float unitySampleShadow ( in vec4 shadowCoord_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt index 1aa0d8aa3..6d8c921b9 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _ShadowMapTexture; -uniform vec4 _LightColor0; -uniform sampler2D _DecalBump; uniform sampler2D _Decal; +uniform sampler2D _DecalBump; +uniform vec4 _LightColor0; +uniform sampler2D _ShadowMapTexture; void main () { vec4 tmpvar_1; @@ -11,12 +11,18 @@ void main () tmpvar_3 = (texture2D (_Decal, tmpvar_1.xy).xyz * 0.5); vec4 normal_4; normal_4.xy = ((texture2D (_DecalBump, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 c_5; - c_5.xyz = ((tmpvar_3 * _LightColor0.xyz) * ((max (0.0, dot (normal_4.xyz, gl_TexCoord[1].xyz)) * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); + c_5.xyz = ((tmpvar_3 * _LightColor0.xyz) * (( + max (0.0, dot (normal_4.xyz, gl_TexCoord[1].xyz)) + * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0)); c_5.w = 0.0; c_2.w = c_5.w; c_2.xyz = (c_5.xyz + (tmpvar_3 * gl_TexCoord[2].xyz)); gl_FragData[0] = c_2; } + +// inputs: 1, stats: 17 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt index 658b945d9..bcf426eb6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _DecalBump; uniform sampler2D _Decal; +uniform sampler2D _DecalBump; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt index 4ba073d3c..190c552fd 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _DecalBump; uniform sampler2D _Decal; +uniform sampler2D _DecalBump; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; void main () { vec4 tmpvar_1; @@ -11,12 +11,20 @@ void main () vec4 c_3; vec4 normal_4; normal_4.xy = ((texture2D (_DecalBump, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 c_5; - c_5.xyz = (((texture2D (_Decal, tmpvar_1.xy).xyz * 0.5) * _LightColor0.xyz) * ((max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz))) * texture2D (_LightTexture0, vec2(dot (tmpvar_2, tmpvar_2))).w) * 2.0)); + c_5.xyz = (((texture2D (_Decal, tmpvar_1.xy).xyz * 0.5) * _LightColor0.xyz) * (( + max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz))) + * texture2D (_LightTexture0, vec2( + dot (tmpvar_2, tmpvar_2) + )).w) * 2.0)); c_5.w = 0.0; c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 18 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt index c3015568b..d26884e12 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-ir.txt @@ -17,10 +17,10 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt index 90f44341c..8cf3c87fb 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt @@ -1,14 +1,18 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; void main () { vec4 c_1; vec4 c_2; - c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * ((((dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5) + 0.5) * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); + c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (( + ((dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5) + 0.5) + * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0)); c_2.w = 0.0; c_1.xyz = c_2.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 9 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt index a7f82671c..26f21d2d8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec3 normal; vec3 lightDir; }; -varying vec4 xlv_FOG; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt index bc056d4c0..e7d9100b8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt @@ -1,13 +1,17 @@ -uniform sampler2D _MainTex; uniform vec4 _LightColor0; +uniform sampler2D _MainTex; void main () { vec4 c_1; vec4 c_2; - c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * 2.0)); + c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (max (0.0, + dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) + ) * 2.0)); c_2.w = 0.0; c_1.xyz = c_2.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 7 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt index 641bd40a0..6c86c7ae1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-ir.txt @@ -18,12 +18,12 @@ struct v2f_surf { vec4 hip_screen; vec3 normal; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt index b526cce70..344715111 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt @@ -1,8 +1,8 @@ -uniform vec4 unity_Ambient; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +uniform vec4 unity_Ambient; void main () { vec4 col_1; @@ -15,7 +15,11 @@ void main () c_4.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz); c_4.w = 0.0; col_1.w = c_4.w; - col_1.xyz = (c_4.xyz + (_RimColor.xyz * pow ((1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0)), _RimPower))); + col_1.xyz = (c_4.xyz + (_RimColor.xyz * pow ( + (1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0)) + , _RimPower))); gl_FragData[0] = col_1; } + +// inputs: 1, stats: 12 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt index ff4ab9104..59140bc5b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-ir.txt @@ -19,13 +19,13 @@ struct v2f_surf { vec3 normal; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt index b5c1b7b5d..e3fe8ce78 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -18,7 +18,11 @@ void main () c_5.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz); c_5.w = 0.0; col_2.w = c_5.w; - col_2.xyz = (c_5.xyz + (_RimColor.xyz * pow ((1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0)), _RimPower))); + col_2.xyz = (c_5.xyz + (_RimColor.xyz * pow ( + (1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0)) + , _RimPower))); gl_FragData[0] = col_2; } + +// inputs: 1, stats: 16 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt index 9221c1dab..10f07d48b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-ir.txt @@ -17,14 +17,14 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) @@ -270,7 +270,9 @@ vec4 frag_surf ( float tmpvar_85; tmpvar_85 = UnitySpotAttenuate (IN_70._LightCoord.xyz); vec4 tmpvar_86; - tmpvar_86 = LightingLambert (o_73, lightDir_72, ((float((IN_70._LightCoord.z > 0.0)) * tmpvar_84) * tmpvar_85)); + tmpvar_86 = LightingLambert (o_73, lightDir_72, ((float( + (IN_70._LightCoord.z > 0.0) + ) * tmpvar_84) * tmpvar_85)); vec4 tmpvar_87; tmpvar_87 = tmpvar_86; c_71 = tmpvar_87; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt index 58f6b154c..4c4b7550a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec2 tmpvar_1; @@ -12,12 +12,20 @@ void main () vec4 c_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 c_5; - c_5.xyz = ((texture2D (_MainTex, tmpvar_1).xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_5.xyz = ((texture2D (_MainTex, tmpvar_1).xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_5.w = 0.0; c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 23 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt index 7d846d4d2..7192c56d4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-ir.txt @@ -17,14 +17,14 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform float _RimPower; -uniform vec4 _RimColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform vec4 _RimColor; +uniform float _RimPower; +varying vec4 xlv_FOG; float xll_saturate ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt index 9f9299503..3378c5b66 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform sampler2D _BumpMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec2 tmpvar_1; @@ -12,12 +12,20 @@ void main () vec4 c_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 c_5; - c_5.xyz = ((texture2D (_MainTex, tmpvar_1).xyz * _LightColor0.xyz) * ((max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w)) * 2.0)); + c_5.xyz = ((texture2D (_MainTex, tmpvar_1).xyz * _LightColor0.xyz) * (( + max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz))) + * + (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w) + ) * 2.0)); c_5.w = 0.0; c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 18 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt index 84555d660..260aac60a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-ir.txt @@ -16,11 +16,11 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -131,7 +131,9 @@ vec4 frag_surf ( float tmpvar_41; tmpvar_41 = UnitySpotAttenuate (IN_26._LightCoord.xyz); vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_30, lightDir_28, ((float((IN_26._LightCoord.z > 0.0)) * tmpvar_40) * tmpvar_41)); + tmpvar_42 = LightingLambert (o_30, lightDir_28, ((float( + (IN_26._LightCoord.z > 0.0) + ) * tmpvar_40) * tmpvar_41)); vec4 tmpvar_43; tmpvar_43 = tmpvar_42; c_27 = tmpvar_43; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt index 626aad518..aa462556a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt @@ -1,16 +1,22 @@ -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; void main () { vec4 tmpvar_1; tmpvar_1 = gl_TexCoord[2]; vec4 c_2; vec4 c_3; - c_3.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[0].xyz, normalize(gl_TexCoord[1].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)) * 2.0)); + c_3.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[0].xyz, normalize(gl_TexCoord[1].xyz))) + * + ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) + ) * 2.0)); c_3.w = 0.0; c_2.xyz = c_3.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 16 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt index 34a869bd6..d83bbbb76 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-ir.txt @@ -16,11 +16,11 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt index 51d235348..89a2d1fc2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt @@ -1,16 +1,22 @@ -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; void main () { vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[2].xyz; vec4 c_2; vec4 c_3; - c_3.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[0].xyz, normalize(gl_TexCoord[1].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)) * 2.0)); + c_3.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[0].xyz, normalize(gl_TexCoord[1].xyz))) + * + (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w) + ) * 2.0)); c_3.w = 0.0; c_2.xyz = c_3.xyz; c_2.w = 0.0; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 11 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt index d5e6cd110..a366de427 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt index d5e6cd110..a366de427 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt index 107776240..6496da7ed 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-ir.txt @@ -15,10 +15,10 @@ struct v2f_surf { vec4 hip_screenPos; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt index d0771428c..e9d2592f0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt @@ -1,6 +1,6 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 tmpvar_1; @@ -16,3 +16,5 @@ void main () gl_FragData[0] = c_4; } + +// inputs: 1, stats: 7 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt index 8a6f5e9ad..9cc042424 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-ir.txt @@ -19,11 +19,11 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) @@ -142,7 +142,9 @@ vec4 frag_surf ( float tmpvar_41; tmpvar_41 = UnitySpotAttenuate (IN_24._LightCoord.xyz); vec4 tmpvar_42; - tmpvar_42 = LightingLambert (o_27, lightDir_26, ((float((IN_24._LightCoord.z > 0.0)) * tmpvar_40) * tmpvar_41)); + tmpvar_42 = LightingLambert (o_27, lightDir_26, ((float( + (IN_24._LightCoord.z > 0.0) + ) * tmpvar_40) * tmpvar_41)); vec4 tmpvar_43; tmpvar_43 = tmpvar_42; c_25 = tmpvar_43; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt index c7a616599..90781031e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec3 tmpvar_1; @@ -10,15 +10,23 @@ void main () tmpvar_2 = gl_TexCoord[4]; vec4 c_3; float x_4; - x_4 = (fract(((tmpvar_1.y + (tmpvar_1.z * 0.1)) * 5.0)) - 0.5); + x_4 = (fract(( + (tmpvar_1.y + (tmpvar_1.z * 0.1)) + * 5.0)) - 0.5); if ((x_4 < 0.0)) { discard; }; vec4 c_5; - c_5.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[2].xyz, normalize(gl_TexCoord[3].xyz))) * ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)) * 2.0)); + c_5.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[2].xyz, normalize(gl_TexCoord[3].xyz))) + * + ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w) + ) * 2.0)); c_5.w = 0.0; c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 22 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt index 35420313a..a1394ac8b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-ir.txt @@ -17,10 +17,10 @@ struct v2f_surf { vec3 worldPos; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt index a328ab3b4..ea6cffca8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt @@ -1,13 +1,15 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec3 tmpvar_1; tmpvar_1 = gl_TexCoord[1].xyz; vec4 light_2; float x_3; - x_3 = (fract(((tmpvar_1.y + (tmpvar_1.z * 0.1)) * 5.0)) - 0.5); + x_3 = (fract(( + (tmpvar_1.y + (tmpvar_1.z * 0.1)) + * 5.0)) - 0.5); if ((x_3 < 0.0)) { discard; }; @@ -21,3 +23,5 @@ void main () gl_FragData[0] = c_5; } + +// inputs: 1, stats: 11 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt index 836ce6ed0..7bd1bfdf6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-ir.txt @@ -18,11 +18,11 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt index 8c59a8db0..e404f3f57 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt @@ -1,7 +1,7 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform sampler2D _MainTex; uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -10,7 +10,9 @@ void main () tmpvar_2 = gl_TexCoord[3].xyz; vec4 light_3; float x_4; - x_4 = (fract(((tmpvar_1.y + (tmpvar_1.z * 0.1)) * 5.0)) - 0.5); + x_4 = (fract(( + (tmpvar_1.y + (tmpvar_1.z * 0.1)) + * 5.0)) - 0.5); if ((x_4 < 0.0)) { discard; }; @@ -24,3 +26,5 @@ void main () gl_FragData[0] = c_6; } + +// inputs: 1, stats: 15 alu 5 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt index 195977bcf..c78e4c77e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-ir.txt @@ -19,12 +19,12 @@ struct v2f_surf { vec2 _ShadowZFade; vec3 worldPos; }; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _MainTex; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _MainTex; +uniform vec4 _ProjectionParams; +uniform sampler2D _ShadowMapTexture; void xll_clip ( in float x_1 ) @@ -238,7 +238,11 @@ vec4 frag_surf ( weights_54 = tmpvar_74; vec4 tmpvar_75; tmpvar_75.w = 1.0; - tmpvar_75.xyz = ((((IN_49._ShadowCoord0 * weights_54.x) + (IN_49._ShadowCoord1 * weights_54.y)) + (IN_49._ShadowCoord2 * weights_54.z)) + (IN_49._ShadowCoord3 * weights_54.w)).xyz; + tmpvar_75.xyz = ((( + (IN_49._ShadowCoord0 * weights_54.x) + + + (IN_49._ShadowCoord1 * weights_54.y) + ) + (IN_49._ShadowCoord2 * weights_54.z)) + (IN_49._ShadowCoord3 * weights_54.w)).xyz; vec4 tmpvar_76; tmpvar_76 = tmpvar_75; coord_53 = tmpvar_76; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt index 315386b25..c4b1181a4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform vec4 _ProjectionParams; +uniform sampler2D _ShadowMapTexture; void main () { vec2 tmpvar_1; @@ -11,7 +11,9 @@ void main () tmpvar_2 = gl_TexCoord[5].xyz; vec4 res_3; float x_4; - x_4 = (fract(((tmpvar_2.y + (tmpvar_2.z * 0.1)) * 5.0)) - 0.5); + x_4 = (fract(( + (tmpvar_2.y + (tmpvar_2.z * 0.1)) + * 5.0)) - 0.5); if ((x_4 < 0.0)) { discard; }; @@ -19,7 +21,11 @@ void main () tmpvar_5 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); vec4 tmpvar_6; tmpvar_6.w = 1.0; - tmpvar_6.xyz = ((((gl_TexCoord[0].xyz * tmpvar_5.x) + (gl_TexCoord[1].xyz * tmpvar_5.y)) + (gl_TexCoord[2].xyz * tmpvar_5.z)) + (gl_TexCoord[3].xyz * tmpvar_5.w)); + tmpvar_6.xyz = ((( + (gl_TexCoord[0].xyz * tmpvar_5.x) + + + (gl_TexCoord[1].xyz * tmpvar_5.y) + ) + (gl_TexCoord[2].xyz * tmpvar_5.z)) + (gl_TexCoord[3].xyz * tmpvar_5.w)); vec4 tmpvar_7; tmpvar_7 = texture2D (_ShadowMapTexture, tmpvar_6.xy); float tmpvar_8; @@ -32,10 +38,14 @@ void main () res_3.y = 1.0; vec2 enc_9; vec2 tmpvar_10; - tmpvar_10 = fract((vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x)); + tmpvar_10 = fract((vec2(1.0, 255.0) * (1.0 - + (tmpvar_1.xxxx * _ProjectionParams.w) + ).x)); enc_9.y = tmpvar_10.y; enc_9.x = (tmpvar_10.x - (tmpvar_10.y * 0.00392157)); res_3.zw = enc_9; gl_FragData[0] = res_3; } + +// inputs: 1, stats: 31 alu 2 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt index 0877279b6..86dbf5fd0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-ir.txt @@ -16,9 +16,9 @@ struct v2f_surf { vec3 normal; vec3 lightDir; }; -varying vec4 xlv_FOG; -uniform vec4 _LightColor0; uniform samplerCube _Cube; +uniform vec4 _LightColor0; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt index b7edfe906..54baf6f59 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt @@ -1,13 +1,17 @@ -uniform vec4 _LightColor0; uniform samplerCube _Cube; +uniform vec4 _LightColor0; void main () { vec4 c_1; vec4 c_2; - c_2.xyz = ((textureCube (_Cube, gl_TexCoord[0].xyz).xyz * _LightColor0.xyz) * (max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)) * 2.0)); + c_2.xyz = ((textureCube (_Cube, gl_TexCoord[0].xyz).xyz * _LightColor0.xyz) * (max (0.0, + dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) + ) * 2.0)); c_2.w = 0.0; c_1.xyz = c_2.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 7 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt index d5e6cd110..a366de427 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt index 74e3fb284..6f9f2b170 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt @@ -3,3 +3,5 @@ void main () gl_FragData[0] = gl_Color; } + +// inputs: 1, stats: 0 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt index 066a56ee5..e81fcd63d 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 vertex; vec2 texcoord; }; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt index 775cddc57..9bc8363a0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt @@ -1,7 +1,9 @@ -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; void main () { gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); } + +// inputs: 1, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt index 8565daa71..e2e692a6e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-ir.txt @@ -2,8 +2,8 @@ struct v2f { vec4 pos; vec2 uv; }; -uniform vec4 _ZBufferParams; uniform sampler2D _CameraDepthTexture; +uniform vec4 _ZBufferParams; float Linear01Depth ( in float z_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt index 896249a0c..51badb6b3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt @@ -1,7 +1,11 @@ -uniform vec4 _ZBufferParams; uniform sampler2D _CameraDepthTexture; +uniform vec4 _ZBufferParams; void main () { - gl_FragData[0] = vec4((1.0 - (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x) + _ZBufferParams.y))))); + gl_FragData[0] = vec4((1.0 - (1.0/(( + (_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x) + + _ZBufferParams.y))))); } + +// inputs: 1, stats: 4 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt index 4cb551151..4cd820c96 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = texture2D (_MainTex, gl_TexCoord[0].xy); } + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt index aec89fdd6..7a97d97ee 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-ir.txt @@ -2,22 +2,22 @@ struct v2f { vec4 pos; vec2 uv; }; -uniform sampler2D _MainTex9; -uniform sampler2D _MainTex8; -uniform sampler2D _MainTex7; -uniform sampler2D _MainTex6; -uniform sampler2D _MainTex5; -uniform sampler2D _MainTex4; -uniform sampler2D _MainTex3; -uniform sampler2D _MainTex2; -uniform sampler2D _MainTex15; -uniform sampler2D _MainTex14; -uniform sampler2D _MainTex13; -uniform sampler2D _MainTex12; -uniform sampler2D _MainTex11; -uniform sampler2D _MainTex10; -uniform sampler2D _MainTex1; uniform sampler2D _MainTex0; +uniform sampler2D _MainTex1; +uniform sampler2D _MainTex10; +uniform sampler2D _MainTex11; +uniform sampler2D _MainTex12; +uniform sampler2D _MainTex13; +uniform sampler2D _MainTex14; +uniform sampler2D _MainTex15; +uniform sampler2D _MainTex2; +uniform sampler2D _MainTex3; +uniform sampler2D _MainTex4; +uniform sampler2D _MainTex5; +uniform sampler2D _MainTex6; +uniform sampler2D _MainTex7; +uniform sampler2D _MainTex8; +uniform sampler2D _MainTex9; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt index 5bd4641fc..4d8828b8c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt @@ -1,23 +1,31 @@ -uniform sampler2D _MainTex9; -uniform sampler2D _MainTex8; -uniform sampler2D _MainTex7; -uniform sampler2D _MainTex6; -uniform sampler2D _MainTex5; -uniform sampler2D _MainTex4; -uniform sampler2D _MainTex3; -uniform sampler2D _MainTex2; -uniform sampler2D _MainTex15; -uniform sampler2D _MainTex14; -uniform sampler2D _MainTex13; -uniform sampler2D _MainTex12; -uniform sampler2D _MainTex11; -uniform sampler2D _MainTex10; -uniform sampler2D _MainTex1; uniform sampler2D _MainTex0; +uniform sampler2D _MainTex1; +uniform sampler2D _MainTex10; +uniform sampler2D _MainTex11; +uniform sampler2D _MainTex12; +uniform sampler2D _MainTex13; +uniform sampler2D _MainTex14; +uniform sampler2D _MainTex15; +uniform sampler2D _MainTex2; +uniform sampler2D _MainTex3; +uniform sampler2D _MainTex4; +uniform sampler2D _MainTex5; +uniform sampler2D _MainTex6; +uniform sampler2D _MainTex7; +uniform sampler2D _MainTex8; +uniform sampler2D _MainTex9; void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; - gl_FragData[0] = (((((((((((((((texture2D (_MainTex0, tmpvar_1) + texture2D (_MainTex1, tmpvar_1)) + texture2D (_MainTex2, tmpvar_1)) + texture2D (_MainTex3, tmpvar_1)) + texture2D (_MainTex4, tmpvar_1)) + texture2D (_MainTex5, tmpvar_1)) + texture2D (_MainTex6, tmpvar_1)) + texture2D (_MainTex7, tmpvar_1)) + texture2D (_MainTex8, tmpvar_1)) + texture2D (_MainTex9, tmpvar_1)) + texture2D (_MainTex10, tmpvar_1)) + texture2D (_MainTex11, tmpvar_1)) + texture2D (_MainTex12, tmpvar_1)) + texture2D (_MainTex13, tmpvar_1)) + texture2D (_MainTex14, tmpvar_1)) + texture2D (_MainTex15, tmpvar_1)); + gl_FragData[0] = ((( + (((( + (((( + ((((texture2D (_MainTex0, tmpvar_1) + texture2D (_MainTex1, tmpvar_1)) + texture2D (_MainTex2, tmpvar_1)) + texture2D (_MainTex3, tmpvar_1)) + texture2D (_MainTex4, tmpvar_1)) + + texture2D (_MainTex5, tmpvar_1)) + texture2D (_MainTex6, tmpvar_1)) + texture2D (_MainTex7, tmpvar_1)) + texture2D (_MainTex8, tmpvar_1)) + + texture2D (_MainTex9, tmpvar_1)) + texture2D (_MainTex10, tmpvar_1)) + texture2D (_MainTex11, tmpvar_1)) + texture2D (_MainTex12, tmpvar_1)) + + texture2D (_MainTex13, tmpvar_1)) + texture2D (_MainTex14, tmpvar_1)) + texture2D (_MainTex15, tmpvar_1)); } + +// inputs: 1, stats: 15 alu 16 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt index 927a222bc..1999eb35e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-ir.txt @@ -16,9 +16,9 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _LightTexture0; uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt index 94881b4bd..484d6e050 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = c_1; } + +// inputs: 0, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt index d5e6cd110..a366de427 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt @@ -6,3 +6,5 @@ void main () gl_FragData[0] = res_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt index 114c707c6..391a87da8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = textureCube (_MainTex, gl_TexCoord[0].xyz); } + +// inputs: 1, stats: 0 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt index 4c20be042..480e8f972 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-ir.txt @@ -3,9 +3,9 @@ struct v2f { vec2 texcoord; vec3 cubenormal; }; -uniform samplerCube _ToonShade; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; +uniform samplerCube _ToonShade; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt index 76911fc75..57c487749 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt @@ -1,6 +1,6 @@ -uniform samplerCube _ToonShade; -uniform sampler2D _MainTex; uniform vec4 _Color; +uniform sampler2D _MainTex; +uniform samplerCube _ToonShade; void main () { vec4 tmpvar_1; @@ -11,3 +11,5 @@ void main () gl_FragData[0] = tmpvar_2; } + +// inputs: 1, stats: 3 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt index 95ca7cc54..1a094fc2c 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-ir.txt @@ -17,12 +17,12 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _Ramp; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform sampler2D _Ramp; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt index 92c3cfaba..f2ec42ee1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt @@ -1,16 +1,22 @@ -uniform sampler2D _Ramp; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform sampler2D _Ramp; void main () { vec4 c_1; vec4 c_2; - c_2.xyz = ((((texture2D (_MainTex, gl_TexCoord[0].xy) * _Color).xyz * _LightColor0.xyz) * texture2D (_Ramp, vec2(((dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5) + 0.5))).xyz) * (texture2D (_LightTexture0, gl_TexCoord[3].xy).w * 2.0)); + c_2.xyz = ((( + (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color) + .xyz * _LightColor0.xyz) * texture2D (_Ramp, vec2(( + (dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5) + + 0.5))).xyz) * (texture2D (_LightTexture0, gl_TexCoord[3].xy).w * 2.0)); c_2.w = 0.0; c_1.xyz = c_2.xyz; c_1.w = 0.0; gl_FragData[0] = c_1; } + +// inputs: 1, stats: 10 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt index 8923b3090..d01d1df51 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-ir.txt @@ -18,15 +18,15 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -114,10 +114,16 @@ vec4 LightingBlinnPhong ( tmpvar_37 = (tmpvar_36 * s_19.Gloss); spec_24 = tmpvar_37; vec3 tmpvar_38; - tmpvar_38 = ((((s_19.Albedo * _LightColor0.xyz) * diff_26) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_24)) * (atten_22 * 2.0)); + tmpvar_38 = ((( + (s_19.Albedo * _LightColor0.xyz) + * diff_26) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_24)) * (atten_22 * 2.0)); c_23.xyz = tmpvar_38.xyz.xyz; float tmpvar_39; - tmpvar_39 = (s_19.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_24) * atten_22)); + tmpvar_39 = (s_19.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_24) * atten_22)); c_23.w = vec4(tmpvar_39).w; return c_23; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt index b17e18586..fc1baa3c2 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt @@ -1,11 +1,11 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec4 tmpvar_1; @@ -19,18 +19,32 @@ void main () tmpvar_5 = (tmpvar_4.w * _Color.w); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_6.z = sqrt(((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); + normal_6.z = sqrt(((1.0 - + (normal_6.x * normal_6.x) + ) - (normal_6.y * normal_6.y))); vec3 tmpvar_7; tmpvar_7 = normalize(gl_TexCoord[1].xyz); float atten_8; atten_8 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_9; float tmpvar_10; - tmpvar_10 = (pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_9.xyz = (((((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_6.xyz, tmpvar_7))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_10)) * (atten_8 * 2.0)); - c_9.w = (tmpvar_5 + (((_LightColor0.w * _SpecColor.w) * tmpvar_10) * atten_8)); + tmpvar_10 = (pow (max (0.0, + dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_9.xyz = ((( + ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_6.xyz, tmpvar_7)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_10)) * (atten_8 * 2.0)); + c_9.w = (tmpvar_5 + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_10) * atten_8)); c_3.xyz = c_9.xyz; c_3.w = tmpvar_5; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 33 alu 4 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt index 319cc41dc..1c9ba060a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt @@ -16,12 +16,12 @@ struct v2f_surf { vec4 hip_pack0; vec3 lightDir; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt index b9ba3a72f..4fee2e8d6 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -14,17 +14,23 @@ void main () tmpvar_4 = tmpvar_3.w; vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); float x_6; x_6 = (tmpvar_3.w - _Cutoff); if ((x_6 < 0.0)) { discard; }; vec4 c_7; - c_7.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (max (0.0, dot (normal_5.xyz, gl_TexCoord[1].xyz)) * 2.0)); + c_7.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (max (0.0, + dot (normal_5.xyz, gl_TexCoord[1].xyz) + ) * 2.0)); c_7.w = tmpvar_4; c_2.xyz = c_7.xyz; c_2.w = tmpvar_4; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 15 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt index e010d39dc..941c43f1e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt @@ -16,13 +16,13 @@ struct v2f_surf { vec2 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt index 67cde282a..a84d23cb1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt @@ -1,9 +1,9 @@ -uniform vec4 unity_Ambient; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 unity_Ambient; void main () { vec4 light_1; @@ -12,7 +12,9 @@ void main () tmpvar_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color); vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); float x_5; x_5 = (tmpvar_3.w - _Cutoff); if ((x_5 < 0.0)) { @@ -28,3 +30,5 @@ void main () gl_FragData[0] = c_7; } + +// inputs: 1, stats: 14 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt index ecddaff68..d2a333323 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-ir.txt @@ -17,11 +17,11 @@ struct v2f_surf { vec3 TtoV1; vec3 TtoV2; }; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _MainTex; +uniform float _Shininess; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt index 1428b85b8..4cdc432e1 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt @@ -1,8 +1,8 @@ -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _MainTex; +uniform float _Shininess; void main () { vec4 tmpvar_1; @@ -11,7 +11,9 @@ void main () vec3 viewN_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); float x_5; x_5 = ((texture2D (_MainTex, tmpvar_1.xy).w * _Color.w) - _Cutoff); if ((x_5 < 0.0)) { @@ -25,3 +27,5 @@ void main () gl_FragData[0] = res_2; } + +// inputs: 1, stats: 15 alu 3 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt index b7cb57ff2..2fe9ed4a7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-ir.txt @@ -16,15 +16,15 @@ struct v2f_surf { vec2 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt index 9f2db47f3..77e5bc48f 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_Ambient; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform vec4 unity_Ambient; void main () { vec4 light_1; @@ -15,7 +15,9 @@ void main () tmpvar_4 = (tmpvar_3.w * _Color.w); vec4 normal_5; normal_5.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_5.z = sqrt(((1.0 - (normal_5.x * normal_5.x)) - (normal_5.y * normal_5.y))); + normal_5.z = sqrt(((1.0 - + (normal_5.x * normal_5.x) + ) - (normal_5.y * normal_5.y))); float x_6; x_6 = (tmpvar_4 - _Cutoff); if ((x_6 < 0.0)) { @@ -33,3 +35,5 @@ void main () gl_FragData[0] = c_8; } + +// inputs: 1, stats: 21 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt index 1dbbe265f..89aa05cb0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) @@ -144,7 +144,9 @@ vec4 frag_surf ( float tmpvar_42; tmpvar_42 = UnitySpotAttenuate (IN_26._LightCoord.xyz); vec4 tmpvar_43; - tmpvar_43 = LightingLambert (o_29, lightDir_28, ((float((IN_26._LightCoord.z > 0.0)) * tmpvar_41) * tmpvar_42)); + tmpvar_43 = LightingLambert (o_29, lightDir_28, ((float( + (IN_26._LightCoord.z > 0.0) + ) * tmpvar_41) * tmpvar_42)); vec4 tmpvar_44; tmpvar_44 = tmpvar_43; c_27 = tmpvar_44; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt index df8b3a8c2..3894f7fb8 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt @@ -1,9 +1,9 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec4 tmpvar_1; @@ -19,10 +19,16 @@ void main () discard; }; vec4 c_6; - c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)) * 2.0)); + c_6.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w) + ) * 2.0)); c_6.w = tmpvar_4; c_2.xyz = c_6.xyz; c_2.w = tmpvar_4; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 17 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt index 1f9c8d825..cbe62c1e4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-ir.txt @@ -17,13 +17,13 @@ struct v2f_surf { vec3 lightDir; vec3 viewDir; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) @@ -95,10 +95,16 @@ vec4 LightingBlinnPhong ( tmpvar_29 = (tmpvar_28 * s_11.Gloss); spec_16 = tmpvar_29; vec3 tmpvar_30; - tmpvar_30 = ((((s_11.Albedo * _LightColor0.xyz) * diff_18) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_16)) * (atten_14 * 2.0)); + tmpvar_30 = ((( + (s_11.Albedo * _LightColor0.xyz) + * diff_18) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_16)) * (atten_14 * 2.0)); c_15.xyz = tmpvar_30.xyz.xyz; float tmpvar_31; - tmpvar_31 = (s_11.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_16) * atten_14)); + tmpvar_31 = (s_11.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_16) * atten_14)); c_15.w = vec4(tmpvar_31).w; return c_15; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt index ce9dad0f5..cabc40043 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt @@ -1,9 +1,9 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec3 tmpvar_1; @@ -22,11 +22,21 @@ void main () }; vec4 c_7; float tmpvar_8; - tmpvar_8 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_7.xyz = (((((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_2))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_8)) * 2.0); + tmpvar_8 = (pow (max (0.0, + dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_7.xyz = ((( + ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_1, tmpvar_2)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_8)) * 2.0); c_7.w = (tmpvar_5 + ((_LightColor0.w * _SpecColor.w) * tmpvar_8)); c_3.xyz = c_7.xyz; c_3.w = tmpvar_5; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 23 alu 2 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt index eeec2e22c..27e0f51f0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-ir.txt @@ -18,15 +18,15 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) @@ -98,10 +98,16 @@ vec4 LightingBlinnPhong ( tmpvar_29 = (tmpvar_28 * s_11.Gloss); spec_16 = tmpvar_29; vec3 tmpvar_30; - tmpvar_30 = ((((s_11.Albedo * _LightColor0.xyz) * diff_18) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_16)) * (atten_14 * 2.0)); + tmpvar_30 = ((( + (s_11.Albedo * _LightColor0.xyz) + * diff_18) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_16)) * (atten_14 * 2.0)); c_15.xyz = tmpvar_30.xyz.xyz; float tmpvar_31; - tmpvar_31 = (s_11.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_16) * atten_14)); + tmpvar_31 = (s_11.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_16) * atten_14)); c_15.w = vec4(tmpvar_31).w; return c_15; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt index 217fa1191..ec1a1e4e0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt @@ -1,11 +1,11 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec3 tmpvar_1; @@ -28,11 +28,23 @@ void main () atten_8 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_9; float tmpvar_10; - tmpvar_10 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_7 + normalize(gl_TexCoord[3].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_9.xyz = (((((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_7))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_10)) * (atten_8 * 2.0)); - c_9.w = (tmpvar_5 + (((_LightColor0.w * _SpecColor.w) * tmpvar_10) * atten_8)); + tmpvar_10 = (pow (max (0.0, + dot (tmpvar_1, normalize((tmpvar_7 + normalize(gl_TexCoord[3].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_9.xyz = ((( + ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_1, tmpvar_7)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_10)) * (atten_8 * 2.0)); + c_9.w = (tmpvar_5 + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_10) * atten_8)); c_3.xyz = c_9.xyz; c_3.w = tmpvar_5; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 28 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt index 24dbe75fd..b8e7d9a77 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-ir.txt @@ -16,15 +16,15 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt index 56994a993..60fea62d7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D unity_LightmapInd; -uniform sampler2D unity_Lightmap; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform sampler2D _LightBuffer; -uniform float _Cutoff; uniform vec4 _Color; +uniform float _Cutoff; +uniform sampler2D _LightBuffer; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; void main () { vec3 tmpvar_1; @@ -31,3 +31,5 @@ void main () gl_FragData[0] = c_7; } + +// inputs: 1, stats: 18 alu 5 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt index d3e5edcb0..562e47169 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-ir.txt @@ -17,12 +17,12 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt index f3a72a94b..256f8fed3 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt @@ -1,8 +1,8 @@ -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; void main () { vec3 tmpvar_1; @@ -13,10 +13,16 @@ void main () float tmpvar_4; tmpvar_4 = tmpvar_3.w; vec4 c_5; - c_5.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * ((max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) * (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)) * 2.0)); + c_5.xyz = ((tmpvar_3.xyz * _LightColor0.xyz) * (( + max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz))) + * + (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w) + ) * 2.0)); c_5.w = tmpvar_4; c_2.xyz = c_5.xyz; c_2.w = tmpvar_4; gl_FragData[0] = c_2; } + +// inputs: 1, stats: 10 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt index 5561c16e7..c92b30743 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-ir.txt @@ -18,13 +18,13 @@ struct v2f_surf { vec3 viewDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; +varying vec4 xlv_FOG; void surf ( in Input IN_1, inout SurfaceOutput o_2 @@ -87,10 +87,16 @@ vec4 LightingBlinnPhong ( tmpvar_28 = (tmpvar_27 * s_10.Gloss); spec_15 = tmpvar_28; vec3 tmpvar_29; - tmpvar_29 = ((((s_10.Albedo * _LightColor0.xyz) * diff_17) + ((_LightColor0.xyz * _SpecColor.xyz) * spec_15)) * (atten_13 * 2.0)); + tmpvar_29 = ((( + (s_10.Albedo * _LightColor0.xyz) + * diff_17) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * spec_15)) * (atten_13 * 2.0)); c_14.xyz = tmpvar_29.xyz.xyz; float tmpvar_30; - tmpvar_30 = (s_10.Alpha + (((_LightColor0.w * _SpecColor.w) * spec_15) * atten_13)); + tmpvar_30 = (s_10.Alpha + (( + (_LightColor0.w * _SpecColor.w) + * spec_15) * atten_13)); c_14.w = vec4(tmpvar_30).w; return c_14; } diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt index 8fb1a10cb..5cd633137 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt @@ -1,9 +1,9 @@ -uniform vec4 _SpecColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTexture0; -uniform vec4 _LightColor0; uniform vec4 _Color; +uniform vec4 _LightColor0; +uniform sampler2D _LightTexture0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _SpecColor; void main () { vec3 tmpvar_1; @@ -19,11 +19,23 @@ void main () atten_6 = texture2D (_LightTexture0, gl_TexCoord[4].xy).w; vec4 c_7; float tmpvar_8; - tmpvar_8 = (pow (max (0.0, dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz))))), (_Shininess * 128.0)) * tmpvar_4.w); - c_7.xyz = (((((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) * max (0.0, dot (tmpvar_1, tmpvar_2))) + ((_LightColor0.xyz * _SpecColor.xyz) * tmpvar_8)) * (atten_6 * 2.0)); - c_7.w = (tmpvar_5 + (((_LightColor0.w * _SpecColor.w) * tmpvar_8) * atten_6)); + tmpvar_8 = (pow (max (0.0, + dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz)))) + ), (_Shininess * 128.0)) * tmpvar_4.w); + c_7.xyz = ((( + ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (tmpvar_1, tmpvar_2)) + ) + ( + (_LightColor0.xyz * _SpecColor.xyz) + * tmpvar_8)) * (atten_6 * 2.0)); + c_7.w = (tmpvar_5 + (( + (_LightColor0.w * _SpecColor.w) + * tmpvar_8) * atten_6)); c_3.xyz = c_7.xyz; c_3.w = tmpvar_5; gl_FragData[0] = c_3; } + +// inputs: 1, stats: 23 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt index b97eb0dd6..2af2fd621 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-ir.txt @@ -6,13 +6,13 @@ struct v2f { vec3 nl; vec3 nh; }; -uniform sampler2D _TranslucencyMap; -uniform vec3 _TranslucencyColor; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform float _Cutoff; uniform sampler2D _BumpSpecMap; +uniform float _Cutoff; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; void xll_clip ( in float x_1 ) @@ -95,7 +95,11 @@ vec4 frag ( tmpvar_34 = (tmpvar_33 * gloss_12); spec_4 = tmpvar_34; vec3 tmpvar_35; - tmpvar_35 = (light_11 + (((albedo_15 * (translucencyColor_7 + nl_6)) + (_SpecColor.xyz * spec_4)) * lightColor_8)); + tmpvar_35 = (light_11 + (( + (albedo_15 * (translucencyColor_7 + nl_6)) + + + (_SpecColor.xyz * spec_4) + ) * lightColor_8)); light_11 = tmpvar_35; int _post_incdec_tmp_36; _post_incdec_tmp_36 = j_9; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt index 62b1b1b20..a5f5a229a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt @@ -1,10 +1,10 @@ -uniform sampler2D _TranslucencyMap; -uniform vec3 _TranslucencyColor; -uniform vec4 _TerrainTreeLightColors[4]; -uniform vec4 _SpecColor; -uniform sampler2D _MainTex; -uniform float _Cutoff; uniform sampler2D _BumpSpecMap; +uniform float _Cutoff; +uniform sampler2D _MainTex; +uniform vec4 _SpecColor; +uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; void main () { vec2 tmpvar_1; @@ -31,17 +31,25 @@ void main () tmpvar_11 = texture2D (_TranslucencyMap, tmpvar_1); light_6 = (gl_LightModel.ambient.xyz * tmpvar_10); backContribs_5 = (gl_TexCoord[2].xyz * tmpvar_11.z); - float tmpvar_12; - tmpvar_12 = (pow (tmpvar_3.x, specular_7) * tmpvar_11.w); - light_6 = (light_6 + (((tmpvar_10 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x)) + (_SpecColor.xyz * tmpvar_12)) * _TerrainTreeLightColors[0].xyz)); - float tmpvar_13; - tmpvar_13 = (pow (tmpvar_3.y, specular_7) * tmpvar_11.w); - light_6 = (light_6 + (((tmpvar_10 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y)) + (_SpecColor.xyz * tmpvar_13)) * _TerrainTreeLightColors[1].xyz)); - float tmpvar_14; - tmpvar_14 = (pow (tmpvar_3.z, specular_7) * tmpvar_11.w); - light_6 = (light_6 + (((tmpvar_10 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z)) + (_SpecColor.xyz * tmpvar_14)) * _TerrainTreeLightColors[2].xyz)); + light_6 = (light_6 + (( + (tmpvar_10 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x)) + + + (_SpecColor.xyz * (pow (tmpvar_3.x, specular_7) * tmpvar_11.w)) + ) * _TerrainTreeLightColors[0].xyz)); + light_6 = (light_6 + (( + (tmpvar_10 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y)) + + + (_SpecColor.xyz * (pow (tmpvar_3.y, specular_7) * tmpvar_11.w)) + ) * _TerrainTreeLightColors[1].xyz)); + light_6 = (light_6 + (( + (tmpvar_10 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z)) + + + (_SpecColor.xyz * (pow (tmpvar_3.z, specular_7) * tmpvar_11.w)) + ) * _TerrainTreeLightColors[2].xyz)); c_4.xyz = (light_6 * 2.0); c_4.w = 1.0; gl_FragData[0] = c_4; } + +// inputs: 1, stats: 35 alu 4 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt index d669987a3..91f28e873 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-ir.txt @@ -18,13 +18,13 @@ struct v2f_surf { vec3 lightDir; vec3 viewDir; }; -varying vec4 xlv_FOG; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform sampler2D _GlossMap; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _GlossMap; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -114,7 +114,9 @@ vec4 LightingTreeBark ( tmpvar_38 = (tmpvar_37 * s_20.Gloss); spec_25 = tmpvar_38; vec3 tmpvar_39; - tmpvar_39 = ((((s_20.Albedo * _LightColor0.xyz) * diff_27) + (_LightColor0.xyz * spec_25)) * (atten_23 * 2.0)); + tmpvar_39 = ((( + (s_20.Albedo * _LightColor0.xyz) + * diff_27) + (_LightColor0.xyz * spec_25)) * (atten_23 * 2.0)); c_24.xyz = tmpvar_39.xyz.xyz; float tmpvar_40; tmpvar_40 = (((_LightColor0.w * spec_25) * atten_23) * s_20.Alpha); diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt index fd48910e9..692b27e27 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt @@ -1,9 +1,9 @@ -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform vec4 _LightColor0; -uniform sampler2D _GlossMap; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _GlossMap; +uniform vec4 _LightColor0; +uniform sampler2D _MainTex; +uniform float _Shininess; void main () { vec2 tmpvar_1; @@ -13,14 +13,24 @@ void main () vec4 c_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec4 c_5; float tmpvar_6; - tmpvar_6 = (pow (max (0.0, dot (normal_4.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz))))), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w); - c_5.xyz = (((((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_4.xyz, tmpvar_2))) + (_LightColor0.xyz * tmpvar_6)) * 2.0); + tmpvar_6 = (pow (max (0.0, + dot (normal_4.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz)))) + ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w); + c_5.xyz = ((( + ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_4.xyz, tmpvar_2)) + ) + (_LightColor0.xyz * tmpvar_6)) * 2.0); c_5.w = ((_LightColor0.w * tmpvar_6) * _Color.w); c_3.xyz = c_5.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 2, stats: 26 alu 3 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt index 669848d55..53fd1ae95 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-ir.txt @@ -19,15 +19,15 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _GlossMap; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _GlossMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +varying vec4 xlv_FOG; vec4 UnpackNormal ( in vec4 packednormal_1 ) @@ -117,7 +117,9 @@ vec4 LightingTreeBark ( tmpvar_38 = (tmpvar_37 * s_20.Gloss); spec_25 = tmpvar_38; vec3 tmpvar_39; - tmpvar_39 = ((((s_20.Albedo * _LightColor0.xyz) * diff_27) + (_LightColor0.xyz * spec_25)) * (atten_23 * 2.0)); + tmpvar_39 = ((( + (s_20.Albedo * _LightColor0.xyz) + * diff_27) + (_LightColor0.xyz * spec_25)) * (atten_23 * 2.0)); c_24.xyz = tmpvar_39.xyz.xyz; float tmpvar_40; tmpvar_40 = (((_LightColor0.w * spec_25) * atten_23) * s_20.Alpha); diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt index b1849829b..e5bad3d49 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt @@ -1,11 +1,11 @@ -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _GlossMap; -uniform vec4 _Color; uniform sampler2D _BumpMap; +uniform vec4 _Color; +uniform sampler2D _GlossMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; void main () { vec2 tmpvar_1; @@ -15,18 +15,28 @@ void main () vec4 c_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); vec3 tmpvar_5; tmpvar_5 = normalize(gl_TexCoord[1].xyz); float atten_6; atten_6 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w); vec4 c_7; float tmpvar_8; - tmpvar_8 = (pow (max (0.0, dot (normal_4.xyz, normalize((tmpvar_5 + normalize(gl_TexCoord[2].xyz))))), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w); - c_7.xyz = (((((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) * max (0.0, dot (normal_4.xyz, tmpvar_5))) + (_LightColor0.xyz * tmpvar_8)) * (atten_6 * 2.0)); + tmpvar_8 = (pow (max (0.0, + dot (normal_4.xyz, normalize((tmpvar_5 + normalize(gl_TexCoord[2].xyz)))) + ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w); + c_7.xyz = ((( + ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz) + * + max (0.0, dot (normal_4.xyz, tmpvar_5)) + ) + (_LightColor0.xyz * tmpvar_8)) * (atten_6 * 2.0)); c_7.w = (((_LightColor0.w * tmpvar_8) * atten_6) * _Color.w); c_3.xyz = c_7.xyz; c_3.w = 0.0; gl_FragData[0] = c_3; } + +// inputs: 2, stats: 31 alu 5 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt index 959454b60..2af0965e7 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-ir.txt @@ -20,17 +20,17 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -uniform sampler2D _TranslucencyMap; -uniform vec4 _TranslucencyColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _GlossMap; -uniform float _Cutoff; uniform sampler2D _BumpMap; +uniform float _Cutoff; +uniform sampler2D _GlossMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; +varying vec4 xlv_FOG; void xll_clip ( in float x_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt index 2824ede77..5de1ff08b 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt @@ -1,13 +1,13 @@ -uniform sampler2D _TranslucencyMap; -uniform vec4 _TranslucencyColor; -uniform float _Shininess; -uniform sampler2D _MainTex; -uniform sampler2D _LightTextureB0; -uniform samplerCube _LightTexture0; -uniform vec4 _LightColor0; -uniform sampler2D _GlossMap; -uniform float _Cutoff; uniform sampler2D _BumpMap; +uniform float _Cutoff; +uniform sampler2D _GlossMap; +uniform vec4 _LightColor0; +uniform samplerCube _LightTexture0; +uniform sampler2D _LightTextureB0; +uniform sampler2D _MainTex; +uniform float _Shininess; +uniform vec4 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; void main () { vec2 tmpvar_1; @@ -21,7 +21,9 @@ void main () tmpvar_5 = (tmpvar_4.w * gl_Color.w); vec4 normal_6; normal_6.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0); - normal_6.z = sqrt(((1.0 - (normal_6.x * normal_6.x)) - (normal_6.y * normal_6.y))); + normal_6.z = sqrt(((1.0 - + (normal_6.x * normal_6.x) + ) - (normal_6.y * normal_6.y))); float x_7; x_7 = (tmpvar_5 - _Cutoff); if ((x_7 < 0.0)) { @@ -34,9 +36,23 @@ void main () tmpvar_10 = dot (normal_6.xyz, tmpvar_8); float tmpvar_11; tmpvar_11 = max (0.0, -(tmpvar_10)); - c_9.xyz = (((((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ((tmpvar_10 * 0.5) + 0.5)) + (((texture2D (_TranslucencyMap, tmpvar_1).xyz * _TranslucencyColor.xyz) * tmpvar_11) * 2.0))) + ((pow (max (0.0, dot (normal_6.xyz, normalize((tmpvar_8 + normalize(gl_TexCoord[2].xyz))))), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w) * (1.0 - clamp (ceil(tmpvar_11), 0.0, 1.0)))) * _LightColor0.xyz) * ((texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0)); + c_9.xyz = ((( + ((tmpvar_4.xyz * gl_Color.xyz) * (max (0.0, ( + (tmpvar_10 * 0.5) + + 0.5)) + (( + (texture2D (_TranslucencyMap, tmpvar_1).xyz * _TranslucencyColor.xyz) + * tmpvar_11) * 2.0))) + + + ((pow (max (0.0, + dot (normal_6.xyz, normalize((tmpvar_8 + normalize(gl_TexCoord[2].xyz)))) + ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w) * (1.0 - clamp (ceil(tmpvar_11), 0.0, 1.0))) + ) * _LightColor0.xyz) * ((texture2D (_LightTextureB0, vec2( + dot (tmpvar_2, tmpvar_2) + )).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0)); c_3.xyz = c_9.xyz; c_3.w = tmpvar_5; gl_FragData[0] = c_3; } + +// inputs: 2, stats: 41 alu 7 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt index 0dcf80da8..84e650a6a 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-ir.txt @@ -21,18 +21,18 @@ struct v2f_surf { vec2 hip_pack0; vec4 lop_color; }; -uniform sampler2D _TranslucencyMap; -uniform vec4 _TranslucencyColor; -uniform float _Shininess; -uniform sampler2D _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _MainTex; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; -uniform sampler2D _GlossMap; -uniform float _Cutoff; uniform sampler2D _BumpMap; +uniform float _Cutoff; +uniform sampler2D _GlossMap; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _MainTex; +uniform vec4 _ProjectionParams; +uniform sampler2D _ShadowMapTexture; +uniform float _Shininess; +uniform vec4 _TranslucencyColor; +uniform sampler2D _TranslucencyMap; void xll_clip ( in float x_1 ) @@ -291,7 +291,11 @@ vec4 frag_surf ( weights_71 = tmpvar_91; vec4 tmpvar_92; tmpvar_92.w = 1.0; - tmpvar_92.xyz = ((((IN_66._ShadowCoord0 * weights_71.x) + (IN_66._ShadowCoord1 * weights_71.y)) + (IN_66._ShadowCoord2 * weights_71.z)) + (IN_66._ShadowCoord3 * weights_71.w)).xyz; + tmpvar_92.xyz = ((( + (IN_66._ShadowCoord0 * weights_71.x) + + + (IN_66._ShadowCoord1 * weights_71.y) + ) + (IN_66._ShadowCoord2 * weights_71.z)) + (IN_66._ShadowCoord3 * weights_71.w)).xyz; vec4 tmpvar_93; tmpvar_93 = tmpvar_92; coord_70 = tmpvar_93; diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt index be9cfe8fc..81d50eeba 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt @@ -1,11 +1,11 @@ -uniform sampler2D _ShadowMapTexture; -uniform vec4 _ProjectionParams; -uniform sampler2D _MainTex; -uniform vec4 _LightSplitsNear; -uniform vec4 _LightSplitsFar; -uniform vec4 _LightShadowData; -uniform float _Cutoff; uniform sampler2D _BumpMap; +uniform float _Cutoff; +uniform vec4 _LightShadowData; +uniform vec4 _LightSplitsFar; +uniform vec4 _LightSplitsNear; +uniform sampler2D _MainTex; +uniform vec4 _ProjectionParams; +uniform sampler2D _ShadowMapTexture; void main () { vec2 tmpvar_1; @@ -15,7 +15,9 @@ void main () vec4 res_3; vec4 normal_4; normal_4.xy = ((texture2D (_BumpMap, tmpvar_2).wy * 2.0) - 1.0); - normal_4.z = sqrt(((1.0 - (normal_4.x * normal_4.x)) - (normal_4.y * normal_4.y))); + normal_4.z = sqrt(((1.0 - + (normal_4.x * normal_4.x) + ) - (normal_4.y * normal_4.y))); float x_5; x_5 = ((texture2D (_MainTex, tmpvar_2).w * gl_Color.w) - _Cutoff); if ((x_5 < 0.0)) { @@ -25,7 +27,11 @@ void main () tmpvar_6 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar))); vec4 tmpvar_7; tmpvar_7.w = 1.0; - tmpvar_7.xyz = ((((gl_TexCoord[0].xyz * tmpvar_6.x) + (gl_TexCoord[1].xyz * tmpvar_6.y)) + (gl_TexCoord[2].xyz * tmpvar_6.z)) + (gl_TexCoord[3].xyz * tmpvar_6.w)); + tmpvar_7.xyz = ((( + (gl_TexCoord[0].xyz * tmpvar_6.x) + + + (gl_TexCoord[1].xyz * tmpvar_6.y) + ) + (gl_TexCoord[2].xyz * tmpvar_6.z)) + (gl_TexCoord[3].xyz * tmpvar_6.w)); vec4 tmpvar_8; tmpvar_8 = texture2D (_ShadowMapTexture, tmpvar_7.xy); float tmpvar_9; @@ -38,10 +44,14 @@ void main () res_3.y = 1.0; vec2 enc_10; vec2 tmpvar_11; - tmpvar_11 = fract((vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x)); + tmpvar_11 = fract((vec2(1.0, 255.0) * (1.0 - + (tmpvar_1.xxxx * _ProjectionParams.w) + ).x)); enc_10.y = tmpvar_11.y; enc_10.x = (tmpvar_11.x - (tmpvar_11.y * 0.00392157)); res_3.zw = enc_10; gl_FragData[0] = res_3; } + +// inputs: 2, stats: 35 alu 4 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt index 90ce2d961..4f7de8fc0 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-ir.txt @@ -5,8 +5,8 @@ struct v2f { vec2 texcoord; vec3 normal; }; -varying vec4 xlv_FOG; uniform sampler2D _MainTex; +varying vec4 xlv_FOG; vec4 frag ( in v2f i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt index 852501ba4..b968c4b48 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt @@ -4,3 +4,5 @@ void main () gl_FragData[0] = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)); } + +// inputs: 2, stats: 1 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt index 5302a61a1..26eb19b78 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-ir.txt @@ -2,9 +2,9 @@ struct v2f_img { vec4 pos; vec2 uv; }; -uniform sampler2D _MainTex; -uniform sampler2D _CurTex; uniform vec4 _AdaptParams; +uniform sampler2D _CurTex; +uniform sampler2D _MainTex; vec4 frag ( in v2f_img i_1 ) diff --git a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt index 31adeed99..97e57d5c4 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt @@ -1,19 +1,18 @@ -uniform sampler2D _MainTex; -uniform sampler2D _CurTex; uniform vec4 _AdaptParams; +uniform sampler2D _CurTex; +uniform sampler2D _MainTex; void main () { vec2 tmpvar_1; tmpvar_1 = gl_TexCoord[0].xy; vec4 valNew_2; - vec2 delta_3; - vec4 tmpvar_4; - tmpvar_4 = texture2D (_MainTex, tmpvar_1); - vec2 tmpvar_5; - tmpvar_5 = ((texture2D (_CurTex, tmpvar_1).xy - tmpvar_4.xy) * _AdaptParams.x); - delta_3.x = (sign(tmpvar_5.x) * max (0.00392157, abs(tmpvar_5.x))); - delta_3.y = (sign(tmpvar_5.y) * max (0.00392157, abs(tmpvar_5.y))); - valNew_2.xy = (tmpvar_4.xy + delta_3); + vec4 tmpvar_3; + tmpvar_3 = texture2D (_MainTex, tmpvar_1); + vec2 tmpvar_4; + tmpvar_4 = ((texture2D (_CurTex, tmpvar_1).xy - tmpvar_3.xy) * _AdaptParams.x); + valNew_2.xy = (tmpvar_3.xy + (sign(tmpvar_4) * max (vec2(0.00392157, 0.00392157), + abs(tmpvar_4) + ))); valNew_2.x = max (valNew_2.x, _AdaptParams.z); valNew_2.y = min (valNew_2.y, _AdaptParams.y); valNew_2.z = ((valNew_2.x - valNew_2.y) + 0.01); @@ -21,3 +20,5 @@ void main () gl_FragData[0] = valNew_2; } + +// inputs: 1, stats: 12 alu 2 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt index 8dcb34200..c32cf55aa 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-ir.txt @@ -2,9 +2,9 @@ struct v2f { vec4 pos; vec2 uv; }; -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; vec2 maxMag ( in vec2 a_1, in vec2 b_2 diff --git a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt index e04ae6c6a..b54a94b4e 100644 --- a/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt +++ b/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt @@ -1,68 +1,31 @@ -varying vec2 xlv_TEXCOORD0; -uniform vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; +uniform vec4 _MainTex_TexelSize; +varying vec2 xlv_TEXCOORD0; void main () { - int j_1; vec2 mx_2; vec2 uvCorner_3; uvCorner_3 = xlv_TEXCOORD0; mx_2 = texture2D (_MainTex, xlv_TEXCOORD0).xy; - j_1 = 0; - for (int j_1 = 0; j_1 < 8; ) { - vec2 tmpvar_4; - tmpvar_4.x = 0.0; - tmpvar_4.y = float(j_1); - vec4 tmpvar_5; - tmpvar_5 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_4 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_5.xy, vec2(float((dot (tmpvar_5.xy, tmpvar_5.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_6; - tmpvar_6.x = 1.0; - tmpvar_6.y = float(j_1); - vec4 tmpvar_7; - tmpvar_7 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_6 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_7.xy, vec2(float((dot (tmpvar_7.xy, tmpvar_7.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_8; - tmpvar_8.x = 2.0; - tmpvar_8.y = float(j_1); - vec4 tmpvar_9; - tmpvar_9 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_8 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_9.xy, vec2(float((dot (tmpvar_9.xy, tmpvar_9.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_10; - tmpvar_10.x = 3.0; - tmpvar_10.y = float(j_1); - vec4 tmpvar_11; - tmpvar_11 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_10 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_11.xy, vec2(float((dot (tmpvar_11.xy, tmpvar_11.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_12; - tmpvar_12.x = 4.0; - tmpvar_12.y = float(j_1); - vec4 tmpvar_13; - tmpvar_13 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_12 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_13.xy, vec2(float((dot (tmpvar_13.xy, tmpvar_13.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_14; - tmpvar_14.x = 5.0; - tmpvar_14.y = float(j_1); - vec4 tmpvar_15; - tmpvar_15 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_14 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_15.xy, vec2(float((dot (tmpvar_15.xy, tmpvar_15.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_16; - tmpvar_16.x = 6.0; - tmpvar_16.y = float(j_1); - vec4 tmpvar_17; - tmpvar_17 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_16 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_17.xy, vec2(float((dot (tmpvar_17.xy, tmpvar_17.xy) >= dot (mx_2, mx_2))))); - vec2 tmpvar_18; - tmpvar_18.x = 7.0; - tmpvar_18.y = float(j_1); - vec4 tmpvar_19; - tmpvar_19 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_18 * _MainTex_TexelSize.xy))); - mx_2 = mix (mx_2, tmpvar_19.xy, vec2(float((dot (tmpvar_19.xy, tmpvar_19.xy) >= dot (mx_2, mx_2))))); - j_1 = (j_1 + 1); + for (int j_1 = 0; j_1 < 8; j_1++) { + for (int l_4 = 0; l_4 < 8; l_4++) { + vec2 tmpvar_5; + tmpvar_5.x = float(l_4); + tmpvar_5.y = float(j_1); + vec4 tmpvar_6; + tmpvar_6 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_5 * _MainTex_TexelSize.xy))); + mx_2 = mix (mx_2, tmpvar_6.xy, vec2(float(( + dot (tmpvar_6.xy, tmpvar_6.xy) + >= + dot (mx_2, mx_2) + )))); + }; }; - vec4 tmpvar_20; - tmpvar_20.zw = vec2(0.0, 0.0); - tmpvar_20.xy = mx_2; - gl_FragData[0] = tmpvar_20; + vec4 tmpvar_7; + tmpvar_7.zw = vec2(0.0, 0.0); + tmpvar_7.xy = mx_2; + gl_FragData[0] = tmpvar_7; } + +// inputs: 1, stats: 16 alu 2 tex 4 flow diff --git a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp index 8b9546976..abdce65ba 100644 --- a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp +++ b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp @@ -3,6 +3,8 @@ #include #include "../src/glsl/glsl_optimizer.h" +#define GL_GLEXT_PROTOTYPES 1 + #if __linux__ #define GOT_GFX 0 #else @@ -11,6 +13,7 @@ #if GOT_GFX +// ---- Windows GL bits #ifdef _MSC_VER #define GOT_MORE_THAN_GLSL_120 1 #include @@ -34,21 +37,34 @@ static PFNGLCOMPILESHADERARBPROC glCompileShaderARB; static PFNGLGETINFOLOGARBPROC glGetInfoLogARB; static PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; } -#else +#endif // #ifdef _MSC_VER + + +// ---- Apple GL bits +#ifdef __APPLE__ + #define GOT_MORE_THAN_GLSL_120 0 #include -#include +#include +#include #include -#endif +static CGLContextObj s_GLContext; +static CGLContextObj s_GLContext3; +static bool s_GL3Active = false; + +#endif // ifdef __APPLE__ + + +#else // #if GOT_GFX -#else // GOT_GFX #define GOT_MORE_THAN_GLSL_120 0 #include #include #include "dirent.h" #include "GL/gl.h" #include "GL/glext.h" -#endif + +#endif // ! #if GOT_GFX #ifndef _MSC_VER @@ -88,25 +104,52 @@ static bool InitializeOpenGL () HGLRC rc = wglCreateContext( dc ); wglMakeCurrent( dc, rc ); - -#else - GLint attributes[16]; - int i = 0; - attributes[i++]=AGL_RGBA; - attributes[i++]=AGL_PIXEL_SIZE; - attributes[i++]=32; - attributes[i++]=AGL_NO_RECOVERY; - attributes[i++]=AGL_NONE; - AGLPixelFormat pixelFormat = aglChoosePixelFormat(NULL,0,attributes); - AGLContext agl = aglCreateContext(pixelFormat, NULL); - aglSetCurrentContext (agl); +#elif defined(__APPLE__) + + CGLPixelFormatAttribute attributes[] = { + kCGLPFAAccelerated, // no software rendering + (CGLPixelFormatAttribute) 0 + }; + CGLPixelFormatAttribute attributes3[] = { + kCGLPFAAccelerated, // no software rendering + kCGLPFAOpenGLProfile, // core profile with the version stated below + (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core, + (CGLPixelFormatAttribute) 0 + }; + GLint num; + CGLPixelFormatObj pix; + + // create legacy context + CGLChoosePixelFormat(attributes, &pix, &num); + if (pix == NULL) + return false; + CGLCreateContext(pix, NULL, &s_GLContext); + if (s_GLContext == NULL) + return false; + CGLDestroyPixelFormat(pix); + CGLSetCurrentContext(s_GLContext); + + // create core 3.2 context + CGLChoosePixelFormat(attributes3, &pix, &num); + if (pix == NULL) + return false; + CGLCreateContext(pix, NULL, &s_GLContext3); + if (s_GLContext3 == NULL) + return false; + CGLDestroyPixelFormat(pix); #endif // check if we have GLSL const char* extensions = (const char*)glGetString(GL_EXTENSIONS); - hasGLSL = strstr(extensions, "GL_ARB_shader_objects") && strstr(extensions, "GL_ARB_vertex_shader") && strstr(extensions, "GL_ARB_fragment_shader"); + hasGLSL = extensions != NULL && strstr(extensions, "GL_ARB_shader_objects") && strstr(extensions, "GL_ARB_vertex_shader") && strstr(extensions, "GL_ARB_fragment_shader"); + + #if defined(__APPLE__) + // using core profile; always has GLSL + hasGLSL = true; + #endif + #ifdef _MSC_VER if (hasGLSL) @@ -124,6 +167,19 @@ static bool InitializeOpenGL () return hasGLSL; } +static void CleanupGL() +{ +#if GOT_GFX + #ifdef __APPLE__ + CGLSetCurrentContext(NULL); + if (s_GLContext) + CGLDestroyContext(s_GLContext); + if (s_GLContext3) + CGLDestroyContext(s_GLContext3); + #endif // #ifdef __APPLE__ +#endif // #if GOT_GFX +} + static void replace_string (std::string& target, const std::string& search, const std::string& replace, size_t startPos) { if (search.empty()) @@ -148,6 +204,27 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons return true; #endif +# ifdef __APPLE__ + // Mac core context does not accept any older shader versions, so need to switch to + // either legacy context or core one. + const bool need3 = + (source.find("#version 150") != std::string::npos) || + (source.find("#version 300") != std::string::npos); + if (need3) + { + if (!s_GL3Active) + CGLSetCurrentContext(s_GLContext3); + s_GL3Active = true; + } + else + { + if (s_GL3Active) + CGLSetCurrentContext(s_GLContext); + s_GL3Active = false; + } +# endif // ifdef __APPLE__ + + std::string src; if (gles) { @@ -156,6 +233,8 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons src += "#define highp\n"; src += "#define texture2DLodEXT texture2DLod\n"; src += "#define texture2DProjLodEXT texture2DProjLod\n"; + src += "#define texture2DGradEXT texture2DGradARB\n"; + src += "#define textureCubeGradEXT textureCubeGradARB\n"; src += "#define gl_FragDepthEXT gl_FragDepth\n"; src += "float shadow2DEXT (sampler2DShadow s, vec3 p) { return shadow2D(s,p).r; }\n"; src += "float shadow2DProjEXT (sampler2DShadow s, vec4 p) { return shadow2DProj(s,p).r; }\n"; @@ -167,7 +246,11 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons replace_string (src, "#extension GL_OES_standard_derivatives : require", "", 0); replace_string (src, "#extension GL_EXT_shadow_samplers : require", "", 0); replace_string (src, "#extension GL_EXT_frag_depth : require", "", 0); + replace_string (src, "#extension GL_OES_standard_derivatives : enable", "", 0); + replace_string (src, "#extension GL_EXT_shadow_samplers : enable", "", 0); + replace_string (src, "#extension GL_EXT_frag_depth : enable", "", 0); replace_string (src, "precision ", "// precision ", 0); + replace_string (src, "#version 300 es", "#version 330", 0); } const char* sourcePtr = src.c_str(); @@ -212,6 +295,8 @@ static bool ReadStringFromFile (const char* pathName, std::string& output) output.clear(); return false; } + + replace_string(output, "\r\n", "\n", 0); return true; } @@ -326,6 +411,14 @@ static bool TestFile (glslopt_ctx* ctx, bool vertex, { std::string textHir = glslopt_get_raw_output (shader); std::string textOpt = glslopt_get_output (shader); + + char buffer[200]; + int statsAlu, statsTex, statsFlow; + glslopt_shader_get_stats (shader, &statsAlu, &statsTex, &statsFlow); + int inputCount = glslopt_shader_get_input_count (shader); + sprintf(buffer, "\n// inputs: %i, stats: %i alu %i tex %i flow\n", inputCount, statsAlu, statsTex, statsFlow); + textOpt += buffer; + std::string outputHir; ReadStringFromFile (hirPath.c_str(), outputHir); std::string outputOpt; @@ -390,15 +483,19 @@ int main (int argc, const char** argv) } bool hasOpenGL = InitializeOpenGL (); - glslopt_ctx* ctx[2] = { - glslopt_initialize(true), - glslopt_initialize(false), + glslopt_ctx* ctx[3] = { + glslopt_initialize(kGlslTargetOpenGLES20), + glslopt_initialize(kGlslTargetOpenGLES30), + glslopt_initialize(kGlslTargetOpenGL), }; std::string baseFolder = argv[1]; clock_t time0 = clock(); + // 2.39s + // ralloc fix 256 initial: 1.35s + static const char* kTypeName[2] = { "vertex", "fragment" }; size_t tests = 0; size_t errors = 0; @@ -406,11 +503,11 @@ int main (int argc, const char** argv) { std::string testFolder = baseFolder + "/" + kTypeName[type]; - static const char* kAPIName[2] = { "OpenGL ES 2.0", "OpenGL" }; - static const char* kApiIn [2] = {"-inES.txt", "-in.txt"}; - static const char* kApiIR [2] = {"-irES.txt", "-ir.txt"}; - static const char* kApiOut[2] = {"-outES.txt", "-out.txt"}; - for (int api = 0; api < 2; ++api) + static const char* kAPIName[3] = { "OpenGL ES 2.0", "OpenGL ES 3.0", "OpenGL" }; + static const char* kApiIn [3] = {"-inES.txt", "-inES3.txt", "-in.txt"}; + static const char* kApiIR [3] = {"-irES.txt", "-irES3.txt", "-ir.txt"}; + static const char* kApiOut[3] = {"-outES.txt", "-outES3.txt", "-out.txt"}; + for (int api = 0; api < 3; ++api) { printf ("\n** running %s tests for %s...\n", kTypeName[type], kAPIName[api]); StringVector inputFiles = GetFiles (testFolder, kApiIn[api]); @@ -445,6 +542,7 @@ int main (int argc, const char** argv) for (int i = 0; i < 2; ++i) glslopt_cleanup (ctx[i]); + CleanupGL(); return errors ? 1 : 0; } diff --git a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.vcproj b/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.vcproj deleted file mode 100644 index 2d3ddf879..000000000 --- a/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.vcproj +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/3rdparty/glsl-optimizer/tests/tests.gyp b/3rdparty/glsl-optimizer/tests/tests.gyp new file mode 100644 index 000000000..e69de29bb diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt index c6c4b1f9e..440076458 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt @@ -74,7 +74,7 @@ highp float CalcFadeOutFactor( in highp float dist ); highp float CalcDistScale( in highp float dist ); v2f xlat_main( in appdata_full v ); void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up ) { - up = (( (abs( dir.y ) > 0.999000) ) ? ( highp vec3( 0.00000, 0.00000, 1.00000) ) : ( highp vec3( 0.00000, 1.00000, 0.00000) )); + up = (( (abs( dir.y ) > 0.999000) ) ? ( vec3( 0.0, 0.0, 1.0) ) : ( vec3( 0.0, 1.0, 0.0) )); right = normalize( cross( up, dir) ); up = cross( dir, right); } diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt index 63a4d22b2..3bf5c3295 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-irES.txt @@ -11,32 +11,32 @@ struct appdata_full { highp vec4 texcoord1; highp vec4 color; }; -varying lowp vec4 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_SV_POSITION; -attribute vec4 TANGENT; -uniform highp mat4 glstate_matrix_mvp; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 _World2Object; -uniform highp float _VerticalBillboarding; -uniform highp float _TimeOnDuration; -uniform highp float _TimeOffDuration; -uniform highp vec4 _Time; -uniform highp float _SizeGrowStartDist; -uniform highp float _SizeGrowEndDist; -uniform highp float _NoiseAmount; -uniform highp float _Multiplier; -uniform highp float _MaxGrowSize; -uniform highp float _FadeOutDistNear; -uniform highp float _FadeOutDistFar; -uniform highp vec4 _Color; -uniform highp float _BlinkingTimeOffsScale; -uniform highp float _Bias; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp float _Bias; +uniform highp float _BlinkingTimeOffsScale; +uniform highp vec4 _Color; +uniform highp float _FadeOutDistFar; +uniform highp float _FadeOutDistNear; +uniform highp float _MaxGrowSize; +uniform highp float _Multiplier; +uniform highp float _NoiseAmount; +uniform highp float _SizeGrowEndDist; +uniform highp float _SizeGrowStartDist; +uniform highp vec4 _Time; +uniform highp float _TimeOffDuration; +uniform highp float _TimeOnDuration; +uniform highp float _VerticalBillboarding; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp mat4 glstate_matrix_mvp; +attribute vec4 TANGENT; +varying highp vec4 xlv_SV_POSITION; +varying highp vec2 xlv_TEXCOORD0; +varying lowp vec4 xlv_TEXCOORD1; float xll_mod ( in float x_1, in float y_2 @@ -434,7 +434,11 @@ v2f xlat_main ( tmpvar_137 = ((rightLocal_118 * v_106.normal.x) + (upLocal_117 * v_106.normal.y)); BBNormal_115 = tmpvar_137; highp vec3 tmpvar_138; - tmpvar_138 = ((centerLocal_122 - ((rightLocal_118 * centerOffs_123.x) + (upLocal_117 * centerOffs_123.y))) + (BBNormal_115 * distScale_116)); + tmpvar_138 = ((centerLocal_122 - ( + (rightLocal_118 * centerOffs_123.x) + + + (upLocal_117 * centerOffs_123.y) + )) + (BBNormal_115 * distScale_116)); BBLocalPos_114 = tmpvar_138; highp float tmpvar_139; tmpvar_139 = (_Time.y + (_BlinkingTimeOffsScale * v_106.color.z)); diff --git a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt index 93cd8eaa2..9545d98ac 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt @@ -1,28 +1,28 @@ -varying lowp vec4 xlv_TEXCOORD1; -varying highp vec2 xlv_TEXCOORD0; -varying highp vec4 xlv_SV_POSITION; -uniform highp mat4 glstate_matrix_mvp; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 _World2Object; -uniform highp float _VerticalBillboarding; -uniform highp float _TimeOnDuration; -uniform highp float _TimeOffDuration; -uniform highp vec4 _Time; -uniform highp float _SizeGrowStartDist; -uniform highp float _SizeGrowEndDist; -uniform highp float _NoiseAmount; -uniform highp float _Multiplier; -uniform highp float _MaxGrowSize; -uniform highp float _FadeOutDistNear; -uniform highp float _FadeOutDistFar; -uniform highp vec4 _Color; -uniform highp float _BlinkingTimeOffsScale; -uniform highp float _Bias; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp float _Bias; +uniform highp float _BlinkingTimeOffsScale; +uniform highp vec4 _Color; +uniform highp float _FadeOutDistFar; +uniform highp float _FadeOutDistNear; +uniform highp float _MaxGrowSize; +uniform highp float _Multiplier; +uniform highp float _NoiseAmount; +uniform highp float _SizeGrowEndDist; +uniform highp float _SizeGrowStartDist; +uniform highp vec4 _Time; +uniform highp float _TimeOffDuration; +uniform highp float _TimeOnDuration; +uniform highp float _VerticalBillboarding; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp mat4 glstate_matrix_mvp; +varying highp vec4 xlv_SV_POSITION; +varying highp vec2 xlv_TEXCOORD0; +varying lowp vec4 xlv_TEXCOORD1; void main () { highp vec3 tmpvar_1; @@ -62,9 +62,21 @@ void main () highp vec3 tmpvar_15; tmpvar_15 = ((dir_11.yzx * tmpvar_14.zxy) - (dir_11.zxy * tmpvar_14.yzx)); highp float tmpvar_16; - tmpvar_16 = min ((max ((tmpvar_10 - _SizeGrowStartDist), 0.0) / _SizeGrowEndDist), 1.0); + tmpvar_16 = min ((max ( + (tmpvar_10 - _SizeGrowStartDist) + , 0.0) / _SizeGrowEndDist), 1.0); highp vec3 tmpvar_17; - tmpvar_17 = ((tmpvar_7 - ((tmpvar_14 * tmpvar_6.x) + (tmpvar_15 * tmpvar_6.y))) + (((tmpvar_14 * tmpvar_1.x) + (tmpvar_15 * tmpvar_1.y)) * (((tmpvar_16 * tmpvar_16) * _MaxGrowSize) * tmpvar_2.w))); + tmpvar_17 = ((tmpvar_7 - ( + (tmpvar_14 * tmpvar_6.x) + + + (tmpvar_15 * tmpvar_6.y) + )) + (( + (tmpvar_14 * tmpvar_1.x) + + + (tmpvar_15 * tmpvar_1.y) + ) * ( + ((tmpvar_16 * tmpvar_16) * _MaxGrowSize) + * tmpvar_2.w))); highp float tmpvar_18; tmpvar_18 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z)); highp float y_19; @@ -79,18 +91,28 @@ void main () } else { tmpvar_22 = -(tmpvar_21); }; - highp float t_23; - t_23 = max (min ((tmpvar_22 / (_TimeOnDuration * 0.25)), 1.0), 0.0); + highp float tmpvar_23; + tmpvar_23 = clamp ((tmpvar_22 / (_TimeOnDuration * 0.25)), 0.0, 1.0); highp float edge0_24; edge0_24 = (_TimeOnDuration * 0.75); - highp float t_25; - t_25 = max (min (((tmpvar_22 - edge0_24) / (_TimeOnDuration - edge0_24)), 1.0), 0.0); + highp float tmpvar_25; + tmpvar_25 = clamp (((tmpvar_22 - edge0_24) / (_TimeOnDuration - edge0_24)), 0.0, 1.0); highp float tmpvar_26; - tmpvar_26 = ((t_23 * (t_23 * (3.0 - (2.0 * t_23)))) * (1.0 - (t_25 * (t_25 * (3.0 - (2.0 * t_25)))))); + tmpvar_26 = ((tmpvar_23 * (tmpvar_23 * + (3.0 - (2.0 * tmpvar_23)) + )) * (1.0 - (tmpvar_25 * + (tmpvar_25 * (3.0 - (2.0 * tmpvar_25))) + ))); highp float tmpvar_27; tmpvar_27 = (tmpvar_18 * (6.28319 / _TimeOnDuration)); highp float tmpvar_28; - tmpvar_28 = ((_NoiseAmount * (sin(tmpvar_27) * ((0.5 * cos(((tmpvar_27 * 0.6366) + 56.7272))) + 0.5))) + (1.0 - _NoiseAmount)); + tmpvar_28 = ((_NoiseAmount * ( + sin(tmpvar_27) + * + ((0.5 * cos(( + (tmpvar_27 * 0.6366) + + 56.7272))) + 0.5) + )) + (1.0 - _NoiseAmount)); highp float tmpvar_29; if ((_NoiseAmount < 0.01)) { tmpvar_29 = tmpvar_26; @@ -103,14 +125,20 @@ void main () highp float tmpvar_31; tmpvar_31 = clamp ((tmpvar_10 / _FadeOutDistNear), 0.0, 1.0); highp float tmpvar_32; - tmpvar_32 = (1.0 - clamp ((max ((tmpvar_10 - _FadeOutDistFar), 0.0) * 0.2), 0.0, 1.0)); + tmpvar_32 = (1.0 - clamp (( + max ((tmpvar_10 - _FadeOutDistFar), 0.0) + * 0.2), 0.0, 1.0)); highp float tmpvar_33; tmpvar_33 = (tmpvar_31 * tmpvar_31); highp vec4 tmpvar_34; - tmpvar_34 = (((((tmpvar_33 * tmpvar_33) * (tmpvar_32 * tmpvar_32)) * _Color) * _Multiplier) * (tmpvar_29 + _Bias)); + tmpvar_34 = ((( + ((tmpvar_33 * tmpvar_33) * (tmpvar_32 * tmpvar_32)) + * _Color) * _Multiplier) * (tmpvar_29 + _Bias)); tmpvar_3 = tmpvar_34; xlv_SV_POSITION = (glstate_matrix_mvp * tmpvar_30); xlv_TEXCOORD0 = _glesMultiTexCoord0.xy; xlv_TEXCOORD1 = tmpvar_3; } + +// inputs: 5, stats: 95 alu 0 tex 3 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt new file mode 100644 index 000000000..6bc638390 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt @@ -0,0 +1,13 @@ +// https://github.com/aras-p/glsl-optimizer/issues/48 + +attribute vec3 _in_position; + +uniform mat4 mtx; + +void main() +{ + mat4 m = mtx; + // chained assignments used to not work, #48 + m[0][1] = m[0][2] = m[0][3] = 0.0; + gl_Position = m * vec4(_in_position,1); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt new file mode 100644 index 000000000..808398706 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-ir.txt @@ -0,0 +1,25 @@ +attribute vec3 _in_position; +uniform mat4 mtx; +void main () +{ + mat4 m_1; + mat4 tmpvar_2; + tmpvar_2 = mtx; + m_1 = tmpvar_2; + vec4 tmpvar_3; + tmpvar_3 = m_1[0]; tmpvar_3.w = 0.0; + m_1[0] = tmpvar_3; + vec4 tmpvar_4; + tmpvar_4 = m_1[0]; tmpvar_4.z = tmpvar_3[3]; + m_1[0] = tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = m_1[0]; tmpvar_5.y = tmpvar_4[2]; + m_1[0] = tmpvar_5; + vec4 tmpvar_6; + tmpvar_6.w = 1.0; + tmpvar_6.xyz = _in_position.xyz; + vec4 tmpvar_7; + tmpvar_7 = (m_1 * tmpvar_6); + gl_Position = tmpvar_7; +} + diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt new file mode 100644 index 000000000..d247fc3db --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt @@ -0,0 +1,21 @@ +attribute vec3 _in_position; +uniform mat4 mtx; +void main () +{ + mat4 m_1; + m_1 = mtx; + vec4 tmpvar_2; + tmpvar_2 = mtx[0]; tmpvar_2.w = 0.0; + m_1[0] = tmpvar_2; + vec4 tmpvar_3; + tmpvar_3 = m_1[0]; tmpvar_3.z = tmpvar_2.w; + m_1[0] = tmpvar_3; + m_1[0] = m_1[0]; m_1[0].y = tmpvar_3.z; + vec4 tmpvar_4; + tmpvar_4.w = 1.0; + tmpvar_4.xyz = _in_position; + gl_Position = (m_1 * tmpvar_4); +} + + +// inputs: 1, stats: 5 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt new file mode 100644 index 000000000..342409325 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt @@ -0,0 +1,14 @@ +// https://github.com/aras-p/glsl-optimizer/issues/18 + +struct shadow_map_t +{ + mat4 transform; +}; + +uniform shadow_map_t ShadowMaps[1]; +attribute vec3 _in_position; + +void main() +{ + gl_Position = ShadowMaps[0].transform * vec4(_in_position,1); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt new file mode 100644 index 000000000..b52a892c8 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-ir.txt @@ -0,0 +1,15 @@ +struct shadow_map_t { + mat4 transform; +}; +uniform shadow_map_t ShadowMaps[1]; +attribute vec3 _in_position; +void main () +{ + vec4 tmpvar_1; + tmpvar_1.w = 1.0; + tmpvar_1.xyz = _in_position.xyz; + vec4 tmpvar_2; + tmpvar_2 = (ShadowMaps[0].transform * tmpvar_1); + gl_Position = tmpvar_2; +} + diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt new file mode 100644 index 000000000..d16bc45bc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt @@ -0,0 +1,15 @@ +struct shadow_map_t { + mat4 transform; +}; +uniform shadow_map_t ShadowMaps[1]; +attribute vec3 _in_position; +void main () +{ + vec4 tmpvar_1; + tmpvar_1.w = 1.0; + tmpvar_1.xyz = _in_position; + gl_Position = (ShadowMaps[0].transform * tmpvar_1); +} + + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt index a386d348a..6d6071e9c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-ir.txt @@ -1,6 +1,6 @@ -varying vec4 var4ok; -varying float var1; varying vec4 var4; +varying float var1; +varying vec4 var4ok; void main () { vec4 tmpvar_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt index 4a1657f87..1daf4b589 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt @@ -1,6 +1,6 @@ -varying vec4 var4ok; -varying float var1; varying vec4 var4; +varying float var1; +varying vec4 var4ok; void main () { var4 = vec4(0.0, 0.0, 0.0, 0.0); @@ -8,3 +8,5 @@ void main () var4ok = gl_Vertex; } + +// inputs: 1, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt index 6c3f232f7..27154eefb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/estest1-ir.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform mat4 modelViewProjectionMatrix; attribute vec4 position; +uniform mat4 modelViewProjectionMatrix; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; void main () { vec4 tmpvar_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt index 77e06763b..e4f69b7fa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform mat4 modelViewProjectionMatrix; attribute vec4 position; +uniform mat4 modelViewProjectionMatrix; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; void main () { gl_Position = (modelViewProjectionMatrix * position); @@ -15,3 +15,5 @@ void main () xlv_TEXCOORD1 = tmpvar_2; } + +// inputs: 1, stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt index d56219332..237c56880 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-ir.txt @@ -1,8 +1,8 @@ #version 140 -out vec4 col; -in vec4 icol; -in vec4 position; uniform vec2 p; +in vec4 position; +in vec4 icol; +out vec4 col; void main () { vec4 tmpvar_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt index d651533ac..9de971476 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt @@ -1,8 +1,8 @@ #version 140 -out vec4 col; -in vec4 icol; -in vec4 position; uniform vec2 p; +in vec4 position; +in vec4 icol; +out vec4 col; void main () { col = icol; @@ -12,3 +12,5 @@ void main () gl_Position = (tmpvar_1 + position); } + +// inputs: 2, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt index edcd13b87..b8fdde133 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-ir.txt @@ -1,9 +1,9 @@ #version 140 -flat out ivec4 colint; -out vec4 col; -in vec4 icol; -in vec4 position; uniform vec2 p; +in vec4 position; +in vec4 icol; +out vec4 col; +flat out ivec4 colint; void main () { vec4 tmpvar_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt index 36fe7178f..45e81e3a2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt @@ -1,8 +1,8 @@ #version 140 -flat out ivec4 colint; -out vec4 col; -in vec4 position; uniform vec2 p; +in vec4 position; +out vec4 col; +flat out ivec4 colint; void main () { vec4 tmpvar_1; @@ -14,8 +14,14 @@ void main () colint.z = (gl_InstanceID << 2); colint.w = (gl_VertexID + colint.y); col.x = trunc(position.x); - col.y = roundEven(position.y); - col.z = roundEven(position.y); - col.w = (0.5 * (exp(position.w) + exp(-(position.w)))); + float cse_2; + cse_2 = roundEven(position.y); + col.y = cse_2; + col.z = cse_2; + col.w = (0.5 * (exp(position.w) + exp( + -(position.w) + ))); } + +// inputs: 1, stats: 12 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt index 5c435a2a0..e4066b2ea 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-ir.txt @@ -6,13 +6,13 @@ struct appdata { vec4 vertex; vec3 normal; }; -varying vec4 xlv_TEXCOORD0; -uniform vec4 unity_LightPosition[4]; -uniform vec4 unity_LightColor[4]; -uniform vec4 unity_LightAtten[4]; -uniform mat4 UNITY_MATRIX_MVP; -uniform mat4 UNITY_MATRIX_MV; uniform mat4 UNITY_MATRIX_IT_MV; +uniform mat4 UNITY_MATRIX_MV; +uniform mat4 UNITY_MATRIX_MVP; +uniform vec4 unity_LightAtten[4]; +uniform vec4 unity_LightColor[4]; +uniform vec4 unity_LightPosition[4]; +varying vec4 xlv_TEXCOORD0; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt index eadb7c1ee..ff49769a6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_TEXCOORD0; -uniform vec4 unity_LightPosition[4]; -uniform vec4 unity_LightColor[4]; -uniform vec4 unity_LightAtten[4]; -uniform mat4 UNITY_MATRIX_MVP; -uniform mat4 UNITY_MATRIX_MV; uniform mat4 UNITY_MATRIX_IT_MV; +uniform mat4 UNITY_MATRIX_MV; +uniform mat4 UNITY_MATRIX_MVP; +uniform vec4 unity_LightAtten[4]; +uniform vec4 unity_LightColor[4]; +uniform vec4 unity_LightPosition[4]; +varying vec4 xlv_TEXCOORD0; void main () { vec3 lightColor_1; @@ -18,10 +18,18 @@ void main () viewN_2 = (tmpvar_4 * gl_Normal); vec3 tmpvar_5; tmpvar_5 = (unity_LightPosition[0].xyz - viewpos_3); - lightColor_1 = (unity_LightColor[0].xyz * (max (0.0, dot (viewN_2, normalize(tmpvar_5))) * (1.0/((1.0 + (dot (tmpvar_5, tmpvar_5) * unity_LightAtten[0].z)))))); + lightColor_1 = (unity_LightColor[0].xyz * (max (0.0, + dot (viewN_2, normalize(tmpvar_5)) + ) * (1.0/( + (1.0 + (dot (tmpvar_5, tmpvar_5) * unity_LightAtten[0].z)) + )))); vec3 tmpvar_6; tmpvar_6 = (unity_LightPosition[1].xyz - viewpos_3); - lightColor_1 = (lightColor_1 + (unity_LightColor[1].xyz * (max (0.0, dot (viewN_2, normalize(tmpvar_6))) * (1.0/((1.0 + (dot (tmpvar_6, tmpvar_6) * unity_LightAtten[1].z))))))); + lightColor_1 = (lightColor_1 + (unity_LightColor[1].xyz * ( + max (0.0, dot (viewN_2, normalize(tmpvar_6))) + * + (1.0/((1.0 + (dot (tmpvar_6, tmpvar_6) * unity_LightAtten[1].z)))) + ))); vec4 tmpvar_7; tmpvar_7.w = 1.0; tmpvar_7.xyz = (lightColor_1 * 2.0); @@ -29,3 +37,5 @@ void main () xlv_TEXCOORD0 = tmpvar_7; } + +// inputs: 2, stats: 26 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt index 3be422d75..96f05b68b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-ir.txt @@ -1,5 +1,5 @@ -varying vec4 varColor; uniform vec4 uniColors[4]; +varying vec4 varColor; void main () { int i_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt index 668f0df24..4ffab2942 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt @@ -1,5 +1,5 @@ -varying vec4 varColor; uniform vec4 uniColors[4]; +varying vec4 varColor; void main () { vec4 col_1; @@ -11,3 +11,5 @@ void main () varColor = col_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt index 31db1ab8e..997faa55d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-irES.txt @@ -6,15 +6,15 @@ struct appdata { highp vec4 vertex; highp vec3 normal; }; -varying mediump vec4 xlv_TEXCOORD0; -uniform highp vec4 unity_LightColor[4]; -uniform highp vec4 unity_LightAtten[4]; -uniform highp mat4 UNITY_MATRIX_MVP; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp mat4 UNITY_MATRIX_MVP; +uniform highp vec4 unity_LightAtten[4]; +uniform highp vec4 unity_LightColor[4]; +varying mediump vec4 xlv_TEXCOORD0; v2f xlat_main ( in appdata v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt index 6989523d9..5a6f8f776 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt @@ -1,8 +1,8 @@ -varying mediump vec4 xlv_TEXCOORD0; -uniform highp vec4 unity_LightColor[4]; -uniform highp vec4 unity_LightAtten[4]; -uniform highp mat4 UNITY_MATRIX_MVP; attribute highp vec4 _glesVertex; +uniform highp mat4 UNITY_MATRIX_MVP; +uniform highp vec4 unity_LightAtten[4]; +uniform highp vec4 unity_LightColor[4]; +varying mediump vec4 xlv_TEXCOORD0; void main () { mediump vec4 tmpvar_1; @@ -62,3 +62,5 @@ void main () xlv_TEXCOORD0 = tmpvar_2; } + +// inputs: 1, stats: 20 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt index 86f8c0306..5d1ac310b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-ir.txt @@ -1,5 +1,5 @@ -varying vec4 varColor; uniform vec4 uniColors[4]; +varying vec4 varColor; void main () { int i_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt index 6ad258137..9d851c1a1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt @@ -1,5 +1,5 @@ -varying vec4 varColor; uniform vec4 uniColors[4]; +varying vec4 varColor; void main () { vec4 col_1; @@ -11,3 +11,5 @@ void main () varColor = col_1; } + +// inputs: 1, stats: 7 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt index ca8b1aaf9..f5294ef94 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt @@ -5,3 +5,5 @@ void main () gl_Position = vec4((((gl_Vertex.x + tmpvar_1) + (gl_Vertex.x * tmpvar_1)) + sqrt(tmpvar_1))); } + +// inputs: 1, stats: 6 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt index 565e42f28..d5eff77ed 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-ir.txt @@ -6,8 +6,8 @@ void main () tmpvar_3 = (gl_ModelViewProjectionMatrix * gl_Vertex); gl_Position = tmpvar_3; mat3 tmpvar_4; - tmpvar_4 = (mat3(0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1)); - m_2 = (tmpvar_4); + tmpvar_4 = mat3(0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1); + m_2 = tmpvar_4; vec3 tmpvar_5; tmpvar_5 = (m_2 * gl_Normal); n_1 = tmpvar_5; diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt index 392ae7f34..5a85534a1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt @@ -7,3 +7,5 @@ void main () gl_FrontColor = tmpvar_1; } + +// inputs: 2, stats: 5 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt index 5549b6c13..f1fa14d19 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-irES.txt @@ -9,23 +9,23 @@ struct appdata { highp vec4 tangent; highp vec3 normal; }; -varying lowp vec3 varViewDir; -varying lowp vec3 varLightDir; -varying lowp vec3 varWorldN; -uniform highp vec4 unity_Scale; -uniform lowp vec4 _WorldSpaceLightPos0; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 _World2Object; -uniform highp mat4 _Object2World; -attribute vec4 attrTangent; -attribute vec3 attrNormal; -attribute vec4 attrVertex; -uniform mat4 glstate_matrix_mvp; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform mat4 glstate_matrix_mvp; +attribute vec4 attrVertex; +attribute vec3 attrNormal; +attribute vec4 attrTangent; +uniform highp mat4 _Object2World; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform lowp vec4 _WorldSpaceLightPos0; +uniform highp vec4 unity_Scale; +varying lowp vec3 varWorldN; +varying lowp vec3 varLightDir; +varying lowp vec3 varViewDir; mat3 xll_transpose ( in mat3 m_1 ) @@ -148,8 +148,8 @@ v2f_surf vert_surf ( mat3 tmpvar_44; tmpvar_44 = xll_transpose (tmpvar_40); mat3 tmpvar_45; - tmpvar_45 = (tmpvar_44); - rotation_30 = (tmpvar_45); + tmpvar_45 = tmpvar_44; + rotation_30 = tmpvar_45; highp vec3 tmpvar_46; tmpvar_46 = ObjSpaceLightDir (v_27.vertex); highp vec3 tmpvar_47; diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt index 525b70504..9255730b9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt @@ -1,15 +1,15 @@ -varying lowp vec3 varViewDir; -varying lowp vec3 varLightDir; -varying lowp vec3 varWorldN; -uniform highp vec4 unity_Scale; -uniform lowp vec4 _WorldSpaceLightPos0; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 _World2Object; -uniform highp mat4 _Object2World; -attribute vec4 attrTangent; -attribute vec3 attrNormal; -attribute vec4 attrVertex; uniform mat4 glstate_matrix_mvp; +attribute vec4 attrVertex; +attribute vec3 attrNormal; +attribute vec4 attrTangent; +uniform highp mat4 _Object2World; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform lowp vec4 _WorldSpaceLightPos0; +uniform highp vec4 unity_Scale; +varying lowp vec3 varWorldN; +varying lowp vec3 varLightDir; +varying lowp vec3 varViewDir; void main () { lowp vec3 tmpvar_1; @@ -43,7 +43,9 @@ void main () tmpvar_10.w = 1.0; tmpvar_10.xyz = _WorldSpaceCameraPos; highp vec3 tmpvar_11; - tmpvar_11 = normalize((tmpvar_9 + normalize((tmpvar_8 * (((_World2Object * tmpvar_10).xyz * unity_Scale.w) - attrVertex.xyz))))); + tmpvar_11 = normalize((tmpvar_9 + normalize( + (tmpvar_8 * (((_World2Object * tmpvar_10).xyz * unity_Scale.w) - attrVertex.xyz)) + ))); tmpvar_2 = tmpvar_11; gl_Position = (glstate_matrix_mvp * attrVertex); varWorldN = tmpvar_3; @@ -51,3 +53,5 @@ void main () varViewDir = tmpvar_2; } + +// inputs: 3, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt index e54f61ce2..b3496af6d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-ir.txt @@ -1,10 +1,10 @@ -uniform vec4 v3c; -uniform vec4 v3b; -uniform vec4 v3a; -uniform mat3 m3c; -uniform mat3 m3b; -uniform mat3 m3a; uniform mat4 mvp; +uniform mat3 m3a; +uniform mat3 m3b; +uniform mat3 m3c; +uniform vec4 v3a; +uniform vec4 v3b; +uniform vec4 v3c; void main () { vec3 rc_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt index 6a5fce0b1..99ef221bb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt @@ -1,16 +1,22 @@ -uniform vec4 v3c; -uniform vec4 v3b; -uniform vec4 v3a; -uniform mat3 m3c; -uniform mat3 m3b; -uniform mat3 m3a; uniform mat4 mvp; +uniform mat3 m3a; +uniform mat3 m3b; +uniform mat3 m3c; +uniform vec4 v3a; +uniform vec4 v3b; +uniform vec4 v3c; void main () { gl_Position = (mvp * gl_Vertex); vec4 tmpvar_1; tmpvar_1.w = 1.0; - tmpvar_1.xyz = (((m3a * (gl_Vertex.xyz - v3a.xyz)) + (m3b * (gl_Vertex.xyz - (mvp * v3b).xyz))) + (m3c * (gl_Vertex.xyz - v3c.xyz))); + tmpvar_1.xyz = (((m3a * + (gl_Vertex.xyz - v3a.xyz) + ) + (m3b * + (gl_Vertex.xyz - (mvp * v3b).xyz) + )) + (m3c * (gl_Vertex.xyz - v3c.xyz))); gl_FrontColor = tmpvar_1; } + +// inputs: 1, stats: 11 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt new file mode 100644 index 000000000..5019ea3dc --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt @@ -0,0 +1,6 @@ +varying vec3 var_a; + +void main() { + gl_Position = gl_Vertex * normalize(vec4(1.0,2.0,3.0,4.0)); + var_a = gl_Vertex.xyz * normalize(vec3(0.0)); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt new file mode 100644 index 000000000..219745786 --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-ir.txt @@ -0,0 +1,15 @@ +varying vec3 var_a; +void main () +{ + vec4 tmpvar_1; + tmpvar_1 = normalize (vec4(1.0, 2.0, 3.0, 4.0)); + vec4 tmpvar_2; + tmpvar_2 = (gl_Vertex * tmpvar_1); + gl_Position = tmpvar_2; + vec3 tmpvar_3; + tmpvar_3 = normalize (vec3(0.0, 0.0, 0.0)); + vec3 tmpvar_4; + tmpvar_4 = (gl_Vertex.xyz * tmpvar_3); + var_a = tmpvar_4; +} + diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt new file mode 100644 index 000000000..7e3642aee --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt @@ -0,0 +1,9 @@ +varying vec3 var_a; +void main () +{ + gl_Position = (gl_Vertex * vec4(0.182574, 0.365148, 0.547723, 0.730297)); + var_a = (gl_Vertex.xyz * normalize(vec3(0.0, 0.0, 0.0))); +} + + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt index b0bf7293b..a89eee3ae 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-ir.txt @@ -7,8 +7,8 @@ struct v2f { vec3 backContrib; vec3 nl; }; -uniform float _TranslucencyViewDependency; uniform vec3 _TerrainTreeLightDirections[4]; +uniform float _TranslucencyViewDependency; v2f vert ( in appdata_full v_1 ) @@ -47,14 +47,14 @@ v2f vert ( backContrib_8 = tmpvar_15; float tmpvar_16; tmpvar_16 = mix (-(nl_9), backContrib_8, _TranslucencyViewDependency); - float tmpvar_17; - tmpvar_17 = tmpvar_16; - o_4.backContrib[j_2] = tmpvar_17; + vec3 tmpvar_17; + tmpvar_17 = o_4.backContrib; tmpvar_17[j_2] = tmpvar_16; + o_4.backContrib = tmpvar_17; float tmpvar_18; tmpvar_18 = max (0.0, ((nl_9 * 0.6) + 0.4)); - float tmpvar_19; - tmpvar_19 = tmpvar_18; - o_4.nl[j_2] = tmpvar_19; + vec3 tmpvar_19; + tmpvar_19 = o_4.nl; tmpvar_19[j_2] = tmpvar_18; + o_4.nl = tmpvar_19; int _post_incdec_tmp_20; _post_incdec_tmp_20 = j_2; int tmpvar_21; diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt index 85e116688..9a7a91390 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt @@ -1,5 +1,5 @@ -uniform float _TranslucencyViewDependency; uniform vec3 _TerrainTreeLightDirections[4]; +uniform float _TranslucencyViewDependency; void main () { vec3 tmpvar_1; @@ -33,3 +33,5 @@ void main () gl_TexCoord[3] = tmpvar_10; } + +// inputs: 2, stats: 32 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt index 53eac9e60..6790386aa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-ir.txt @@ -1,8 +1,8 @@ -attribute vec3 myUnused; -attribute vec4 myColor; -uniform float unusedFloat; -uniform mat4 unusedMatrix; uniform mat4 mvp; +uniform mat4 unusedMatrix; +uniform float unusedFloat; +attribute vec4 myColor; +attribute vec3 myUnused; void main () { vec4 tmpvar_1; diff --git a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt index 20381eaa6..3a8d8b449 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt @@ -1,8 +1,10 @@ -attribute vec4 myColor; uniform mat4 mvp; +attribute vec4 myColor; void main () { gl_Position = (mvp * gl_Vertex); gl_FrontColor = myColor; } + +// inputs: 2, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt b/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt index 718ecd892..1d7689a47 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt @@ -8,3 +8,5 @@ void main () texcoord.w = gl_Vertex.x; } + +// inputs: 1, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt b/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt index c6927fdd5..fc0488b96 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt @@ -30,12 +30,12 @@ varying lowp vec4 xlv_COLOR; void main() { v2f xl_retval; a2v xlt_v; - xlt_v.pos = highp vec4( gl_Vertex); - xlt_v.uv = highp vec2( gl_MultiTexCoord0); - xlt_v.normal = mediump vec3( gl_Normal); - xlt_v.color = lowp vec4( gl_Color); + xlt_v.pos = vec4( gl_Vertex); + xlt_v.uv = vec2( gl_MultiTexCoord0); + xlt_v.normal = vec3( gl_Normal); + xlt_v.color = vec4( gl_Color); xl_retval = xlat_main( xlt_v); - gl_Position = highp vec4( xl_retval.pos); - xlv_TEXCOORD0 = mediump vec2( xl_retval.uv); - xlv_COLOR = lowp vec4( xl_retval.color); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec2( xl_retval.uv); + xlv_COLOR = vec4( xl_retval.color); } diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt index 79de32358..f82c1f3f4 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-ir.txt @@ -9,9 +9,9 @@ struct a2v { vec3 normal; vec4 color; }; -varying vec4 xlv_COLOR; -varying vec2 xlv_TEXCOORD0; uniform mat4 mvp; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_COLOR; v2f xlat_main ( in a2v v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt index e0d25fa2b..54bc70a03 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-irES.txt @@ -9,14 +9,14 @@ struct a2v { mediump vec3 normal; lowp vec4 color; }; -varying lowp vec4 xlv_COLOR; -varying mediump vec2 xlv_TEXCOORD0; -uniform highp mat4 mvp; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp mat4 mvp; +varying mediump vec2 xlv_TEXCOORD0; +varying lowp vec4 xlv_COLOR; v2f xlat_main ( in a2v v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-out.txt b/3rdparty/glsl-optimizer/tests/vertex/types-out.txt index 88c255e46..14a6ccbf9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-out.txt @@ -1,6 +1,6 @@ -varying vec4 xlv_COLOR; -varying vec2 xlv_TEXCOORD0; uniform mat4 mvp; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_COLOR; void main () { vec4 tmpvar_1; @@ -11,3 +11,5 @@ void main () xlv_COLOR = tmpvar_1; } + +// inputs: 4, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt index cc0f4ccbd..fffde4d82 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt @@ -1,10 +1,10 @@ -varying lowp vec4 xlv_COLOR; -varying mediump vec2 xlv_TEXCOORD0; -uniform highp mat4 mvp; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute lowp vec4 _glesColor; +uniform highp mat4 mvp; +varying mediump vec2 xlv_TEXCOORD0; +varying lowp vec4 xlv_COLOR; void main () { highp vec2 tmpvar_1; @@ -21,3 +21,5 @@ void main () xlv_COLOR = tmpvar_3; } + +// inputs: 4, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt index af81f6873..5294bc97f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-ir.txt @@ -14,22 +14,22 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -198,8 +198,8 @@ v2f_surf vert_surf ( tmpvar_63 = v_42.normal.z; tmpvar_54[2].z = tmpvar_63; mat3 tmpvar_64; - tmpvar_64 = (tmpvar_54); - rotation_44 = (tmpvar_64); + tmpvar_64 = tmpvar_54; + rotation_44 = tmpvar_64; vec3 tmpvar_65; tmpvar_65 = ObjSpaceLightDir (v_42.vertex); vec3 tmpvar_66; diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt index 4daa8ff56..5034292ac 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt @@ -1,19 +1,19 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -63,7 +63,9 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_13; tmpvar_13.w = 0.0; - tmpvar_13.xyz = (tmpvar_6 * (((_World2Object * tmpvar_7).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_13.xyz = (tmpvar_6 * (( + (_World2Object * tmpvar_7) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_13; vec4 tmpvar_14; tmpvar_14.w = 0.0; @@ -71,7 +73,13 @@ void main () gl_TexCoord[2] = tmpvar_14; vec4 tmpvar_15; tmpvar_15.w = 0.0; - tmpvar_15.xyz = ((x1_10 + x2_9) + (unity_SHC.xyz * ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)))); + tmpvar_15.xyz = ((x1_10 + x2_9) + (unity_SHC.xyz * ( + (tmpvar_4.x * tmpvar_4.x) + - + (tmpvar_4.y * tmpvar_4.y) + ))); gl_TexCoord[3] = tmpvar_15; } + +// inputs: 4, stats: 36 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt index 38165ebab..8ae07255b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt @@ -23,11 +23,11 @@ varying mediump vec2 xlv_TEXCOORD0; void main() { v2f xl_retval; appdata_t xlt_v; - xlt_v.vertex = highp vec4( gl_Vertex); - xlt_v.color = lowp vec4( gl_Color); - xlt_v.texcoord = highp vec2( gl_MultiTexCoord0); + xlt_v.vertex = vec4( gl_Vertex); + xlt_v.color = vec4( gl_Color); + xlt_v.texcoord = vec2( gl_MultiTexCoord0); xl_retval = xlat_main( xlt_v); - gl_Position = highp vec4( xl_retval.vertex); - xlv_COLOR = lowp vec4( xl_retval.color); - xlv_TEXCOORD0 = mediump vec2( xl_retval.texcoord); + gl_Position = vec4( xl_retval.vertex); + xlv_COLOR = vec4( xl_retval.color); + xlv_TEXCOORD0 = vec2( xl_retval.texcoord); } diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt index 57642c6eb..13401b9e7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-ir.txt @@ -8,10 +8,10 @@ struct appdata_t { vec4 color; vec2 texcoord; }; -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR; -uniform mat4 glstate_matrix_mvp; uniform vec4 _MainTex_ST; +uniform mat4 glstate_matrix_mvp; +varying vec4 xlv_COLOR; +varying vec2 xlv_TEXCOORD0; v2f xlat_main ( in appdata_t v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt index e64250049..2c67efa4c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-irES.txt @@ -8,15 +8,15 @@ struct appdata_t { lowp vec4 color; highp vec2 texcoord; }; -varying mediump vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; -uniform highp mat4 glstate_matrix_mvp; -uniform highp vec4 _MainTex_ST; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp vec4 _MainTex_ST; +uniform highp mat4 glstate_matrix_mvp; +varying lowp vec4 xlv_COLOR; +varying mediump vec2 xlv_TEXCOORD0; v2f xlat_main ( in appdata_t v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt index 6573aef04..0c5be6fba 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt @@ -1,7 +1,7 @@ -varying vec2 xlv_TEXCOORD0; -varying vec4 xlv_COLOR; -uniform mat4 glstate_matrix_mvp; uniform vec4 _MainTex_ST; +uniform mat4 glstate_matrix_mvp; +varying vec4 xlv_COLOR; +varying vec2 xlv_TEXCOORD0; void main () { gl_Position = (glstate_matrix_mvp * gl_Vertex); @@ -9,3 +9,5 @@ void main () xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); } + +// inputs: 3, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt index 1d3225bdd..07b82d61a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt @@ -1,10 +1,10 @@ -varying mediump vec2 xlv_TEXCOORD0; -varying lowp vec4 xlv_COLOR; -uniform highp mat4 glstate_matrix_mvp; -uniform highp vec4 _MainTex_ST; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord0; attribute highp vec4 _glesVertex; +attribute highp vec4 _glesMultiTexCoord0; +attribute lowp vec4 _glesColor; +uniform highp vec4 _MainTex_ST; +uniform highp mat4 glstate_matrix_mvp; +varying lowp vec4 xlv_COLOR; +varying mediump vec2 xlv_TEXCOORD0; void main () { mediump vec2 tmpvar_1; @@ -16,3 +16,5 @@ void main () xlv_TEXCOORD0 = tmpvar_1; } + +// inputs: 3, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt index a675d38f6..66bb45698 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt @@ -23,7 +23,7 @@ v2f xlat_main( in appdata v ) { v2f o; o.pos = ( glstate_matrix_mvp * v.vertex ); o.uv = ComputeScreenPos( o.pos); - o.ray = (( glstate_matrix_modelview0 * v.vertex ).xyz * highp vec3( -1.00000, -1.00000, 1.00000)); + o.ray = (( glstate_matrix_modelview0 * v.vertex ).xyz * vec3( -1.00000, -1.00000, 1.00000)); o.ray = mix( o.ray, v.normal, vec3( float( (v.normal.z != 0.000000) ))); return o; } @@ -32,10 +32,10 @@ varying highp vec3 xlv_TEXCOORD1; void main() { v2f xl_retval; appdata xlt_v; - xlt_v.vertex = highp vec4( gl_Vertex); - xlt_v.normal = highp vec3( gl_Normal); + xlt_v.vertex = vec4( gl_Vertex); + xlt_v.normal = vec3( gl_Normal); xl_retval = xlat_main( xlt_v); - gl_Position = highp vec4( xl_retval.pos); - xlv_TEXCOORD0 = highp vec4( xl_retval.uv); - xlv_TEXCOORD1 = highp vec3( xl_retval.ray); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec4( xl_retval.uv); + xlv_TEXCOORD1 = vec3( xl_retval.ray); } diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt index f6b9a4a3a..a39de35fe 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-ir.txt @@ -7,11 +7,11 @@ struct appdata { vec4 vertex; vec3 normal; }; -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform mat4 glstate_matrix_mvp; -uniform mat4 glstate_matrix_modelview0; uniform vec4 _ProjectionParams; +uniform mat4 glstate_matrix_modelview0; +uniform mat4 glstate_matrix_mvp; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; vec4 ComputeScreenPos ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt index 350852569..2a564f28b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-irES.txt @@ -7,16 +7,16 @@ struct appdata { highp vec4 vertex; highp vec3 normal; }; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_TEXCOORD0; -uniform highp mat4 glstate_matrix_mvp; -uniform highp mat4 glstate_matrix_modelview0; -uniform highp vec4 _ProjectionParams; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp vec4 _ProjectionParams; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_mvp; +varying highp vec4 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; vec4 ComputeScreenPos ( in highp vec4 pos_1 ) @@ -72,9 +72,9 @@ void main () highp vec4 tmpvar_19; tmpvar_19 = tmpvar_18; xlt_v_16.vertex = tmpvar_19; - highp vec3 tmpvar_20; + mediump vec3 tmpvar_20; tmpvar_20 = _glesNormal.xyz; - highp vec3 tmpvar_21; + mediump vec3 tmpvar_21; tmpvar_21 = tmpvar_20; xlt_v_16.normal = tmpvar_21; v2f tmpvar_22; diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt index 28164dabe..e9a275f18 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt @@ -1,8 +1,8 @@ -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_TEXCOORD0; -uniform mat4 glstate_matrix_mvp; -uniform mat4 glstate_matrix_modelview0; uniform vec4 _ProjectionParams; +uniform mat4 glstate_matrix_modelview0; +uniform mat4 glstate_matrix_mvp; +varying vec4 xlv_TEXCOORD0; +varying vec3 xlv_TEXCOORD1; void main () { vec4 tmpvar_1; @@ -20,3 +20,5 @@ void main () xlv_TEXCOORD1 = mix (((glstate_matrix_modelview0 * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0)), gl_Normal, vec3(float((gl_Normal.z != 0.0)))); } + +// inputs: 2, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt index 71f240670..53930262c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt @@ -1,10 +1,10 @@ -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_TEXCOORD0; -uniform highp mat4 glstate_matrix_mvp; -uniform highp mat4 glstate_matrix_modelview0; -uniform highp vec4 _ProjectionParams; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +uniform highp vec4 _ProjectionParams; +uniform highp mat4 glstate_matrix_modelview0; +uniform highp mat4 glstate_matrix_mvp; +varying highp vec4 xlv_TEXCOORD0; +varying highp vec3 xlv_TEXCOORD1; void main () { highp vec3 tmpvar_1; @@ -24,3 +24,5 @@ void main () xlv_TEXCOORD1 = mix (((glstate_matrix_modelview0 * _glesVertex).xyz * vec3(-1.0, -1.0, 1.0)), tmpvar_1, vec3(float((tmpvar_1.z != 0.0)))); } + +// inputs: 2, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt index 7466b4370..e127550bb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt @@ -80,7 +80,7 @@ highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 fBranchPhase = (fObjPhase + animParams.x ); fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase))); vWavesIn = (_Time.yy + vec2( fVtxPhase, fBranchPhase)); - vWaves = ((fract( (vWavesIn.xxyy * highp vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000); + vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000); vWaves = SmoothTriangleWave( vWaves); vWavesSum = (vWaves.xz + vWaves.yw ); bend = ((animParams.y * fDetailAmp) * normal.xyz ); @@ -132,17 +132,17 @@ varying highp vec2 xlv_TEXCOORD3; void main() { v2f_surf xl_retval; appdata_full xlt_v; - xlt_v.vertex = highp vec4( gl_Vertex); - xlt_v.tangent = highp vec4( TANGENT); - xlt_v.normal = highp vec3( gl_Normal); - xlt_v.texcoord = highp vec4( gl_MultiTexCoord0); - xlt_v.texcoord1 = highp vec4( gl_MultiTexCoord1); - xlt_v.color = highp vec4( gl_Color); + xlt_v.vertex = vec4( gl_Vertex); + xlt_v.tangent = vec4( TANGENT); + xlt_v.normal = vec3( gl_Normal); + xlt_v.texcoord = vec4( gl_MultiTexCoord0); + xlt_v.texcoord1 = vec4( gl_MultiTexCoord1); + xlt_v.color = vec4( gl_Color); xl_retval = xlat_main( xlt_v); - gl_Position = highp vec4( xl_retval.pos); - xlv_TEXCOORD0 = highp vec2( xl_retval.hip_pack0); - xlv_COLOR0 = highp vec4( xl_retval.lop_color); - xlv_TEXCOORD1 = highp vec3( xl_retval.lightDir); - xlv_TEXCOORD2 = highp vec3( xl_retval.viewDir); - xlv_TEXCOORD3 = highp vec2( xl_retval._LightCoord); + gl_Position = vec4( xl_retval.pos); + xlv_TEXCOORD0 = vec2( xl_retval.hip_pack0); + xlv_COLOR0 = vec4( xl_retval.lop_color); + xlv_TEXCOORD1 = vec3( xl_retval.lightDir); + xlv_TEXCOORD2 = vec3( xl_retval.viewDir); + xlv_TEXCOORD3 = vec2( xl_retval._LightCoord); } diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt index 0fc4f287f..6dc063e52 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-ir.txt @@ -14,26 +14,26 @@ struct v2f_surf { vec3 viewDir; vec2 _LightCoord; }; -varying vec2 xlv_TEXCOORD3; -varying vec3 xlv_TEXCOORD2; -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_COLOR0; -varying vec2 xlv_TEXCOORD0; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform mat4 glstate_matrix_mvp; -uniform mat4 glstate_matrix_invtrans_modelview0; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform vec4 _Time; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform vec4 _Time; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform mat4 glstate_matrix_invtrans_modelview0; +uniform mat4 glstate_matrix_mvp; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_COLOR0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec2 xlv_TEXCOORD3; vec4 Squash ( in vec4 pos_1 ) @@ -214,7 +214,11 @@ vec4 AnimateVertex ( tmpvar_73 = (animParams_47.w * fBranchAmp_55); bend_48.y = vec2(tmpvar_73).y; vec3 tmpvar_74; - tmpvar_74 = (pos_45.xyz + (((vWavesSum_49.xyx * bend_48) + ((_Wind.xyz * vWavesSum_49.y) * animParams_47.w)) * _Wind.w)); + tmpvar_74 = (pos_45.xyz + (( + (vWavesSum_49.xyx * bend_48) + + + ((_Wind.xyz * vWavesSum_49.y) * animParams_47.w) + ) * _Wind.w)); pos_45.xyz = tmpvar_74.xyz.xyz; vec3 tmpvar_75; tmpvar_75 = (pos_45.xyz + (animParams_47.z * _Wind.xyz)); @@ -337,8 +341,8 @@ v2f_surf xlat_main ( tmpvar_114 = v_96.normal.z; tmpvar_105[2].z = tmpvar_114; mat3 tmpvar_115; - tmpvar_115 = (tmpvar_105); - rotation_97 = (tmpvar_115); + tmpvar_115 = tmpvar_105; + rotation_97 = tmpvar_115; vec3 tmpvar_116; tmpvar_116 = ObjSpaceLightDir (v_96.vertex); vec3 tmpvar_117; diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt index af9d86398..de058326e 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-irES.txt @@ -14,31 +14,31 @@ struct v2f_surf { highp vec3 viewDir; highp vec2 _LightCoord; }; -varying highp vec2 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_COLOR0; -varying highp vec2 xlv_TEXCOORD0; -attribute vec4 TANGENT; -uniform highp vec4 unity_Scale; -uniform highp mat4 glstate_matrix_mvp; -uniform highp mat4 glstate_matrix_invtrans_modelview0; -uniform highp vec4 _WorldSpaceLightPos0; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 _World2Object; -uniform highp vec4 _Wind; -uniform highp vec4 _Time; -uniform highp vec4 _SquashPlaneNormal; -uniform highp float _SquashAmount; -uniform highp vec4 _Scale; -uniform highp mat4 _Object2World; -uniform highp vec4 _MainTex_ST; -uniform highp mat4 _LightMatrix0; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _MainTex_ST; +uniform highp mat4 _Object2World; +uniform highp vec4 _Scale; +uniform highp float _SquashAmount; +uniform highp vec4 _SquashPlaneNormal; +uniform highp vec4 _Time; +uniform highp vec4 _Wind; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _WorldSpaceLightPos0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp mat4 glstate_matrix_mvp; +uniform highp vec4 unity_Scale; +attribute vec4 TANGENT; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR0; +varying highp vec3 xlv_TEXCOORD1; +varying highp vec3 xlv_TEXCOORD2; +varying highp vec2 xlv_TEXCOORD3; vec4 Squash ( in highp vec4 pos_1 ) @@ -219,7 +219,11 @@ vec4 AnimateVertex ( tmpvar_73 = (animParams_47.w * fBranchAmp_55); bend_48.y = vec2(tmpvar_73).y; highp vec3 tmpvar_74; - tmpvar_74 = (pos_45.xyz + (((vWavesSum_49.xyx * bend_48) + ((_Wind.xyz * vWavesSum_49.y) * animParams_47.w)) * _Wind.w)); + tmpvar_74 = (pos_45.xyz + (( + (vWavesSum_49.xyx * bend_48) + + + ((_Wind.xyz * vWavesSum_49.y) * animParams_47.w) + ) * _Wind.w)); pos_45.xyz = tmpvar_74.xyz.xyz; highp vec3 tmpvar_75; tmpvar_75 = (pos_45.xyz + (animParams_47.z * _Wind.xyz)); @@ -342,8 +346,8 @@ v2f_surf xlat_main ( tmpvar_114 = v_96.normal.z; tmpvar_105[2].z = tmpvar_114; mat3 tmpvar_115; - tmpvar_115 = (tmpvar_105); - rotation_97 = (tmpvar_115); + tmpvar_115 = tmpvar_105; + rotation_97 = tmpvar_115; highp vec3 tmpvar_116; tmpvar_116 = ObjSpaceLightDir (v_96.vertex); highp vec3 tmpvar_117; @@ -369,14 +373,14 @@ void main () highp vec4 tmpvar_124; tmpvar_124 = tmpvar_123; xlt_v_121.vertex = tmpvar_124; - highp vec4 tmpvar_125; + vec4 tmpvar_125; tmpvar_125 = TANGENT.xyzw; - highp vec4 tmpvar_126; + vec4 tmpvar_126; tmpvar_126 = tmpvar_125; xlt_v_121.tangent = tmpvar_126; - highp vec3 tmpvar_127; + mediump vec3 tmpvar_127; tmpvar_127 = _glesNormal.xyz; - highp vec3 tmpvar_128; + mediump vec3 tmpvar_128; tmpvar_128 = tmpvar_127; xlt_v_121.normal = tmpvar_128; highp vec4 tmpvar_129; @@ -389,9 +393,9 @@ void main () highp vec4 tmpvar_132; tmpvar_132 = tmpvar_131; xlt_v_121.texcoord1 = tmpvar_132; - highp vec4 tmpvar_133; + lowp vec4 tmpvar_133; tmpvar_133 = _glesColor.xyzw; - highp vec4 tmpvar_134; + lowp vec4 tmpvar_134; tmpvar_134 = tmpvar_133; xlt_v_121.color = tmpvar_134; v2f_surf tmpvar_135; diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt index 4e35d1df9..38f99b958 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt @@ -1,23 +1,23 @@ -varying vec2 xlv_TEXCOORD3; -varying vec3 xlv_TEXCOORD2; -varying vec3 xlv_TEXCOORD1; -varying vec4 xlv_COLOR0; -varying vec2 xlv_TEXCOORD0; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform mat4 glstate_matrix_mvp; -uniform mat4 glstate_matrix_invtrans_modelview0; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform vec4 _Time; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform vec4 _Time; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform mat4 glstate_matrix_invtrans_modelview0; +uniform mat4 glstate_matrix_mvp; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec2 xlv_TEXCOORD0; +varying vec4 xlv_COLOR0; +varying vec3 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec2 xlv_TEXCOORD3; void main () { vec4 tmpvar_1; @@ -54,17 +54,27 @@ void main () tmpvar_14.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_13))); tmpvar_14.y = tmpvar_13; vec4 tmpvar_15; - tmpvar_15 = abs(((fract((((fract(((_Time.yy + tmpvar_14).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_15 = abs((( + fract(((( + fract(((_Time.yy + tmpvar_14).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_16; tmpvar_16 = ((tmpvar_15 * tmpvar_15) * (3.0 - (2.0 * tmpvar_15))); vec2 tmpvar_17; tmpvar_17 = (tmpvar_16.xz + tmpvar_16.yw); bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz; bend_12.y = (gl_MultiTexCoord1.y * 0.3); - pos_11.xyz = (tmpvar_1.xyz + (((tmpvar_17.xyx * bend_12) + ((_Wind.xyz * tmpvar_17.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_11.xyz = (tmpvar_1.xyz + (( + (tmpvar_17.xyx * bend_12) + + + ((_Wind.xyz * tmpvar_17.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_18; - tmpvar_18 = mix ((pos_11.xyz - ((dot (_SquashPlaneNormal.xyz, pos_11.xyz) + _SquashPlaneNormal.w) * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount)); + tmpvar_18 = mix ((pos_11.xyz - ( + (dot (_SquashPlaneNormal.xyz, pos_11.xyz) + _SquashPlaneNormal.w) + * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount)); vec4 tmpvar_19; tmpvar_19.w = 1.0; tmpvar_19.xyz = tmpvar_18; @@ -94,7 +104,11 @@ void main () xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); xlv_COLOR0 = tmpvar_20; xlv_TEXCOORD1 = (tmpvar_23 * (_World2Object * _WorldSpaceLightPos0).xyz); - xlv_TEXCOORD2 = (tmpvar_23 * (((_World2Object * tmpvar_24).xyz * unity_Scale.w) - tmpvar_18)); + xlv_TEXCOORD2 = (tmpvar_23 * (( + (_World2Object * tmpvar_24) + .xyz * unity_Scale.w) - tmpvar_18)); xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_19)).xy; } + +// inputs: 6, stats: 71 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt index 0e21e3756..f08c22028 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt @@ -1,33 +1,33 @@ -varying highp vec2 xlv_TEXCOORD3; -varying highp vec3 xlv_TEXCOORD2; -varying highp vec3 xlv_TEXCOORD1; -varying highp vec4 xlv_COLOR0; -varying highp vec2 xlv_TEXCOORD0; -attribute vec4 TANGENT; -uniform highp vec4 unity_Scale; -uniform highp mat4 glstate_matrix_mvp; -uniform highp mat4 glstate_matrix_invtrans_modelview0; -uniform highp vec4 _WorldSpaceLightPos0; -uniform highp vec3 _WorldSpaceCameraPos; -uniform highp mat4 _World2Object; -uniform highp vec4 _Wind; -uniform highp vec4 _Time; -uniform highp vec4 _SquashPlaneNormal; -uniform highp float _SquashAmount; -uniform highp vec4 _Scale; -uniform highp mat4 _Object2World; -uniform highp vec4 _MainTex_ST; -uniform highp mat4 _LightMatrix0; -attribute lowp vec4 _glesColor; -attribute highp vec4 _glesMultiTexCoord1; -attribute highp vec4 _glesMultiTexCoord0; -attribute mediump vec3 _glesNormal; attribute highp vec4 _glesVertex; +attribute mediump vec3 _glesNormal; +attribute highp vec4 _glesMultiTexCoord0; +attribute highp vec4 _glesMultiTexCoord1; +attribute lowp vec4 _glesColor; +uniform highp mat4 _LightMatrix0; +uniform highp vec4 _MainTex_ST; +uniform highp mat4 _Object2World; +uniform highp vec4 _Scale; +uniform highp float _SquashAmount; +uniform highp vec4 _SquashPlaneNormal; +uniform highp vec4 _Time; +uniform highp vec4 _Wind; +uniform highp mat4 _World2Object; +uniform highp vec3 _WorldSpaceCameraPos; +uniform highp vec4 _WorldSpaceLightPos0; +uniform highp mat4 glstate_matrix_invtrans_modelview0; +uniform highp mat4 glstate_matrix_mvp; +uniform highp vec4 unity_Scale; +attribute vec4 TANGENT; +varying highp vec2 xlv_TEXCOORD0; +varying highp vec4 xlv_COLOR0; +varying highp vec3 xlv_TEXCOORD1; +varying highp vec3 xlv_TEXCOORD2; +varying highp vec2 xlv_TEXCOORD3; void main () { highp vec3 tmpvar_1; - tmpvar_1 = _glesNormal; highp vec4 tmpvar_2; + tmpvar_1 = _glesNormal; tmpvar_2 = _glesColor; highp vec4 tmpvar_3; highp vec4 tmpvar_4; @@ -63,17 +63,27 @@ void main () tmpvar_16.x = dot (tmpvar_3.xyz, vec3((tmpvar_2.y + tmpvar_15))); tmpvar_16.y = tmpvar_15; highp vec4 tmpvar_17; - tmpvar_17 = abs(((fract((((fract(((_Time.yy + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_17 = abs((( + fract(((( + fract(((_Time.yy + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); highp vec4 tmpvar_18; tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17))); highp vec2 tmpvar_19; tmpvar_19 = (tmpvar_18.xz + tmpvar_18.yw); bend_14.xz = ((tmpvar_2.y * 0.1) * tmpvar_10).xz; bend_14.y = (_glesMultiTexCoord1.y * 0.3); - pos_13.xyz = (tmpvar_3.xyz + (((tmpvar_19.xyx * bend_14) + ((_Wind.xyz * tmpvar_19.y) * _glesMultiTexCoord1.y)) * _Wind.w)); + pos_13.xyz = (tmpvar_3.xyz + (( + (tmpvar_19.xyx * bend_14) + + + ((_Wind.xyz * tmpvar_19.y) * _glesMultiTexCoord1.y) + ) * _Wind.w)); pos_13.xyz = (pos_13.xyz + (_glesMultiTexCoord1.x * _Wind.xyz)); highp vec3 tmpvar_20; - tmpvar_20 = mix ((pos_13.xyz - ((dot (_SquashPlaneNormal.xyz, pos_13.xyz) + _SquashPlaneNormal.w) * _SquashPlaneNormal.xyz)), pos_13.xyz, vec3(_SquashAmount)); + tmpvar_20 = mix ((pos_13.xyz - ( + (dot (_SquashPlaneNormal.xyz, pos_13.xyz) + _SquashPlaneNormal.w) + * _SquashPlaneNormal.xyz)), pos_13.xyz, vec3(_SquashAmount)); highp vec4 tmpvar_21; tmpvar_21.w = 1.0; tmpvar_21.xyz = tmpvar_20; @@ -103,7 +113,11 @@ void main () xlv_TEXCOORD0 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); xlv_COLOR0 = tmpvar_22; xlv_TEXCOORD1 = (tmpvar_25 * (_World2Object * _WorldSpaceLightPos0).xyz); - xlv_TEXCOORD2 = (tmpvar_25 * (((_World2Object * tmpvar_26).xyz * unity_Scale.w) - tmpvar_20)); + xlv_TEXCOORD2 = (tmpvar_25 * (( + (_World2Object * tmpvar_26) + .xyz * unity_Scale.w) - tmpvar_20)); xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_21)).xy; } + +// inputs: 6, stats: 71 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt new file mode 100644 index 000000000..3fda534cf --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt @@ -0,0 +1,109 @@ +mat3 xll_constructMat3_mf4x4( mat4 m) { + return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2])); +} +struct VertexOutput { + vec4 pos; + vec4 tex; + vec4 posWorld; + vec3 normalWorld; + vec4 tangentWorld; + vec3 extra; + vec4 _ShadowCoord; + vec3 lightDir; +}; +struct VertexInput { + vec4 vertex; + vec3 normal; + vec4 texcoord; + vec4 texcoord1; + vec4 tangent; +}; +uniform vec4 _ProjectionParams; +uniform vec4 _ScreenParams; +uniform vec4 _WorldSpaceLightPos0; + +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 unity_Scale; +uniform mat4 glstate_matrix_transpose_modelview0; + +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _MainTex_ST; +uniform sampler2D _DetailAlbedoMap; +uniform vec4 _DetailAlbedoMap_ST; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform vec4 _DetailNormalMap_ST; +uniform float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform float _Exposure; +uniform float _DetailBumpScale; +uniform float _AlphaTestRef; +uniform float _DetailBumpTiling; +uniform vec4 _Color; +uniform vec4 _SpecularColor; +uniform sampler2D _SpecGlossMap; +uniform float _Glossiness; + +uniform vec4 unity_ColorSpaceGrey; + +uniform vec4 _LightColor0; + +uniform samplerCube _SpecCube; +uniform vec4 unity_LightmapST; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform float _SelfIllumScale; +uniform sampler2D _SelfIllum; + +vec4 ComputeScreenPos( in vec4 pos ) { + vec4 o = (pos * 0.5); + o.xy = (vec2( o.x, (o.y * _ProjectionParams.x)) + o.w); + o.zw = pos.zw; + return o; +} + +VertexOutput vert( in VertexInput v ) { + VertexOutput o; + o.posWorld = (_Object2World * v.vertex); + o.pos = (gl_ModelViewProjectionMatrix * v.vertex); + o.tex = v.texcoord; + o.tex.xy = ((v.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + o.tex.zw = ((v.texcoord.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + o.normalWorld = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal)); + o.tangentWorld = vec4( (xll_constructMat3_mf4x4( _Object2World) * v.tangent.xyz), v.tangent.w); + o.tangentWorld.xyz = normalize(o.tangentWorld.xyz); + o._ShadowCoord = ComputeScreenPos( o.pos); + o.extra.xy = ((v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + o.extra.z = 0.0; + return o; +} +attribute vec4 TANGENT; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +varying vec3 xlv_TEXCOORD7; +void main() { + VertexOutput xl_retval; + VertexInput xlt_v; + xlt_v.vertex = vec4(gl_Vertex); + xlt_v.normal = vec3(gl_Normal); + xlt_v.texcoord = vec4(gl_MultiTexCoord0); + xlt_v.texcoord1 = vec4(gl_MultiTexCoord1); + xlt_v.tangent = vec4(TANGENT); + xl_retval = vert( xlt_v); + gl_Position = vec4(xl_retval.pos); + xlv_TEXCOORD0 = vec4(xl_retval.tex); + xlv_TEXCOORD1 = vec4(xl_retval.posWorld); + xlv_TEXCOORD2 = vec3(xl_retval.normalWorld); + xlv_TEXCOORD3 = vec4(xl_retval.tangentWorld); + xlv_TEXCOORD4 = vec3(xl_retval.extra); + xlv_TEXCOORD5 = vec4(xl_retval._ShadowCoord); + xlv_TEXCOORD7 = vec3(xl_retval.lightDir); +} diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt new file mode 100644 index 000000000..6dc21bc7d --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-ir.txt @@ -0,0 +1,233 @@ +struct VertexOutput { + vec4 pos; + vec4 tex; + vec4 posWorld; + vec3 normalWorld; + vec4 tangentWorld; + vec3 extra; + vec4 _ShadowCoord; + vec3 lightDir; +}; +struct VertexInput { + vec4 vertex; + vec3 normal; + vec4 texcoord; + vec4 texcoord1; + vec4 tangent; +}; +uniform vec4 _ProjectionParams; +uniform vec4 _ScreenParams; +uniform vec4 _WorldSpaceLightPos0; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 unity_Scale; +uniform mat4 glstate_matrix_transpose_modelview0; +uniform samplerCube _Cube; +uniform sampler2D _MainTex; +uniform vec4 _MainTex_ST; +uniform sampler2D _DetailAlbedoMap; +uniform vec4 _DetailAlbedoMap_ST; +uniform sampler2D _AlphaMap; +uniform sampler2D _Occlusion; +uniform sampler2D _DetailNormalMap; +uniform vec4 _DetailNormalMap_ST; +uniform float _DetailNormalMapScale; +uniform sampler2D _BumpMap; +uniform float _BumpScale; +uniform float _Exposure; +uniform float _DetailBumpScale; +uniform float _AlphaTestRef; +uniform float _DetailBumpTiling; +uniform vec4 _Color; +uniform vec4 _SpecularColor; +uniform sampler2D _SpecGlossMap; +uniform float _Glossiness; +uniform vec4 unity_ColorSpaceGrey; +uniform vec4 _LightColor0; +uniform samplerCube _SpecCube; +uniform vec4 unity_LightmapST; +uniform sampler2D unity_Lightmap; +uniform sampler2D unity_LightmapInd; +uniform float _SelfIllumScale; +uniform sampler2D _SelfIllum; +attribute vec4 TANGENT; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +varying vec3 xlv_TEXCOORD7; +mat3 xll_constructMat3_mf4x4 ( + in mat4 m_1 +) +{ + vec3 tmpvar_2; + tmpvar_2 = m_1[0].xyz; + vec3 tmpvar_3; + tmpvar_3 = m_1[1].xyz; + vec3 tmpvar_4; + tmpvar_4 = m_1[2].xyz; + mat3 tmpvar_5; + vec3 tmpvar_6; + tmpvar_6 = tmpvar_2; + tmpvar_5[0] = tmpvar_6; + vec3 tmpvar_7; + tmpvar_7 = tmpvar_3; + tmpvar_5[1] = tmpvar_7; + vec3 tmpvar_8; + tmpvar_8 = tmpvar_4; + tmpvar_5[2] = tmpvar_8; + return tmpvar_5; +} + +vec4 ComputeScreenPos ( + in vec4 pos_9 +) +{ + vec4 o_10; + vec4 tmpvar_11; + tmpvar_11 = (pos_9 * 0.5); + o_10 = tmpvar_11; + vec2 tmpvar_12; + tmpvar_12.x = o_10.x; + tmpvar_12.y = (o_10.y * _ProjectionParams.x); + vec2 tmpvar_13; + tmpvar_13 = (tmpvar_12 + o_10.w); + o_10.xy = tmpvar_13.xy.xy; + vec2 tmpvar_14; + tmpvar_14 = pos_9.zw; + o_10.zw = tmpvar_14.xxxy.zw; + return o_10; +} + +VertexOutput vert ( + in VertexInput v_15 +) +{ + VertexOutput o_16; + vec4 tmpvar_17; + tmpvar_17 = (_Object2World * v_15.vertex); + o_16.posWorld = tmpvar_17; + vec4 tmpvar_18; + tmpvar_18 = (gl_ModelViewProjectionMatrix * v_15.vertex); + o_16.pos = tmpvar_18; + vec4 tmpvar_19; + tmpvar_19 = v_15.texcoord; + o_16.tex = tmpvar_19; + vec2 tmpvar_20; + tmpvar_20 = ((v_15.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + o_16.tex.xy = tmpvar_20.xy.xy; + vec2 tmpvar_21; + tmpvar_21 = ((v_15.texcoord.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + o_16.tex.zw = tmpvar_21.xxxy.zw; + mat3 tmpvar_22; + tmpvar_22 = xll_constructMat3_mf4x4 (_Object2World); + vec3 tmpvar_23; + tmpvar_23 = normalize ((tmpvar_22 * v_15.normal)); + vec3 tmpvar_24; + tmpvar_24 = tmpvar_23; + o_16.normalWorld = tmpvar_24; + mat3 tmpvar_25; + tmpvar_25 = xll_constructMat3_mf4x4 (_Object2World); + vec4 tmpvar_26; + tmpvar_26.xyz = (tmpvar_25 * v_15.tangent.xyz).xyz; + tmpvar_26.w = v_15.tangent.w; + vec4 tmpvar_27; + tmpvar_27 = tmpvar_26; + o_16.tangentWorld = tmpvar_27; + vec3 tmpvar_28; + tmpvar_28 = normalize (o_16.tangentWorld.xyz); + vec3 tmpvar_29; + tmpvar_29 = tmpvar_28; + o_16.tangentWorld.xyz = tmpvar_29.xyz.xyz; + vec4 tmpvar_30; + tmpvar_30 = ComputeScreenPos (o_16.pos); + vec4 tmpvar_31; + tmpvar_31 = tmpvar_30; + o_16._ShadowCoord = tmpvar_31; + vec2 tmpvar_32; + tmpvar_32 = ((v_15.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + o_16.extra.xy = tmpvar_32.xy.xy; + float tmpvar_33; + tmpvar_33 = 0.0; + o_16.extra.z = vec3(tmpvar_33).z; + return o_16; +} + +void main () +{ + VertexInput xlt_v_34; + VertexOutput xl_retval_35; + vec4 tmpvar_36; + tmpvar_36 = gl_Vertex.xyzw; + vec4 tmpvar_37; + tmpvar_37 = tmpvar_36; + xlt_v_34.vertex = tmpvar_37; + vec3 tmpvar_38; + tmpvar_38 = gl_Normal.xyz; + vec3 tmpvar_39; + tmpvar_39 = tmpvar_38; + xlt_v_34.normal = tmpvar_39; + vec4 tmpvar_40; + tmpvar_40 = gl_MultiTexCoord0.xyzw; + vec4 tmpvar_41; + tmpvar_41 = tmpvar_40; + xlt_v_34.texcoord = tmpvar_41; + vec4 tmpvar_42; + tmpvar_42 = gl_MultiTexCoord1.xyzw; + vec4 tmpvar_43; + tmpvar_43 = tmpvar_42; + xlt_v_34.texcoord1 = tmpvar_43; + vec4 tmpvar_44; + tmpvar_44 = TANGENT.xyzw; + vec4 tmpvar_45; + tmpvar_45 = tmpvar_44; + xlt_v_34.tangent = tmpvar_45; + VertexOutput tmpvar_46; + tmpvar_46 = vert (xlt_v_34); + VertexOutput tmpvar_47; + tmpvar_47 = tmpvar_46; + xl_retval_35 = tmpvar_47; + vec4 tmpvar_48; + tmpvar_48 = xl_retval_35.pos.xyzw; + vec4 tmpvar_49; + tmpvar_49 = tmpvar_48; + gl_Position = tmpvar_49; + vec4 tmpvar_50; + tmpvar_50 = xl_retval_35.tex.xyzw; + vec4 tmpvar_51; + tmpvar_51 = tmpvar_50; + xlv_TEXCOORD0 = tmpvar_51; + vec4 tmpvar_52; + tmpvar_52 = xl_retval_35.posWorld.xyzw; + vec4 tmpvar_53; + tmpvar_53 = tmpvar_52; + xlv_TEXCOORD1 = tmpvar_53; + vec3 tmpvar_54; + tmpvar_54 = xl_retval_35.normalWorld.xyz; + vec3 tmpvar_55; + tmpvar_55 = tmpvar_54; + xlv_TEXCOORD2 = tmpvar_55; + vec4 tmpvar_56; + tmpvar_56 = xl_retval_35.tangentWorld.xyzw; + vec4 tmpvar_57; + tmpvar_57 = tmpvar_56; + xlv_TEXCOORD3 = tmpvar_57; + vec3 tmpvar_58; + tmpvar_58 = xl_retval_35.extra.xyz; + vec3 tmpvar_59; + tmpvar_59 = tmpvar_58; + xlv_TEXCOORD4 = tmpvar_59; + vec4 tmpvar_60; + tmpvar_60 = xl_retval_35._ShadowCoord.xyzw; + vec4 tmpvar_61; + tmpvar_61 = tmpvar_60; + xlv_TEXCOORD5 = tmpvar_61; + vec3 tmpvar_62; + tmpvar_62 = xl_retval_35.lightDir.xyz; + vec3 tmpvar_63; + tmpvar_63 = tmpvar_62; + xlv_TEXCOORD7 = tmpvar_63; +} + diff --git a/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt new file mode 100644 index 000000000..dea8b7ffa --- /dev/null +++ b/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt @@ -0,0 +1,58 @@ +uniform vec4 _ProjectionParams; +uniform mat4 _Object2World; +uniform vec4 _MainTex_ST; +uniform vec4 _DetailAlbedoMap_ST; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_TEXCOORD0; +varying vec4 xlv_TEXCOORD1; +varying vec3 xlv_TEXCOORD2; +varying vec4 xlv_TEXCOORD3; +varying vec3 xlv_TEXCOORD4; +varying vec4 xlv_TEXCOORD5; +varying vec3 xlv_TEXCOORD7; +void main () +{ + vec4 tmpvar_1; + vec4 tmpvar_2; + vec3 tmpvar_3; + vec3 tmpvar_4; + vec4 tmpvar_5; + tmpvar_5 = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw); + mat3 tmpvar_6; + tmpvar_6[0] = _Object2World[0].xyz; + tmpvar_6[1] = _Object2World[1].xyz; + tmpvar_6[2] = _Object2World[2].xyz; + mat3 tmpvar_7; + tmpvar_7[0] = _Object2World[0].xyz; + tmpvar_7[1] = _Object2World[1].xyz; + tmpvar_7[2] = _Object2World[2].xyz; + vec4 tmpvar_8; + tmpvar_8.xyz = (tmpvar_7 * TANGENT.xyz); + tmpvar_8.w = TANGENT.w; + tmpvar_2.w = tmpvar_8.w; + tmpvar_2.xyz = normalize(tmpvar_8.xyz); + vec4 o_9; + vec4 tmpvar_10; + tmpvar_10 = (tmpvar_5 * 0.5); + vec2 tmpvar_11; + tmpvar_11.x = tmpvar_10.x; + tmpvar_11.y = (tmpvar_10.y * _ProjectionParams.x); + o_9.xy = (tmpvar_11 + tmpvar_10.w); + o_9.zw = tmpvar_5.zw; + tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); + tmpvar_3.z = 0.0; + gl_Position = tmpvar_5; + xlv_TEXCOORD0 = tmpvar_1; + xlv_TEXCOORD1 = (_Object2World * gl_Vertex); + xlv_TEXCOORD2 = normalize((tmpvar_6 * gl_Normal)); + xlv_TEXCOORD3 = tmpvar_2; + xlv_TEXCOORD4 = tmpvar_3; + xlv_TEXCOORD5 = o_9; + xlv_TEXCOORD7 = tmpvar_4; +} + + +// inputs: 5, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt index 179c8cc48..978cd6068 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-ir.txt @@ -13,8 +13,8 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -attribute vec4 TANGENT; uniform vec4 _BumpMap_ST; +attribute vec4 TANGENT; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -85,8 +85,8 @@ v2f_surf vert_surf ( tmpvar_26 = v_9.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_10 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_10 = tmpvar_27; mat3 tmpvar_28; tmpvar_28 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); vec3 tmpvar_29; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt index 2d9c18872..d5d4cef51 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt @@ -1,5 +1,5 @@ -attribute vec4 TANGENT; uniform vec4 _BumpMap_ST; +attribute vec4 TANGENT; void main () { vec3 tmpvar_1; @@ -33,3 +33,5 @@ void main () gl_TexCoord[3] = tmpvar_6; } + +// inputs: 4, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt index a13d7f753..9afae106c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-ir.txt @@ -12,10 +12,10 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt index 6e8b0331f..5f8bfc54f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt @@ -1,6 +1,6 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -25,3 +25,5 @@ void main () gl_TexCoord[1] = o_2; } + +// inputs: 2, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt index c13bd778e..20ca719ca 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-ir.txt @@ -15,31 +15,31 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -318,8 +318,8 @@ v2f_surf vert_surf ( tmpvar_111 = v_89.normal.z; tmpvar_102[2].z = tmpvar_111; mat3 tmpvar_112; - tmpvar_112 = (tmpvar_102); - rotation_92 = (tmpvar_112); + tmpvar_112 = tmpvar_102; + rotation_92 = tmpvar_112; vec3 tmpvar_113; tmpvar_113 = ObjSpaceLightDir (v_89.vertex); vec3 tmpvar_114; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt index 535fdb22c..1ced1167a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt @@ -1,28 +1,28 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -75,7 +75,13 @@ void main () vec4 tmpvar_16; tmpvar_16 = (((tmpvar_13 * tmpvar_13) + (tmpvar_14 * tmpvar_14)) + (tmpvar_15 * tmpvar_15)); vec4 tmpvar_17; - tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) * inversesqrt(tmpvar_16))) * (1.0/((1.0 + (tmpvar_16 * unity_4LightAtten0))))); + tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( + (((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) + * + inversesqrt(tmpvar_16) + )) * (1.0/((1.0 + + (tmpvar_16 * unity_4LightAtten0) + )))); vec4 o_18; vec4 tmpvar_19; tmpvar_19 = (tmpvar_2 * 0.5); @@ -92,7 +98,9 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_6 * (((_World2Object * tmpvar_7).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_22.xyz = (tmpvar_6 * (( + (_World2Object * tmpvar_7) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.w = 0.0; @@ -100,8 +108,16 @@ void main () gl_TexCoord[2] = tmpvar_23; vec4 tmpvar_24; tmpvar_24.w = 0.0; - tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)))) + ((((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) + (unity_LightColor2 * tmpvar_17.z)) + (unity_LightColor3 * tmpvar_17.w))); + tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * + ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)) + )) + (( + ((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) + + + (unity_LightColor2 * tmpvar_17.z) + ) + (unity_LightColor3 * tmpvar_17.w))); gl_TexCoord[3] = tmpvar_24; gl_TexCoord[4] = o_18; } + +// inputs: 4, stats: 68 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt index 38e2b72f4..ec3cdf973 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -71,7 +71,9 @@ v2f_surf vert_surf ( tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_13.hip_lmapFade.xy = tmpvar_17.xy.xy; float tmpvar_18; - tmpvar_18 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_18 = ((-( + (gl_ModelViewMatrix * v_12.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_13.hip_lmapFade.z = vec3(tmpvar_18).z; return o_13; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt index 5dedb6f9a..e8a9b9657 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; @@ -17,7 +17,9 @@ void main () o_3.xy = (tmpvar_5 + tmpvar_4.w); o_3.zw = tmpvar_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_1.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_2; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); @@ -34,3 +36,5 @@ void main () gl_TexCoord[2] = tmpvar_8; } + +// inputs: 3, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt index 052450fa9..351a53179 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-ir.txt @@ -13,13 +13,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _DecalTex_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt index c21429435..ff5c2a512 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _DecalTex_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -31,3 +31,5 @@ void main () gl_TexCoord[2] = tmpvar_6; } + +// inputs: 3, stats: 10 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt index 9b5fc8839..0363cfe2f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt index 31addc376..158ff2b44 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -27,11 +27,15 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz; - gl_TexCoord[3] = tmpvar_7; + vec4 tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_LightMatrix0 * cse_7).xyz; + gl_TexCoord[3] = tmpvar_8; } + +// inputs: 3, stats: 13 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt index 38e2b72f4..ec3cdf973 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -71,7 +71,9 @@ v2f_surf vert_surf ( tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_13.hip_lmapFade.xy = tmpvar_17.xy.xy; float tmpvar_18; - tmpvar_18 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_18 = ((-( + (gl_ModelViewMatrix * v_12.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_13.hip_lmapFade.z = vec3(tmpvar_18).z; return o_13; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt index 5dedb6f9a..e8a9b9657 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; @@ -17,7 +17,9 @@ void main () o_3.xy = (tmpvar_5 + tmpvar_4.w); o_3.zw = tmpvar_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_1.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_2; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); @@ -34,3 +36,5 @@ void main () gl_TexCoord[2] = tmpvar_8; } + +// inputs: 3, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt index 517731a1e..cb972f835 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-ir.txt @@ -13,18 +13,18 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt index bddcaa43d..56d2c48da 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt @@ -1,14 +1,14 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -47,7 +47,13 @@ void main () gl_TexCoord[1] = tmpvar_10; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = ((x1_6 + x2_5) + (unity_SHC.xyz * ((tmpvar_3.x * tmpvar_3.x) - (tmpvar_3.y * tmpvar_3.y)))); + tmpvar_11.xyz = ((x1_6 + x2_5) + (unity_SHC.xyz * ( + (tmpvar_3.x * tmpvar_3.x) + - + (tmpvar_3.y * tmpvar_3.y) + ))); gl_TexCoord[2] = tmpvar_11; } + +// inputs: 3, stats: 23 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt index 7ba3a251d..107d69455 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt @@ -9,12 +9,10 @@ void main () tmpvar_2.zw = tmpvar_3.zw; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.x = tmpvar_1.x; - tmpvar_4.y = tmpvar_1.y; + tmpvar_4.xy = tmpvar_1; vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); - tmpvar_5.x = tmpvar_1.x; - tmpvar_5.y = tmpvar_1.y; + tmpvar_5.xy = tmpvar_1; gl_Position = tmpvar_3; gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_6; @@ -27,3 +25,5 @@ void main () gl_TexCoord[2] = tmpvar_7; } + +// inputs: 2, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt index 196c84d41..a6fe917da 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-ir.txt @@ -8,12 +8,12 @@ struct appdata { vec4 vertex; vec3 normal; }; -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform float _WaveScale; uniform vec4 _WaveOffset; +uniform float _WaveScale; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt index e3dff8457..10b5ab644 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform float _WaveScale; uniform vec4 _WaveOffset; +uniform float _WaveScale; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 temp_1; @@ -28,7 +28,11 @@ void main () gl_TexCoord[1] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = normalize((((_World2Object * tmpvar_3).xyz * unity_Scale.w) - gl_Vertex.xyz)).xzy; + tmpvar_7.xyz = normalize((( + (_World2Object * tmpvar_3) + .xyz * unity_Scale.w) - gl_Vertex.xyz)).xzy; gl_TexCoord[2] = tmpvar_7; } + +// inputs: 1, stats: 13 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt index 454756024..06a4d669f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt @@ -9,3 +9,5 @@ void main () gl_TexCoord[0] = tmpvar_1; } + +// inputs: 1, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt index 7b488296d..268f5b805 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-ir.txt @@ -9,11 +9,11 @@ struct appdata { vec4 color; vec4 texcoord; }; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; uniform vec4 _ProjectionParams; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt index ef77f3c8a..d3dc3caa6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt @@ -1,8 +1,8 @@ -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; uniform vec4 _ProjectionParams; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; void main () { vec4 tmpvar_1; @@ -18,7 +18,9 @@ void main () tmpvar_4.y = _SquashPlaneNormal.w; vec4 tmpvar_5; tmpvar_5.w = 1.0; - tmpvar_5.xyz = mix ((pos_2.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz)) * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount)); + tmpvar_5.xyz = mix ((pos_2.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz)) + * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount)); pos_2 = tmpvar_5; mat3 tmpvar_6; tmpvar_6[0] = gl_ModelViewMatrixInverseTranspose[0].xyz; @@ -34,3 +36,5 @@ void main () gl_TexCoord[1] = tmpvar_1; } + +// inputs: 4, stats: 17 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt index 6087e9367..4e161fec1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-ir.txt @@ -10,10 +10,10 @@ struct appdata_grass { vec4 texcoord; vec4 texcoord1; }; -attribute vec4 TANGENT; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; uniform vec4 _ProjectionParams; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +attribute vec4 TANGENT; void FastSinCos ( in vec4 val_1, out vec4 s_2, @@ -60,10 +60,16 @@ void FastSinCos ( tmpvar_22 = (r2_7 * r5_12); r3_6 = tmpvar_22; vec4 tmpvar_23; - tmpvar_23 = (((val_1 + (r1_8 * sin7_5.y)) + (r2_7 * sin7_5.z)) + (r3_6 * sin7_5.w)); + tmpvar_23 = (((val_1 + + (r1_8 * sin7_5.y) + ) + (r2_7 * sin7_5.z)) + (r3_6 * sin7_5.w)); s_2 = tmpvar_23; vec4 tmpvar_24; - tmpvar_24 = ((((1.0 + (r5_12 * cos8_4.x)) + (r6_11 * cos8_4.y)) + (r7_10 * cos8_4.z)) + (r8_9 * cos8_4.w)); + tmpvar_24 = ((( + (1.0 + (r5_12 * cos8_4.x)) + + + (r6_11 * cos8_4.y) + ) + (r7_10 * cos8_4.z)) + (r8_9 * cos8_4.w)); c_3 = tmpvar_24; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt index 9e3698ed1..405f959ca 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt @@ -1,5 +1,5 @@ -uniform vec4 _WaveAndDistance; uniform vec4 _ProjectionParams; +uniform vec4 _WaveAndDistance; void main () { vec4 tmpvar_1; @@ -8,7 +8,9 @@ void main () vec3 waveMove_3; waveMove_3.y = 0.0; vec4 tmpvar_4; - tmpvar_4 = ((fract((((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)))) * 6.40885) - 3.14159); + tmpvar_4 = ((fract( + (((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); vec4 tmpvar_5; tmpvar_5 = (tmpvar_4 * tmpvar_4); vec4 tmpvar_6; @@ -16,7 +18,9 @@ void main () vec4 tmpvar_7; tmpvar_7 = (tmpvar_6 * tmpvar_5); vec4 tmpvar_8; - tmpvar_8 = (((tmpvar_4 + (tmpvar_6 * -0.161616)) + (tmpvar_7 * 0.0083333)) + ((tmpvar_7 * tmpvar_5) * -0.00019841)); + tmpvar_8 = (((tmpvar_4 + + (tmpvar_6 * -0.161616) + ) + (tmpvar_7 * 0.0083333)) + ((tmpvar_7 * tmpvar_5) * -0.00019841)); vec4 tmpvar_9; tmpvar_9 = (tmpvar_8 * tmpvar_8); vec4 tmpvar_10; @@ -34,3 +38,5 @@ void main () gl_TexCoord[1] = tmpvar_1; } + +// inputs: 3, stats: 35 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt index 044dfb131..ab9b92792 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-ir.txt @@ -8,11 +8,11 @@ struct appdata_tree_billboard { vec4 texcoord; vec2 texcoord1; }; -uniform vec4 _TreeBillboardDistances; -uniform vec4 _TreeBillboardCameraUp; -uniform vec3 _TreeBillboardCameraRight; -uniform vec4 _TreeBillboardCameraPos; uniform vec4 _TreeBillboardCameraFront; +uniform vec4 _TreeBillboardCameraPos; +uniform vec3 _TreeBillboardCameraRight; +uniform vec4 _TreeBillboardCameraUp; +uniform vec4 _TreeBillboardDistances; void TerrainBillboardTree ( inout vec4 pos_1, in vec2 offset_2, @@ -66,7 +66,9 @@ void TerrainBillboardTree ( vec3 tmpvar_24; tmpvar_24 = vec3(billboardModeFactor_6); vec3 tmpvar_25; - tmpvar_25 = mix (((((_TreeBillboardCameraUp.xyz * tmpvar_23) * 2.0) - (vec3(0.0, 1.0, 0.0) * absRadius_4)) - ((_TreeBillboardCameraUp.xyz * absRadius_4) * billboardRootOffsetFactor_5)), (_TreeBillboardCameraUp.xyz * radius_7), tmpvar_24); + tmpvar_25 = mix (((( + (_TreeBillboardCameraUp.xyz * tmpvar_23) + * 2.0) - (vec3(0.0, 1.0, 0.0) * absRadius_4)) - ((_TreeBillboardCameraUp.xyz * absRadius_4) * billboardRootOffsetFactor_5)), (_TreeBillboardCameraUp.xyz * radius_7), tmpvar_24); vec3 tmpvar_26; tmpvar_26 = (pos_1.xyz + tmpvar_25); pos_1.xyz = tmpvar_26.xyz.xyz; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt index 87cf7ccf8..c0532e933 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt @@ -1,8 +1,8 @@ -uniform vec4 _TreeBillboardDistances; -uniform vec4 _TreeBillboardCameraUp; -uniform vec3 _TreeBillboardCameraRight; -uniform vec4 _TreeBillboardCameraPos; uniform vec4 _TreeBillboardCameraFront; +uniform vec4 _TreeBillboardCameraPos; +uniform vec3 _TreeBillboardCameraRight; +uniform vec4 _TreeBillboardCameraUp; +uniform vec4 _TreeBillboardDistances; void main () { vec2 tmpvar_1; @@ -22,7 +22,11 @@ void main () tmpvar_6 = mix (offset_3.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w); float tmpvar_7; tmpvar_7 = abs(tmpvar_6); - pos_2.xyz = (pos_2.xyz + mix (((((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7)) - ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w)), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www)); + pos_2.xyz = (pos_2.xyz + mix (( + (((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7)) + - + ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w) + ), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www)); tmpvar_1.x = gl_MultiTexCoord0.x; tmpvar_1.y = float((gl_MultiTexCoord0.y > 0.0)); gl_Position = (gl_ModelViewProjectionMatrix * pos_2); @@ -32,3 +36,5 @@ void main () gl_TexCoord[0] = tmpvar_8; } + +// inputs: 3, stats: 23 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt index 55e3e26c1..8c22c2351 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt @@ -1,39 +1,42 @@ uniform vec4 _MainTex_TexelSize; void main () { - vec2 tmpvar_1; - tmpvar_1 = gl_MultiTexCoord0.xy; - vec4 uv_2; - vec4 tmpvar_3; - tmpvar_3.zw = vec2(0.0, 0.0); - tmpvar_3.x = tmpvar_1.x; - tmpvar_3.y = tmpvar_1.y; - uv_2.xy = (gl_TextureMatrix[0] * tmpvar_3).xy; - uv_2.zw = vec2(0.0, 0.0); + vec4 uv_1; + vec4 tmpvar_2; + tmpvar_2.zw = vec2(0.0, 0.0); + tmpvar_2.xy = gl_MultiTexCoord0.xy; + uv_1.xy = (gl_TextureMatrix[0] * tmpvar_2).xy; + uv_1.zw = vec2(0.0, 0.0); + float tmpvar_3; + tmpvar_3 = _MainTex_TexelSize.x; float tmpvar_4; - tmpvar_4 = _MainTex_TexelSize.x; - float tmpvar_5; - tmpvar_5 = _MainTex_TexelSize.y; - vec4 tmpvar_6; - tmpvar_6.zw = vec2(0.0, 1.0); - tmpvar_6.x = -(_MainTex_TexelSize.x); - tmpvar_6.y = -(_MainTex_TexelSize.y); - vec4 tmpvar_7; - tmpvar_7.zw = vec2(0.0, 1.0); - tmpvar_7.x = tmpvar_4; - tmpvar_7.y = -(_MainTex_TexelSize.y); + tmpvar_4 = _MainTex_TexelSize.y; + vec4 tmpvar_5; + tmpvar_5.zw = vec2(0.0, 1.0); + float cse_6; + cse_6 = -(_MainTex_TexelSize.x); + tmpvar_5.x = cse_6; + float cse_7; + cse_7 = -(_MainTex_TexelSize.y); + tmpvar_5.y = cse_7; vec4 tmpvar_8; tmpvar_8.zw = vec2(0.0, 1.0); - tmpvar_8.x = tmpvar_4; - tmpvar_8.y = tmpvar_5; + tmpvar_8.x = tmpvar_3; + tmpvar_8.y = cse_7; vec4 tmpvar_9; tmpvar_9.zw = vec2(0.0, 1.0); - tmpvar_9.x = -(_MainTex_TexelSize.x); - tmpvar_9.y = tmpvar_5; + tmpvar_9.x = tmpvar_3; + tmpvar_9.y = tmpvar_4; + vec4 tmpvar_10; + tmpvar_10.zw = vec2(0.0, 1.0); + tmpvar_10.x = cse_6; + tmpvar_10.y = tmpvar_4; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); - gl_TexCoord[0] = (uv_2 + tmpvar_6); - gl_TexCoord[1] = (uv_2 + tmpvar_7); - gl_TexCoord[2] = (uv_2 + tmpvar_8); - gl_TexCoord[3] = (uv_2 + tmpvar_9); + gl_TexCoord[0] = (uv_1 + tmpvar_5); + gl_TexCoord[1] = (uv_1 + tmpvar_8); + gl_TexCoord[2] = (uv_1 + tmpvar_9); + gl_TexCoord[3] = (uv_1 + tmpvar_10); } + +// inputs: 2, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt index 312727868..cb799b50d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-ir.txt @@ -9,8 +9,8 @@ struct appdata_t { vec4 color; vec2 texcoord; }; -uniform vec4 _MainTex_ST; uniform mat4 _GUIClipTextureMatrix; +uniform vec4 _MainTex_ST; v2f vert ( in appdata_t v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt index 53f49cecc..295771f57 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt @@ -1,5 +1,5 @@ -uniform vec4 _MainTex_ST; uniform mat4 _GUIClipTextureMatrix; +uniform vec4 _MainTex_ST; void main () { gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); @@ -14,3 +14,5 @@ void main () gl_TexCoord[1] = tmpvar_2; } + +// inputs: 3, stats: 7 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt index 3863fd91a..1e10c3c5f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt @@ -19,3 +19,5 @@ void main () gl_TexCoord[1] = tmpvar_5; } + +// inputs: 2, stats: 10 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt index 205bd8a5f..b6b12f5b4 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-ir.txt @@ -8,8 +8,8 @@ struct v2f { vec2 uvg; vec2 uvs; }; -uniform vec4 _ScratchOffsetScale; uniform vec4 _GrainOffsetScale; +uniform vec4 _ScratchOffsetScale; vec2 MultiplyUV ( in mat4 mat_1, in vec2 inUV_2 diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt index d5fac99be..4ea96facf 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt @@ -1,25 +1,24 @@ -uniform vec4 _ScratchOffsetScale; uniform vec4 _GrainOffsetScale; +uniform vec4 _ScratchOffsetScale; void main () { - vec2 tmpvar_1; - tmpvar_1 = gl_MultiTexCoord0.xy; + vec4 tmpvar_1; + tmpvar_1.zw = vec2(0.0, 0.0); + tmpvar_1.xy = gl_MultiTexCoord0.xy; + gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_2; tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.x = tmpvar_1.x; - tmpvar_2.y = tmpvar_1.y; - gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); + tmpvar_2.xy = (gl_TextureMatrix[0] * tmpvar_1).xy; + gl_TexCoord[0] = tmpvar_2; vec4 tmpvar_3; tmpvar_3.zw = vec2(0.0, 0.0); - tmpvar_3.xy = (gl_TextureMatrix[0] * tmpvar_2).xy; - gl_TexCoord[0] = tmpvar_3; + tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _GrainOffsetScale.zw) + _GrainOffsetScale.xy); + gl_TexCoord[1] = tmpvar_3; vec4 tmpvar_4; tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _GrainOffsetScale.zw) + _GrainOffsetScale.xy); - gl_TexCoord[1] = tmpvar_4; - vec4 tmpvar_5; - tmpvar_5.zw = vec2(0.0, 0.0); - tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _ScratchOffsetScale.zw) + _ScratchOffsetScale.xy); - gl_TexCoord[2] = tmpvar_5; + tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _ScratchOffsetScale.zw) + _ScratchOffsetScale.xy); + gl_TexCoord[2] = tmpvar_4; } + +// inputs: 2, stats: 10 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt index df5313097..ffb816482 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-ir.txt @@ -10,12 +10,12 @@ struct appdata_tree_billboard { vec4 texcoord; vec2 texcoord1; }; -varying vec4 xlv_FOG; -uniform vec4 _TreeBillboardDistances; -uniform vec4 _TreeBillboardCameraUp; -uniform vec3 _TreeBillboardCameraRight; -uniform vec4 _TreeBillboardCameraPos; uniform vec4 _TreeBillboardCameraFront; +uniform vec4 _TreeBillboardCameraPos; +uniform vec3 _TreeBillboardCameraRight; +uniform vec4 _TreeBillboardCameraUp; +uniform vec4 _TreeBillboardDistances; +varying vec4 xlv_FOG; void TerrainBillboardTree ( inout vec4 pos_1, in vec2 offset_2, @@ -69,7 +69,9 @@ void TerrainBillboardTree ( vec3 tmpvar_24; tmpvar_24 = vec3(billboardModeFactor_6); vec3 tmpvar_25; - tmpvar_25 = mix (((((_TreeBillboardCameraUp.xyz * tmpvar_23) * 2.0) - (vec3(0.0, 1.0, 0.0) * absRadius_4)) - ((_TreeBillboardCameraUp.xyz * absRadius_4) * billboardRootOffsetFactor_5)), (_TreeBillboardCameraUp.xyz * radius_7), tmpvar_24); + tmpvar_25 = mix (((( + (_TreeBillboardCameraUp.xyz * tmpvar_23) + * 2.0) - (vec3(0.0, 1.0, 0.0) * absRadius_4)) - ((_TreeBillboardCameraUp.xyz * absRadius_4) * billboardRootOffsetFactor_5)), (_TreeBillboardCameraUp.xyz * radius_7), tmpvar_24); vec3 tmpvar_26; tmpvar_26 = (pos_1.xyz + tmpvar_25); pos_1.xyz = tmpvar_26.xyz.xyz; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt index 0ca441624..dcc03f0e0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 _TreeBillboardDistances; -uniform vec4 _TreeBillboardCameraUp; -uniform vec3 _TreeBillboardCameraRight; -uniform vec4 _TreeBillboardCameraPos; uniform vec4 _TreeBillboardCameraFront; +uniform vec4 _TreeBillboardCameraPos; +uniform vec3 _TreeBillboardCameraRight; +uniform vec4 _TreeBillboardCameraUp; +uniform vec4 _TreeBillboardDistances; +varying vec4 xlv_FOG; void main () { vec2 tmpvar_1; @@ -23,7 +23,11 @@ void main () tmpvar_6 = mix (offset_3.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w); float tmpvar_7; tmpvar_7 = abs(tmpvar_6); - pos_2.xyz = (pos_2.xyz + mix (((((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7)) - ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w)), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www)); + pos_2.xyz = (pos_2.xyz + mix (( + (((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7)) + - + ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w) + ), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www)); vec4 tmpvar_8; tmpvar_8 = (gl_ModelViewProjectionMatrix * pos_2); tmpvar_1.x = gl_MultiTexCoord0.x; @@ -40,3 +44,5 @@ void main () gl_TexCoord[0] = tmpvar_10; } + +// inputs: 4, stats: 24 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt index 8932b3eb9..16670f477 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-ir.txt @@ -14,31 +14,31 @@ struct v2f_surf { vec3 normal; vec3 vlight; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform vec3 _CameraUp; -uniform vec3 _CameraRight; uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -108,10 +108,16 @@ void FastSinCos ( tmpvar_30 = (r2_15 * r5_20); r3_14 = tmpvar_30; vec4 tmpvar_31; - tmpvar_31 = (((val_9 + (r1_16 * sin7_13.y)) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); + tmpvar_31 = (((val_9 + + (r1_16 * sin7_13.y) + ) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); s_10 = tmpvar_31; vec4 tmpvar_32; - tmpvar_32 = ((((1.0 + (r5_20 * cos8_12.x)) + (r6_19 * cos8_12.y)) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); + tmpvar_32 = ((( + (1.0 + (r5_20 * cos8_12.x)) + + + (r6_19 * cos8_12.y) + ) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); c_11 = tmpvar_32; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt index 9b5d97136..3d3839925 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt @@ -1,28 +1,28 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform vec3 _CameraUp; -uniform vec3 _CameraRight; uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 pos_1; @@ -44,7 +44,9 @@ void main () vec3 waveMove_7; waveMove_7.y = 0.0; vec4 tmpvar_8; - tmpvar_8 = ((fract((((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)))) * 6.40885) - 3.14159); + tmpvar_8 = ((fract( + (((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); vec4 tmpvar_9; tmpvar_9 = (tmpvar_8 * tmpvar_8); vec4 tmpvar_10; @@ -52,7 +54,9 @@ void main () vec4 tmpvar_11; tmpvar_11 = (tmpvar_10 * tmpvar_9); vec4 tmpvar_12; - tmpvar_12 = (((tmpvar_8 + (tmpvar_10 * -0.161616)) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); + tmpvar_12 = (((tmpvar_8 + + (tmpvar_10 * -0.161616) + ) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); vec4 tmpvar_13; tmpvar_13 = (tmpvar_12 * tmpvar_12); vec4 tmpvar_14; @@ -62,7 +66,9 @@ void main () waveMove_7.x = dot (tmpvar_15, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_7.z = dot (tmpvar_15, vec4(0.006, 0.02, -0.02, 0.1)); vertex_5.xz = (pos_1.xz - (waveMove_7.xz * _WaveAndDistance.z)); - outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3((dot (tmpvar_14, normalize(vec4(1.0, 1.0, 0.4, 0.2))) * 0.7)))) * 2.0); + outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( + (dot (tmpvar_14, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) + ))) * 2.0); outColor_6.w = 1.0; vec4 tmpvar_16; tmpvar_16 = (gl_ModelViewProjectionMatrix * vertex_5); @@ -96,7 +102,13 @@ void main () vec4 tmpvar_27; tmpvar_27 = (((tmpvar_24 * tmpvar_24) + (tmpvar_25 * tmpvar_25)) + (tmpvar_26 * tmpvar_26)); vec4 tmpvar_28; - tmpvar_28 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_24 * tmpvar_18.x) + (tmpvar_25 * tmpvar_18.y)) + (tmpvar_26 * tmpvar_18.z)) * inversesqrt(tmpvar_27))) * (1.0/((1.0 + (tmpvar_27 * unity_4LightAtten0))))); + tmpvar_28 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( + (((tmpvar_24 * tmpvar_18.x) + (tmpvar_25 * tmpvar_18.y)) + (tmpvar_26 * tmpvar_18.z)) + * + inversesqrt(tmpvar_27) + )) * (1.0/((1.0 + + (tmpvar_27 * unity_4LightAtten0) + )))); gl_Position = tmpvar_16; vec4 tmpvar_29; tmpvar_29.yzw = vec3(0.0, 0.0, 0.0); @@ -113,7 +125,15 @@ void main () gl_TexCoord[1] = tmpvar_31; vec4 tmpvar_32; tmpvar_32.w = 0.0; - tmpvar_32.xyz = (((x1_21 + x2_20) + (unity_SHC.xyz * ((tmpvar_18.x * tmpvar_18.x) - (tmpvar_18.y * tmpvar_18.y)))) + ((((unity_LightColor0 * tmpvar_28.x) + (unity_LightColor1 * tmpvar_28.y)) + (unity_LightColor2 * tmpvar_28.z)) + (unity_LightColor3 * tmpvar_28.w))); + tmpvar_32.xyz = (((x1_21 + x2_20) + (unity_SHC.xyz * + ((tmpvar_18.x * tmpvar_18.x) - (tmpvar_18.y * tmpvar_18.y)) + )) + (( + ((unity_LightColor0 * tmpvar_28.x) + (unity_LightColor1 * tmpvar_28.y)) + + + (unity_LightColor2 * tmpvar_28.z) + ) + (unity_LightColor3 * tmpvar_28.w))); gl_TexCoord[2] = tmpvar_32; } + +// inputs: 5, stats: 94 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt index a39c1dc27..bd6fa8388 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-ir.txt @@ -15,18 +15,18 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; -uniform vec3 _CameraUp; -uniform vec3 _CameraRight; uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -96,10 +96,16 @@ void FastSinCos ( tmpvar_30 = (r2_15 * r5_20); r3_14 = tmpvar_30; vec4 tmpvar_31; - tmpvar_31 = (((val_9 + (r1_16 * sin7_13.y)) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); + tmpvar_31 = (((val_9 + + (r1_16 * sin7_13.y) + ) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); s_10 = tmpvar_31; vec4 tmpvar_32; - tmpvar_32 = ((((1.0 + (r5_20 * cos8_12.x)) + (r6_19 * cos8_12.y)) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); + tmpvar_32 = ((( + (1.0 + (r5_20 * cos8_12.x)) + + + (r6_19 * cos8_12.y) + ) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); c_11 = tmpvar_32; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt index 84950e786..e661e09fa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt @@ -1,15 +1,15 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; -uniform vec3 _CameraUp; -uniform vec3 _CameraRight; uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 pos_1; @@ -31,7 +31,9 @@ void main () vec3 waveMove_7; waveMove_7.y = 0.0; vec4 tmpvar_8; - tmpvar_8 = ((fract((((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)))) * 6.40885) - 3.14159); + tmpvar_8 = ((fract( + (((pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); vec4 tmpvar_9; tmpvar_9 = (tmpvar_8 * tmpvar_8); vec4 tmpvar_10; @@ -39,7 +41,9 @@ void main () vec4 tmpvar_11; tmpvar_11 = (tmpvar_10 * tmpvar_9); vec4 tmpvar_12; - tmpvar_12 = (((tmpvar_8 + (tmpvar_10 * -0.161616)) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); + tmpvar_12 = (((tmpvar_8 + + (tmpvar_10 * -0.161616) + ) + (tmpvar_11 * 0.0083333)) + ((tmpvar_11 * tmpvar_9) * -0.00019841)); vec4 tmpvar_13; tmpvar_13 = (tmpvar_12 * tmpvar_12); vec4 tmpvar_14; @@ -49,7 +53,9 @@ void main () waveMove_7.x = dot (tmpvar_15, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_7.z = dot (tmpvar_15, vec4(0.006, 0.02, -0.02, 0.1)); vertex_5.xz = (pos_1.xz - (waveMove_7.xz * _WaveAndDistance.z)); - outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3((dot (tmpvar_14, normalize(vec4(1.0, 1.0, 0.4, 0.2))) * 0.7)))) * 2.0); + outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( + (dot (tmpvar_14, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) + ))) * 2.0); outColor_6.w = 1.0; vec4 tmpvar_16; tmpvar_16 = (gl_ModelViewProjectionMatrix * vertex_5); @@ -81,3 +87,5 @@ void main () gl_TexCoord[3] = tmpvar_22; } + +// inputs: 5, stats: 56 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt index 57b937d0b..fb22450e7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-ir.txt @@ -11,14 +11,14 @@ struct v2f_surf { vec2 hip_pack0; vec4 lop_color; }; -attribute vec4 TANGENT; -uniform vec4 unity_LightShadowBias; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform vec4 _MainTex_ST; -uniform vec3 _CameraUp; -uniform vec3 _CameraRight; uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform vec4 _MainTex_ST; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 unity_LightShadowBias; +attribute vec4 TANGENT; void FastSinCos ( in vec4 val_1, out vec4 s_2, @@ -65,10 +65,16 @@ void FastSinCos ( tmpvar_22 = (r2_7 * r5_12); r3_6 = tmpvar_22; vec4 tmpvar_23; - tmpvar_23 = (((val_1 + (r1_8 * sin7_5.y)) + (r2_7 * sin7_5.z)) + (r3_6 * sin7_5.w)); + tmpvar_23 = (((val_1 + + (r1_8 * sin7_5.y) + ) + (r2_7 * sin7_5.z)) + (r3_6 * sin7_5.w)); s_2 = tmpvar_23; vec4 tmpvar_24; - tmpvar_24 = ((((1.0 + (r5_12 * cos8_4.x)) + (r6_11 * cos8_4.y)) + (r7_10 * cos8_4.z)) + (r8_9 * cos8_4.w)); + tmpvar_24 = ((( + (1.0 + (r5_12 * cos8_4.x)) + + + (r6_11 * cos8_4.y) + ) + (r7_10 * cos8_4.z)) + (r8_9 * cos8_4.w)); c_3 = tmpvar_24; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt index e851e6244..a8a6f8832 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt @@ -1,11 +1,11 @@ -attribute vec4 TANGENT; -uniform vec4 unity_LightShadowBias; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform vec4 _MainTex_ST; -uniform vec3 _CameraUp; -uniform vec3 _CameraRight; uniform vec4 _CameraPosition; +uniform vec3 _CameraRight; +uniform vec3 _CameraUp; +uniform vec4 _MainTex_ST; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 unity_LightShadowBias; +attribute vec4 TANGENT; void main () { vec4 tmpvar_1; @@ -29,7 +29,9 @@ void main () vec3 waveMove_9; waveMove_9.y = 0.0; vec4 tmpvar_10; - tmpvar_10 = ((fract((((pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)))) * 6.40885) - 3.14159); + tmpvar_10 = ((fract( + (((pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); vec4 tmpvar_11; tmpvar_11 = (tmpvar_10 * tmpvar_10); vec4 tmpvar_12; @@ -37,7 +39,9 @@ void main () vec4 tmpvar_13; tmpvar_13 = (tmpvar_12 * tmpvar_11); vec4 tmpvar_14; - tmpvar_14 = (((tmpvar_10 + (tmpvar_12 * -0.161616)) + (tmpvar_13 * 0.0083333)) + ((tmpvar_13 * tmpvar_11) * -0.00019841)); + tmpvar_14 = (((tmpvar_10 + + (tmpvar_12 * -0.161616) + ) + (tmpvar_13 * 0.0083333)) + ((tmpvar_13 * tmpvar_11) * -0.00019841)); vec4 tmpvar_15; tmpvar_15 = (tmpvar_14 * tmpvar_14); vec4 tmpvar_16; @@ -47,7 +51,9 @@ void main () waveMove_9.x = dot (tmpvar_17, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_9.z = dot (tmpvar_17, vec4(0.006, 0.02, -0.02, 0.1)); vertex_7.xz = (pos_3.xz - (waveMove_9.xz * _WaveAndDistance.z)); - outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3((dot (tmpvar_16, normalize(vec4(1.0, 1.0, 0.4, 0.2))) * 0.7)))) * 2.0); + outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( + (dot (tmpvar_16, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) + ))) * 2.0); outColor_8.w = 1.0; tmpvar_2 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); vec4 tmpvar_18; @@ -65,3 +71,5 @@ void main () gl_FrontColor = outColor_8; } + +// inputs: 4, stats: 50 alu 0 tex 2 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt index dfceada2b..5faab96d0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-ir.txt @@ -15,15 +15,15 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -93,10 +93,16 @@ void FastSinCos ( tmpvar_30 = (r2_15 * r5_20); r3_14 = tmpvar_30; vec4 tmpvar_31; - tmpvar_31 = (((val_9 + (r1_16 * sin7_13.y)) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); + tmpvar_31 = (((val_9 + + (r1_16 * sin7_13.y) + ) + (r2_15 * sin7_13.z)) + (r3_14 * sin7_13.w)); s_10 = tmpvar_31; vec4 tmpvar_32; - tmpvar_32 = ((((1.0 + (r5_20 * cos8_12.x)) + (r6_19 * cos8_12.y)) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); + tmpvar_32 = ((( + (1.0 + (r5_20 * cos8_12.x)) + + + (r6_19 * cos8_12.y) + ) + (r7_18 * cos8_12.z)) + (r8_17 * cos8_12.w)); c_11 = tmpvar_32; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt index deae43b30..a56694e45 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec4 _WavingTint; -uniform vec4 _WaveAndDistance; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WaveAndDistance; +uniform vec4 _WavingTint; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 vertex_1; @@ -14,7 +14,9 @@ void main () vec3 waveMove_3; waveMove_3.y = 0.0; vec4 tmpvar_4; - tmpvar_4 = ((fract((((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)))) * 6.40885) - 3.14159); + tmpvar_4 = ((fract( + (((gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y)) + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y))) + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8))) + ) * 6.40885) - 3.14159); vec4 tmpvar_5; tmpvar_5 = (tmpvar_4 * tmpvar_4); vec4 tmpvar_6; @@ -22,7 +24,9 @@ void main () vec4 tmpvar_7; tmpvar_7 = (tmpvar_6 * tmpvar_5); vec4 tmpvar_8; - tmpvar_8 = (((tmpvar_4 + (tmpvar_6 * -0.161616)) + (tmpvar_7 * 0.0083333)) + ((tmpvar_7 * tmpvar_5) * -0.00019841)); + tmpvar_8 = (((tmpvar_4 + + (tmpvar_6 * -0.161616) + ) + (tmpvar_7 * 0.0083333)) + ((tmpvar_7 * tmpvar_5) * -0.00019841)); vec4 tmpvar_9; tmpvar_9 = (tmpvar_8 * tmpvar_8); vec4 tmpvar_10; @@ -32,7 +36,9 @@ void main () waveMove_3.x = dot (tmpvar_11, vec4(0.024, 0.04, -0.12, 0.096)); waveMove_3.z = dot (tmpvar_11, vec4(0.006, 0.02, -0.02, 0.1)); vertex_1.xz = (gl_Vertex.xz - (waveMove_3.xz * _WaveAndDistance.z)); - outColor_2.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3((dot (tmpvar_10, normalize(vec4(1.0, 1.0, 0.4, 0.2))) * 0.7)))) * 2.0); + outColor_2.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3( + (dot (tmpvar_10, vec4(0.6742, 0.6742, 0.26968, 0.13484)) * 0.7) + ))) * 2.0); outColor_2.w = 1.0; vec4 tmpvar_12; tmpvar_12 = (gl_ModelViewProjectionMatrix * vertex_1); @@ -61,3 +67,5 @@ void main () gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * vertex_1)); } + +// inputs: 4, stats: 48 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt index eec47c4de..6eabfe2a7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-ir.txt @@ -11,16 +11,16 @@ struct appdata_tree { vec4 color; vec4 texcoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec3 _TerrainTreeLightDirections[4]; -uniform vec4 _TerrainTreeLightColors[4]; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform vec4 _Color; uniform float _AO; +uniform vec4 _Color; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt index cf8ea1a12..7d53d07ab 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -uniform vec3 _TerrainTreeLightDirections[4]; -uniform vec4 _TerrainTreeLightColors[4]; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform vec4 _Color; uniform float _AO; +uniform vec4 _Color; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +varying vec4 xlv_FOG; void main () { vec4 lightColor_1; @@ -24,20 +24,30 @@ void main () tmpvar_6.y = _SquashPlaneNormal.w; vec4 tmpvar_7; tmpvar_7.w = 1.0; - tmpvar_7.xyz = mix ((pos_4.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); + tmpvar_7.xyz = mix ((pos_4.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) + * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); pos_4 = tmpvar_7; vec4 tmpvar_8; tmpvar_8 = (gl_ModelViewProjectionMatrix * tmpvar_7); lightDir_2.w = _AO; lightColor_1 = gl_LightModel.ambient; lightDir_2.xyz = _TerrainTreeLightDirections[0]; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))); lightDir_2.xyz = _TerrainTreeLightDirections[1]; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))); lightDir_2.xyz = _TerrainTreeLightDirections[2]; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))); lightDir_2.xyz = _TerrainTreeLightDirections[3]; - lightColor_1.xyz = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))).xyz; + lightColor_1.xyz = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))).xyz; lightColor_1.w = 1.0; tmpvar_3.xyz = (lightColor_1 * _Color).xyz; tmpvar_3.w = 1.0; @@ -50,3 +60,5 @@ void main () gl_FrontColor = tmpvar_3; } + +// inputs: 4, stats: 32 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt index eec47c4de..6eabfe2a7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-ir.txt @@ -11,16 +11,16 @@ struct appdata_tree { vec4 color; vec4 texcoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec3 _TerrainTreeLightDirections[4]; -uniform vec4 _TerrainTreeLightColors[4]; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform vec4 _Color; uniform float _AO; +uniform vec4 _Color; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt index cf8ea1a12..7d53d07ab 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -uniform vec3 _TerrainTreeLightDirections[4]; -uniform vec4 _TerrainTreeLightColors[4]; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform vec4 _Color; uniform float _AO; +uniform vec4 _Color; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +varying vec4 xlv_FOG; void main () { vec4 lightColor_1; @@ -24,20 +24,30 @@ void main () tmpvar_6.y = _SquashPlaneNormal.w; vec4 tmpvar_7; tmpvar_7.w = 1.0; - tmpvar_7.xyz = mix ((pos_4.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); + tmpvar_7.xyz = mix ((pos_4.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz)) + * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount)); pos_4 = tmpvar_7; vec4 tmpvar_8; tmpvar_8 = (gl_ModelViewProjectionMatrix * tmpvar_7); lightDir_2.w = _AO; lightColor_1 = gl_LightModel.ambient; lightDir_2.xyz = _TerrainTreeLightDirections[0]; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))); lightDir_2.xyz = _TerrainTreeLightDirections[1]; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))); lightDir_2.xyz = _TerrainTreeLightDirections[2]; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))); lightDir_2.xyz = _TerrainTreeLightDirections[3]; - lightColor_1.xyz = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, dot (lightDir_2.xyz, gl_Normal)))).xyz; + lightColor_1.xyz = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, + dot (lightDir_2.xyz, gl_Normal) + ))).xyz; lightColor_1.w = 1.0; tmpvar_3.xyz = (lightColor_1 * _Color).xyz; tmpvar_3.w = 1.0; @@ -50,3 +60,5 @@ void main () gl_FrontColor = tmpvar_3; } + +// inputs: 4, stats: 32 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt index c1a7bffb1..9c9f2bbe8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-ir.txt @@ -16,31 +16,31 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _Splat3_ST; -uniform vec4 _Splat2_ST; -uniform vec4 _Splat1_ST; -uniform vec4 _Splat0_ST; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _Control_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform vec4 _Splat0_ST; +uniform vec4 _Splat1_ST; +uniform vec4 _Splat2_ST; +uniform vec4 _Splat3_ST; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt index 1116de908..d39356df8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt @@ -1,27 +1,27 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _Splat3_ST; -uniform vec4 _Splat2_ST; -uniform vec4 _Splat1_ST; -uniform vec4 _Splat0_ST; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _Control_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform vec4 _Splat0_ST; +uniform vec4 _Splat1_ST; +uniform vec4 _Splat2_ST; +uniform vec4 _Splat3_ST; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -62,7 +62,13 @@ void main () vec4 tmpvar_14; tmpvar_14 = (((tmpvar_11 * tmpvar_11) + (tmpvar_12 * tmpvar_12)) + (tmpvar_13 * tmpvar_13)); vec4 tmpvar_15; - tmpvar_15 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_11 * tmpvar_5.x) + (tmpvar_12 * tmpvar_5.y)) + (tmpvar_13 * tmpvar_5.z)) * inversesqrt(tmpvar_14))) * (1.0/((1.0 + (tmpvar_14 * unity_4LightAtten0))))); + tmpvar_15 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( + (((tmpvar_11 * tmpvar_5.x) + (tmpvar_12 * tmpvar_5.y)) + (tmpvar_13 * tmpvar_5.z)) + * + inversesqrt(tmpvar_14) + )) * (1.0/((1.0 + + (tmpvar_14 * unity_4LightAtten0) + )))); vec4 o_16; vec4 tmpvar_17; tmpvar_17 = (tmpvar_3 * 0.5); @@ -88,8 +94,16 @@ void main () gl_TexCoord[3] = tmpvar_21; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (((x1_8 + x2_7) + (unity_SHC.xyz * ((tmpvar_5.x * tmpvar_5.x) - (tmpvar_5.y * tmpvar_5.y)))) + ((((unity_LightColor0 * tmpvar_15.x) + (unity_LightColor1 * tmpvar_15.y)) + (unity_LightColor2 * tmpvar_15.z)) + (unity_LightColor3 * tmpvar_15.w))); + tmpvar_22.xyz = (((x1_8 + x2_7) + (unity_SHC.xyz * + ((tmpvar_5.x * tmpvar_5.x) - (tmpvar_5.y * tmpvar_5.y)) + )) + (( + ((unity_LightColor0 * tmpvar_15.x) + (unity_LightColor1 * tmpvar_15.y)) + + + (unity_LightColor2 * tmpvar_15.z) + ) + (unity_LightColor3 * tmpvar_15.w))); gl_TexCoord[4] = tmpvar_22; gl_TexCoord[5] = o_16; } + +// inputs: 3, stats: 63 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt index dfcdf2ced..749d8b22b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-ir.txt @@ -15,16 +15,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _Splat3_ST; -uniform vec4 _Splat2_ST; -uniform vec4 _Splat1_ST; -uniform vec4 _Splat0_ST; -uniform vec4 _ProjectionParams; uniform vec4 _Control_ST; +uniform vec4 _ProjectionParams; +uniform vec4 _Splat0_ST; +uniform vec4 _Splat1_ST; +uniform vec4 _Splat2_ST; +uniform vec4 _Splat3_ST; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -89,7 +89,9 @@ v2f_surf vert_surf ( tmpvar_21 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_13.hip_lmapFade.xy = tmpvar_21.xy.xy; float tmpvar_22; - tmpvar_22 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_22 = ((-( + (gl_ModelViewMatrix * v_12.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_13.hip_lmapFade.z = vec3(tmpvar_22).z; return o_13; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt index b3d6c3868..92ac6c4c2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _Splat3_ST; -uniform vec4 _Splat2_ST; -uniform vec4 _Splat1_ST; -uniform vec4 _Splat0_ST; -uniform vec4 _ProjectionParams; uniform vec4 _Control_ST; +uniform vec4 _ProjectionParams; +uniform vec4 _Splat0_ST; +uniform vec4 _Splat1_ST; +uniform vec4 _Splat2_ST; +uniform vec4 _Splat3_ST; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -27,7 +27,9 @@ void main () o_5.xy = (tmpvar_7 + tmpvar_6.w); o_5.zw = tmpvar_4.zw; tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_3.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_3.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_4; vec4 tmpvar_8; tmpvar_8.yzw = vec3(0.0, 0.0, 0.0); @@ -46,3 +48,5 @@ void main () gl_TexCoord[4] = tmpvar_10; } + +// inputs: 3, stats: 23 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt index 8dcf9a2c7..c6ee35549 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-ir.txt @@ -11,9 +11,9 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -attribute vec4 TANGENT; -uniform vec3 _TerrainTreeLightDirections[4]; uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +attribute vec4 TANGENT; v2f vert ( in appdata_full v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt index 464ac5077..3aacb15f6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt @@ -1,13 +1,21 @@ -uniform vec3 _TerrainTreeLightDirections[4]; uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; void main () { vec3 lightColor_1; lightColor_1 = gl_LightModel.ambient.xyz; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, dot (_TerrainTreeLightDirections[0], gl_Normal))).xyz); - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, dot (_TerrainTreeLightDirections[1], gl_Normal))).xyz); - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, dot (_TerrainTreeLightDirections[2], gl_Normal))).xyz); - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, dot (_TerrainTreeLightDirections[3], gl_Normal))).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, + dot (_TerrainTreeLightDirections[0], gl_Normal) + )).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, + dot (_TerrainTreeLightDirections[1], gl_Normal) + )).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, + dot (_TerrainTreeLightDirections[2], gl_Normal) + )).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, + dot (_TerrainTreeLightDirections[3], gl_Normal) + )).xyz); gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_2; tmpvar_2.zw = vec2(0.0, 0.0); @@ -19,3 +27,5 @@ void main () gl_TexCoord[1] = tmpvar_3; } + +// inputs: 4, stats: 20 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt index 33f0af0e7..aa15374ee 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-ir.txt @@ -11,9 +11,9 @@ struct v2f { vec2 uv; vec3 color; }; -attribute vec4 TANGENT; -uniform vec3 _TerrainTreeLightDirections[4]; uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +attribute vec4 TANGENT; void ExpandBillboard ( in mat4 mat_1, inout vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt index 35f03a81b..5c0c0eeef 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt @@ -1,6 +1,6 @@ -attribute vec4 TANGENT; -uniform vec3 _TerrainTreeLightDirections[4]; uniform vec4 _TerrainTreeLightColors[4]; +uniform vec3 _TerrainTreeLightDirections[4]; +attribute vec4 TANGENT; void main () { vec3 lightColor_1; @@ -12,11 +12,21 @@ void main () vec3 tmpvar_4; tmpvar_4 = mix (gl_Normal, normalize((tmpvar_3 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_2)); lightColor_1 = gl_LightModel.ambient.xyz; - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, ((dot (_TerrainTreeLightDirections[0], tmpvar_4) * 0.5) + 0.5))).xyz); - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, ((dot (_TerrainTreeLightDirections[1], tmpvar_4) * 0.5) + 0.5))).xyz); - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, ((dot (_TerrainTreeLightDirections[2], tmpvar_4) * 0.5) + 0.5))).xyz); - lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, ((dot (_TerrainTreeLightDirections[3], tmpvar_4) * 0.5) + 0.5))).xyz); - gl_Position = (gl_ModelViewProjectionMatrix * (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * tmpvar_2))); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0, + ((dot (_TerrainTreeLightDirections[0], tmpvar_4) * 0.5) + 0.5) + )).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0, + ((dot (_TerrainTreeLightDirections[1], tmpvar_4) * 0.5) + 0.5) + )).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0, + ((dot (_TerrainTreeLightDirections[2], tmpvar_4) * 0.5) + 0.5) + )).xyz); + lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0, + ((dot (_TerrainTreeLightDirections[3], tmpvar_4) * 0.5) + 0.5) + )).xyz); + gl_Position = (gl_ModelViewProjectionMatrix * (gl_Vertex + ( + (TANGENT * gl_ModelViewMatrixInverseTranspose) + * tmpvar_2))); vec4 tmpvar_5; tmpvar_5.zw = vec2(0.0, 0.0); tmpvar_5.xy = gl_MultiTexCoord0.xy; @@ -27,3 +37,5 @@ void main () gl_TexCoord[1] = tmpvar_6; } + +// inputs: 5, stats: 37 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt index 2a8f700e8..4acacc687 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-ir.txt @@ -15,21 +15,21 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) @@ -160,7 +160,11 @@ vec4 AnimateVertex ( tmpvar_51 = (animParams_25.w * fBranchAmp_33); bend_26.y = vec2(tmpvar_51).y; vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (((vWavesSum_27.xyx * bend_26) + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w)) * _Wind.w)); + tmpvar_52 = (pos_23.xyz + (( + (vWavesSum_27.xyx * bend_26) + + + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) + ) * _Wind.w)); pos_23.xyz = tmpvar_52.xyz.xyz; vec3 tmpvar_53; tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); @@ -294,8 +298,8 @@ v2f_surf vert_surf ( tmpvar_96 = v_79.normal.z; tmpvar_87[2].z = tmpvar_96; mat3 tmpvar_97; - tmpvar_97 = (tmpvar_87); - rotation_80 = (tmpvar_97); + tmpvar_97 = tmpvar_87; + rotation_80 = tmpvar_97; vec3 tmpvar_98; tmpvar_98 = ObjSpaceLightDir (v_79.vertex); vec3 tmpvar_99; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt index d78cfb7c9..6019b9c9d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt @@ -1,18 +1,18 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -29,20 +29,30 @@ void main () tmpvar_6.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_5))); tmpvar_6.y = tmpvar_5; vec4 tmpvar_7; - tmpvar_7 = abs(((fract((((fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_7 = abs((( + fract(((( + fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_8; tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); vec2 tmpvar_9; tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_1.xyz + (((tmpvar_9.xyx * bend_4) + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_3.xyz = (tmpvar_1.xyz + (( + (tmpvar_9.xyx * bend_4) + + + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_10; tmpvar_10.xz = vec2(0.0, 0.0); tmpvar_10.y = _SquashPlaneNormal.w; vec3 tmpvar_11; - tmpvar_11 = mix ((pos_3.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); + tmpvar_11 = mix ((pos_3.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) + * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); vec4 tmpvar_12; tmpvar_12.w = 1.0; tmpvar_12.xyz = tmpvar_11; @@ -82,11 +92,15 @@ void main () gl_FrontColor = tmpvar_13; vec4 tmpvar_21; tmpvar_21.w = 0.0; - tmpvar_21.xyz = (tmpvar_17 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - tmpvar_11)); + tmpvar_21.xyz = (tmpvar_17 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_11)); gl_TexCoord[1] = tmpvar_21; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_17 * (((_World2Object * tmpvar_18).xyz * unity_Scale.w) - tmpvar_11)); + tmpvar_22.xyz = (tmpvar_17 * (( + (_World2Object * tmpvar_18) + .xyz * unity_Scale.w) - tmpvar_11)); gl_TexCoord[2] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.w = 0.0; @@ -94,3 +108,5 @@ void main () gl_TexCoord[3] = tmpvar_23; } + +// inputs: 6, stats: 64 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt index a8277744b..53dbf7a51 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-ir.txt @@ -9,15 +9,15 @@ struct appdata_full { struct v2f_surf { vec4 pos; }; -attribute vec4 TANGENT; -uniform vec4 unity_LightShadowBias; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; uniform vec4 _Color; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform vec4 unity_LightShadowBias; +attribute vec4 TANGENT; vec4 Squash ( in vec4 pos_1 ) @@ -148,7 +148,11 @@ vec4 AnimateVertex ( tmpvar_51 = (animParams_25.w * fBranchAmp_33); bend_26.y = vec2(tmpvar_51).y; vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (((vWavesSum_27.xyx * bend_26) + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w)) * _Wind.w)); + tmpvar_52 = (pos_23.xyz + (( + (vWavesSum_27.xyx * bend_26) + + + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) + ) * _Wind.w)); pos_23.xyz = tmpvar_52.xyz.xyz; vec3 tmpvar_53; tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt index c0e978180..1c13a8ec5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt @@ -1,10 +1,10 @@ -uniform vec4 unity_LightShadowBias; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform vec4 unity_LightShadowBias; void main () { vec4 tmpvar_1; @@ -20,21 +20,31 @@ void main () tmpvar_6.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + tmpvar_5))); tmpvar_6.y = tmpvar_5; vec4 tmpvar_7; - tmpvar_7 = abs(((fract((((fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_7 = abs((( + fract(((( + fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_8; tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); vec2 tmpvar_9; tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_2.xyz + (((tmpvar_9.xyx * bend_4) + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_3.xyz = (tmpvar_2.xyz + (( + (tmpvar_9.xyx * bend_4) + + + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_10; tmpvar_10.xz = vec2(0.0, 0.0); tmpvar_10.y = _SquashPlaneNormal.w; vec4 tmpvar_11; tmpvar_11.w = 1.0; - tmpvar_11.xyz = mix ((pos_3.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); + tmpvar_11.xyz = mix ((pos_3.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) + * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); tmpvar_2 = tmpvar_11; vec4 tmpvar_12; tmpvar_12 = (gl_ModelViewProjectionMatrix * tmpvar_11); @@ -46,3 +56,5 @@ void main () gl_Position = tmpvar_1; } + +// inputs: 4, stats: 43 alu 0 tex 1 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt index 15deb3968..8d5739c41 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-ir.txt @@ -14,20 +14,20 @@ struct v2f_surf { vec3 lightDir; vec3 viewDir; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _Color; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) @@ -216,7 +216,11 @@ vec4 AnimateVertex ( tmpvar_76 = (animParams_50.w * fBranchAmp_58); bend_51.y = vec2(tmpvar_76).y; vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (((vWavesSum_52.xyx * bend_51) + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w)) * _Wind.w)); + tmpvar_77 = (pos_48.xyz + (( + (vWavesSum_52.xyx * bend_51) + + + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) + ) * _Wind.w)); pos_48.xyz = tmpvar_77.xyz.xyz; vec3 tmpvar_78; tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); @@ -351,8 +355,8 @@ v2f_surf vert_surf ( tmpvar_121 = v_104.normal.z; tmpvar_112[2].z = tmpvar_121; mat3 tmpvar_122; - tmpvar_122 = (tmpvar_112); - rotation_105 = (tmpvar_122); + tmpvar_122 = tmpvar_112; + rotation_105 = tmpvar_122; vec3 tmpvar_123; tmpvar_123 = ObjSpaceLightDir (v_104.vertex); vec3 tmpvar_124; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt index ea93b48ac..25cbe1895 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt @@ -1,17 +1,17 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _Color; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -46,20 +46,30 @@ void main () tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12))); tmpvar_13.y = tmpvar_12; vec4 tmpvar_14; - tmpvar_14 = abs(((fract((((fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_14 = abs((( + fract(((( + fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_15; tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); vec2 tmpvar_16; tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw); bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz; bend_11.y = (gl_MultiTexCoord1.y * 0.3); - pos_10.xyz = (tmpvar_1.xyz + (((tmpvar_16.xyx * bend_11) + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_10.xyz = (tmpvar_1.xyz + (( + (tmpvar_16.xyx * bend_11) + + + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_17; tmpvar_17.xz = vec2(0.0, 0.0); tmpvar_17.y = _SquashPlaneNormal.w; vec3 tmpvar_18; - tmpvar_18 = mix ((pos_10.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); + tmpvar_18 = mix ((pos_10.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) + * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); vec4 tmpvar_19; tmpvar_19.w = 1.0; tmpvar_19.xyz = tmpvar_18; @@ -103,7 +113,11 @@ void main () gl_TexCoord[1] = tmpvar_28; vec4 tmpvar_29; tmpvar_29.w = 0.0; - tmpvar_29.xyz = (tmpvar_24 * (((_World2Object * tmpvar_25).xyz * unity_Scale.w) - tmpvar_18)); + tmpvar_29.xyz = (tmpvar_24 * (( + (_World2Object * tmpvar_25) + .xyz * unity_Scale.w) - tmpvar_18)); gl_TexCoord[2] = tmpvar_29; } + +// inputs: 6, stats: 74 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt index 1f7782285..916639786 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-ir.txt @@ -15,21 +15,21 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) @@ -218,7 +218,11 @@ vec4 AnimateVertex ( tmpvar_76 = (animParams_50.w * fBranchAmp_58); bend_51.y = vec2(tmpvar_76).y; vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (((vWavesSum_52.xyx * bend_51) + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w)) * _Wind.w)); + tmpvar_77 = (pos_48.xyz + (( + (vWavesSum_52.xyx * bend_51) + + + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) + ) * _Wind.w)); pos_48.xyz = tmpvar_77.xyz.xyz; vec3 tmpvar_78; tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); @@ -353,8 +357,8 @@ v2f_surf vert_surf ( tmpvar_121 = v_104.normal.z; tmpvar_112[2].z = tmpvar_121; mat3 tmpvar_122; - tmpvar_122 = (tmpvar_112); - rotation_105 = (tmpvar_122); + tmpvar_122 = tmpvar_112; + rotation_105 = tmpvar_122; vec3 tmpvar_123; tmpvar_123 = ObjSpaceLightDir (v_104.vertex); vec3 tmpvar_124; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt index c9c5cf074..27635dfc2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt @@ -1,18 +1,18 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -47,20 +47,30 @@ void main () tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12))); tmpvar_13.y = tmpvar_12; vec4 tmpvar_14; - tmpvar_14 = abs(((fract((((fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_14 = abs((( + fract(((( + fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_15; tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); vec2 tmpvar_16; tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw); bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz; bend_11.y = (gl_MultiTexCoord1.y * 0.3); - pos_10.xyz = (tmpvar_1.xyz + (((tmpvar_16.xyx * bend_11) + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_10.xyz = (tmpvar_1.xyz + (( + (tmpvar_16.xyx * bend_11) + + + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_17; tmpvar_17.xz = vec2(0.0, 0.0); tmpvar_17.y = _SquashPlaneNormal.w; vec3 tmpvar_18; - tmpvar_18 = mix ((pos_10.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); + tmpvar_18 = mix ((pos_10.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) + * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); vec4 tmpvar_19; tmpvar_19.w = 1.0; tmpvar_19.xyz = tmpvar_18; @@ -100,11 +110,15 @@ void main () gl_FrontColor = tmpvar_20; vec4 tmpvar_28; tmpvar_28.w = 0.0; - tmpvar_28.xyz = (tmpvar_24 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - tmpvar_18)); + tmpvar_28.xyz = (tmpvar_24 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_18)); gl_TexCoord[1] = tmpvar_28; vec4 tmpvar_29; tmpvar_29.w = 0.0; - tmpvar_29.xyz = (tmpvar_24 * (((_World2Object * tmpvar_25).xyz * unity_Scale.w) - tmpvar_18)); + tmpvar_29.xyz = (tmpvar_24 * (( + (_World2Object * tmpvar_25) + .xyz * unity_Scale.w) - tmpvar_18)); gl_TexCoord[2] = tmpvar_29; vec4 tmpvar_30; tmpvar_30.w = 0.0; @@ -112,3 +126,5 @@ void main () gl_TexCoord[3] = tmpvar_30; } + +// inputs: 6, stats: 79 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt index 2e0bb7cfb..74ca25ee6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt @@ -5,8 +5,7 @@ void main () tmpvar_1 = (gl_MultiTexCoord0.xy - _CenterRadius.xy); vec4 tmpvar_2; tmpvar_2.zw = vec2(0.0, 0.0); - tmpvar_2.x = tmpvar_1.x; - tmpvar_2.y = tmpvar_1.y; + tmpvar_2.xy = tmpvar_1; gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_3; tmpvar_3.zw = vec2(0.0, 0.0); @@ -18,3 +17,5 @@ void main () gl_TexCoord[1] = tmpvar_4; } + +// inputs: 2, stats: 6 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt index 79c900f52..c05b093ad 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -94,8 +94,8 @@ v2f_surf vert_surf ( tmpvar_26 = v_9.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_10 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_10 = tmpvar_27; vec3 tmpvar_28; tmpvar_28 = ObjSpaceLightDir (v_9.vertex); vec3 tmpvar_29; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt index a35760d3f..b22e77338 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -41,3 +41,5 @@ void main () gl_TexCoord[2] = tmpvar_7; } + +// inputs: 4, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt index 0b0319b3f..60d4eac64 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-ir.txt @@ -14,17 +14,17 @@ struct v2f_surf { vec3 lightDir; vec4 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt index d617d828d..4da97fe10 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 pos_1; @@ -22,7 +22,9 @@ void main () tmpvar_3.y = _SquashPlaneNormal.w; vec4 tmpvar_4; tmpvar_4.w = 1.0; - tmpvar_4.xyz = mix ((pos_1.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); + tmpvar_4.xyz = mix ((pos_1.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) + * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); pos_1 = tmpvar_4; vec4 tmpvar_5; tmpvar_5 = (gl_ModelViewProjectionMatrix * tmpvar_4); @@ -50,3 +52,5 @@ void main () gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * tmpvar_4)); } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt index 7052cdc5b..6c82fc12f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-ir.txt @@ -10,13 +10,13 @@ struct v2f_surf { vec4 pos; vec3 vec; }; -attribute vec4 TANGENT; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; uniform vec4 _LightPositionRange; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +attribute vec4 TANGENT; vec4 Squash ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt index 293ee2307..636e490cf 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt @@ -1,9 +1,9 @@ -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; uniform vec4 _LightPositionRange; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; void main () { vec4 pos_1; @@ -18,7 +18,9 @@ void main () tmpvar_3.y = _SquashPlaneNormal.w; vec4 tmpvar_4; tmpvar_4.w = 1.0; - tmpvar_4.xyz = mix ((pos_1.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); + tmpvar_4.xyz = mix ((pos_1.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) + * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); pos_1 = tmpvar_4; gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_4); vec4 tmpvar_5; @@ -27,3 +29,5 @@ void main () gl_TexCoord[0] = tmpvar_5; } + +// inputs: 2, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt index 11ff88f01..6fa7e7b58 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-ir.txt @@ -14,17 +14,17 @@ struct v2f_surf { vec3 _ShadowCoord3; vec2 _ShadowZFade; }; -attribute vec4 TANGENT; -uniform mat4 _World2Shadow3; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; uniform vec4 _LightShadowData; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform mat4 _World2Shadow; +uniform mat4 _World2Shadow1; +uniform mat4 _World2Shadow2; +uniform mat4 _World2Shadow3; +attribute vec4 TANGENT; vec4 Squash ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt index e0f158851..160b5ca5d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt @@ -1,13 +1,13 @@ -uniform mat4 _World2Shadow3; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; uniform vec4 _LightShadowData; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +uniform mat4 _World2Shadow; +uniform mat4 _World2Shadow1; +uniform mat4 _World2Shadow2; +uniform mat4 _World2Shadow3; void main () { vec2 tmpvar_1; @@ -23,7 +23,9 @@ void main () tmpvar_4.y = _SquashPlaneNormal.w; vec4 tmpvar_5; tmpvar_5.w = 1.0; - tmpvar_5.xyz = mix ((pos_2.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz)) * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount)); + tmpvar_5.xyz = mix ((pos_2.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz)) + * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount)); pos_2 = tmpvar_5; float tmpvar_6; tmpvar_6 = -((gl_ModelViewMatrix * tmpvar_5).z); @@ -54,3 +56,5 @@ void main () gl_TexCoord[4] = tmpvar_12; } + +// inputs: 2, stats: 26 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt index 3373ad2f9..5643d1a4d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-ir.txt @@ -12,14 +12,14 @@ struct v2f_surf { vec2 hip_pack0; vec4 hip_screen; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt index 92f9d351d..7e0010b79 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +varying vec4 xlv_FOG; void main () { vec4 pos_1; @@ -19,7 +19,9 @@ void main () tmpvar_3.y = _SquashPlaneNormal.w; vec4 tmpvar_4; tmpvar_4.w = 1.0; - tmpvar_4.xyz = mix ((pos_1.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); + tmpvar_4.xyz = mix ((pos_1.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) + * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); pos_1 = tmpvar_4; vec4 tmpvar_5; tmpvar_5 = (gl_ModelViewProjectionMatrix * tmpvar_4); @@ -43,3 +45,5 @@ void main () gl_TexCoord[1] = o_6; } + +// inputs: 3, stats: 19 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt index 839bed816..e3f79d8c5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-ir.txt @@ -11,14 +11,14 @@ struct v2f_surf { vec3 vec; vec2 hip_pack0; }; -attribute vec4 TANGENT; -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _LightPositionRange; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; +attribute vec4 TANGENT; vec4 Squash ( in vec4 pos_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt index 2c3eddff3..d7edb37e9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt @@ -1,10 +1,10 @@ -uniform mat4 _TerrainEngineBendTree; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _LightPositionRange; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform mat4 _TerrainEngineBendTree; void main () { vec4 pos_1; @@ -19,7 +19,9 @@ void main () tmpvar_3.y = _SquashPlaneNormal.w; vec4 tmpvar_4; tmpvar_4.w = 1.0; - tmpvar_4.xyz = mix ((pos_1.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); + tmpvar_4.xyz = mix ((pos_1.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz)) + * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount)); pos_1 = tmpvar_4; gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_4); vec4 tmpvar_5; @@ -32,3 +34,5 @@ void main () gl_TexCoord[1] = tmpvar_6; } + +// inputs: 3, stats: 18 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt index c13bd778e..20ca719ca 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-ir.txt @@ -15,31 +15,31 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -318,8 +318,8 @@ v2f_surf vert_surf ( tmpvar_111 = v_89.normal.z; tmpvar_102[2].z = tmpvar_111; mat3 tmpvar_112; - tmpvar_112 = (tmpvar_102); - rotation_92 = (tmpvar_112); + tmpvar_112 = tmpvar_102; + rotation_92 = tmpvar_112; vec3 tmpvar_113; tmpvar_113 = ObjSpaceLightDir (v_89.vertex); vec3 tmpvar_114; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt index 535fdb22c..1ced1167a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt @@ -1,28 +1,28 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec3 unity_LightColor3; -uniform vec3 unity_LightColor2; -uniform vec3 unity_LightColor1; -uniform vec3 unity_LightColor0; -uniform vec4 unity_4LightPosZ0; -uniform vec4 unity_4LightPosY0; -uniform vec4 unity_4LightPosX0; -uniform vec4 unity_4LightAtten0; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_4LightAtten0; +uniform vec4 unity_4LightPosX0; +uniform vec4 unity_4LightPosY0; +uniform vec4 unity_4LightPosZ0; +uniform vec3 unity_LightColor0; +uniform vec3 unity_LightColor1; +uniform vec3 unity_LightColor2; +uniform vec3 unity_LightColor3; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -75,7 +75,13 @@ void main () vec4 tmpvar_16; tmpvar_16 = (((tmpvar_13 * tmpvar_13) + (tmpvar_14 * tmpvar_14)) + (tmpvar_15 * tmpvar_15)); vec4 tmpvar_17; - tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ((((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) * inversesqrt(tmpvar_16))) * (1.0/((1.0 + (tmpvar_16 * unity_4LightAtten0))))); + tmpvar_17 = (max (vec4(0.0, 0.0, 0.0, 0.0), ( + (((tmpvar_13 * tmpvar_4.x) + (tmpvar_14 * tmpvar_4.y)) + (tmpvar_15 * tmpvar_4.z)) + * + inversesqrt(tmpvar_16) + )) * (1.0/((1.0 + + (tmpvar_16 * unity_4LightAtten0) + )))); vec4 o_18; vec4 tmpvar_19; tmpvar_19 = (tmpvar_2 * 0.5); @@ -92,7 +98,9 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_6 * (((_World2Object * tmpvar_7).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_22.xyz = (tmpvar_6 * (( + (_World2Object * tmpvar_7) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.w = 0.0; @@ -100,8 +108,16 @@ void main () gl_TexCoord[2] = tmpvar_23; vec4 tmpvar_24; tmpvar_24.w = 0.0; - tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)))) + ((((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) + (unity_LightColor2 * tmpvar_17.z)) + (unity_LightColor3 * tmpvar_17.w))); + tmpvar_24.xyz = (((x1_10 + x2_9) + (unity_SHC.xyz * + ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)) + )) + (( + ((unity_LightColor0 * tmpvar_17.x) + (unity_LightColor1 * tmpvar_17.y)) + + + (unity_LightColor2 * tmpvar_17.z) + ) + (unity_LightColor3 * tmpvar_17.w))); gl_TexCoord[3] = tmpvar_24; gl_TexCoord[4] = o_18; } + +// inputs: 4, stats: 68 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt index 02196f2be..ab619d425 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -122,8 +122,8 @@ v2f_surf vert_surf ( tmpvar_35 = v_16.normal.z; tmpvar_26[2].z = tmpvar_35; mat3 tmpvar_36; - tmpvar_36 = (tmpvar_26); - rotation_17 = (tmpvar_36); + tmpvar_36 = tmpvar_26; + rotation_17 = tmpvar_36; vec3 tmpvar_37; tmpvar_37 = ObjSpaceViewDir (v_16.vertex); vec3 tmpvar_38; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt index 5214368b9..37fadb916 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -44,8 +44,12 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_7 * (((_World2Object * tmpvar_8).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_10.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_8) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_10; gl_TexCoord[2] = o_3; } + +// inputs: 4, stats: 19 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt index 534c6f07e..bbdd26fd8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -95,7 +95,9 @@ v2f_surf vert_surf ( tmpvar_24 = ((v_16.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_19.hip_lmapFade.xy = tmpvar_24.xy.xy; float tmpvar_25; - tmpvar_25 = ((-((gl_ModelViewMatrix * v_16.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_25 = ((-( + (gl_ModelViewMatrix * v_16.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_19.hip_lmapFade.z = vec3(tmpvar_25).z; vec3 tmpvar_26; tmpvar_26 = cross (v_16.normal, v_16.tangent.xyz); @@ -131,8 +133,8 @@ v2f_surf vert_surf ( tmpvar_37 = v_16.normal.z; tmpvar_28[2].z = tmpvar_37; mat3 tmpvar_38; - tmpvar_38 = (tmpvar_28); - rotation_17 = (tmpvar_38); + tmpvar_38 = tmpvar_28; + rotation_17 = tmpvar_38; vec3 tmpvar_39; tmpvar_39 = ObjSpaceViewDir (v_16.vertex); vec3 tmpvar_40; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt index 81b6e5681..c7012b9c6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -25,7 +25,9 @@ void main () o_4.xy = (tmpvar_6 + tmpvar_5.w); o_4.zw = tmpvar_3.zw; tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_2.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_2.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); vec3 tmpvar_7; tmpvar_7 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_8; @@ -49,7 +51,9 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = (tmpvar_8 * (((_World2Object * tmpvar_9).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_11.xyz = (tmpvar_8 * (( + (_World2Object * tmpvar_9) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_11; gl_TexCoord[2] = o_4; vec4 tmpvar_12; @@ -58,3 +62,5 @@ void main () gl_TexCoord[3] = tmpvar_12; } + +// inputs: 5, stats: 26 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt index ebe65af65..f7208562b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt @@ -9,3 +9,5 @@ void main () gl_TexCoord[0] = tmpvar_1; } + +// inputs: 3, stats: 4 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt index 79c900f52..c05b093ad 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -94,8 +94,8 @@ v2f_surf vert_surf ( tmpvar_26 = v_9.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_10 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_10 = tmpvar_27; vec3 tmpvar_28; tmpvar_28 = ObjSpaceLightDir (v_9.vertex); vec3 tmpvar_29; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt index a35760d3f..b22e77338 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -41,3 +41,5 @@ void main () gl_TexCoord[2] = tmpvar_7; } + +// inputs: 4, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt index a4f3e476a..de25a2da5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-ir.txt @@ -16,17 +16,17 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -158,8 +158,8 @@ v2f_surf vert_surf ( tmpvar_47 = v_24.normal.z; tmpvar_38[2].z = tmpvar_47; mat3 tmpvar_48; - tmpvar_48 = (tmpvar_38); - rotation_25 = (tmpvar_48); + tmpvar_48 = tmpvar_38; + rotation_25 = tmpvar_48; vec4 tmpvar_49; tmpvar_49.xyz = (rotation_25 * _Object2World[0].xyz).xyz; tmpvar_49.w = worldRefl_27.x; @@ -187,7 +187,9 @@ v2f_surf vert_surf ( tmpvar_57 = ((v_24.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_29.hip_lmapFade.xy = tmpvar_57.xy.xy; float tmpvar_58; - tmpvar_58 = ((-((gl_ModelViewMatrix * v_24.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_58 = ((-( + (gl_ModelViewMatrix * v_24.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_29.hip_lmapFade.z = vec3(tmpvar_58).z; return o_29; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt index 60cde11b9..2d8db42c0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt @@ -1,14 +1,14 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -25,7 +25,9 @@ void main () tmpvar_5[1] = _Object2World[1].xyz; tmpvar_5[2] = _Object2World[2].xyz; vec3 tmpvar_6; - tmpvar_6 = (tmpvar_5 * (gl_Vertex.xyz - ((_World2Object * tmpvar_4).xyz * unity_Scale.w))); + tmpvar_6 = (tmpvar_5 * (gl_Vertex.xyz - ( + (_World2Object * tmpvar_4) + .xyz * unity_Scale.w))); vec3 tmpvar_7; tmpvar_7 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_8; @@ -56,7 +58,9 @@ void main () o_12.xy = (tmpvar_14 + tmpvar_13.w); o_12.zw = tmpvar_3.zw; tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_2.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_2.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_3; vec4 tmpvar_15; tmpvar_15.yzw = vec3(0.0, 0.0, 0.0); @@ -73,3 +77,5 @@ void main () gl_TexCoord[5] = tmpvar_16; } + +// inputs: 5, stats: 31 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt index db41fd5f6..54759a7fb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt index 1909fb05a..9bf1599ee 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,11 +38,15 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_8.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[2] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; @@ -50,3 +54,5 @@ void main () gl_TexCoord[3] = tmpvar_9; } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt index 179c8cc48..978cd6068 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-ir.txt @@ -13,8 +13,8 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -attribute vec4 TANGENT; uniform vec4 _BumpMap_ST; +attribute vec4 TANGENT; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -85,8 +85,8 @@ v2f_surf vert_surf ( tmpvar_26 = v_9.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_10 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_10 = tmpvar_27; mat3 tmpvar_28; tmpvar_28 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); vec3 tmpvar_29; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt index 2d9c18872..d5d4cef51 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt @@ -1,5 +1,5 @@ -attribute vec4 TANGENT; uniform vec4 _BumpMap_ST; +attribute vec4 TANGENT; void main () { vec3 tmpvar_1; @@ -33,3 +33,5 @@ void main () gl_TexCoord[3] = tmpvar_6; } + +// inputs: 4, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt index 6b7fe6c63..ec9ac2bda 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-ir.txt @@ -15,15 +15,15 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -155,8 +155,8 @@ v2f_surf vert_surf ( tmpvar_47 = v_24.normal.z; tmpvar_38[2].z = tmpvar_47; mat3 tmpvar_48; - tmpvar_48 = (tmpvar_38); - rotation_25 = (tmpvar_48); + tmpvar_48 = tmpvar_38; + rotation_25 = tmpvar_48; vec4 tmpvar_49; tmpvar_49.xyz = (rotation_25 * _Object2World[0].xyz).xyz; tmpvar_49.w = worldRefl_27.x; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt index 9edd70601..21397b28a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -22,7 +22,9 @@ void main () tmpvar_4[1] = _Object2World[1].xyz; tmpvar_4[2] = _Object2World[2].xyz; vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4 * (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w))); + tmpvar_5 = (tmpvar_4 * (gl_Vertex.xyz - ( + (_World2Object * tmpvar_3) + .xyz * unity_Scale.w))); vec3 tmpvar_6; tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_7; @@ -64,3 +66,5 @@ void main () gl_TexCoord[4] = (tmpvar_10 * unity_Scale.w); } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt index c484e67be..2b086cde2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-ir.txt @@ -14,13 +14,13 @@ struct appdata_tan { vec3 normal; vec4 texcoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec3 WorldSpaceViewDir ( in vec4 v_1 ) @@ -95,8 +95,8 @@ v2f vert ( tmpvar_26 = v_7.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_8 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_8 = tmpvar_27; vec3 tmpvar_28; tmpvar_28 = (rotation_8 * (_Object2World[0].xyz * unity_Scale.w)); o_10.TtoW0 = tmpvar_28; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt index 336fa7a7d..1fb57ad5b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -52,3 +52,5 @@ void main () gl_TexCoord[5] = tmpvar_10; } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt index dfe724d28..124993e25 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt index 6605302cf..888a0e793 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -27,8 +27,12 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + gl_TexCoord[3] = (_LightMatrix0 * cse_7); } + +// inputs: 3, stats: 12 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt index 7f9615b21..51b487d10 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt index 46f6b0110..268d24ac1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -37,8 +37,12 @@ void main () gl_TexCoord[0] = tmpvar_9; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * (dot (gl_Normal, tmpvar_3) * gl_Normal)))); + tmpvar_10.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * + (dot (gl_Normal, tmpvar_3) * gl_Normal) + ))); gl_TexCoord[1] = tmpvar_10; gl_TexCoord[2] = o_5; } + +// inputs: 3, stats: 18 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt index 45db56523..f447ceceb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt index 7433c9fa4..fa28b13aa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,12 +38,18 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_8.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[2] = tmpvar_8; gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex)); } + +// inputs: 4, stats: 23 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt index dde933701..6296db159 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-ir.txt @@ -16,15 +16,15 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -156,8 +156,8 @@ v2f_surf vert_surf ( tmpvar_47 = v_24.normal.z; tmpvar_38[2].z = tmpvar_47; mat3 tmpvar_48; - tmpvar_48 = (tmpvar_38); - rotation_25 = (tmpvar_48); + tmpvar_48 = tmpvar_38; + rotation_25 = tmpvar_48; vec4 tmpvar_49; tmpvar_49.xyz = (rotation_25 * _Object2World[0].xyz).xyz; tmpvar_49.w = worldRefl_27.x; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt index 1f0c03a1e..6849eeb38 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -22,7 +22,9 @@ void main () tmpvar_4[1] = _Object2World[1].xyz; tmpvar_4[2] = _Object2World[2].xyz; vec3 tmpvar_5; - tmpvar_5 = (tmpvar_4 * (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w))); + tmpvar_5 = (tmpvar_4 * (gl_Vertex.xyz - ( + (_World2Object * tmpvar_3) + .xyz * unity_Scale.w))); vec3 tmpvar_6; tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_7; @@ -63,7 +65,9 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_16; tmpvar_16.w = 0.0; - tmpvar_16.xyz = (tmpvar_7 * (((_World2Object * tmpvar_14).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_16.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_14) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_16; gl_TexCoord[2] = o_11; gl_TexCoord[3] = (tmpvar_8 * unity_Scale.w); @@ -71,3 +75,5 @@ void main () gl_TexCoord[5] = (tmpvar_10 * unity_Scale.w); } + +// inputs: 4, stats: 30 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt index 108214120..b4bd5df69 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt index f837248fa..a130481e9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,11 +38,15 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_8.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[2] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; @@ -50,3 +54,5 @@ void main () gl_TexCoord[3] = tmpvar_9; } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt index b275478f3..b84c5cf0c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt index 66f4a3ff0..9f858c9af 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,7 +38,9 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; @@ -50,3 +52,5 @@ void main () gl_TexCoord[3] = tmpvar_9; } + +// inputs: 4, stats: 22 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt index 8f70b73cb..e4f737453 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-ir.txt @@ -15,14 +15,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt index 427bda0ed..12b706993 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -28,12 +28,16 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_WorldSpaceCameraPos - (_Object2World * gl_Vertex).xyz); - gl_TexCoord[3] = tmpvar_7; - gl_TexCoord[4] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + vec4 tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_7.xyz); + gl_TexCoord[3] = tmpvar_8; + gl_TexCoord[4] = (_LightMatrix0 * cse_7); } + +// inputs: 3, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt index 7f9615b21..51b487d10 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt index 46f6b0110..268d24ac1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -37,8 +37,12 @@ void main () gl_TexCoord[0] = tmpvar_9; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * (dot (gl_Normal, tmpvar_3) * gl_Normal)))); + tmpvar_10.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * + (dot (gl_Normal, tmpvar_3) * gl_Normal) + ))); gl_TexCoord[1] = tmpvar_10; gl_TexCoord[2] = o_5; } + +// inputs: 3, stats: 18 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt index f33832836..e85b98a3f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt @@ -7,3 +7,5 @@ void main () gl_TexCoord[0] = tmpvar_1; } + +// inputs: 2, stats: 2 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt index db58fc285..8d904e645 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-ir.txt @@ -13,15 +13,15 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -95,8 +95,8 @@ v2f_surf vert_surf ( tmpvar_26 = v_9.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_10 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_10 = tmpvar_27; vec3 tmpvar_28; tmpvar_28 = ObjSpaceLightDir (v_9.vertex); vec3 tmpvar_29; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt index 1fea6ffee..efec9e38c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -34,8 +34,12 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_6.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_6; gl_TexCoord[2] = (_LightMatrix0 * (_Object2World * gl_Vertex)); } + +// inputs: 4, stats: 17 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt index 7ed21c7f8..6803ca019 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-ir.txt @@ -12,11 +12,11 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _Illum_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt index f1e3883dd..45095b64f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _Illum_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -26,3 +26,5 @@ void main () gl_TexCoord[1] = o_3; } + +// inputs: 2, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt index 16bfb4f29..5fa4e515d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-ir.txt @@ -13,13 +13,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _Illum_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -75,7 +75,9 @@ v2f_surf vert_surf ( tmpvar_18 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_13.hip_lmapFade.xy = tmpvar_18.xy.xy; float tmpvar_19; - tmpvar_19 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_19 = ((-( + (gl_ModelViewMatrix * v_12.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_13.hip_lmapFade.z = vec3(tmpvar_19).z; return o_13; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt index 63c99b8ea..3ff7ba068 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _Illum_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -21,7 +21,9 @@ void main () o_4.xy = (tmpvar_6 + tmpvar_5.w); o_4.zw = tmpvar_3.zw; tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_2.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_2.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_3; vec4 tmpvar_7; tmpvar_7.yzw = vec3(0.0, 0.0, 0.0); @@ -35,3 +37,5 @@ void main () gl_TexCoord[2] = tmpvar_8; } + +// inputs: 3, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt index 45db56523..f447ceceb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt index 7433c9fa4..fa28b13aa 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,12 +38,18 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_8.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[2] = tmpvar_8; gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex)); } + +// inputs: 4, stats: 23 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt index 108214120..b4bd5df69 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt index f837248fa..a130481e9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,11 +38,15 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_8.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[2] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; @@ -50,3 +54,5 @@ void main () gl_TexCoord[3] = tmpvar_9; } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt index 7f1f40e96..0bb88373a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt @@ -3,3 +3,5 @@ void main () gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); } + +// inputs: 1, stats: 1 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt index 8f70b73cb..e4f737453 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-ir.txt @@ -15,14 +15,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt index 427bda0ed..12b706993 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -28,12 +28,16 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_WorldSpaceCameraPos - (_Object2World * gl_Vertex).xyz); - gl_TexCoord[3] = tmpvar_7; - gl_TexCoord[4] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + vec4 tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_7.xyz); + gl_TexCoord[3] = tmpvar_8; + gl_TexCoord[4] = (_LightMatrix0 * cse_7); } + +// inputs: 3, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt index 38e2b72f4..ec3cdf973 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -71,7 +71,9 @@ v2f_surf vert_surf ( tmpvar_17 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_13.hip_lmapFade.xy = tmpvar_17.xy.xy; float tmpvar_18; - tmpvar_18 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_18 = ((-( + (gl_ModelViewMatrix * v_12.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_13.hip_lmapFade.z = vec3(tmpvar_18).z; return o_13; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt index 5dedb6f9a..e8a9b9657 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; @@ -17,7 +17,9 @@ void main () o_3.xy = (tmpvar_5 + tmpvar_4.w); o_3.zw = tmpvar_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_1.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_2; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); @@ -34,3 +36,5 @@ void main () gl_TexCoord[2] = tmpvar_8; } + +// inputs: 3, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt index f2302ccf3..514cced93 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-ir.txt @@ -14,14 +14,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Detail_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt index 0306d7504..77137c987 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Detail_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -28,8 +28,12 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + gl_TexCoord[3] = (_LightMatrix0 * cse_7); } + +// inputs: 4, stats: 13 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt index cb4969bd9..05d5189c8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-ir.txt @@ -12,11 +12,11 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _Detail_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt index 76ea81825..1abd95879 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; -uniform vec4 _MainTex_ST; uniform vec4 _Detail_ST; +uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -26,3 +26,5 @@ void main () gl_TexCoord[1] = o_3; } + +// inputs: 3, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt index cb68a45ee..1434d1ff1 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-ir.txt @@ -15,15 +15,15 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _SpecMap_ST; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _SpecMap_ST; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt index 7f21e8bfb..6f3f81b98 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform vec4 _SpecMap_ST; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _SpecMap_ST; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -29,12 +29,16 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_WorldSpaceCameraPos - (_Object2World * gl_Vertex).xyz); - gl_TexCoord[3] = tmpvar_7; - gl_TexCoord[4] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + vec4 tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_7.xyz); + gl_TexCoord[3] = tmpvar_8; + gl_TexCoord[4] = (_LightMatrix0 * cse_7); } + +// inputs: 3, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt index 9143927f0..ed242d2be 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-ir.txt @@ -17,12 +17,12 @@ struct v2f_surf { vec3 lightDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt index 472e62fd4..d4ffef871 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -26,11 +26,15 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - vec4 tmpvar_7; - tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz; - gl_TexCoord[3] = tmpvar_7; + vec4 tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_LightMatrix0 * cse_7).xyz; + gl_TexCoord[3] = tmpvar_8; } + +// inputs: 2, stats: 13 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt index ac47708bb..c26d5d803 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-ir.txt @@ -17,12 +17,12 @@ struct v2f_surf { vec3 lightDir; vec2 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt index 9bd361ecd..b73629a41 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -34,3 +34,5 @@ void main () gl_TexCoord[3] = tmpvar_7; } + +// inputs: 2, stats: 12 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt index 2e036780e..aea7e61b0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-ir.txt @@ -16,11 +16,11 @@ struct v2f_surf { vec4 hip_screen; vec3 hip_lmapFade; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void vert ( inout appdata_full v_1, out Input o_2 @@ -85,7 +85,9 @@ v2f_surf vert_surf ( tmpvar_21 = ((v_15.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_16.hip_lmapFade.xy = tmpvar_21.xy.xy; float tmpvar_22; - tmpvar_22 = ((-((gl_ModelViewMatrix * v_15.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_22 = ((-( + (gl_ModelViewMatrix * v_15.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_16.hip_lmapFade.z = vec3(tmpvar_22).z; return o_16; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt index e9f0404da..84158b70b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; @@ -16,7 +16,9 @@ void main () o_3.xy = (tmpvar_5 + tmpvar_4.w); o_3.zw = tmpvar_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_1.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_2; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); @@ -33,3 +35,5 @@ void main () gl_TexCoord[2] = tmpvar_8; } + +// inputs: 3, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt index 1f83f28dc..f53223c90 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt index 5fe3954f3..cba56ee87 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -30,3 +30,5 @@ void main () gl_TexCoord[2] = tmpvar_6; } + +// inputs: 3, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt index a13d7f753..9afae106c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-ir.txt @@ -12,10 +12,10 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt index 6e8b0331f..5f8bfc54f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt @@ -1,6 +1,6 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -25,3 +25,5 @@ void main () gl_TexCoord[1] = o_2; } + +// inputs: 2, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt index 2991310b4..5fe44c3a0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-ir.txt @@ -12,13 +12,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform mat4 _Object2World; -uniform vec4 _Decal_ST; uniform vec4 _DecalBump_ST; +uniform vec4 _Decal_ST; +uniform mat4 _Object2World; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -113,8 +113,8 @@ v2f_surf vert_surf ( tmpvar_35 = v_14.normal.z; tmpvar_26[2].z = tmpvar_35; mat3 tmpvar_36; - tmpvar_36 = (tmpvar_26); - rotation_15 = (tmpvar_36); + tmpvar_36 = tmpvar_26; + rotation_15 = tmpvar_36; return o_18; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt index 0a63196c8..5c68e342c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 _Decal_ST; uniform vec4 _DecalBump_ST; +uniform vec4 _Decal_ST; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -21,3 +21,5 @@ void main () gl_TexCoord[1] = tmpvar_4; } + +// inputs: 3, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt index 769293b2e..81d24600d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-ir.txt @@ -14,22 +14,22 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _Decal_ST; uniform vec4 _DecalBump_ST; +uniform vec4 _Decal_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -204,8 +204,8 @@ v2f_surf vert_surf ( tmpvar_65 = v_44.normal.z; tmpvar_56[2].z = tmpvar_65; mat3 tmpvar_66; - tmpvar_66 = (tmpvar_56); - rotation_46 = (tmpvar_66); + tmpvar_66 = tmpvar_56; + rotation_46 = tmpvar_66; vec3 tmpvar_67; tmpvar_67 = ObjSpaceLightDir (v_44.vertex); vec3 tmpvar_68; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt index 0fa9011f5..ba79fd91b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt @@ -1,19 +1,19 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_SHC; -uniform vec4 unity_SHBr; -uniform vec4 unity_SHBg; -uniform vec4 unity_SHBb; -uniform vec4 unity_SHAr; -uniform vec4 unity_SHAg; -uniform vec4 unity_SHAb; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; -uniform vec4 _Decal_ST; uniform vec4 _DecalBump_ST; +uniform vec4 _Decal_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_SHAb; +uniform vec4 unity_SHAg; +uniform vec4 unity_SHAr; +uniform vec4 unity_SHBb; +uniform vec4 unity_SHBg; +uniform vec4 unity_SHBr; +uniform vec4 unity_SHC; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -72,8 +72,14 @@ void main () gl_TexCoord[1] = tmpvar_15; vec4 tmpvar_16; tmpvar_16.w = 0.0; - tmpvar_16.xyz = ((x1_9 + x2_8) + (unity_SHC.xyz * ((tmpvar_4.x * tmpvar_4.x) - (tmpvar_4.y * tmpvar_4.y)))); + tmpvar_16.xyz = ((x1_9 + x2_8) + (unity_SHC.xyz * ( + (tmpvar_4.x * tmpvar_4.x) + - + (tmpvar_4.y * tmpvar_4.y) + ))); gl_TexCoord[2] = tmpvar_16; gl_TexCoord[3] = o_11; } + +// inputs: 4, stats: 33 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt index d461fbaef..1ea6bd8b9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt index a99d72429..9941a8469 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -35,3 +35,5 @@ void main () gl_TexCoord[3] = tmpvar_7; } + +// inputs: 3, stats: 12 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt index 1f83f28dc..f53223c90 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt index 5fe3954f3..cba56ee87 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -30,3 +30,5 @@ void main () gl_TexCoord[2] = tmpvar_6; } + +// inputs: 3, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt index f57e743dc..dc4e3734e 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -119,8 +119,8 @@ v2f_surf vert_surf ( tmpvar_34 = v_16.normal.z; tmpvar_25[2].z = tmpvar_34; mat3 tmpvar_35; - tmpvar_35 = (tmpvar_25); - rotation_17 = (tmpvar_35); + tmpvar_35 = tmpvar_25; + rotation_17 = tmpvar_35; vec3 tmpvar_36; tmpvar_36 = (rotation_17 * (v_16.normal * unity_Scale.w)); o_19.normal = tmpvar_36; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt index 7c12a26c6..a9bb87d49 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -43,7 +43,9 @@ void main () gl_TexCoord[0] = tmpvar_9; vec4 tmpvar_10; tmpvar_10.w = 0.0; - tmpvar_10.xyz = (tmpvar_6 * (((_World2Object * tmpvar_7).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_10.xyz = (tmpvar_6 * (( + (_World2Object * tmpvar_7) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_10; gl_TexCoord[2] = o_2; vec4 tmpvar_11; @@ -52,3 +54,5 @@ void main () gl_TexCoord[3] = tmpvar_11; } + +// inputs: 4, stats: 21 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt index 734fd37e0..1e2b15b76 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-ir.txt @@ -15,15 +15,15 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -92,7 +92,9 @@ v2f_surf vert_surf ( tmpvar_23 = ((v_16.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_19.hip_lmapFade.xy = tmpvar_23.xy.xy; float tmpvar_24; - tmpvar_24 = ((-((gl_ModelViewMatrix * v_16.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_24 = ((-( + (gl_ModelViewMatrix * v_16.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_19.hip_lmapFade.z = vec3(tmpvar_24).z; vec3 tmpvar_25; tmpvar_25 = cross (v_16.normal, v_16.tangent.xyz); @@ -128,8 +130,8 @@ v2f_surf vert_surf ( tmpvar_36 = v_16.normal.z; tmpvar_27[2].z = tmpvar_36; mat3 tmpvar_37; - tmpvar_37 = (tmpvar_27); - rotation_17 = (tmpvar_37); + tmpvar_37 = tmpvar_27; + rotation_17 = tmpvar_37; vec3 tmpvar_38; tmpvar_38 = (rotation_17 * (v_16.normal * unity_Scale.w)); o_19.normal = tmpvar_38; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt index f3e5b72d6..8f06a8358 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt @@ -1,12 +1,12 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; @@ -21,7 +21,9 @@ void main () o_3.xy = (tmpvar_5 + tmpvar_4.w); o_3.zw = tmpvar_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_1.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); vec3 tmpvar_6; tmpvar_6 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w); mat3 tmpvar_7; @@ -48,7 +50,9 @@ void main () gl_TexCoord[0] = tmpvar_10; vec4 tmpvar_11; tmpvar_11.w = 0.0; - tmpvar_11.xyz = (tmpvar_7 * (((_World2Object * tmpvar_8).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_11.xyz = (tmpvar_7 * (( + (_World2Object * tmpvar_8) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_11; gl_TexCoord[2] = o_3; vec4 tmpvar_12; @@ -61,3 +65,5 @@ void main () gl_TexCoord[4] = tmpvar_13; } + +// inputs: 5, stats: 28 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt index 54b160074..c4e2aced5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -91,8 +91,8 @@ v2f_surf vert_surf ( tmpvar_25 = v_9.normal.z; tmpvar_16[2].z = tmpvar_25; mat3 tmpvar_26; - tmpvar_26 = (tmpvar_16); - rotation_10 = (tmpvar_26); + tmpvar_26 = tmpvar_16; + rotation_10 = tmpvar_26; vec3 tmpvar_27; tmpvar_27 = ObjSpaceLightDir (v_9.vertex); vec3 tmpvar_28; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt index 0564ae9c4..a29d637f9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -33,8 +33,12 @@ void main () gl_TexCoord[0] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (tmpvar_3 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_6.xyz = (tmpvar_3 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_6; gl_TexCoord[2] = (_LightMatrix0 * (_Object2World * gl_Vertex)); } + +// inputs: 4, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt index 5aaeb8aa0..10c8cc4a3 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-ir.txt @@ -13,14 +13,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -91,8 +91,8 @@ v2f_surf vert_surf ( tmpvar_25 = v_9.normal.z; tmpvar_16[2].z = tmpvar_25; mat3 tmpvar_26; - tmpvar_26 = (tmpvar_16); - rotation_10 = (tmpvar_26); + tmpvar_26 = tmpvar_16; + rotation_10 = tmpvar_26; vec3 tmpvar_27; tmpvar_27 = ObjSpaceLightDir (v_9.vertex); vec3 tmpvar_28; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt index cc9aebe0e..c936a3ae3 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt @@ -1,11 +1,11 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -33,7 +33,9 @@ void main () gl_TexCoord[0] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (tmpvar_3 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_6.xyz = (tmpvar_3 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; @@ -41,3 +43,5 @@ void main () gl_TexCoord[2] = tmpvar_7; } + +// inputs: 4, stats: 17 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt index 0bb837710..527205299 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt index 0f5f44b75..e54094068 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -22,8 +22,12 @@ void main () gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_6; + cse_6 = (_Object2World * gl_Vertex); + tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - cse_6.xyz); gl_TexCoord[1] = tmpvar_5; - gl_TexCoord[2] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + gl_TexCoord[2] = (_LightMatrix0 * cse_6); } + +// inputs: 2, stats: 9 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt index 0eda7468a..1e71632f9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-ir.txt @@ -13,12 +13,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt index c53a31ae4..3c4d9ac3b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt @@ -1,8 +1,8 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; uniform mat4 _LightMatrix0; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -22,11 +22,15 @@ void main () gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_6; + cse_6 = (_Object2World * gl_Vertex); + tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - cse_6.xyz); gl_TexCoord[1] = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz; - gl_TexCoord[2] = tmpvar_6; + vec4 tmpvar_7; + tmpvar_7.w = 0.0; + tmpvar_7.xyz = (_LightMatrix0 * cse_6).xyz; + gl_TexCoord[2] = tmpvar_7; } + +// inputs: 2, stats: 10 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt index fa02fdea6..3521a37c7 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-ir.txt @@ -12,9 +12,9 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt index 0e4f04cfb..f999bcb56 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt @@ -1,5 +1,5 @@ -varying vec4 xlv_FOG; uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -29,3 +29,5 @@ void main () gl_TexCoord[1] = o_5; } + +// inputs: 1, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt index 5826fc015..9a534c980 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-ir.txt @@ -15,13 +15,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt index d7a05196a..381f83ba3 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -23,16 +23,20 @@ void main () gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - tmpvar_5.xyz = (_Object2World * gl_Vertex).xyz; + vec4 cse_6; + cse_6 = (_Object2World * gl_Vertex); + tmpvar_5.xyz = cse_6.xyz; gl_TexCoord[1] = tmpvar_5; - vec4 tmpvar_6; - tmpvar_6.w = 0.0; - tmpvar_6.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); - gl_TexCoord[3] = tmpvar_7; - gl_TexCoord[4] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + tmpvar_7.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[2] = tmpvar_7; + vec4 tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_WorldSpaceLightPos0.xyz - cse_6.xyz); + gl_TexCoord[3] = tmpvar_8; + gl_TexCoord[4] = (_LightMatrix0 * cse_6); } + +// inputs: 3, stats: 13 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt index db0e904eb..eecc238a2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-ir.txt @@ -13,11 +13,11 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt index e98121c7c..4d7c43d31 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt @@ -1,7 +1,7 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -30,3 +30,5 @@ void main () gl_TexCoord[2] = o_2; } + +// inputs: 2, stats: 10 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt index 60108be71..86ab7adfd 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -76,7 +76,9 @@ v2f_surf vert_surf ( tmpvar_18 = ((v_12.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); o_13.hip_lmapFade.xy = tmpvar_18.xy.xy; float tmpvar_19; - tmpvar_19 = ((-((gl_ModelViewMatrix * v_12.vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_19 = ((-( + (gl_ModelViewMatrix * v_12.vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); o_13.hip_lmapFade.z = vec3(tmpvar_19).z; return o_13; } diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt index b0652cf58..eee2df817 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_LightmapST; -uniform vec4 unity_LightmapFade; -uniform vec4 _ProjectionParams; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _ProjectionParams; +uniform vec4 unity_LightmapFade; +uniform vec4 unity_LightmapST; +varying vec4 xlv_FOG; void main () { vec3 tmpvar_1; @@ -18,7 +18,9 @@ void main () o_3.xy = (tmpvar_5 + tmpvar_4.w); o_3.zw = tmpvar_2.zw; tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw); - tmpvar_1.z = ((-((gl_ModelViewMatrix * gl_Vertex).z) * unity_LightmapFade.z) + unity_LightmapFade.w); + tmpvar_1.z = ((-( + (gl_ModelViewMatrix * gl_Vertex) + .z) * unity_LightmapFade.z) + unity_LightmapFade.w); gl_Position = tmpvar_2; vec4 tmpvar_6; tmpvar_6.yzw = vec3(0.0, 0.0, 0.0); @@ -39,3 +41,5 @@ void main () gl_TexCoord[3] = tmpvar_9; } + +// inputs: 3, stats: 17 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt index 406d6cbeb..f244019bc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-ir.txt @@ -15,13 +15,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -attribute vec4 TANGENT; -uniform mat4 _World2Shadow3; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow; -uniform mat4 _Object2World; uniform vec4 _LightShadowData; +uniform mat4 _Object2World; +uniform mat4 _World2Shadow; +uniform mat4 _World2Shadow1; +uniform mat4 _World2Shadow2; +uniform mat4 _World2Shadow3; +attribute vec4 TANGENT; v2f_surf vert_surf ( in appdata_full v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt index d99fac1d6..00652d53a 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt @@ -1,9 +1,9 @@ -uniform mat4 _World2Shadow3; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow; -uniform mat4 _Object2World; uniform vec4 _LightShadowData; +uniform mat4 _Object2World; +uniform mat4 _World2Shadow; +uniform mat4 _World2Shadow1; +uniform mat4 _World2Shadow2; +uniform mat4 _World2Shadow3; void main () { vec2 tmpvar_1; @@ -11,24 +11,24 @@ void main () tmpvar_2 = -((gl_ModelViewMatrix * gl_Vertex).z); tmpvar_1.x = tmpvar_2; tmpvar_1.y = ((tmpvar_2 * _LightShadowData.z) + _LightShadowData.w); - vec4 tmpvar_3; - tmpvar_3 = (_Object2World * gl_Vertex); + vec4 cse_3; + cse_3 = (_Object2World * gl_Vertex); gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); vec4 tmpvar_4; tmpvar_4.w = 0.0; - tmpvar_4.xyz = (_World2Shadow * tmpvar_3).xyz; + tmpvar_4.xyz = (_World2Shadow * cse_3).xyz; gl_TexCoord[0] = tmpvar_4; vec4 tmpvar_5; tmpvar_5.w = 0.0; - tmpvar_5.xyz = (_World2Shadow1 * tmpvar_3).xyz; + tmpvar_5.xyz = (_World2Shadow1 * cse_3).xyz; gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_World2Shadow2 * tmpvar_3).xyz; + tmpvar_6.xyz = (_World2Shadow2 * cse_3).xyz; gl_TexCoord[2] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_World2Shadow3 * tmpvar_3).xyz; + tmpvar_7.xyz = (_World2Shadow3 * cse_3).xyz; gl_TexCoord[3] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.zw = vec2(0.0, 0.0); @@ -36,7 +36,9 @@ void main () gl_TexCoord[4] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; - tmpvar_9.xyz = (_Object2World * gl_Vertex).xyz; + tmpvar_9.xyz = cse_3.xyz; gl_TexCoord[5] = tmpvar_9; } + +// inputs: 1, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt index aa6fa6236..9fc806e7b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-ir.txt @@ -13,13 +13,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt index 0b75fd189..ed1f25362 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -28,7 +28,9 @@ void main () xlv_FOG = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * (dot (gl_Normal, tmpvar_3) * gl_Normal)))); + tmpvar_7.xyz = (tmpvar_4 * (tmpvar_3 - (2.0 * + (dot (gl_Normal, tmpvar_3) * gl_Normal) + ))); gl_TexCoord[0] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; @@ -40,3 +42,5 @@ void main () gl_TexCoord[2] = tmpvar_9; } + +// inputs: 2, stats: 16 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt index ec3e493bd..9b51150cc 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 3 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt index 4a53ccc60..e6140fa0f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt @@ -11,3 +11,5 @@ void main () gl_FrontColor = tmpvar_2; } + +// inputs: 2, stats: 5 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt index 1dbc679ff..47e13aeb5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 5 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt index 300d18006..1ff76b834 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt @@ -11,3 +11,5 @@ void main () gl_TexCoord[0] = tmpvar_2; } + +// inputs: 2, stats: 4 alu 1 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt index 99802fae6..5638731df 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-ir.txt @@ -8,9 +8,9 @@ struct appdata_t { vec4 color; vec3 normal; }; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; vec3 ObjSpaceViewDir ( in vec4 v_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt index 676689aa9..2df96c608 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt @@ -1,16 +1,20 @@ -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; void main () { vec4 tmpvar_1; tmpvar_1.w = 1.0; tmpvar_1.xyz = _WorldSpaceCameraPos; vec3 tmpvar_2; - tmpvar_2 = -(normalize((((_World2Object * tmpvar_1).xyz * unity_Scale.w) - gl_Vertex.xyz))); + tmpvar_2 = -(normalize(( + ((_World2Object * tmpvar_1).xyz * unity_Scale.w) + - gl_Vertex.xyz))); vec4 tmpvar_3; tmpvar_3.w = 0.0; - tmpvar_3.xyz = (tmpvar_2 - (2.0 * (dot (gl_Normal, tmpvar_2) * gl_Normal))); + tmpvar_3.xyz = (tmpvar_2 - (2.0 * ( + dot (gl_Normal, tmpvar_2) + * gl_Normal))); gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex); gl_FrontColor = gl_Color; vec4 tmpvar_4; @@ -19,3 +23,5 @@ void main () gl_TexCoord[0] = tmpvar_4; } + +// inputs: 3, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt index fa85a3cc8..431e0d7c8 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt @@ -15,3 +15,5 @@ void main () gl_TexCoord[1] = tmpvar_3; } + +// inputs: 3, stats: 7 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt index db41fd5f6..54759a7fb 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-ir.txt @@ -14,16 +14,16 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -111,8 +111,8 @@ v2f_surf vert_surf ( tmpvar_30 = v_13.normal.z; tmpvar_21[2].z = tmpvar_30; mat3 tmpvar_31; - tmpvar_31 = (tmpvar_21); - rotation_14 = (tmpvar_31); + tmpvar_31 = tmpvar_21; + rotation_14 = tmpvar_31; vec3 tmpvar_32; tmpvar_32 = ObjSpaceLightDir (v_13.vertex); vec3 tmpvar_33; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt index 1909fb05a..9bf1599ee 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt @@ -1,13 +1,13 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _BumpMap_ST; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -38,11 +38,15 @@ void main () gl_TexCoord[0] = tmpvar_1; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (tmpvar_4 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_7.xyz = (tmpvar_4 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[1] = tmpvar_7; vec4 tmpvar_8; tmpvar_8.w = 0.0; - tmpvar_8.xyz = (tmpvar_4 * (((_World2Object * tmpvar_5).xyz * unity_Scale.w) - gl_Vertex.xyz)); + tmpvar_8.xyz = (tmpvar_4 * (( + (_World2Object * tmpvar_5) + .xyz * unity_Scale.w) - gl_Vertex.xyz)); gl_TexCoord[2] = tmpvar_8; vec4 tmpvar_9; tmpvar_9.w = 0.0; @@ -50,3 +54,5 @@ void main () gl_TexCoord[3] = tmpvar_9; } + +// inputs: 4, stats: 24 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt index 5e136a41f..8c147cede 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-ir.txt @@ -12,12 +12,12 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, @@ -91,8 +91,8 @@ v2f_surf vert_surf ( tmpvar_26 = v_9.normal.z; tmpvar_17[2].z = tmpvar_26; mat3 tmpvar_27; - tmpvar_27 = (tmpvar_17); - rotation_10 = (tmpvar_27); + tmpvar_27 = tmpvar_17; + rotation_10 = tmpvar_27; vec3 tmpvar_28; tmpvar_28 = ObjSpaceLightDir (v_9.vertex); vec3 tmpvar_29; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt index f485da26f..b902f3406 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _World2Object; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +uniform mat4 _World2Object; +uniform vec4 _WorldSpaceLightPos0; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -35,3 +35,5 @@ void main () gl_TexCoord[1] = tmpvar_6; } + +// inputs: 4, stats: 13 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt index a13d7f753..9afae106c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-ir.txt @@ -12,10 +12,10 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt index 6e8b0331f..5f8bfc54f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt @@ -1,6 +1,6 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -25,3 +25,5 @@ void main () gl_TexCoord[1] = o_2; } + +// inputs: 2, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt index c051f97a0..62ff8c157 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-ir.txt @@ -13,9 +13,9 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -attribute vec4 TANGENT; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +attribute vec4 TANGENT; mat3 xll_constructMat3 ( in mat4 m_1 ) @@ -89,8 +89,8 @@ v2f_surf vert_surf ( tmpvar_27 = v_9.normal.z; tmpvar_18[2].z = tmpvar_27; mat3 tmpvar_28; - tmpvar_28 = (tmpvar_18); - rotation_10 = (tmpvar_28); + tmpvar_28 = tmpvar_18; + rotation_10 = tmpvar_28; mat3 tmpvar_29; tmpvar_29 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose); vec3 tmpvar_30; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt index f95f66485..8a617abb5 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt @@ -1,6 +1,6 @@ -attribute vec4 TANGENT; -uniform vec4 _MainTex_ST; uniform vec4 _BumpMap_ST; +uniform vec4 _MainTex_ST; +attribute vec4 TANGENT; void main () { vec4 tmpvar_1; @@ -34,3 +34,5 @@ void main () gl_TexCoord[3] = tmpvar_6; } + +// inputs: 4, stats: 15 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt index a13d7f753..9afae106c 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-ir.txt @@ -12,10 +12,10 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt index 6e8b0331f..5f8bfc54f 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt @@ -1,6 +1,6 @@ -varying vec4 xlv_FOG; -uniform vec4 _ProjectionParams; uniform vec4 _MainTex_ST; +uniform vec4 _ProjectionParams; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -25,3 +25,5 @@ void main () gl_TexCoord[1] = o_2; } + +// inputs: 2, stats: 8 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt index dfe724d28..124993e25 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt index 6605302cf..888a0e793 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -27,8 +27,12 @@ void main () gl_TexCoord[1] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * gl_Vertex).xyz); + vec4 cse_7; + cse_7 = (_Object2World * gl_Vertex); + tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - cse_7.xyz); gl_TexCoord[2] = tmpvar_6; - gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex)); + gl_TexCoord[3] = (_LightMatrix0 * cse_7); } + +// inputs: 3, stats: 12 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt index 342f7b464..1e7ab371b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-ir.txt @@ -14,13 +14,13 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt index 99b5ae821..ff7e63e61 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt @@ -1,9 +1,9 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -35,3 +35,5 @@ void main () gl_TexCoord[3] = tmpvar_7; } + +// inputs: 3, stats: 12 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt index 7b997fdf8..4c73a9d04 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-ir.txt @@ -15,14 +15,14 @@ struct appdata_full { vec4 texcoord1; vec4 color; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; mat3 xll_constructMat3 ( in mat4 m_1 ) diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt index f30052442..fae31daf6 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt @@ -1,10 +1,10 @@ -varying vec4 xlv_FOG; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -13,30 +13,34 @@ void main () tmpvar_2[0] = _Object2World[0].xyz; tmpvar_2[1] = _Object2World[1].xyz; tmpvar_2[2] = _Object2World[2].xyz; + vec4 cse_3; + cse_3 = (_Object2World * gl_Vertex); gl_Position = tmpvar_1; - vec4 tmpvar_3; - tmpvar_3.yzw = vec3(0.0, 0.0, 0.0); - tmpvar_3.x = tmpvar_1.z; - xlv_FOG = tmpvar_3; vec4 tmpvar_4; - tmpvar_4.zw = vec2(0.0, 0.0); - tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); - gl_TexCoord[0] = tmpvar_4; + tmpvar_4.yzw = vec3(0.0, 0.0, 0.0); + tmpvar_4.x = tmpvar_1.z; + xlv_FOG = tmpvar_4; vec4 tmpvar_5; - tmpvar_5.w = 0.0; - tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w)); - gl_TexCoord[1] = tmpvar_5; + tmpvar_5.zw = vec2(0.0, 0.0); + tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw); + gl_TexCoord[0] = tmpvar_5; vec4 tmpvar_6; tmpvar_6.w = 0.0; - tmpvar_6.xyz = _WorldSpaceLightPos0.xyz; - gl_TexCoord[2] = tmpvar_6; + tmpvar_6.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w)); + gl_TexCoord[1] = tmpvar_6; vec4 tmpvar_7; tmpvar_7.w = 0.0; - tmpvar_7.xyz = (_WorldSpaceCameraPos - (_Object2World * gl_Vertex).xyz); - gl_TexCoord[3] = tmpvar_7; + tmpvar_7.xyz = _WorldSpaceLightPos0.xyz; + gl_TexCoord[2] = tmpvar_7; vec4 tmpvar_8; - tmpvar_8.zw = vec2(0.0, 0.0); - tmpvar_8.xy = (_LightMatrix0 * (_Object2World * gl_Vertex)).xy; - gl_TexCoord[4] = tmpvar_8; + tmpvar_8.w = 0.0; + tmpvar_8.xyz = (_WorldSpaceCameraPos - cse_3.xyz); + gl_TexCoord[3] = tmpvar_8; + vec4 tmpvar_9; + tmpvar_9.zw = vec2(0.0, 0.0); + tmpvar_9.xy = (_LightMatrix0 * cse_3).xy; + gl_TexCoord[4] = tmpvar_9; } + +// inputs: 3, stats: 14 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt index 3316b2caa..67be5b70b 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-ir.txt @@ -14,12 +14,12 @@ struct v2f { vec3 nl; vec3 nh; }; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform float _TranslucencyViewDependency; uniform vec3 _TerrainTreeLightDirections[4]; +uniform float _TranslucencyViewDependency; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; float xll_saturate ( in float x_1 ) @@ -158,17 +158,17 @@ v2f vert ( float tmpvar_56; tmpvar_56 = tmpvar_55; backContrib_36 = tmpvar_56; - float tmpvar_57; - tmpvar_57 = (backContrib_36 * 2.0); - o_41.backContrib[j_39] = tmpvar_57; + vec3 tmpvar_57; + tmpvar_57 = o_41.backContrib; tmpvar_57[j_39] = (backContrib_36 * 2.0); + o_41.backContrib = tmpvar_57; float tmpvar_58; tmpvar_58 = max (0.0, ((nl_37 * 0.6) + 0.4)); float tmpvar_59; tmpvar_59 = tmpvar_58; nl_37 = tmpvar_59; - float tmpvar_60; - tmpvar_60 = nl_37; - o_41.nl[j_39] = tmpvar_60; + vec3 tmpvar_60; + tmpvar_60 = o_41.nl; tmpvar_60[j_39] = nl_37; + o_41.nl = tmpvar_60; vec3 tmpvar_61; tmpvar_61 = normalize ((lightDir_38 + viewDir_40)); vec3 tmpvar_62; @@ -181,9 +181,9 @@ v2f vert ( float tmpvar_65; tmpvar_65 = tmpvar_64; nh_34 = tmpvar_65; - float tmpvar_66; - tmpvar_66 = nh_34; - o_41.nh[j_39] = tmpvar_66; + vec3 tmpvar_66; + tmpvar_66 = o_41.nh; tmpvar_66[j_39] = nh_34; + o_41.nh = tmpvar_66; int _post_incdec_tmp_67; _post_incdec_tmp_67 = j_39; int tmpvar_68; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt index 995514427..72484e1c9 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt @@ -1,9 +1,9 @@ -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform float _TranslucencyViewDependency; uniform vec3 _TerrainTreeLightDirections[4]; +uniform float _TranslucencyViewDependency; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; void main () { vec3 viewDir_1; @@ -25,28 +25,48 @@ void main () vec4 tmpvar_10; tmpvar_10.w = 1.0; tmpvar_10.xyz = _WorldSpaceCameraPos; - viewDir_1 = normalize((((_World2Object * tmpvar_10).xyz * unity_Scale.w) - tmpvar_8.xyz)); + viewDir_1 = normalize((( + (_World2Object * tmpvar_10) + .xyz * unity_Scale.w) - tmpvar_8.xyz)); vec3 tmpvar_11; tmpvar_11 = _TerrainTreeLightDirections[0]; float tmpvar_12; tmpvar_12 = dot (tmpvar_9, tmpvar_11); - tmpvar_2.x = (mix (clamp (-(tmpvar_12), 0.0, 1.0), clamp (dot (viewDir_1, -(tmpvar_11)), 0.0, 1.0), _TranslucencyViewDependency) * 2.0); + tmpvar_2.x = (mix (clamp ( + -(tmpvar_12) + , 0.0, 1.0), clamp ( + dot (viewDir_1, -(tmpvar_11)) + , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); tmpvar_3.x = max (0.0, ((tmpvar_12 * 0.6) + 0.4)); - tmpvar_4.x = max (0.0, dot (tmpvar_9, normalize((tmpvar_11 + viewDir_1)))); + tmpvar_4.x = max (0.0, dot (tmpvar_9, normalize( + (tmpvar_11 + viewDir_1) + ))); vec3 tmpvar_13; tmpvar_13 = _TerrainTreeLightDirections[1]; float tmpvar_14; tmpvar_14 = dot (tmpvar_9, tmpvar_13); - tmpvar_2.y = (mix (clamp (-(tmpvar_14), 0.0, 1.0), clamp (dot (viewDir_1, -(tmpvar_13)), 0.0, 1.0), _TranslucencyViewDependency) * 2.0); + tmpvar_2.y = (mix (clamp ( + -(tmpvar_14) + , 0.0, 1.0), clamp ( + dot (viewDir_1, -(tmpvar_13)) + , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); tmpvar_3.y = max (0.0, ((tmpvar_14 * 0.6) + 0.4)); - tmpvar_4.y = max (0.0, dot (tmpvar_9, normalize((tmpvar_13 + viewDir_1)))); + tmpvar_4.y = max (0.0, dot (tmpvar_9, normalize( + (tmpvar_13 + viewDir_1) + ))); vec3 tmpvar_15; tmpvar_15 = _TerrainTreeLightDirections[2]; float tmpvar_16; tmpvar_16 = dot (tmpvar_9, tmpvar_15); - tmpvar_2.z = (mix (clamp (-(tmpvar_16), 0.0, 1.0), clamp (dot (viewDir_1, -(tmpvar_15)), 0.0, 1.0), _TranslucencyViewDependency) * 2.0); + tmpvar_2.z = (mix (clamp ( + -(tmpvar_16) + , 0.0, 1.0), clamp ( + dot (viewDir_1, -(tmpvar_15)) + , 0.0, 1.0), _TranslucencyViewDependency) * 2.0); tmpvar_3.z = max (0.0, ((tmpvar_16 * 0.6) + 0.4)); - tmpvar_4.z = max (0.0, dot (tmpvar_9, normalize((tmpvar_15 + viewDir_1)))); + tmpvar_4.z = max (0.0, dot (tmpvar_9, normalize( + (tmpvar_15 + viewDir_1) + ))); gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_8); vec4 tmpvar_17; tmpvar_17.zw = vec2(0.0, 0.0); @@ -70,3 +90,5 @@ void main () gl_TexCoord[4] = tmpvar_21; } + +// inputs: 5, stats: 75 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt index 64aebadd7..aa11c3947 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-ir.txt @@ -14,20 +14,20 @@ struct v2f_surf { vec3 lightDir; vec3 viewDir; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _Color; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) @@ -158,7 +158,11 @@ vec4 AnimateVertex ( tmpvar_51 = (animParams_25.w * fBranchAmp_33); bend_26.y = vec2(tmpvar_51).y; vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (((vWavesSum_27.xyx * bend_26) + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w)) * _Wind.w)); + tmpvar_52 = (pos_23.xyz + (( + (vWavesSum_27.xyx * bend_26) + + + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) + ) * _Wind.w)); pos_23.xyz = tmpvar_52.xyz.xyz; vec3 tmpvar_53; tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); @@ -292,8 +296,8 @@ v2f_surf vert_surf ( tmpvar_96 = v_79.normal.z; tmpvar_87[2].z = tmpvar_96; mat3 tmpvar_97; - tmpvar_97 = (tmpvar_87); - rotation_80 = (tmpvar_97); + tmpvar_97 = tmpvar_87; + rotation_80 = tmpvar_97; vec3 tmpvar_98; tmpvar_98 = ObjSpaceLightDir (v_79.vertex); vec3 tmpvar_99; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt index 7bcd691da..d930e3b8d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt @@ -1,17 +1,17 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; uniform vec4 _Color; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -28,20 +28,30 @@ void main () tmpvar_6.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_5))); tmpvar_6.y = tmpvar_5; vec4 tmpvar_7; - tmpvar_7 = abs(((fract((((fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_7 = abs((( + fract(((( + fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_8; tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); vec2 tmpvar_9; tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_1.xyz + (((tmpvar_9.xyx * bend_4) + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_3.xyz = (tmpvar_1.xyz + (( + (tmpvar_9.xyx * bend_4) + + + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_10; tmpvar_10.xz = vec2(0.0, 0.0); tmpvar_10.y = _SquashPlaneNormal.w; vec3 tmpvar_11; - tmpvar_11 = mix ((pos_3.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); + tmpvar_11 = mix ((pos_3.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) + * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); vec4 tmpvar_12; tmpvar_12.w = 1.0; tmpvar_12.xyz = tmpvar_11; @@ -85,7 +95,11 @@ void main () gl_TexCoord[1] = tmpvar_21; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_17 * (((_World2Object * tmpvar_18).xyz * unity_Scale.w) - tmpvar_11)); + tmpvar_22.xyz = (tmpvar_17 * (( + (_World2Object * tmpvar_18) + .xyz * unity_Scale.w) - tmpvar_11)); gl_TexCoord[2] = tmpvar_22; } + +// inputs: 6, stats: 59 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt index 2a8f700e8..4acacc687 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-ir.txt @@ -15,21 +15,21 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) @@ -160,7 +160,11 @@ vec4 AnimateVertex ( tmpvar_51 = (animParams_25.w * fBranchAmp_33); bend_26.y = vec2(tmpvar_51).y; vec3 tmpvar_52; - tmpvar_52 = (pos_23.xyz + (((vWavesSum_27.xyx * bend_26) + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w)) * _Wind.w)); + tmpvar_52 = (pos_23.xyz + (( + (vWavesSum_27.xyx * bend_26) + + + ((_Wind.xyz * vWavesSum_27.y) * animParams_25.w) + ) * _Wind.w)); pos_23.xyz = tmpvar_52.xyz.xyz; vec3 tmpvar_53; tmpvar_53 = (pos_23.xyz + (animParams_25.z * _Wind.xyz)); @@ -294,8 +298,8 @@ v2f_surf vert_surf ( tmpvar_96 = v_79.normal.z; tmpvar_87[2].z = tmpvar_96; mat3 tmpvar_97; - tmpvar_97 = (tmpvar_87); - rotation_80 = (tmpvar_97); + tmpvar_97 = tmpvar_87; + rotation_80 = tmpvar_97; vec3 tmpvar_98; tmpvar_98 = ObjSpaceLightDir (v_79.vertex); vec3 tmpvar_99; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt index d78cfb7c9..6019b9c9d 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt @@ -1,18 +1,18 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -29,20 +29,30 @@ void main () tmpvar_6.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_5))); tmpvar_6.y = tmpvar_5; vec4 tmpvar_7; - tmpvar_7 = abs(((fract((((fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_7 = abs((( + fract(((( + fract(((_TimeX + tmpvar_6).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_8; tmpvar_8 = ((tmpvar_7 * tmpvar_7) * (3.0 - (2.0 * tmpvar_7))); vec2 tmpvar_9; tmpvar_9 = (tmpvar_8.xz + tmpvar_8.yw); bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz; bend_4.y = (gl_MultiTexCoord1.y * 0.3); - pos_3.xyz = (tmpvar_1.xyz + (((tmpvar_9.xyx * bend_4) + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_3.xyz = (tmpvar_1.xyz + (( + (tmpvar_9.xyx * bend_4) + + + ((_Wind.xyz * tmpvar_9.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_10; tmpvar_10.xz = vec2(0.0, 0.0); tmpvar_10.y = _SquashPlaneNormal.w; vec3 tmpvar_11; - tmpvar_11 = mix ((pos_3.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); + tmpvar_11 = mix ((pos_3.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_10 - pos_3.xyz)) + * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount)); vec4 tmpvar_12; tmpvar_12.w = 1.0; tmpvar_12.xyz = tmpvar_11; @@ -82,11 +92,15 @@ void main () gl_FrontColor = tmpvar_13; vec4 tmpvar_21; tmpvar_21.w = 0.0; - tmpvar_21.xyz = (tmpvar_17 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - tmpvar_11)); + tmpvar_21.xyz = (tmpvar_17 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_11)); gl_TexCoord[1] = tmpvar_21; vec4 tmpvar_22; tmpvar_22.w = 0.0; - tmpvar_22.xyz = (tmpvar_17 * (((_World2Object * tmpvar_18).xyz * unity_Scale.w) - tmpvar_11)); + tmpvar_22.xyz = (tmpvar_17 * (( + (_World2Object * tmpvar_18) + .xyz * unity_Scale.w) - tmpvar_11)); gl_TexCoord[2] = tmpvar_22; vec4 tmpvar_23; tmpvar_23.w = 0.0; @@ -94,3 +108,5 @@ void main () gl_TexCoord[3] = tmpvar_23; } + +// inputs: 6, stats: 64 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt index 1f7782285..916639786 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-ir.txt @@ -15,21 +15,21 @@ struct v2f_surf { vec3 viewDir; vec3 _LightCoord; }; -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; vec4 Squash ( in vec4 pos_1 ) @@ -218,7 +218,11 @@ vec4 AnimateVertex ( tmpvar_76 = (animParams_50.w * fBranchAmp_58); bend_51.y = vec2(tmpvar_76).y; vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (((vWavesSum_52.xyx * bend_51) + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w)) * _Wind.w)); + tmpvar_77 = (pos_48.xyz + (( + (vWavesSum_52.xyx * bend_51) + + + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) + ) * _Wind.w)); pos_48.xyz = tmpvar_77.xyz.xyz; vec3 tmpvar_78; tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); @@ -353,8 +357,8 @@ v2f_surf vert_surf ( tmpvar_121 = v_104.normal.z; tmpvar_112[2].z = tmpvar_121; mat3 tmpvar_122; - tmpvar_122 = (tmpvar_112); - rotation_105 = (tmpvar_122); + tmpvar_122 = tmpvar_112; + rotation_105 = tmpvar_122; vec3 tmpvar_123; tmpvar_123 = ObjSpaceLightDir (v_104.vertex); vec3 tmpvar_124; diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt index c9c5cf074..27635dfc2 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt @@ -1,18 +1,18 @@ -varying vec4 xlv_FOG; -attribute vec4 TANGENT; -uniform vec4 unity_Scale; -uniform vec4 _WorldSpaceLightPos0; -uniform vec3 _WorldSpaceCameraPos; -uniform mat4 _World2Object; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform mat4 _LightMatrix0; uniform vec4 _Color; +uniform mat4 _LightMatrix0; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Object; +uniform vec3 _WorldSpaceCameraPos; +uniform vec4 _WorldSpaceLightPos0; +uniform vec4 unity_Scale; +attribute vec4 TANGENT; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -47,20 +47,30 @@ void main () tmpvar_13.x = dot (tmpvar_1.xyz, vec3((gl_Color.y + tmpvar_12))); tmpvar_13.y = tmpvar_12; vec4 tmpvar_14; - tmpvar_14 = abs(((fract((((fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_14 = abs((( + fract(((( + fract(((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_15; tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14))); vec2 tmpvar_16; tmpvar_16 = (tmpvar_15.xz + tmpvar_15.yw); bend_11.xz = ((gl_Color.y * 0.1) * tmpvar_7).xz; bend_11.y = (gl_MultiTexCoord1.y * 0.3); - pos_10.xyz = (tmpvar_1.xyz + (((tmpvar_16.xyx * bend_11) + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_10.xyz = (tmpvar_1.xyz + (( + (tmpvar_16.xyx * bend_11) + + + ((_Wind.xyz * tmpvar_16.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_10.xyz = (pos_10.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_17; tmpvar_17.xz = vec2(0.0, 0.0); tmpvar_17.y = _SquashPlaneNormal.w; vec3 tmpvar_18; - tmpvar_18 = mix ((pos_10.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); + tmpvar_18 = mix ((pos_10.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_17 - pos_10.xyz)) + * _SquashPlaneNormal.xyz)), pos_10.xyz, vec3(_SquashAmount)); vec4 tmpvar_19; tmpvar_19.w = 1.0; tmpvar_19.xyz = tmpvar_18; @@ -100,11 +110,15 @@ void main () gl_FrontColor = tmpvar_20; vec4 tmpvar_28; tmpvar_28.w = 0.0; - tmpvar_28.xyz = (tmpvar_24 * (((_World2Object * _WorldSpaceLightPos0).xyz * unity_Scale.w) - tmpvar_18)); + tmpvar_28.xyz = (tmpvar_24 * (( + (_World2Object * _WorldSpaceLightPos0) + .xyz * unity_Scale.w) - tmpvar_18)); gl_TexCoord[1] = tmpvar_28; vec4 tmpvar_29; tmpvar_29.w = 0.0; - tmpvar_29.xyz = (tmpvar_24 * (((_World2Object * tmpvar_25).xyz * unity_Scale.w) - tmpvar_18)); + tmpvar_29.xyz = (tmpvar_24 * (( + (_World2Object * tmpvar_25) + .xyz * unity_Scale.w) - tmpvar_18)); gl_TexCoord[2] = tmpvar_29; vec4 tmpvar_30; tmpvar_30.w = 0.0; @@ -112,3 +126,5 @@ void main () gl_TexCoord[3] = tmpvar_30; } + +// inputs: 6, stats: 79 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt index c54d37180..5ff357e71 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-ir.txt @@ -16,20 +16,20 @@ struct v2f_surf { vec2 hip_pack0; vec4 lop_color; }; -attribute vec4 TANGENT; -uniform mat4 _World2Shadow3; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform vec4 _LightShadowData; uniform vec4 _Color; +uniform vec4 _LightShadowData; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Shadow; +uniform mat4 _World2Shadow1; +uniform mat4 _World2Shadow2; +uniform mat4 _World2Shadow3; +attribute vec4 TANGENT; vec4 Squash ( in vec4 pos_1 ) @@ -218,7 +218,11 @@ vec4 AnimateVertex ( tmpvar_76 = (animParams_50.w * fBranchAmp_58); bend_51.y = vec2(tmpvar_76).y; vec3 tmpvar_77; - tmpvar_77 = (pos_48.xyz + (((vWavesSum_52.xyx * bend_51) + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w)) * _Wind.w)); + tmpvar_77 = (pos_48.xyz + (( + (vWavesSum_52.xyx * bend_51) + + + ((_Wind.xyz * vWavesSum_52.y) * animParams_50.w) + ) * _Wind.w)); pos_48.xyz = tmpvar_77.xyz.xyz; vec3 tmpvar_78; tmpvar_78 = (pos_48.xyz + (animParams_50.z * _Wind.xyz)); diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt index f2cd6ba73..2a42c5189 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt @@ -1,17 +1,17 @@ -attribute vec4 TANGENT; -uniform mat4 _World2Shadow3; -uniform mat4 _World2Shadow2; -uniform mat4 _World2Shadow1; -uniform mat4 _World2Shadow; -uniform vec4 _Wind; -uniform float _TimeX; -uniform vec4 _SquashPlaneNormal; -uniform float _SquashAmount; -uniform vec4 _Scale; -uniform mat4 _Object2World; -uniform vec4 _MainTex_ST; -uniform vec4 _LightShadowData; uniform vec4 _Color; +uniform vec4 _LightShadowData; +uniform vec4 _MainTex_ST; +uniform mat4 _Object2World; +uniform vec4 _Scale; +uniform float _SquashAmount; +uniform vec4 _SquashPlaneNormal; +uniform float _TimeX; +uniform vec4 _Wind; +uniform mat4 _World2Shadow; +uniform mat4 _World2Shadow1; +uniform mat4 _World2Shadow2; +uniform mat4 _World2Shadow3; +attribute vec4 TANGENT; void main () { vec2 tmpvar_1; @@ -34,21 +34,33 @@ void main () tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + tmpvar_8))); tmpvar_9.y = tmpvar_8; vec4 tmpvar_10; - tmpvar_10 = abs(((fract((((fract(((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) * 2.0) - 1.0) + 0.5)) * 2.0) - 1.0)); + tmpvar_10 = abs((( + fract(((( + fract(((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))) + * 2.0) - 1.0) + 0.5)) + * 2.0) - 1.0)); vec4 tmpvar_11; tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10))); vec2 tmpvar_12; tmpvar_12 = (tmpvar_11.xz + tmpvar_11.yw); - bend_7.xz = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize((tmpvar_4 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(tmpvar_3))).xz; + bend_7.xz = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize( + (tmpvar_4 * gl_ModelViewMatrixInverseTranspose) + ).xyz, vec3(tmpvar_3))).xz; bend_7.y = (gl_MultiTexCoord1.y * 0.3); - pos_6.xyz = (tmpvar_2.xyz + (((tmpvar_12.xyx * bend_7) + ((_Wind.xyz * tmpvar_12.y) * gl_MultiTexCoord1.y)) * _Wind.w)); + pos_6.xyz = (tmpvar_2.xyz + (( + (tmpvar_12.xyx * bend_7) + + + ((_Wind.xyz * tmpvar_12.y) * gl_MultiTexCoord1.y) + ) * _Wind.w)); pos_6.xyz = (pos_6.xyz + (gl_MultiTexCoord1.x * _Wind.xyz)); vec3 tmpvar_13; tmpvar_13.xz = vec2(0.0, 0.0); tmpvar_13.y = _SquashPlaneNormal.w; vec4 tmpvar_14; tmpvar_14.w = 1.0; - tmpvar_14.xyz = mix ((pos_6.xyz + (dot (_SquashPlaneNormal.xyz, (tmpvar_13 - pos_6.xyz)) * _SquashPlaneNormal.xyz)), pos_6.xyz, vec3(_SquashAmount)); + tmpvar_14.xyz = mix ((pos_6.xyz + ( + dot (_SquashPlaneNormal.xyz, (tmpvar_13 - pos_6.xyz)) + * _SquashPlaneNormal.xyz)), pos_6.xyz, vec3(_SquashAmount)); tmpvar_2 = tmpvar_14; vec4 tmpvar_15; tmpvar_15.xyz = (gl_Color.w * _Color.xyz); @@ -87,3 +99,5 @@ void main () gl_FrontColor = tmpvar_15; } + +// inputs: 6, stats: 66 alu 0 tex 0 flow diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt index 61026e91a..151560403 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-ir.txt @@ -11,8 +11,8 @@ struct appdata_t { vec3 normal; vec2 texcoord; }; -varying vec4 xlv_FOG; uniform vec4 _MainTex_ST; +varying vec4 xlv_FOG; void PositionFog ( in vec4 v_1, out vec4 pos_2, diff --git a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt index 8c5324a2d..62e1344c0 100644 --- a/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt +++ b/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt @@ -1,5 +1,5 @@ -varying vec4 xlv_FOG; uniform vec4 _MainTex_ST; +varying vec4 xlv_FOG; void main () { vec4 tmpvar_1; @@ -20,3 +20,5 @@ void main () gl_TexCoord[1] = tmpvar_4; } + +// inputs: 4, stats: 6 alu 0 tex 0 flow diff --git a/examples/02-metaballs/fs_metaballs.bin.h b/examples/02-metaballs/fs_metaballs.bin.h index 22c8a9858..4e54105d6 100644 --- a/examples/02-metaballs/fs_metaballs.bin.h +++ b/examples/02-metaballs/fs_metaballs.bin.h @@ -1,31 +1,30 @@ -static const uint8_t fs_metaballs_glsl[408] = +static const uint8_t fs_metaballs_glsl[386] = { - 0x46, 0x53, 0x48, 0x01, 0x03, 0x2c, 0xf5, 0x3f, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH..,.?#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x76, 0x61, 0x72, // if // GL_ES..var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // ying vec3 v_norm - 0x61, 0x6c, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, // al;.varying vec4 - 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // v_color0;.void - 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // main ().{. floa - 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_1;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x6e, 0x6f, // pvar_1 = dot (no - 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // rmalize(v_normal - 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, // ), vec3(0.0, 0.0 - 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, // , -1.0));. vec4 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_2;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_2.w = 1.0;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_2.xyz = - 0x70, 0x6f, 0x77, 0x20, 0x28, 0x28, 0x28, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, // pow (((pow (v_co - 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, // lor0.xyz, vec3(2 - 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x29, 0x29, 0x20, 0x2a, // .2, 2.2, 2.2)) * - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x70, 0x6f, 0x77, // tmpvar_1) + pow - 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, 0x30, // (tmpvar_1, 30.0 - 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, // )), vec3(0.45454 - 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, // 5, 0.454545, 0.4 - 0x35, 0x34, 0x35, 0x34, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // 54545));. gl_Fr - 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // agColor = tmpvar - 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // _2;.}... + 0x46, 0x53, 0x48, 0x01, 0x03, 0x2c, 0xf5, 0x3f, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH..,.?precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // c3 v_normal;.voi + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // d main ().{. fl + 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_1;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, // tmpvar_1 = dot ( + 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // normalize(v_norm + 0x61, 0x6c, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x30, // al), vec3(0.0, 0 + 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, // .0, -1.0));. ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_2;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, // mpvar_2.w = 1.0; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, // . tmpvar_2.xyz + 0x3d, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, // = pow (((. po + 0x77, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x2c, // w (v_color0.xyz, + 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x32, 0x2e, 0x32, 0x2c, 0x20, 0x32, 0x2e, 0x32, 0x2c, 0x20, // vec3(2.2, 2.2, + 0x32, 0x2e, 0x32, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 2.2)). * tmpva + 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2b, 0x20, 0x70, 0x6f, 0x77, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // r_1) + pow (tmpv + 0x61, 0x72, 0x5f, 0x31, 0x2c, 0x20, 0x33, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x76, 0x65, // ar_1, 30.0)), ve + 0x63, 0x33, 0x28, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, // c3(0.454545, 0.4 + 0x35, 0x34, 0x35, 0x34, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x35, 0x34, 0x35, 0x34, 0x35, 0x29, // 54545, 0.454545) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );. gl_FragColo + 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_2;.}. + 0x0a, 0x00, // .. }; static const uint8_t fs_metaballs_dx9[429] = { diff --git a/examples/02-metaballs/vs_metaballs.bin.h b/examples/02-metaballs/vs_metaballs.bin.h index c0969b30c..978b47437 100644 --- a/examples/02-metaballs/vs_metaballs.bin.h +++ b/examples/02-metaballs/vs_metaballs.bin.h @@ -1,37 +1,35 @@ -static const uint8_t vs_metaballs_glsl[500] = +static const uint8_t vs_metaballs_glsl[470] = { - 0x56, 0x53, 0x48, 0x01, 0x03, 0x2c, 0xf5, 0x3f, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH..,.?#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // form mat4 u_mode - 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // lViewProj;.unifo - 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, // rm mat4 u_model[ - 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, // 32];.varying vec - 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // 3 v_normal;.vary + 0x56, 0x53, 0x48, 0x01, 0x03, 0x2c, 0xf5, 0x3f, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH..,.?precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut + 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, // e vec3 a_normal; + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // .attribute vec3 + 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, // a_position;.vary 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ing vec4 v_color - 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, // 0;.attribute vec - 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, // 3 a_position;.at - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, // tribute vec3 a_n - 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // ormal;.attribute - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // vec4 a_color0;. - 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, // vec4 tmpvar_1;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, // tmpvar_1.w = 1 - 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // .0;. tmpvar_1.x - 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // yz = a_position; - 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, // . gl_Position = - 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // (u_modelViewPro - 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, // j * tmpvar_1);. - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // vec4 tmpvar_2;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x30, // tmpvar_2.w = 0 - 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, // .0;. tmpvar_2.x - 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x20, // yz = a_normal;. - 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, // v_normal = (u_m - 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // odel[0] * tmpvar - 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // _2).xyz;. v_col - 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // or0 = a_color0;. - 0x7d, 0x0a, 0x0a, 0x00, // }... + 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // 0;.varying vec3 + 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // v_normal;.unifor + 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x33, // m mat4 u_model[3 + 0x32, 0x5d, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, // 2];.uniform mat4 + 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // u_modelViewProj + 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{ + 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // . vec4 tmpvar_1 + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_1.w = + 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 1.0;. tmpvar_1 + 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // .xyz = a_positio + 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // n;. gl_Position + 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // = (u_modelViewP + 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, // roj * tmpvar_1); + 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // . vec4 tmpvar_2 + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_2.w = + 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // 0.0;. tmpvar_2 + 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, // .xyz = a_normal; + 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x75, // . v_normal = (u + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // _model[0] * tmpv + 0x61, 0x72, 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, // ar_2).xyz;. v_c + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // olor0 = a_color0 + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... }; static const uint8_t vs_metaballs_dx9[457] = { diff --git a/examples/17-drawstress/fs_drawstress.bin.h b/examples/17-drawstress/fs_drawstress.bin.h index e7b5ff588..0566cfcad 100644 --- a/examples/17-drawstress/fs_drawstress.bin.h +++ b/examples/17-drawstress/fs_drawstress.bin.h @@ -1,14 +1,12 @@ -static const uint8_t fs_drawstress_glsl[130] = +static const uint8_t fs_drawstress_glsl[100] = { - 0x46, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH....I#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x76, 0x61, 0x72, // if // GL_ES..var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ying vec4 v_colo - 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, // r0;.void main () - 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // .{. gl_FragColo - 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, // r = v_color0;.}. - 0x0a, 0x00, // .. + 0x46, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH....Iprecisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, // lor0;.void main + 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // ().{. gl_FragCo + 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // lor = v_color0;. + 0x7d, 0x0a, 0x0a, 0x00, // }... }; static const uint8_t fs_drawstress_dx9[137] = { diff --git a/examples/17-drawstress/vs_drawstress.bin.h b/examples/17-drawstress/vs_drawstress.bin.h index d61bc7a91..284e80aa9 100644 --- a/examples/17-drawstress/vs_drawstress.bin.h +++ b/examples/17-drawstress/vs_drawstress.bin.h @@ -1,25 +1,24 @@ -static const uint8_t vs_drawstress_glsl[320] = +static const uint8_t vs_drawstress_glsl[290] = { - 0x56, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH....I#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // form mat4 u_mode - 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // lViewProj;.varyi - 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // ng vec4 v_color0 - 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, // ;.attribute vec3 - 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, // a_position;.att - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, // ribute vec4 a_co - 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, // lor0;.void main - 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // ().{. vec4 tmpv - 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // ar_1;. tmpvar_1 - 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // .w = 1.0;. tmpv - 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // ar_1.xyz = a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, // ition;. gl_Posi - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, // tion = (u_modelV - 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // iewProj * tmpvar - 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, // _1);. v_color0 - 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // = a_color0;.}... + 0x56, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH....Iprecisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut + 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec3 a_positio + 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // n;.varying vec4 + 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // v_color0;.unifor + 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, // m mat4 u_modelVi + 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, // ewProj;.void mai + 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, // n ().{. vec4 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_1;. tmpvar + 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // _1.w = 1.0;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, // pvar_1.xyz = a_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // osition;. gl_Po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // sition = (u_mode + 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // lViewProj * tmpv + 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ar_1);. v_color + 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, // 0 = a_color0;.}. + 0x0a, 0x00, // .. }; static const uint8_t vs_drawstress_dx9[319] = { diff --git a/examples/common/font/fs_font_basic.bin.h b/examples/common/font/fs_font_basic.bin.h index a136c178b..0a3a19355 100644 --- a/examples/common/font/fs_font_basic.bin.h +++ b/examples/common/font/fs_font_basic.bin.h @@ -1,40 +1,39 @@ -static const uint8_t fs_font_basic_glsl[545] = +static const uint8_t fs_font_basic_glsl[530] = { - 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, 0x62, 0x65, // form samplerCube - 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x61, 0x72, // u_texColor;.var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ying vec4 v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, // oord0;.varying v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, // ec4 v_color0;.vo - 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x66, // id main ().{. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, // loat rgba_1[4];. - 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, // vec4 tmpvar_2; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, // . tmpvar_2 = te - 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, // xtureCube (u_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // Color, v_texcoor - 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, // d0.xyz);. int t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_3;. tmpva - 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, // r_3 = int(((v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, // xcoord0.w * 4.0) - 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, // + 0.5));. rgba - 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // _1[0] = tmpvar_2 - 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, // .z;. rgba_1[1] - 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_2.y;. - 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // rgba_1[2] = tmpv - 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, // ar_2.x;. rgba_1 - 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, // [3] = tmpvar_2.w - 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ;. vec4 tmpvar_ - 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, // 4;. tmpvar_4.xy - 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, // z = v_color0.xyz - 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_4.w = - 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x72, // (v_color0.w * r - 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x29, // gba_1[tmpvar_3]) - 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ;. gl_FragColor - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // = tmpvar_4;.}.. - 0x00, // . + 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // uniform samplerC + 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube u_texColor;. + 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. + 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, 0x61, // lowp float rgba + 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // _1[4];. lowp ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_2;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // mpvar_2 = textur + 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // eCube (u_texColo + 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // r, v_texcoord0.x + 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // yz);. int tmpva + 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, // r_3;. tmpvar_3 + 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = int(((v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, // rd0.w * 4.0) + 0 + 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, // .5));. rgba_1[0 + 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, // ] = tmpvar_2.z;. + 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, // rgba_1[1] = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, // pvar_2.y;. rgba + 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // _1[2] = tmpvar_2 + 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, // .x;. rgba_1[3] + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_2.w;. + 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar + 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, // _4;. tmpvar_4.x + 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, // yz = v_color0.xy + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x77, 0x20, // z;. tmpvar_4.w + 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, // = (v_color0.w * + 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, // rgba_1[tmpvar_3] + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );. gl_FragColo + 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, // r = tmpvar_4;.}. + 0x0a, 0x00, // .. }; static const uint8_t fs_font_basic_dx9[445] = { diff --git a/examples/common/font/fs_font_distance_field.bin.h b/examples/common/font/fs_font_distance_field.bin.h index 913595c27..b96646d23 100644 --- a/examples/common/font/fs_font_distance_field.bin.h +++ b/examples/common/font/fs_font_distance_field.bin.h @@ -1,64 +1,66 @@ -static const uint8_t fs_font_distance_field_glsl[929] = +static const uint8_t fs_font_distance_field_glsl[972] = { - 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, 0x62, 0x65, // form samplerCube - 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x61, 0x72, // u_texColor;.var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ying vec4 v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, // oord0;.varying v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, // ec4 v_color0;.vo - 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x66, // id main ().{. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, // loat rgba_1[4];. - 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, // vec4 tmpvar_2; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, // . tmpvar_2 = te - 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, // xtureCube (u_tex - 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // Color, v_texcoor - 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, // d0.xyz);. int t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_3;. tmpva - 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, // r_3 = int(((v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, // xcoord0.w * 4.0) - 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, // + 0.5));. rgba - 0x5f, 0x31, 0x5b, 0x30, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // _1[0] = tmpvar_2 - 0x2e, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, // .z;. rgba_1[1] - 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_2.y;. - 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // rgba_1[2] = tmpv - 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, // ar_2.x;. rgba_1 - 0x5b, 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, // [3] = tmpvar_2.w - 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ;. vec3 tmpvar_ - 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, // 4;. tmpvar_4 = - 0x64, 0x46, 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // dFdx(v_texcoord0 - 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // .xyz);. vec3 tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_5;. tmpvar - 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // _5 = dFdy(v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // oord0.xyz);. fl - 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_6;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, // tmpvar_6 = (8.0 - 0x2a, 0x20, 0x28, 0x73, 0x71, 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, // * (sqrt(dot (tmp - 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, // var_4, tmpvar_4) - 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, // ) + sqrt(dot (tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, // pvar_5, tmpvar_5 - 0x29, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, // ))));. float ed - 0x67, 0x65, 0x30, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, // ge0_7;. edge0_7 - 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = (0.5 - tmpvar - 0x5f, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x5f, 0x38, // _6);. float t_8 - 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x6d, // ;. t_8 = max (m - 0x69, 0x6e, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, // in (((rgba_1[tmp - 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, // var_3] - edge0_7 - 0x29, 0x20, 0x2f, 0x20, 0x28, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, // ) / ((0.5 + tmpv - 0x61, 0x72, 0x5f, 0x36, 0x29, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, // ar_6) - edge0_7) - 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // ), 1.0), 0.0);. - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, // vec4 tmpvar_9;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, // tmpvar_9.xyz = - 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, // v_color0.xyz;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, // tmpvar_9.w = (v - 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x5f, 0x38, // _color0.w * (t_8 - 0x20, 0x2a, 0x20, 0x28, 0x74, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, // * (t_8 * (3.0 - - 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x5f, 0x38, 0x29, 0x29, 0x29, 0x29, 0x29, // (2.0 * t_8))))) - 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, // ;. gl_FragColor - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // = tmpvar_9;.}.. - 0x00, // . + 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // uniform samplerC + 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube u_texColor;. + 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. + 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x72, 0x67, 0x62, 0x61, // lowp float rgba + 0x5f, 0x31, 0x5b, 0x34, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // _1[4];. lowp ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_2;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // mpvar_2 = textur + 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, // eCube (u_texColo + 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // r, v_texcoord0.x + 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // yz);. int tmpva + 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, // r_3;. tmpvar_3 + 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = int(((v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, // rd0.w * 4.0) + 0 + 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x30, // .5));. rgba_1[0 + 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x3b, 0x0a, // ] = tmpvar_2.z;. + 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x31, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, // rgba_1[1] = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, // pvar_2.y;. rgba + 0x5f, 0x31, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // _1[2] = tmpvar_2 + 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x33, 0x5d, 0x20, // .x;. rgba_1[3] + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_2.w;. + 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec3 tmpvar_4;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, // tmpvar_4 = dFdx + 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // (v_texcoord0.xyz + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // );. vec3 tmpvar + 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, // _5;. tmpvar_5 = + 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // dFdy(v_texcoord + 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // 0.xyz);. float + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_6;. tmpv + 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, // ar_6 = (8.0 * (s + 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, // qrt(. dot (tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // pvar_4, tmpvar_4 + 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // ). ) + sqrt(. + 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x2c, // dot (tmpvar_5, + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, // tmpvar_5). ))) + 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, // ;. float edge0_ + 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, // 7;. edge0_7 = ( + 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x3b, // 0.5 - tmpvar_6); + 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, // . lowp float tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_8;. tmpvar + 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, 0x28, 0x72, 0x67, // _8 = clamp (((rg + 0x62, 0x61, 0x5f, 0x31, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x5d, 0x20, 0x2d, // ba_1[tmpvar_3] - + 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, // edge0_7) / (. + 0x20, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // (0.5 + tmpvar_ + 0x36, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x37, 0x29, // 6). - edge0_7) + 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ), 0.0, 1.0);. + 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // lowp vec4 tmpvar + 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, // _9;. tmpvar_9.x + 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, // yz = v_color0.xy + 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x77, 0x20, // z;. tmpvar_9.w + 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, // = (v_color0.w * + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, // (tmpvar_8 * (tmp + 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x33, 0x2e, // var_8 * . (3. + 0x30, 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 0 - (2.0 * tmpva + 0x72, 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, // r_8)). )));. g + 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, // l_FragColor = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // pvar_9;.}... }; static const uint8_t fs_font_distance_field_dx9[737] = { diff --git a/examples/common/font/fs_font_distance_field_subpixel.bin.h b/examples/common/font/fs_font_distance_field_subpixel.bin.h index cdeb6ea5d..a871be164 100644 --- a/examples/common/font/fs_font_distance_field_subpixel.bin.h +++ b/examples/common/font/fs_font_distance_field_subpixel.bin.h @@ -1,75 +1,84 @@ -static const uint8_t fs_font_distance_field_subpixel_glsl[1119] = +static const uint8_t fs_font_distance_field_subpixel_glsl[1264] = { - 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, 0x75, 0x62, 0x65, // form samplerCube - 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x61, 0x72, // u_texColor;.var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ying vec4 v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, // oord0;.varying v - 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, // ec4 v_color0;.vo - 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x69, // id main ().{. i - 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // nt tmpvar_1;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x28, // mpvar_1 = int((( - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, // v_texcoord0.w * - 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 4.0) + 0.5));. - 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, // vec3 tmpvar_2;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x78, // tmpvar_2 = dFdx - 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, // (v_texcoord0.xyz - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // );. vec3 tmpvar - 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, // _3;. tmpvar_3 = - 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // dFdy(v_texcoord - 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, // 0.xyz);. vec3 t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_4;. tmpva - 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x31, 0x36, 0x36, 0x36, 0x36, 0x37, 0x20, // r_4 = (0.166667 - 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, // * tmpvar_2);. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, // loat tmpvar_5;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, // tmpvar_5 = text - 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, // ureCube (u_texCo - 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // lor, (v_texcoord - 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, // 0.xyz - tmpvar_4 - 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // )).zyxw[tmpvar_1 - 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ];. float tmpva - 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, // r_6;. tmpvar_6 - 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, // = textureCube (u - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, // _texColor, (v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2b, 0x20, 0x74, 0x6d, // xcoord0.xyz + tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, // pvar_4)).zyxw[tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // pvar_1];. float - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_7;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, 0x28, // var_7 = (0.5 * ( - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpvar_5 + tmpva - 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // r_6));. float t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_8;. tmpva - 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, 0x71, // r_8 = (8.0 * (sq - 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // rt(dot (tmpvar_2 - 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x73, // , tmpvar_2)) + s - 0x71, 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // qrt(dot (tmpvar_ - 0x33, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x29, 0x29, 0x3b, // 3, tmpvar_3)))); - 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, // . vec3 tmpvar_9 - 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x20, 0x3d, // ;. tmpvar_9.x = - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_5;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // var_9.y = tmpvar - 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x7a, // _7;. tmpvar_9.z - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x66, // = tmpvar_6;. f - 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, // loat edge0_10;. - 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, // edge0_10 = (0.5 - 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, // - tmpvar_8);. - 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x5f, 0x31, // vec3 t_11;. t_1 - 0x31, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x28, 0x28, // 1 = max (min ((( - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, // tmpvar_9 - edge0 - 0x5f, 0x31, 0x30, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, // _10) / ((0.5 + t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, // mpvar_8) - edge0 - 0x5f, 0x31, 0x30, 0x29, 0x29, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, // _10)), 1.0), 0.0 - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );. gl_FragColo - 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x5f, 0x31, 0x31, 0x20, 0x2a, // r.xyz = ((t_11 * - 0x20, 0x28, 0x74, 0x5f, 0x31, 0x31, 0x20, 0x2a, 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, // (t_11 * (3.0 - - 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x5f, 0x31, 0x31, 0x29, 0x29, 0x29, 0x29, 0x20, // (2.0 * t_11)))) + 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x43, // uniform samplerC + 0x75, 0x62, 0x65, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, // ube u_texColor;. + 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. + 0x20, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // int tmpvar_1;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, // tmpvar_1 = int( + 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x77, 0x20, // ((v_texcoord0.w + 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, // * 4.0) + 0.5));. + 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, // vec3 tmpvar_2; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x64, 0x46, // . tmpvar_2 = dF + 0x64, 0x78, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // dx(v_texcoord0.x + 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, // yz);. vec3 tmpv + 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, // ar_3;. tmpvar_3 + 0x20, 0x3d, 0x20, 0x64, 0x46, 0x64, 0x79, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // = dFdy(v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, // rd0.xyz);. vec3 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_4;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x31, 0x36, 0x36, 0x36, 0x36, // var_4 = (0.16666 + 0x37, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, // 7 * tmpvar_2);. + 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp float tmpv + 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, // ar_5;. tmpvar_5 + 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, // = textureCube ( + 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, // u_texColor, (v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2d, 0x20, 0x74, // excoord0.xyz - t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, // mpvar_4)).zyxw[t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // mpvar_1];. lowp + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, // float tmpvar_6; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x74, 0x65, // . tmpvar_6 = te + 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x75, 0x62, 0x65, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, // xtureCube (u_tex + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // Color, (v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // rd0.xyz + tmpvar + 0x5f, 0x34, 0x29, 0x29, 0x2e, 0x7a, 0x79, 0x78, 0x77, 0x5b, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // _4)).zyxw[tmpvar + 0x5f, 0x31, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _1];. lowp floa + 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // t tmpvar_7;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2a, 0x20, // pvar_7 = (0.5 * + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, // (tmpvar_5 + tmpv + 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ar_6));. float + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_8;. tmpv + 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x38, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x28, 0x73, // ar_8 = (8.0 * (s + 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, // qrt(. dot (tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // pvar_2, tmpvar_2 + 0x29, 0x0a, 0x20, 0x20, 0x29, 0x20, 0x2b, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x0a, 0x20, 0x20, // ). ) + sqrt(. + 0x20, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2c, // dot (tmpvar_3, + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, // tmpvar_3). ))) + 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // ;. lowp vec3 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_9;. tmpvar + 0x5f, 0x39, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, // _9.x = tmpvar_5; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x79, 0x20, 0x3d, 0x20, // . tmpvar_9.y = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_7;. tmpv + 0x61, 0x72, 0x5f, 0x39, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_9.z = tmpvar_ + 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, // 6;. float edge0 + 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x20, // _10;. edge0_10 + 0x3d, 0x20, 0x28, 0x30, 0x2e, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // = (0.5 - tmpvar_ + 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // 8);. lowp vec3 + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_11;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, // var_11 = clamp ( + 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, // ((tmpvar_9 - edg + 0x65, 0x30, 0x5f, 0x31, 0x30, 0x29, 0x20, 0x2f, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, // e0_10) / (. ( + 0x30, 0x2e, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x0a, // 0.5 + tmpvar_8). + 0x20, 0x20, 0x20, 0x2d, 0x20, 0x65, 0x64, 0x67, 0x65, 0x30, 0x5f, 0x31, 0x30, 0x29, 0x29, 0x2c, // - edge0_10)), + 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, // 0.0, 1.0);. lo + 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wp vec3 tmpvar_1 + 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x20, 0x3d, // 2;. tmpvar_12 = + 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x2a, 0x20, 0x28, // ((tmpvar_11 * ( + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, // tmpvar_11 * . + 0x20, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, // (3.0 - (2.0 * t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x20, // mpvar_11)). )) 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, // * v_color0.w);. - 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, // gl_FragColor.w - 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x2a, 0x20, 0x76, 0x5f, // = (tmpvar_7 * v_ - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // color0.w);.}... + 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, // gl_FragColor.xy + 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, // z = tmpvar_12;. + 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp float tmpv + 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ar_13;. tmpvar_ + 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x2a, // 13 = (tmpvar_7 * + 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, // v_color0.w);. + 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, // gl_FragColor.w = + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_13;.}... }; static const uint8_t fs_font_distance_field_subpixel_dx9[885] = { diff --git a/examples/common/font/vs_font_basic.bin.h b/examples/common/font/vs_font_basic.bin.h index d661c2202..8bd7bd4ef 100644 --- a/examples/common/font/vs_font_basic.bin.h +++ b/examples/common/font/vs_font_basic.bin.h @@ -1,31 +1,29 @@ -static const uint8_t vs_font_basic_glsl[414] = +static const uint8_t vs_font_basic_glsl[384] = { - 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // form mat4 u_mode - 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // lViewProj;.varyi - 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // ng vec4 v_texcoo - 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, // rd0;.varying vec - 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, // 4 v_color0;.attr - 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, // ibute vec4 a_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // coord0;.attribut + 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec2 a_positio 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, // n;.attribute vec - 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // 4 a_color0;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // main ().{. vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_1;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, // pvar_1.zw = vec2 - 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // (0.0, 1.0);. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, // pvar_1.xy = a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // sition;. gl_Pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // ition = (u_model - 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ViewProj * tmpva - 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // r_1);. v_texcoo - 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // rd0 = a_texcoord - 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, // 0;. v_color0 = - 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... + 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, // 4 a_texcoord0;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, // uniform mat4 u_m + 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, // odelViewProj;.vo + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, // id main ().{. v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_1;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, // tmpvar_1.zw = ve + 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // c2(0.0, 1.0);. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, // tmpvar_1.xy = a_ + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, // position;. gl_P + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // osition = (u_mod + 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // elViewProj * tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // var_1);. v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // oord0 = a_texcoo + 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, // rd0;. v_color0 + 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // = a_color0;.}... }; static const uint8_t vs_font_basic_dx9[335] = { diff --git a/examples/common/font/vs_font_distance_field.bin.h b/examples/common/font/vs_font_distance_field.bin.h index ae8db15ac..7d385e10d 100644 --- a/examples/common/font/vs_font_distance_field.bin.h +++ b/examples/common/font/vs_font_distance_field.bin.h @@ -1,31 +1,29 @@ -static const uint8_t vs_font_distance_field_glsl[414] = +static const uint8_t vs_font_distance_field_glsl[384] = { - 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // form mat4 u_mode - 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // lViewProj;.varyi - 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // ng vec4 v_texcoo - 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, // rd0;.varying vec - 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, // 4 v_color0;.attr - 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, // ibute vec4 a_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // coord0;.attribut + 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec2 a_positio 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, // n;.attribute vec - 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // 4 a_color0;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // main ().{. vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_1;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, // pvar_1.zw = vec2 - 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // (0.0, 1.0);. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, // pvar_1.xy = a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // sition;. gl_Pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // ition = (u_model - 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ViewProj * tmpva - 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // r_1);. v_texcoo - 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // rd0 = a_texcoord - 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, // 0;. v_color0 = - 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... + 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, // 4 a_texcoord0;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, // uniform mat4 u_m + 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, // odelViewProj;.vo + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, // id main ().{. v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_1;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, // tmpvar_1.zw = ve + 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // c2(0.0, 1.0);. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, // tmpvar_1.xy = a_ + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, // position;. gl_P + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // osition = (u_mod + 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // elViewProj * tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // var_1);. v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // oord0 = a_texcoo + 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, // rd0;. v_color0 + 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // = a_color0;.}... }; static const uint8_t vs_font_distance_field_dx9[335] = { diff --git a/examples/common/font/vs_font_distance_field_subpixel.bin.h b/examples/common/font/vs_font_distance_field_subpixel.bin.h index d119ec029..a43b4335e 100644 --- a/examples/common/font/vs_font_distance_field_subpixel.bin.h +++ b/examples/common/font/vs_font_distance_field_subpixel.bin.h @@ -1,31 +1,29 @@ -static const uint8_t vs_font_distance_field_subpixel_glsl[414] = +static const uint8_t vs_font_distance_field_subpixel_glsl[384] = { - 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // form mat4 u_mode - 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // lViewProj;.varyi - 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // ng vec4 v_texcoo - 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, // rd0;.varying vec - 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, // 4 v_color0;.attr - 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, // ibute vec4 a_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // coord0;.attribut + 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec2 a_positio 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, // n;.attribute vec - 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // 4 a_color0;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // main ().{. vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_1;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, // pvar_1.zw = vec2 - 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // (0.0, 1.0);. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, // pvar_1.xy = a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // sition;. gl_Pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // ition = (u_model - 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ViewProj * tmpva - 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // r_1);. v_texcoo - 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // rd0 = a_texcoord - 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, // 0;. v_color0 = - 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // a_color0;.}... + 0x34, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, // 4 a_texcoord0;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x34, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c4 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, // uniform mat4 u_m + 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, // odelViewProj;.vo + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, // id main ().{. v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_1;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, // tmpvar_1.zw = ve + 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // c2(0.0, 1.0);. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, // tmpvar_1.xy = a_ + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, // position;. gl_P + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // osition = (u_mod + 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // elViewProj * tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // var_1);. v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // oord0 = a_texcoo + 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, // rd0;. v_color0 + 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // = a_color0;.}... }; static const uint8_t vs_font_distance_field_subpixel_dx9[335] = { diff --git a/examples/common/imgui/fs_imgui_color.bin.h b/examples/common/imgui/fs_imgui_color.bin.h index ff2242f2a..0953e40cb 100644 --- a/examples/common/imgui/fs_imgui_color.bin.h +++ b/examples/common/imgui/fs_imgui_color.bin.h @@ -1,14 +1,12 @@ -static const uint8_t fs_imgui_color_glsl[130] = +static const uint8_t fs_imgui_color_glsl[100] = { - 0x46, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH....I#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x76, 0x61, 0x72, // if // GL_ES..var - 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // ying vec4 v_colo - 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, // r0;.void main () - 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // .{. gl_FragColo - 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, // r = v_color0;.}. - 0x0a, 0x00, // .. + 0x46, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH....Iprecisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, // lor0;.void main + 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // ().{. gl_FragCo + 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // lor = v_color0;. + 0x7d, 0x0a, 0x0a, 0x00, // }... }; static const uint8_t fs_imgui_color_dx9[137] = { diff --git a/examples/common/imgui/fs_imgui_texture.bin.h b/examples/common/imgui/fs_imgui_texture.bin.h index 7f9515f15..45f535284 100644 --- a/examples/common/imgui/fs_imgui_texture.bin.h +++ b/examples/common/imgui/fs_imgui_texture.bin.h @@ -1,24 +1,23 @@ -static const uint8_t fs_imgui_texture_glsl[303] = +static const uint8_t fs_imgui_texture_glsl[278] = { - 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // FSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x75, // form sampler2D u - 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, // _texColor;.varyi - 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // ng vec2 v_texcoo - 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, // rd0;.varying vec - 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // 4 v_color0;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // main ().{. vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_1;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, // pvar_1.xyz = v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // olor0.xyz;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // var_1.w = (v_col - 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // or0.w * texture2 - 0x44, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, // D (u_texColor, v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x2e, 0x78, 0x29, 0x3b, 0x0a, // _texcoord0).x);. - 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, // gl_FragColor = - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // tmpvar_1;.}... + 0x46, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // FSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x76, // n highp float;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 v_texcoord0;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, // uniform sampler2 + 0x44, 0x20, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x76, 0x6f, // D u_texColor;.vo + 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, // id main ().{. l + 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // owp vec4 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // 1;. tmpvar_1.xy + 0x7a, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x78, 0x79, 0x7a, // z = v_color0.xyz + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, // ;. tmpvar_1.w = + 0x20, 0x28, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x2e, 0x77, 0x20, 0x2a, 0x20, 0x74, // (v_color0.w * t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x75, 0x5f, 0x74, 0x65, 0x78, 0x43, // exture2D (u_texC + 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // olor, v_texcoord + 0x30, 0x29, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, // 0).x);. gl_Frag + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // Color = tmpvar_1 + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... }; static const uint8_t fs_imgui_texture_dx9[241] = { diff --git a/examples/common/imgui/vs_imgui_color.bin.h b/examples/common/imgui/vs_imgui_color.bin.h index d96fb21ce..201bbb646 100644 --- a/examples/common/imgui/vs_imgui_color.bin.h +++ b/examples/common/imgui/vs_imgui_color.bin.h @@ -1,26 +1,24 @@ -static const uint8_t vs_imgui_color_glsl[321] = +static const uint8_t vs_imgui_color_glsl[291] = { - 0x56, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH....I#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // form mat4 u_view - 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // Proj;.varying ve - 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, // c4 v_color0;.att - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, // ribute vec2 a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // sition;.attribut - 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, // e vec4 a_color0; - 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{. - 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // vec4 tmpvar_1; - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_1.zw = - 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // vec2(0.0, 1.0); - 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, // . tmpvar_1.xy = - 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, // a_position;. g - 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, // l_Position = (u_ - 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // viewProj * tmpva - 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // r_1);. v_color0 - 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // = a_color0;.}.. - 0x00, // . + 0x56, 0x53, 0x48, 0x01, 0xa4, 0x8b, 0xef, 0x49, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH....Iprecisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut + 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec2 a_positio + 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // n;.varying vec4 + 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // v_color0;.unifor + 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // m mat4 u_viewPro + 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // j;.void main (). + 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // {. vec4 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, // 1;. tmpvar_1.zw + 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // = vec2(0.0, 1.0 + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, // );. tmpvar_1.xy + 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, // = a_position;. + 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, // gl_Position = ( + 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // u_viewProj * tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // var_1);. v_colo + 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, // r0 = a_color0;.} + 0x0a, 0x0a, 0x00, // ... }; static const uint8_t vs_imgui_color_dx9[290] = { diff --git a/examples/common/imgui/vs_imgui_texture.bin.h b/examples/common/imgui/vs_imgui_texture.bin.h index c87350bb9..e0db9293d 100644 --- a/examples/common/imgui/vs_imgui_texture.bin.h +++ b/examples/common/imgui/vs_imgui_texture.bin.h @@ -1,31 +1,29 @@ -static const uint8_t vs_imgui_texture_glsl[404] = +static const uint8_t vs_imgui_texture_glsl[374] = { - 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, // VSH.....#ifdef G - 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, // L_ES.precision h - 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x23, 0x65, 0x6e, 0x64, // ighp float;.#end - 0x69, 0x66, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x0a, 0x75, 0x6e, 0x69, // if // GL_ES..uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // form mat4 u_view - 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // Proj;.varying ve + 0x56, 0x53, 0x48, 0x01, 0x01, 0x83, 0xf2, 0xe1, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, // VSH.....precisio + 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x61, // n highp float;.a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, // ttribute vec4 a_ + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // color0;.attribut + 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec2 a_positio + 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, // n;.attribute vec + 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, // 2 a_texcoord0;.v + 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, // arying vec4 v_co + 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, // lor0;.varying ve 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 v_texcoord0;. - 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, // varying vec4 v_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // olor0;.attribute - 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // vec2 a_texcoord - 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, // 0;.attribute vec - 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, // 2 a_position;.at - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, // tribute vec4 a_c - 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // olor0;.void main - 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, // ().{. vec4 tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_1;. tmpvar_ - 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, // 1.zw = vec2(0.0, - 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 1.0);. tmpvar_ - 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // 1.xy = a_positio - 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // n;. gl_Position - 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, // = (u_viewProj * - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, // tmpvar_1);. v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, // texcoord0 = a_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, // xcoord0;. v_col - 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, // or0 = a_color0;. - 0x7d, 0x0a, 0x0a, 0x00, // }... + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, // uniform mat4 u_v + 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, // iewProj;.void ma + 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, // in ().{. vec4 t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1;. tmpva + 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, // r_1.zw = vec2(0. + 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 0, 1.0);. tmpva + 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // r_1.xy = a_posit + 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // ion;. gl_Positi + 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // on = (u_viewProj + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, // * tmpvar_1);. + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, // v_texcoord0 = a_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, // texcoord0;. v_c + 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // olor0 = a_color0 + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... }; static const uint8_t vs_imgui_texture_dx9[326] = { diff --git a/examples/runtime/shaders/gles/fs_bump.bin b/examples/runtime/shaders/gles/fs_bump.bin index 7f6e14e1c..c368afe9a 100644 Binary files a/examples/runtime/shaders/gles/fs_bump.bin and b/examples/runtime/shaders/gles/fs_bump.bin differ diff --git a/examples/runtime/shaders/gles/fs_callback.bin b/examples/runtime/shaders/gles/fs_callback.bin index 3a8d06cff..8624699c6 100644 Binary files a/examples/runtime/shaders/gles/fs_callback.bin and b/examples/runtime/shaders/gles/fs_callback.bin differ diff --git a/examples/runtime/shaders/gles/fs_cubes.bin b/examples/runtime/shaders/gles/fs_cubes.bin index 26f66eb38..f10af7200 100644 Binary files a/examples/runtime/shaders/gles/fs_cubes.bin and b/examples/runtime/shaders/gles/fs_cubes.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_blur.bin b/examples/runtime/shaders/gles/fs_hdr_blur.bin index 2025aa52e..48d79331e 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_blur.bin and b/examples/runtime/shaders/gles/fs_hdr_blur.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_bright.bin b/examples/runtime/shaders/gles/fs_hdr_bright.bin index 3df837567..b3f227cf0 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_bright.bin and b/examples/runtime/shaders/gles/fs_hdr_bright.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_lum.bin b/examples/runtime/shaders/gles/fs_hdr_lum.bin index f29bf0484..6c3316b7d 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_lum.bin and b/examples/runtime/shaders/gles/fs_hdr_lum.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_lumavg.bin b/examples/runtime/shaders/gles/fs_hdr_lumavg.bin index c63097355..991b9cd8e 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_lumavg.bin and b/examples/runtime/shaders/gles/fs_hdr_lumavg.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_mesh.bin b/examples/runtime/shaders/gles/fs_hdr_mesh.bin index 20848769e..5bde573ce 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_mesh.bin and b/examples/runtime/shaders/gles/fs_hdr_mesh.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_skybox.bin b/examples/runtime/shaders/gles/fs_hdr_skybox.bin index abf6aebd9..d65965201 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_skybox.bin and b/examples/runtime/shaders/gles/fs_hdr_skybox.bin differ diff --git a/examples/runtime/shaders/gles/fs_hdr_tonemap.bin b/examples/runtime/shaders/gles/fs_hdr_tonemap.bin index 76a96eae5..fc84aa43c 100644 Binary files a/examples/runtime/shaders/gles/fs_hdr_tonemap.bin and b/examples/runtime/shaders/gles/fs_hdr_tonemap.bin differ diff --git a/examples/runtime/shaders/gles/fs_instancing.bin b/examples/runtime/shaders/gles/fs_instancing.bin index 26f66eb38..f10af7200 100644 Binary files a/examples/runtime/shaders/gles/fs_instancing.bin and b/examples/runtime/shaders/gles/fs_instancing.bin differ diff --git a/examples/runtime/shaders/gles/fs_mesh.bin b/examples/runtime/shaders/gles/fs_mesh.bin index 54b76c868..333355cf6 100644 Binary files a/examples/runtime/shaders/gles/fs_mesh.bin and b/examples/runtime/shaders/gles/fs_mesh.bin differ diff --git a/examples/runtime/shaders/gles/fs_raymarching.bin b/examples/runtime/shaders/gles/fs_raymarching.bin index 974c89e54..f75f55880 100644 --- a/examples/runtime/shaders/gles/fs_raymarching.bin +++ b/examples/runtime/shaders/gles/fs_raymarching.bin @@ -1,44 +1,37 @@ -FSH#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform vec3 u_lightDir; -uniform mat4 u_mtx; -varying vec2 v_texcoord0; +FSHprecision highp float; varying vec4 v_color0; +varying vec2 v_texcoord0; +uniform mat4 u_mtx; +uniform vec3 u_lightDir; void main () { vec4 tmpvar_1; tmpvar_1.zw = vec2(0.0, 1.0); - tmpvar_1.x = v_texcoord0.x; - tmpvar_1.y = v_texcoord0.y; + tmpvar_1.xy = v_texcoord0; vec4 tmpvar_2; tmpvar_2 = (u_mtx * tmpvar_1); vec3 tmpvar_3; tmpvar_3 = (tmpvar_2.xyz / tmpvar_2.w); vec4 tmpvar_4; tmpvar_4.zw = vec2(1.0, 1.0); - tmpvar_4.x = v_texcoord0.x; - tmpvar_4.y = v_texcoord0.y; + tmpvar_4.xy = v_texcoord0; vec4 tmpvar_5; tmpvar_5 = (u_mtx * tmpvar_4); vec3 tmpvar_6; tmpvar_6 = (tmpvar_5.xyz / tmpvar_5.w); float tmpvar_7; - vec3 arg0_8; - arg0_8 = (tmpvar_6 - tmpvar_3); - tmpvar_7 = sqrt(dot (arg0_8, arg0_8)); + vec3 x_8; + x_8 = (tmpvar_6 - tmpvar_3); + tmpvar_7 = sqrt(dot (x_8, x_8)); vec3 tmpvar_9; tmpvar_9 = normalize((tmpvar_6 - tmpvar_3)); vec3 _ray_10; _ray_10 = tmpvar_3; vec3 _dir_11; _dir_11 = tmpvar_9; - int ii_12; float tt_13; tt_13 = 0.0; - ii_12 = 0; - for (int ii_12 = 0; ii_12 < 64; ) { + for (int ii_12 = 0; ii_12 < 64; ii_12++) { vec3 _pos_14; _pos_14 = (_ray_10 + (_dir_11 * tt_13)); vec3 tmpvar_15; @@ -56,11 +49,24 @@ void main () vec3 _pos_21; _pos_21 = (_pos_14 + vec3(0.0, 0.0, -4.0)); float tmpvar_22; - tmpvar_22 = min (min (min (min (min (min ((sqrt(dot (tmpvar_15, tmpvar_15)) - 0.5), (sqrt(dot (_pos_16, _pos_16)) - 1.0)), (sqrt(dot (_pos_17, _pos_17)) - 1.0)), (sqrt(dot (_pos_18, _pos_18)) - 1.0)), (sqrt(dot (_pos_19, _pos_19)) - 1.0)), (sqrt(dot (_pos_20, _pos_20)) - 1.0)), (sqrt(dot (_pos_21, _pos_21)) - 1.0)); + tmpvar_22 = min (min (min ( + min (min (min (( + sqrt(dot (tmpvar_15, tmpvar_15)) + - 0.5), ( + sqrt(dot (_pos_16, _pos_16)) + - 1.0)), (sqrt( + dot (_pos_17, _pos_17) + ) - 1.0)), (sqrt(dot (_pos_18, _pos_18)) - 1.0)) + , + (sqrt(dot (_pos_19, _pos_19)) - 1.0) + ), ( + sqrt(dot (_pos_20, _pos_20)) + - 1.0)), (sqrt( + dot (_pos_21, _pos_21) + ) - 1.0)); if ((tmpvar_22 > 0.001)) { tt_13 = (tt_13 + tmpvar_22); }; - ii_12 = (ii_12 + 1); }; float tmpvar_23; if ((tt_13 < tmpvar_7)) { @@ -168,16 +174,102 @@ void main () vec3 _pos_72; _pos_72 = (_pos_65 + vec3(0.0, 0.0, -4.0)); vec3 tmpvar_73; - tmpvar_73.x = (min (min (min (min (min (min ((sqrt(dot (tmpvar_26, tmpvar_26)) - 0.5), (sqrt(dot (_pos_27, _pos_27)) - 1.0)), (sqrt(dot (_pos_28, _pos_28)) - 1.0)), (sqrt(dot (_pos_29, _pos_29)) - 1.0)), (sqrt(dot (_pos_30, _pos_30)) - 1.0)), (sqrt(dot (_pos_31, _pos_31)) - 1.0)), (sqrt(dot (_pos_32, _pos_32)) - 1.0)) - min (min (min (min (min (min ((sqrt(dot (tmpvar_34, tmpvar_34)) - 0.5), (sqrt(dot (_pos_35, _pos_35)) - 1.0)), (sqrt(dot (_pos_36, _pos_36)) - 1.0)), (sqrt(dot (_pos_37, _pos_37)) - 1.0)), (sqrt(dot (_pos_38, _pos_38)) - 1.0)), (sqrt(dot (_pos_39, _pos_39)) - 1.0)), (sqrt(dot (_pos_40, _pos_40)) - 1.0))); - tmpvar_73.y = (min (min (min (min (min (min ((sqrt(dot (tmpvar_42, tmpvar_42)) - 0.5), (sqrt(dot (_pos_43, _pos_43)) - 1.0)), (sqrt(dot (_pos_44, _pos_44)) - 1.0)), (sqrt(dot (_pos_45, _pos_45)) - 1.0)), (sqrt(dot (_pos_46, _pos_46)) - 1.0)), (sqrt(dot (_pos_47, _pos_47)) - 1.0)), (sqrt(dot (_pos_48, _pos_48)) - 1.0)) - min (min (min (min (min (min ((sqrt(dot (tmpvar_50, tmpvar_50)) - 0.5), (sqrt(dot (_pos_51, _pos_51)) - 1.0)), (sqrt(dot (_pos_52, _pos_52)) - 1.0)), (sqrt(dot (_pos_53, _pos_53)) - 1.0)), (sqrt(dot (_pos_54, _pos_54)) - 1.0)), (sqrt(dot (_pos_55, _pos_55)) - 1.0)), (sqrt(dot (_pos_56, _pos_56)) - 1.0))); - tmpvar_73.z = (min (min (min (min (min (min ((sqrt(dot (tmpvar_58, tmpvar_58)) - 0.5), (sqrt(dot (_pos_59, _pos_59)) - 1.0)), (sqrt(dot (_pos_60, _pos_60)) - 1.0)), (sqrt(dot (_pos_61, _pos_61)) - 1.0)), (sqrt(dot (_pos_62, _pos_62)) - 1.0)), (sqrt(dot (_pos_63, _pos_63)) - 1.0)), (sqrt(dot (_pos_64, _pos_64)) - 1.0)) - min (min (min (min (min (min ((sqrt(dot (tmpvar_66, tmpvar_66)) - 0.5), (sqrt(dot (_pos_67, _pos_67)) - 1.0)), (sqrt(dot (_pos_68, _pos_68)) - 1.0)), (sqrt(dot (_pos_69, _pos_69)) - 1.0)), (sqrt(dot (_pos_70, _pos_70)) - 1.0)), (sqrt(dot (_pos_71, _pos_71)) - 1.0)), (sqrt(dot (_pos_72, _pos_72)) - 1.0))); + tmpvar_73.x = (min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_26, tmpvar_26)) - 0.5) + , + (sqrt(dot (_pos_27, _pos_27)) - 1.0) + ), ( + sqrt(dot (_pos_28, _pos_28)) + - 1.0)), (sqrt( + dot (_pos_29, _pos_29) + ) - 1.0)), (sqrt(dot (_pos_30, _pos_30)) - 1.0)) + , + (sqrt(dot (_pos_31, _pos_31)) - 1.0) + ), ( + sqrt(dot (_pos_32, _pos_32)) + - 1.0)) - min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_34, tmpvar_34)) - 0.5) + , + (sqrt(dot (_pos_35, _pos_35)) - 1.0) + ), ( + sqrt(dot (_pos_36, _pos_36)) + - 1.0)), (sqrt( + dot (_pos_37, _pos_37) + ) - 1.0)), (sqrt(dot (_pos_38, _pos_38)) - 1.0)) + , + (sqrt(dot (_pos_39, _pos_39)) - 1.0) + ), ( + sqrt(dot (_pos_40, _pos_40)) + - 1.0))); + tmpvar_73.y = (min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_42, tmpvar_42)) - 0.5) + , + (sqrt(dot (_pos_43, _pos_43)) - 1.0) + ), ( + sqrt(dot (_pos_44, _pos_44)) + - 1.0)), (sqrt( + dot (_pos_45, _pos_45) + ) - 1.0)), (sqrt(dot (_pos_46, _pos_46)) - 1.0)) + , + (sqrt(dot (_pos_47, _pos_47)) - 1.0) + ), ( + sqrt(dot (_pos_48, _pos_48)) + - 1.0)) - min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_50, tmpvar_50)) - 0.5) + , + (sqrt(dot (_pos_51, _pos_51)) - 1.0) + ), ( + sqrt(dot (_pos_52, _pos_52)) + - 1.0)), (sqrt( + dot (_pos_53, _pos_53) + ) - 1.0)), (sqrt(dot (_pos_54, _pos_54)) - 1.0)) + , + (sqrt(dot (_pos_55, _pos_55)) - 1.0) + ), ( + sqrt(dot (_pos_56, _pos_56)) + - 1.0))); + tmpvar_73.z = (min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_58, tmpvar_58)) - 0.5) + , + (sqrt(dot (_pos_59, _pos_59)) - 1.0) + ), ( + sqrt(dot (_pos_60, _pos_60)) + - 1.0)), (sqrt( + dot (_pos_61, _pos_61) + ) - 1.0)), (sqrt(dot (_pos_62, _pos_62)) - 1.0)) + , + (sqrt(dot (_pos_63, _pos_63)) - 1.0) + ), ( + sqrt(dot (_pos_64, _pos_64)) + - 1.0)) - min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_66, tmpvar_66)) - 0.5) + , + (sqrt(dot (_pos_67, _pos_67)) - 1.0) + ), ( + sqrt(dot (_pos_68, _pos_68)) + - 1.0)), (sqrt( + dot (_pos_69, _pos_69) + ) - 1.0)), (sqrt(dot (_pos_70, _pos_70)) - 1.0)) + , + (sqrt(dot (_pos_71, _pos_71)) - 1.0) + ), ( + sqrt(dot (_pos_72, _pos_72)) + - 1.0))); vec3 tmpvar_74; tmpvar_74 = normalize(tmpvar_73); float tmpvar_75; tmpvar_75 = dot (tmpvar_74, u_lightDir); vec2 tmpvar_76; tmpvar_76.x = tmpvar_75; - tmpvar_76.y = dot ((u_lightDir - ((2.0 * tmpvar_75) * tmpvar_74)), tmpvar_9); + tmpvar_76.y = dot ((u_lightDir - ( + (2.0 * tmpvar_75) + * tmpvar_74)), tmpvar_9); float tmpvar_77; tmpvar_77 = max (0.0, tmpvar_75); vec4 tmpvar_78; @@ -185,16 +277,16 @@ void main () tmpvar_78.y = tmpvar_77; tmpvar_78.z = (float((tmpvar_75 >= 0.0)) * max (0.0, tmpvar_76.y)); float tmpvar_79; - tmpvar_79 = ((0.9 * tmpvar_77) + (pow (tmpvar_78.z, 128.0) * max ((0.2 + (0.8 * pow ((1.0 - tmpvar_75), 5.0))), 0.0))); + tmpvar_79 = ((0.9 * tmpvar_77) + (pow (tmpvar_78.z, 128.0) * max ( + (0.2 + (0.8 * pow ((1.0 - tmpvar_75), 5.0))) + , 0.0))); vec3 _pos_80; _pos_80 = tmpvar_24; vec3 _normal_81; _normal_81 = tmpvar_74; - int ii_82; float occ_83; occ_83 = 0.0; - ii_82 = 1; - for (int ii_82 = 1; ii_82 < 4; ) { + for (int ii_82 = 1; ii_82 < 4; ii_82++) { float tmpvar_84; tmpvar_84 = float(ii_82); vec3 _pos_85; @@ -213,8 +305,23 @@ void main () _pos_91 = (_pos_85 + vec3(0.0, 0.0, 4.0)); vec3 _pos_92; _pos_92 = (_pos_85 + vec3(0.0, 0.0, -4.0)); - occ_83 = (occ_83 + (((tmpvar_84 * 0.2) - min (min (min (min (min (min ((sqrt(dot (tmpvar_86, tmpvar_86)) - 0.5), (sqrt(dot (_pos_87, _pos_87)) - 1.0)), (sqrt(dot (_pos_88, _pos_88)) - 1.0)), (sqrt(dot (_pos_89, _pos_89)) - 1.0)), (sqrt(dot (_pos_90, _pos_90)) - 1.0)), (sqrt(dot (_pos_91, _pos_91)) - 1.0)), (sqrt(dot (_pos_92, _pos_92)) - 1.0))) / pow (2.0, tmpvar_84))); - ii_82 = (ii_82 + 1); + occ_83 = (occ_83 + (( + (tmpvar_84 * 0.2) + - + min (min (min (min ( + min (min ((sqrt( + dot (tmpvar_86, tmpvar_86) + ) - 0.5), (sqrt( + dot (_pos_87, _pos_87) + ) - 1.0)), (sqrt(dot (_pos_88, _pos_88)) - 1.0)) + , + (sqrt(dot (_pos_89, _pos_89)) - 1.0) + ), ( + sqrt(dot (_pos_90, _pos_90)) + - 1.0)), (sqrt( + dot (_pos_91, _pos_91) + ) - 1.0)), (sqrt(dot (_pos_92, _pos_92)) - 1.0)) + ) / exp2(tmpvar_84))); }; float tmpvar_93; tmpvar_93 = pow ((tmpvar_79 * (1.0 - occ_83)), 0.454545); @@ -224,10 +331,10 @@ void main () tmpvar_94.y = tmpvar_93; tmpvar_94.z = tmpvar_93; gl_FragColor = tmpvar_94; - gl_FragDepth = (tmpvar_23 / tmpvar_7); + gl_FragDepth = (tmpvar_23 / tmpvar_7); } else { gl_FragColor = v_color0; - gl_FragDepth = 1.0; + gl_FragDepth = 1.0; }; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin index 6432488d8..e9b0e8cd9 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_black.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin index 9267b9ff4..45e02ef4a 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin index bde58d44b..bbb332282 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_csm.bin @@ -1,33 +1,30 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -77,16 +74,16 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); colorCoverage_2 = tmpvar_20; float _depthMultiplier_21; _depthMultiplier_21 = (u_params1.w * u_params1.z); - float tmpvar_22; + lowp float tmpvar_22; vec2 tmpvar_23; tmpvar_23 = (v_texcoord1.xy / v_texcoord1.w); bool tmpvar_24; @@ -98,7 +95,9 @@ void main () if (tmpvar_24) { tmpvar_22 = 1.0; } else { - tmpvar_22 = clamp (exp((_depthMultiplier_21 * (dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord1.z - u_params1.x) / v_texcoord1.w)))), 0.0, 1.0); + tmpvar_22 = clamp (exp((_depthMultiplier_21 * + (dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord1.z - u_params1.x) / v_texcoord1.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_22; } else { @@ -115,16 +114,16 @@ void main () } else { tmpvar_27 = bool(0); }; - float tmpvar_29; + lowp float tmpvar_29; tmpvar_29 = (float(tmpvar_27) * 0.4); - vec3 tmpvar_30; + lowp vec3 tmpvar_30; tmpvar_30.x = tmpvar_29; tmpvar_30.y = tmpvar_29; tmpvar_30.z = -(tmpvar_29); colorCoverage_2 = tmpvar_30; float _depthMultiplier_31; _depthMultiplier_31 = (u_params1.w * u_params1.z); - float tmpvar_32; + lowp float tmpvar_32; vec2 tmpvar_33; tmpvar_33 = (v_texcoord2.xy / v_texcoord2.w); bool tmpvar_34; @@ -136,7 +135,9 @@ void main () if (tmpvar_34) { tmpvar_32 = 1.0; } else { - tmpvar_32 = clamp (exp((_depthMultiplier_31 * (dot (texture2D (u_shadowMap1, tmpvar_33), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord2.z - u_params1.x) / v_texcoord2.w)))), 0.0, 1.0); + tmpvar_32 = clamp (exp((_depthMultiplier_31 * + (dot (texture2D (u_shadowMap1, tmpvar_33), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord2.z - u_params1.x) / v_texcoord2.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_32; } else { @@ -153,16 +154,16 @@ void main () } else { tmpvar_37 = bool(0); }; - float tmpvar_39; + lowp float tmpvar_39; tmpvar_39 = (float(tmpvar_37) * 0.4); - vec3 tmpvar_40; + lowp vec3 tmpvar_40; tmpvar_40.x = -(tmpvar_39); tmpvar_40.y = -(tmpvar_39); tmpvar_40.z = tmpvar_39; colorCoverage_2 = tmpvar_40; float _depthMultiplier_41; _depthMultiplier_41 = (u_params1.w * u_params1.z); - float tmpvar_42; + lowp float tmpvar_42; vec2 tmpvar_43; tmpvar_43 = (v_texcoord3.xy / v_texcoord3.w); bool tmpvar_44; @@ -174,7 +175,9 @@ void main () if (tmpvar_44) { tmpvar_42 = 1.0; } else { - tmpvar_42 = clamp (exp((_depthMultiplier_41 * (dot (texture2D (u_shadowMap2, tmpvar_43), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord3.z - u_params1.x) / v_texcoord3.w)))), 0.0, 1.0); + tmpvar_42 = clamp (exp((_depthMultiplier_41 * + (dot (texture2D (u_shadowMap2, tmpvar_43), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord3.z - u_params1.x) / v_texcoord3.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_42; } else { @@ -190,16 +193,16 @@ void main () } else { tmpvar_47 = bool(0); }; - float tmpvar_49; + lowp float tmpvar_49; tmpvar_49 = (float(tmpvar_47) * 0.4); - vec3 tmpvar_50; + lowp vec3 tmpvar_50; tmpvar_50.x = tmpvar_49; tmpvar_50.y = -(tmpvar_49); tmpvar_50.z = -(tmpvar_49); colorCoverage_2 = tmpvar_50; float _depthMultiplier_51; _depthMultiplier_51 = (u_params1.w * u_params1.z); - float tmpvar_52; + lowp float tmpvar_52; vec2 tmpvar_53; tmpvar_53 = (v_texcoord4.xy / v_texcoord4.w); bool tmpvar_54; @@ -211,7 +214,9 @@ void main () if (tmpvar_54) { tmpvar_52 = 1.0; } else { - tmpvar_52 = clamp (exp((_depthMultiplier_51 * (dot (texture2D (u_shadowMap3, tmpvar_53), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord4.z - u_params1.x) / v_texcoord4.w)))), 0.0, 1.0); + tmpvar_52 = clamp (exp((_depthMultiplier_51 * + (dot (texture2D (u_shadowMap3, tmpvar_53), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord4.z - u_params1.x) / v_texcoord4.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_52; }; @@ -233,18 +238,48 @@ void main () tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_61; tmpvar_61 = sqrt(dot (tmpvar_58, tmpvar_58)); - tmpvar_57 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61)))) * mix (clamp (((max (0.0, dot (-(tmpvar_59), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_60) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_60)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_57 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_59) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_60) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_60)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_62; tmpvar_62 = dot (v_normal, tmpvar_56); vec2 tmpvar_63; tmpvar_63.x = tmpvar_62; - tmpvar_63.y = (((float((tmpvar_62 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_62) * v_normal) - tmpvar_56), tmpvar_55)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_63.y = ((( + float((tmpvar_62 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_62) * v_normal) + - tmpvar_56), tmpvar_55)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_64; tmpvar_64 = (max (tmpvar_63, 0.0) * tmpvar_57); float tmpvar_65; tmpvar_65 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_65) * tmpvar_65)))), 0.0, 1.0)); + lowp vec3 tmpvar_66; + tmpvar_66 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_65) * tmpvar_65)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_66; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin index a0c619875..5050e7aab 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin index f91a5f6f3..dcc0186b7 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_csm.bin @@ -1,33 +1,30 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -77,9 +74,9 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); @@ -90,7 +87,7 @@ void main () tmpvar_21.z = v_texcoord1.z; float _depthMultiplier_22; _depthMultiplier_22 = (u_params1.w * u_params1.z); - float tmpvar_23; + lowp float tmpvar_23; bool tmpvar_24; if (any(greaterThan (tmpvar_21.xy, vec2(1.0, 1.0)))) { tmpvar_24 = bool(1); @@ -100,7 +97,9 @@ void main () if (tmpvar_24) { tmpvar_23 = 1.0; } else { - tmpvar_23 = clamp (exp((_depthMultiplier_22 * (dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord1.z - u_params1.x)))), 0.0, 1.0); + tmpvar_23 = clamp (exp((_depthMultiplier_22 * + (dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord1.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_23; } else { @@ -117,9 +116,9 @@ void main () } else { tmpvar_27 = bool(0); }; - float tmpvar_29; + lowp float tmpvar_29; tmpvar_29 = (float(tmpvar_27) * 0.4); - vec3 tmpvar_30; + lowp vec3 tmpvar_30; tmpvar_30.x = tmpvar_29; tmpvar_30.y = tmpvar_29; tmpvar_30.z = -(tmpvar_29); @@ -130,7 +129,7 @@ void main () tmpvar_31.z = v_texcoord2.z; float _depthMultiplier_32; _depthMultiplier_32 = (u_params1.w * u_params1.z); - float tmpvar_33; + lowp float tmpvar_33; bool tmpvar_34; if (any(greaterThan (tmpvar_31.xy, vec2(1.0, 1.0)))) { tmpvar_34 = bool(1); @@ -140,7 +139,9 @@ void main () if (tmpvar_34) { tmpvar_33 = 1.0; } else { - tmpvar_33 = clamp (exp((_depthMultiplier_32 * (dot (texture2D (u_shadowMap1, tmpvar_31.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord2.z - u_params1.x)))), 0.0, 1.0); + tmpvar_33 = clamp (exp((_depthMultiplier_32 * + (dot (texture2D (u_shadowMap1, tmpvar_31.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord2.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_33; } else { @@ -157,9 +158,9 @@ void main () } else { tmpvar_37 = bool(0); }; - float tmpvar_39; + lowp float tmpvar_39; tmpvar_39 = (float(tmpvar_37) * 0.4); - vec3 tmpvar_40; + lowp vec3 tmpvar_40; tmpvar_40.x = -(tmpvar_39); tmpvar_40.y = -(tmpvar_39); tmpvar_40.z = tmpvar_39; @@ -170,7 +171,7 @@ void main () tmpvar_41.z = v_texcoord3.z; float _depthMultiplier_42; _depthMultiplier_42 = (u_params1.w * u_params1.z); - float tmpvar_43; + lowp float tmpvar_43; bool tmpvar_44; if (any(greaterThan (tmpvar_41.xy, vec2(1.0, 1.0)))) { tmpvar_44 = bool(1); @@ -180,7 +181,9 @@ void main () if (tmpvar_44) { tmpvar_43 = 1.0; } else { - tmpvar_43 = clamp (exp((_depthMultiplier_42 * (dot (texture2D (u_shadowMap2, tmpvar_41.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord3.z - u_params1.x)))), 0.0, 1.0); + tmpvar_43 = clamp (exp((_depthMultiplier_42 * + (dot (texture2D (u_shadowMap2, tmpvar_41.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord3.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_43; } else { @@ -196,9 +199,9 @@ void main () } else { tmpvar_47 = bool(0); }; - float tmpvar_49; + lowp float tmpvar_49; tmpvar_49 = (float(tmpvar_47) * 0.4); - vec3 tmpvar_50; + lowp vec3 tmpvar_50; tmpvar_50.x = tmpvar_49; tmpvar_50.y = -(tmpvar_49); tmpvar_50.z = -(tmpvar_49); @@ -209,7 +212,7 @@ void main () tmpvar_51.z = v_texcoord4.z; float _depthMultiplier_52; _depthMultiplier_52 = (u_params1.w * u_params1.z); - float tmpvar_53; + lowp float tmpvar_53; bool tmpvar_54; if (any(greaterThan (tmpvar_51.xy, vec2(1.0, 1.0)))) { tmpvar_54 = bool(1); @@ -219,7 +222,9 @@ void main () if (tmpvar_54) { tmpvar_53 = 1.0; } else { - tmpvar_53 = clamp (exp((_depthMultiplier_52 * (dot (texture2D (u_shadowMap3, tmpvar_51.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord4.z - u_params1.x)))), 0.0, 1.0); + tmpvar_53 = clamp (exp((_depthMultiplier_52 * + (dot (texture2D (u_shadowMap3, tmpvar_51.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord4.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_53; }; @@ -241,18 +246,48 @@ void main () tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_61; tmpvar_61 = sqrt(dot (tmpvar_58, tmpvar_58)); - tmpvar_57 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61)))) * mix (clamp (((max (0.0, dot (-(tmpvar_59), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_60) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_60)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_57 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_59) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_60) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_60)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_62; tmpvar_62 = dot (v_normal, tmpvar_56); vec2 tmpvar_63; tmpvar_63.x = tmpvar_62; - tmpvar_63.y = (((float((tmpvar_62 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_62) * v_normal) - tmpvar_56), tmpvar_55)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_63.y = ((( + float((tmpvar_62 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_62) * v_normal) + - tmpvar_56), tmpvar_55)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_64; tmpvar_64 = (max (tmpvar_63, 0.0) * tmpvar_57); float tmpvar_65; tmpvar_65 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_65) * tmpvar_65)))), 0.0, 1.0)); + lowp vec3 tmpvar_66; + tmpvar_66 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_65) * tmpvar_65)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_66; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin index 8bed16a76..84a05a49b 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_linear_omni.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin index fdc1cd30d..7ed142f93 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_esm_omni.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin index c89b3d48c..f89137296 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin index 9bd06bc44..4a4a9c554 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_csm.bin @@ -1,33 +1,30 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -77,14 +74,14 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); colorCoverage_2 = tmpvar_20; - float tmpvar_21; + lowp float tmpvar_21; vec2 tmpvar_22; tmpvar_22 = (v_texcoord1.xy / v_texcoord1.w); bool tmpvar_23; @@ -96,7 +93,9 @@ void main () if (tmpvar_23) { tmpvar_21 = 1.0; } else { - tmpvar_21 = float((dot (texture2D (u_shadowMap0, tmpvar_22), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((v_texcoord1.z - u_params1.x) / v_texcoord1.w))); + tmpvar_21 = float((dot (texture2D (u_shadowMap0, tmpvar_22), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord1.z - u_params1.x) + / v_texcoord1.w))); }; visibility_1 = tmpvar_21; } else { @@ -113,14 +112,14 @@ void main () } else { tmpvar_26 = bool(0); }; - float tmpvar_28; + lowp float tmpvar_28; tmpvar_28 = (float(tmpvar_26) * 0.4); - vec3 tmpvar_29; + lowp vec3 tmpvar_29; tmpvar_29.x = tmpvar_28; tmpvar_29.y = tmpvar_28; tmpvar_29.z = -(tmpvar_28); colorCoverage_2 = tmpvar_29; - float tmpvar_30; + lowp float tmpvar_30; vec2 tmpvar_31; tmpvar_31 = (v_texcoord2.xy / v_texcoord2.w); bool tmpvar_32; @@ -132,7 +131,9 @@ void main () if (tmpvar_32) { tmpvar_30 = 1.0; } else { - tmpvar_30 = float((dot (texture2D (u_shadowMap1, tmpvar_31), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((v_texcoord2.z - u_params1.x) / v_texcoord2.w))); + tmpvar_30 = float((dot (texture2D (u_shadowMap1, tmpvar_31), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord2.z - u_params1.x) + / v_texcoord2.w))); }; visibility_1 = tmpvar_30; } else { @@ -149,14 +150,14 @@ void main () } else { tmpvar_35 = bool(0); }; - float tmpvar_37; + lowp float tmpvar_37; tmpvar_37 = (float(tmpvar_35) * 0.4); - vec3 tmpvar_38; + lowp vec3 tmpvar_38; tmpvar_38.x = -(tmpvar_37); tmpvar_38.y = -(tmpvar_37); tmpvar_38.z = tmpvar_37; colorCoverage_2 = tmpvar_38; - float tmpvar_39; + lowp float tmpvar_39; vec2 tmpvar_40; tmpvar_40 = (v_texcoord3.xy / v_texcoord3.w); bool tmpvar_41; @@ -168,7 +169,9 @@ void main () if (tmpvar_41) { tmpvar_39 = 1.0; } else { - tmpvar_39 = float((dot (texture2D (u_shadowMap2, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((v_texcoord3.z - u_params1.x) / v_texcoord3.w))); + tmpvar_39 = float((dot (texture2D (u_shadowMap2, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord3.z - u_params1.x) + / v_texcoord3.w))); }; visibility_1 = tmpvar_39; } else { @@ -184,14 +187,14 @@ void main () } else { tmpvar_44 = bool(0); }; - float tmpvar_46; + lowp float tmpvar_46; tmpvar_46 = (float(tmpvar_44) * 0.4); - vec3 tmpvar_47; + lowp vec3 tmpvar_47; tmpvar_47.x = tmpvar_46; tmpvar_47.y = -(tmpvar_46); tmpvar_47.z = -(tmpvar_46); colorCoverage_2 = tmpvar_47; - float tmpvar_48; + lowp float tmpvar_48; vec2 tmpvar_49; tmpvar_49 = (v_texcoord4.xy / v_texcoord4.w); bool tmpvar_50; @@ -203,7 +206,9 @@ void main () if (tmpvar_50) { tmpvar_48 = 1.0; } else { - tmpvar_48 = float((dot (texture2D (u_shadowMap3, tmpvar_49), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((v_texcoord4.z - u_params1.x) / v_texcoord4.w))); + tmpvar_48 = float((dot (texture2D (u_shadowMap3, tmpvar_49), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord4.z - u_params1.x) + / v_texcoord4.w))); }; visibility_1 = tmpvar_48; }; @@ -225,18 +230,48 @@ void main () tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_57; tmpvar_57 = sqrt(dot (tmpvar_54, tmpvar_54)); - tmpvar_53 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57)))) * mix (clamp (((max (0.0, dot (-(tmpvar_55), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_56) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_56)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_53 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_55) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_56) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_56)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_58; tmpvar_58 = dot (v_normal, tmpvar_52); vec2 tmpvar_59; tmpvar_59.x = tmpvar_58; - tmpvar_59.y = (((float((tmpvar_58 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_58) * v_normal) - tmpvar_52), tmpvar_51)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_59.y = ((( + float((tmpvar_58 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_58) * v_normal) + - tmpvar_52), tmpvar_51)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_60; tmpvar_60 = (max (tmpvar_59, 0.0) * tmpvar_53); float tmpvar_61; tmpvar_61 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_61) * tmpvar_61)))), 0.0, 1.0)); + lowp vec3 tmpvar_62; + tmpvar_62 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_61) * tmpvar_61)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_62; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin index eb4e48733..03747936f 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin index c7c9aa428..6ecbfef3b 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_csm.bin @@ -1,33 +1,30 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -77,9 +74,9 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); @@ -88,7 +85,7 @@ void main () tmpvar_21.w = 1.0; tmpvar_21.xy = (v_texcoord1.xy / v_texcoord1.w); tmpvar_21.z = v_texcoord1.z; - float tmpvar_22; + lowp float tmpvar_22; bool tmpvar_23; if (any(greaterThan (tmpvar_21.xy, vec2(1.0, 1.0)))) { tmpvar_23 = bool(1); @@ -115,9 +112,9 @@ void main () } else { tmpvar_26 = bool(0); }; - float tmpvar_28; + lowp float tmpvar_28; tmpvar_28 = (float(tmpvar_26) * 0.4); - vec3 tmpvar_29; + lowp vec3 tmpvar_29; tmpvar_29.x = tmpvar_28; tmpvar_29.y = tmpvar_28; tmpvar_29.z = -(tmpvar_28); @@ -126,7 +123,7 @@ void main () tmpvar_30.w = 1.0; tmpvar_30.xy = (v_texcoord2.xy / v_texcoord2.w); tmpvar_30.z = v_texcoord2.z; - float tmpvar_31; + lowp float tmpvar_31; bool tmpvar_32; if (any(greaterThan (tmpvar_30.xy, vec2(1.0, 1.0)))) { tmpvar_32 = bool(1); @@ -153,9 +150,9 @@ void main () } else { tmpvar_35 = bool(0); }; - float tmpvar_37; + lowp float tmpvar_37; tmpvar_37 = (float(tmpvar_35) * 0.4); - vec3 tmpvar_38; + lowp vec3 tmpvar_38; tmpvar_38.x = -(tmpvar_37); tmpvar_38.y = -(tmpvar_37); tmpvar_38.z = tmpvar_37; @@ -164,7 +161,7 @@ void main () tmpvar_39.w = 1.0; tmpvar_39.xy = (v_texcoord3.xy / v_texcoord3.w); tmpvar_39.z = v_texcoord3.z; - float tmpvar_40; + lowp float tmpvar_40; bool tmpvar_41; if (any(greaterThan (tmpvar_39.xy, vec2(1.0, 1.0)))) { tmpvar_41 = bool(1); @@ -190,9 +187,9 @@ void main () } else { tmpvar_44 = bool(0); }; - float tmpvar_46; + lowp float tmpvar_46; tmpvar_46 = (float(tmpvar_44) * 0.4); - vec3 tmpvar_47; + lowp vec3 tmpvar_47; tmpvar_47.x = tmpvar_46; tmpvar_47.y = -(tmpvar_46); tmpvar_47.z = -(tmpvar_46); @@ -201,7 +198,7 @@ void main () tmpvar_48.w = 1.0; tmpvar_48.xy = (v_texcoord4.xy / v_texcoord4.w); tmpvar_48.z = v_texcoord4.z; - float tmpvar_49; + lowp float tmpvar_49; bool tmpvar_50; if (any(greaterThan (tmpvar_48.xy, vec2(1.0, 1.0)))) { tmpvar_50 = bool(1); @@ -233,18 +230,48 @@ void main () tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_57; tmpvar_57 = sqrt(dot (tmpvar_54, tmpvar_54)); - tmpvar_53 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57)))) * mix (clamp (((max (0.0, dot (-(tmpvar_55), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_56) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_56)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_53 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_55) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_56) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_56)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_58; tmpvar_58 = dot (v_normal, tmpvar_52); vec2 tmpvar_59; tmpvar_59.x = tmpvar_58; - tmpvar_59.y = (((float((tmpvar_58 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_58) * v_normal) - tmpvar_52), tmpvar_51)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_59.y = ((( + float((tmpvar_58 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_58) * v_normal) + - tmpvar_52), tmpvar_51)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_60; tmpvar_60 = (max (tmpvar_59, 0.0) * tmpvar_53); float tmpvar_61; tmpvar_61 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_61) * tmpvar_61)))), 0.0, 1.0)); + lowp vec3 tmpvar_62; + tmpvar_62 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_61) * tmpvar_61)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_62; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin index 8e9871dde..f6631ee50 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_linear_omni.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin index 72f2fbc19..4f371c18f 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_hard_omni.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin index 59fac09c4..2df44a4bb 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf.bin @@ -1,24 +1,21 @@ -FSHpjH#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_shadowcoord; +FSHpjHprecision highp float; varying vec3 v_normal; +varying vec4 v_shadowcoord; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; void main () { vec2 _texcoord_1; @@ -33,14 +30,14 @@ void main () } else { tmpvar_3 = bool(0); }; - float tmpvar_5; + lowp float tmpvar_5; tmpvar_5 = (float(tmpvar_3) * 0.3); - vec3 tmpvar_6; + lowp vec3 tmpvar_6; tmpvar_6.x = tmpvar_5; tmpvar_6.y = -(tmpvar_5); tmpvar_6.z = -(tmpvar_5); - float tmpvar_7; - float result_8; + lowp float tmpvar_7; + lowp float result_8; result_8 = 0.0; vec2 tmpvar_9; tmpvar_9 = ((u_smSamplingParams.zw * u_params2.zz) * v_shadowcoord.w); @@ -49,7 +46,7 @@ void main () tmpvar_10.xy = (vec2(-1.5, -1.5) * tmpvar_9); vec4 _shadowCoord_11; _shadowCoord_11 = (v_shadowcoord + tmpvar_10); - float tmpvar_12; + lowp float tmpvar_12; vec2 tmpvar_13; tmpvar_13 = (_shadowCoord_11.xy / _shadowCoord_11.w); bool tmpvar_14; @@ -61,7 +58,9 @@ void main () if (tmpvar_14) { tmpvar_12 = 1.0; } else { - tmpvar_12 = float((dot (texture2D (u_shadowMap0, tmpvar_13), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_11.z - u_params1.x) / _shadowCoord_11.w))); + tmpvar_12 = float((dot (texture2D (u_shadowMap0, tmpvar_13), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_11.z - u_params1.x) + / _shadowCoord_11.w))); }; result_8 = tmpvar_12; vec4 tmpvar_15; @@ -69,7 +68,7 @@ void main () tmpvar_15.xy = (vec2(-1.5, -0.5) * tmpvar_9); vec4 _shadowCoord_16; _shadowCoord_16 = (v_shadowcoord + tmpvar_15); - float tmpvar_17; + lowp float tmpvar_17; vec2 tmpvar_18; tmpvar_18 = (_shadowCoord_16.xy / _shadowCoord_16.w); bool tmpvar_19; @@ -81,7 +80,9 @@ void main () if (tmpvar_19) { tmpvar_17 = 1.0; } else { - tmpvar_17 = float((dot (texture2D (u_shadowMap0, tmpvar_18), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_16.z - u_params1.x) / _shadowCoord_16.w))); + tmpvar_17 = float((dot (texture2D (u_shadowMap0, tmpvar_18), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_16.z - u_params1.x) + / _shadowCoord_16.w))); }; result_8 = (tmpvar_12 + tmpvar_17); vec4 tmpvar_20; @@ -89,7 +90,7 @@ void main () tmpvar_20.xy = (vec2(-1.5, 0.5) * tmpvar_9); vec4 _shadowCoord_21; _shadowCoord_21 = (v_shadowcoord + tmpvar_20); - float tmpvar_22; + lowp float tmpvar_22; vec2 tmpvar_23; tmpvar_23 = (_shadowCoord_21.xy / _shadowCoord_21.w); bool tmpvar_24; @@ -101,7 +102,9 @@ void main () if (tmpvar_24) { tmpvar_22 = 1.0; } else { - tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_21.z - u_params1.x) / _shadowCoord_21.w))); + tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_21.z - u_params1.x) + / _shadowCoord_21.w))); }; result_8 = (result_8 + tmpvar_22); vec4 tmpvar_25; @@ -109,7 +112,7 @@ void main () tmpvar_25.xy = (vec2(-1.5, 1.5) * tmpvar_9); vec4 _shadowCoord_26; _shadowCoord_26 = (v_shadowcoord + tmpvar_25); - float tmpvar_27; + lowp float tmpvar_27; vec2 tmpvar_28; tmpvar_28 = (_shadowCoord_26.xy / _shadowCoord_26.w); bool tmpvar_29; @@ -121,7 +124,9 @@ void main () if (tmpvar_29) { tmpvar_27 = 1.0; } else { - tmpvar_27 = float((dot (texture2D (u_shadowMap0, tmpvar_28), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_26.z - u_params1.x) / _shadowCoord_26.w))); + tmpvar_27 = float((dot (texture2D (u_shadowMap0, tmpvar_28), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_26.z - u_params1.x) + / _shadowCoord_26.w))); }; result_8 = (result_8 + tmpvar_27); vec4 tmpvar_30; @@ -129,7 +134,7 @@ void main () tmpvar_30.xy = (vec2(-0.5, -1.5) * tmpvar_9); vec4 _shadowCoord_31; _shadowCoord_31 = (v_shadowcoord + tmpvar_30); - float tmpvar_32; + lowp float tmpvar_32; vec2 tmpvar_33; tmpvar_33 = (_shadowCoord_31.xy / _shadowCoord_31.w); bool tmpvar_34; @@ -141,7 +146,9 @@ void main () if (tmpvar_34) { tmpvar_32 = 1.0; } else { - tmpvar_32 = float((dot (texture2D (u_shadowMap0, tmpvar_33), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_31.z - u_params1.x) / _shadowCoord_31.w))); + tmpvar_32 = float((dot (texture2D (u_shadowMap0, tmpvar_33), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_31.z - u_params1.x) + / _shadowCoord_31.w))); }; result_8 = (result_8 + tmpvar_32); vec4 tmpvar_35; @@ -149,7 +156,7 @@ void main () tmpvar_35.xy = (vec2(-0.5, -0.5) * tmpvar_9); vec4 _shadowCoord_36; _shadowCoord_36 = (v_shadowcoord + tmpvar_35); - float tmpvar_37; + lowp float tmpvar_37; vec2 tmpvar_38; tmpvar_38 = (_shadowCoord_36.xy / _shadowCoord_36.w); bool tmpvar_39; @@ -161,7 +168,9 @@ void main () if (tmpvar_39) { tmpvar_37 = 1.0; } else { - tmpvar_37 = float((dot (texture2D (u_shadowMap0, tmpvar_38), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_36.z - u_params1.x) / _shadowCoord_36.w))); + tmpvar_37 = float((dot (texture2D (u_shadowMap0, tmpvar_38), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_36.z - u_params1.x) + / _shadowCoord_36.w))); }; result_8 = (result_8 + tmpvar_37); vec4 tmpvar_40; @@ -169,7 +178,7 @@ void main () tmpvar_40.xy = (vec2(-0.5, 0.5) * tmpvar_9); vec4 _shadowCoord_41; _shadowCoord_41 = (v_shadowcoord + tmpvar_40); - float tmpvar_42; + lowp float tmpvar_42; vec2 tmpvar_43; tmpvar_43 = (_shadowCoord_41.xy / _shadowCoord_41.w); bool tmpvar_44; @@ -181,7 +190,9 @@ void main () if (tmpvar_44) { tmpvar_42 = 1.0; } else { - tmpvar_42 = float((dot (texture2D (u_shadowMap0, tmpvar_43), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_41.z - u_params1.x) / _shadowCoord_41.w))); + tmpvar_42 = float((dot (texture2D (u_shadowMap0, tmpvar_43), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_41.z - u_params1.x) + / _shadowCoord_41.w))); }; result_8 = (result_8 + tmpvar_42); vec4 tmpvar_45; @@ -189,7 +200,7 @@ void main () tmpvar_45.xy = (vec2(-0.5, 1.5) * tmpvar_9); vec4 _shadowCoord_46; _shadowCoord_46 = (v_shadowcoord + tmpvar_45); - float tmpvar_47; + lowp float tmpvar_47; vec2 tmpvar_48; tmpvar_48 = (_shadowCoord_46.xy / _shadowCoord_46.w); bool tmpvar_49; @@ -201,7 +212,9 @@ void main () if (tmpvar_49) { tmpvar_47 = 1.0; } else { - tmpvar_47 = float((dot (texture2D (u_shadowMap0, tmpvar_48), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_46.z - u_params1.x) / _shadowCoord_46.w))); + tmpvar_47 = float((dot (texture2D (u_shadowMap0, tmpvar_48), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_46.z - u_params1.x) + / _shadowCoord_46.w))); }; result_8 = (result_8 + tmpvar_47); vec4 tmpvar_50; @@ -209,7 +222,7 @@ void main () tmpvar_50.xy = (vec2(0.5, -1.5) * tmpvar_9); vec4 _shadowCoord_51; _shadowCoord_51 = (v_shadowcoord + tmpvar_50); - float tmpvar_52; + lowp float tmpvar_52; vec2 tmpvar_53; tmpvar_53 = (_shadowCoord_51.xy / _shadowCoord_51.w); bool tmpvar_54; @@ -221,7 +234,9 @@ void main () if (tmpvar_54) { tmpvar_52 = 1.0; } else { - tmpvar_52 = float((dot (texture2D (u_shadowMap0, tmpvar_53), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_51.z - u_params1.x) / _shadowCoord_51.w))); + tmpvar_52 = float((dot (texture2D (u_shadowMap0, tmpvar_53), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_51.z - u_params1.x) + / _shadowCoord_51.w))); }; result_8 = (result_8 + tmpvar_52); vec4 tmpvar_55; @@ -229,7 +244,7 @@ void main () tmpvar_55.xy = (vec2(0.5, -0.5) * tmpvar_9); vec4 _shadowCoord_56; _shadowCoord_56 = (v_shadowcoord + tmpvar_55); - float tmpvar_57; + lowp float tmpvar_57; vec2 tmpvar_58; tmpvar_58 = (_shadowCoord_56.xy / _shadowCoord_56.w); bool tmpvar_59; @@ -241,7 +256,9 @@ void main () if (tmpvar_59) { tmpvar_57 = 1.0; } else { - tmpvar_57 = float((dot (texture2D (u_shadowMap0, tmpvar_58), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_56.z - u_params1.x) / _shadowCoord_56.w))); + tmpvar_57 = float((dot (texture2D (u_shadowMap0, tmpvar_58), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_56.z - u_params1.x) + / _shadowCoord_56.w))); }; result_8 = (result_8 + tmpvar_57); vec4 tmpvar_60; @@ -249,7 +266,7 @@ void main () tmpvar_60.xy = (vec2(0.5, 0.5) * tmpvar_9); vec4 _shadowCoord_61; _shadowCoord_61 = (v_shadowcoord + tmpvar_60); - float tmpvar_62; + lowp float tmpvar_62; vec2 tmpvar_63; tmpvar_63 = (_shadowCoord_61.xy / _shadowCoord_61.w); bool tmpvar_64; @@ -261,7 +278,9 @@ void main () if (tmpvar_64) { tmpvar_62 = 1.0; } else { - tmpvar_62 = float((dot (texture2D (u_shadowMap0, tmpvar_63), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_61.z - u_params1.x) / _shadowCoord_61.w))); + tmpvar_62 = float((dot (texture2D (u_shadowMap0, tmpvar_63), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_61.z - u_params1.x) + / _shadowCoord_61.w))); }; result_8 = (result_8 + tmpvar_62); vec4 tmpvar_65; @@ -269,7 +288,7 @@ void main () tmpvar_65.xy = (vec2(0.5, 1.5) * tmpvar_9); vec4 _shadowCoord_66; _shadowCoord_66 = (v_shadowcoord + tmpvar_65); - float tmpvar_67; + lowp float tmpvar_67; vec2 tmpvar_68; tmpvar_68 = (_shadowCoord_66.xy / _shadowCoord_66.w); bool tmpvar_69; @@ -281,7 +300,9 @@ void main () if (tmpvar_69) { tmpvar_67 = 1.0; } else { - tmpvar_67 = float((dot (texture2D (u_shadowMap0, tmpvar_68), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_66.z - u_params1.x) / _shadowCoord_66.w))); + tmpvar_67 = float((dot (texture2D (u_shadowMap0, tmpvar_68), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_66.z - u_params1.x) + / _shadowCoord_66.w))); }; result_8 = (result_8 + tmpvar_67); vec4 tmpvar_70; @@ -289,7 +310,7 @@ void main () tmpvar_70.xy = (vec2(1.5, -1.5) * tmpvar_9); vec4 _shadowCoord_71; _shadowCoord_71 = (v_shadowcoord + tmpvar_70); - float tmpvar_72; + lowp float tmpvar_72; vec2 tmpvar_73; tmpvar_73 = (_shadowCoord_71.xy / _shadowCoord_71.w); bool tmpvar_74; @@ -301,7 +322,9 @@ void main () if (tmpvar_74) { tmpvar_72 = 1.0; } else { - tmpvar_72 = float((dot (texture2D (u_shadowMap0, tmpvar_73), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_71.z - u_params1.x) / _shadowCoord_71.w))); + tmpvar_72 = float((dot (texture2D (u_shadowMap0, tmpvar_73), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_71.z - u_params1.x) + / _shadowCoord_71.w))); }; result_8 = (result_8 + tmpvar_72); vec4 tmpvar_75; @@ -309,7 +332,7 @@ void main () tmpvar_75.xy = (vec2(1.5, -0.5) * tmpvar_9); vec4 _shadowCoord_76; _shadowCoord_76 = (v_shadowcoord + tmpvar_75); - float tmpvar_77; + lowp float tmpvar_77; vec2 tmpvar_78; tmpvar_78 = (_shadowCoord_76.xy / _shadowCoord_76.w); bool tmpvar_79; @@ -321,7 +344,9 @@ void main () if (tmpvar_79) { tmpvar_77 = 1.0; } else { - tmpvar_77 = float((dot (texture2D (u_shadowMap0, tmpvar_78), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_76.z - u_params1.x) / _shadowCoord_76.w))); + tmpvar_77 = float((dot (texture2D (u_shadowMap0, tmpvar_78), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_76.z - u_params1.x) + / _shadowCoord_76.w))); }; result_8 = (result_8 + tmpvar_77); vec4 tmpvar_80; @@ -329,7 +354,7 @@ void main () tmpvar_80.xy = (vec2(1.5, 0.5) * tmpvar_9); vec4 _shadowCoord_81; _shadowCoord_81 = (v_shadowcoord + tmpvar_80); - float tmpvar_82; + lowp float tmpvar_82; vec2 tmpvar_83; tmpvar_83 = (_shadowCoord_81.xy / _shadowCoord_81.w); bool tmpvar_84; @@ -341,7 +366,9 @@ void main () if (tmpvar_84) { tmpvar_82 = 1.0; } else { - tmpvar_82 = float((dot (texture2D (u_shadowMap0, tmpvar_83), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_81.z - u_params1.x) / _shadowCoord_81.w))); + tmpvar_82 = float((dot (texture2D (u_shadowMap0, tmpvar_83), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_81.z - u_params1.x) + / _shadowCoord_81.w))); }; result_8 = (result_8 + tmpvar_82); vec4 tmpvar_85; @@ -349,7 +376,7 @@ void main () tmpvar_85.xy = (vec2(1.5, 1.5) * tmpvar_9); vec4 _shadowCoord_86; _shadowCoord_86 = (v_shadowcoord + tmpvar_85); - float tmpvar_87; + lowp float tmpvar_87; vec2 tmpvar_88; tmpvar_88 = (_shadowCoord_86.xy / _shadowCoord_86.w); bool tmpvar_89; @@ -361,9 +388,11 @@ void main () if (tmpvar_89) { tmpvar_87 = 1.0; } else { - tmpvar_87 = float((dot (texture2D (u_shadowMap0, tmpvar_88), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_86.z - u_params1.x) / _shadowCoord_86.w))); + tmpvar_87 = float((dot (texture2D (u_shadowMap0, tmpvar_88), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_86.z - u_params1.x) + / _shadowCoord_86.w))); }; - float tmpvar_90; + lowp float tmpvar_90; tmpvar_90 = (result_8 + tmpvar_87); result_8 = tmpvar_90; tmpvar_7 = (tmpvar_90 / 16.0); @@ -383,18 +412,48 @@ void main () tmpvar_96 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_97; tmpvar_97 = sqrt(dot (tmpvar_94, tmpvar_94)); - tmpvar_93 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_97)) + ((u_lightAttenuationSpotOuter.z * tmpvar_97) * tmpvar_97)))) * mix (clamp (((max (0.0, dot (-(tmpvar_95), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_96) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_96)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_93 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_97)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_97) * tmpvar_97) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_95) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_96) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_96)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_98; tmpvar_98 = dot (v_normal, tmpvar_92); vec2 tmpvar_99; tmpvar_99.x = tmpvar_98; - tmpvar_99.y = (((float((tmpvar_98 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_98) * v_normal) - tmpvar_92), tmpvar_91)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_99.y = ((( + float((tmpvar_98 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_98) * v_normal) + - tmpvar_92), tmpvar_91)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_100; tmpvar_100 = (max (tmpvar_99, 0.0) * tmpvar_93); float tmpvar_101; tmpvar_101 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_100.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_100.y)) * u_color.xyz) * tmpvar_7))), vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_101) * tmpvar_101)))), 0.0, 1.0)); + lowp vec3 tmpvar_102; + tmpvar_102 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_100.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_100.y)) + * u_color.xyz) * tmpvar_7))) + , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_101) * tmpvar_101)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_102; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin index 1f4b87582..ffc5ba522 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_csm.bin @@ -1,34 +1,31 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -78,14 +75,14 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); colorCoverage_2 = tmpvar_20; - float result_21; + lowp float result_21; result_21 = 0.0; vec2 tmpvar_22; tmpvar_22 = ((u_smSamplingParams.zw * u_params2.zz) * v_texcoord1.w); @@ -94,7 +91,7 @@ void main () tmpvar_23.xy = (vec2(-1.5, -1.5) * tmpvar_22); vec4 _shadowCoord_24; _shadowCoord_24 = (v_texcoord1 + tmpvar_23); - float tmpvar_25; + lowp float tmpvar_25; vec2 tmpvar_26; tmpvar_26 = (_shadowCoord_24.xy / _shadowCoord_24.w); bool tmpvar_27; @@ -106,7 +103,9 @@ void main () if (tmpvar_27) { tmpvar_25 = 1.0; } else { - tmpvar_25 = float((dot (texture2D (u_shadowMap0, tmpvar_26), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_24.z - u_params1.x) / _shadowCoord_24.w))); + tmpvar_25 = float((dot (texture2D (u_shadowMap0, tmpvar_26), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_24.z - u_params1.x) + / _shadowCoord_24.w))); }; result_21 = tmpvar_25; vec4 tmpvar_28; @@ -114,7 +113,7 @@ void main () tmpvar_28.xy = (vec2(-1.5, -0.5) * tmpvar_22); vec4 _shadowCoord_29; _shadowCoord_29 = (v_texcoord1 + tmpvar_28); - float tmpvar_30; + lowp float tmpvar_30; vec2 tmpvar_31; tmpvar_31 = (_shadowCoord_29.xy / _shadowCoord_29.w); bool tmpvar_32; @@ -126,7 +125,9 @@ void main () if (tmpvar_32) { tmpvar_30 = 1.0; } else { - tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_29.z - u_params1.x) / _shadowCoord_29.w))); + tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_29.z - u_params1.x) + / _shadowCoord_29.w))); }; result_21 = (tmpvar_25 + tmpvar_30); vec4 tmpvar_33; @@ -134,7 +135,7 @@ void main () tmpvar_33.xy = (vec2(-1.5, 0.5) * tmpvar_22); vec4 _shadowCoord_34; _shadowCoord_34 = (v_texcoord1 + tmpvar_33); - float tmpvar_35; + lowp float tmpvar_35; vec2 tmpvar_36; tmpvar_36 = (_shadowCoord_34.xy / _shadowCoord_34.w); bool tmpvar_37; @@ -146,7 +147,9 @@ void main () if (tmpvar_37) { tmpvar_35 = 1.0; } else { - tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_34.z - u_params1.x) / _shadowCoord_34.w))); + tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_34.z - u_params1.x) + / _shadowCoord_34.w))); }; result_21 = (result_21 + tmpvar_35); vec4 tmpvar_38; @@ -154,7 +157,7 @@ void main () tmpvar_38.xy = (vec2(-1.5, 1.5) * tmpvar_22); vec4 _shadowCoord_39; _shadowCoord_39 = (v_texcoord1 + tmpvar_38); - float tmpvar_40; + lowp float tmpvar_40; vec2 tmpvar_41; tmpvar_41 = (_shadowCoord_39.xy / _shadowCoord_39.w); bool tmpvar_42; @@ -166,7 +169,9 @@ void main () if (tmpvar_42) { tmpvar_40 = 1.0; } else { - tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_39.z - u_params1.x) / _shadowCoord_39.w))); + tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_39.z - u_params1.x) + / _shadowCoord_39.w))); }; result_21 = (result_21 + tmpvar_40); vec4 tmpvar_43; @@ -174,7 +179,7 @@ void main () tmpvar_43.xy = (vec2(-0.5, -1.5) * tmpvar_22); vec4 _shadowCoord_44; _shadowCoord_44 = (v_texcoord1 + tmpvar_43); - float tmpvar_45; + lowp float tmpvar_45; vec2 tmpvar_46; tmpvar_46 = (_shadowCoord_44.xy / _shadowCoord_44.w); bool tmpvar_47; @@ -186,7 +191,9 @@ void main () if (tmpvar_47) { tmpvar_45 = 1.0; } else { - tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_44.z - u_params1.x) / _shadowCoord_44.w))); + tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_44.z - u_params1.x) + / _shadowCoord_44.w))); }; result_21 = (result_21 + tmpvar_45); vec4 tmpvar_48; @@ -194,7 +201,7 @@ void main () tmpvar_48.xy = (vec2(-0.5, -0.5) * tmpvar_22); vec4 _shadowCoord_49; _shadowCoord_49 = (v_texcoord1 + tmpvar_48); - float tmpvar_50; + lowp float tmpvar_50; vec2 tmpvar_51; tmpvar_51 = (_shadowCoord_49.xy / _shadowCoord_49.w); bool tmpvar_52; @@ -206,7 +213,9 @@ void main () if (tmpvar_52) { tmpvar_50 = 1.0; } else { - tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_49.z - u_params1.x) / _shadowCoord_49.w))); + tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_49.z - u_params1.x) + / _shadowCoord_49.w))); }; result_21 = (result_21 + tmpvar_50); vec4 tmpvar_53; @@ -214,7 +223,7 @@ void main () tmpvar_53.xy = (vec2(-0.5, 0.5) * tmpvar_22); vec4 _shadowCoord_54; _shadowCoord_54 = (v_texcoord1 + tmpvar_53); - float tmpvar_55; + lowp float tmpvar_55; vec2 tmpvar_56; tmpvar_56 = (_shadowCoord_54.xy / _shadowCoord_54.w); bool tmpvar_57; @@ -226,7 +235,9 @@ void main () if (tmpvar_57) { tmpvar_55 = 1.0; } else { - tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_54.z - u_params1.x) / _shadowCoord_54.w))); + tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_54.z - u_params1.x) + / _shadowCoord_54.w))); }; result_21 = (result_21 + tmpvar_55); vec4 tmpvar_58; @@ -234,7 +245,7 @@ void main () tmpvar_58.xy = (vec2(-0.5, 1.5) * tmpvar_22); vec4 _shadowCoord_59; _shadowCoord_59 = (v_texcoord1 + tmpvar_58); - float tmpvar_60; + lowp float tmpvar_60; vec2 tmpvar_61; tmpvar_61 = (_shadowCoord_59.xy / _shadowCoord_59.w); bool tmpvar_62; @@ -246,7 +257,9 @@ void main () if (tmpvar_62) { tmpvar_60 = 1.0; } else { - tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_59.z - u_params1.x) / _shadowCoord_59.w))); + tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_59.z - u_params1.x) + / _shadowCoord_59.w))); }; result_21 = (result_21 + tmpvar_60); vec4 tmpvar_63; @@ -254,7 +267,7 @@ void main () tmpvar_63.xy = (vec2(0.5, -1.5) * tmpvar_22); vec4 _shadowCoord_64; _shadowCoord_64 = (v_texcoord1 + tmpvar_63); - float tmpvar_65; + lowp float tmpvar_65; vec2 tmpvar_66; tmpvar_66 = (_shadowCoord_64.xy / _shadowCoord_64.w); bool tmpvar_67; @@ -266,7 +279,9 @@ void main () if (tmpvar_67) { tmpvar_65 = 1.0; } else { - tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_64.z - u_params1.x) / _shadowCoord_64.w))); + tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_64.z - u_params1.x) + / _shadowCoord_64.w))); }; result_21 = (result_21 + tmpvar_65); vec4 tmpvar_68; @@ -274,7 +289,7 @@ void main () tmpvar_68.xy = (vec2(0.5, -0.5) * tmpvar_22); vec4 _shadowCoord_69; _shadowCoord_69 = (v_texcoord1 + tmpvar_68); - float tmpvar_70; + lowp float tmpvar_70; vec2 tmpvar_71; tmpvar_71 = (_shadowCoord_69.xy / _shadowCoord_69.w); bool tmpvar_72; @@ -286,7 +301,9 @@ void main () if (tmpvar_72) { tmpvar_70 = 1.0; } else { - tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_69.z - u_params1.x) / _shadowCoord_69.w))); + tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_69.z - u_params1.x) + / _shadowCoord_69.w))); }; result_21 = (result_21 + tmpvar_70); vec4 tmpvar_73; @@ -294,7 +311,7 @@ void main () tmpvar_73.xy = (vec2(0.5, 0.5) * tmpvar_22); vec4 _shadowCoord_74; _shadowCoord_74 = (v_texcoord1 + tmpvar_73); - float tmpvar_75; + lowp float tmpvar_75; vec2 tmpvar_76; tmpvar_76 = (_shadowCoord_74.xy / _shadowCoord_74.w); bool tmpvar_77; @@ -306,7 +323,9 @@ void main () if (tmpvar_77) { tmpvar_75 = 1.0; } else { - tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_74.z - u_params1.x) / _shadowCoord_74.w))); + tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_74.z - u_params1.x) + / _shadowCoord_74.w))); }; result_21 = (result_21 + tmpvar_75); vec4 tmpvar_78; @@ -314,7 +333,7 @@ void main () tmpvar_78.xy = (vec2(0.5, 1.5) * tmpvar_22); vec4 _shadowCoord_79; _shadowCoord_79 = (v_texcoord1 + tmpvar_78); - float tmpvar_80; + lowp float tmpvar_80; vec2 tmpvar_81; tmpvar_81 = (_shadowCoord_79.xy / _shadowCoord_79.w); bool tmpvar_82; @@ -326,7 +345,9 @@ void main () if (tmpvar_82) { tmpvar_80 = 1.0; } else { - tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_79.z - u_params1.x) / _shadowCoord_79.w))); + tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_79.z - u_params1.x) + / _shadowCoord_79.w))); }; result_21 = (result_21 + tmpvar_80); vec4 tmpvar_83; @@ -334,7 +355,7 @@ void main () tmpvar_83.xy = (vec2(1.5, -1.5) * tmpvar_22); vec4 _shadowCoord_84; _shadowCoord_84 = (v_texcoord1 + tmpvar_83); - float tmpvar_85; + lowp float tmpvar_85; vec2 tmpvar_86; tmpvar_86 = (_shadowCoord_84.xy / _shadowCoord_84.w); bool tmpvar_87; @@ -346,7 +367,9 @@ void main () if (tmpvar_87) { tmpvar_85 = 1.0; } else { - tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_84.z - u_params1.x) / _shadowCoord_84.w))); + tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_84.z - u_params1.x) + / _shadowCoord_84.w))); }; result_21 = (result_21 + tmpvar_85); vec4 tmpvar_88; @@ -354,7 +377,7 @@ void main () tmpvar_88.xy = (vec2(1.5, -0.5) * tmpvar_22); vec4 _shadowCoord_89; _shadowCoord_89 = (v_texcoord1 + tmpvar_88); - float tmpvar_90; + lowp float tmpvar_90; vec2 tmpvar_91; tmpvar_91 = (_shadowCoord_89.xy / _shadowCoord_89.w); bool tmpvar_92; @@ -366,7 +389,9 @@ void main () if (tmpvar_92) { tmpvar_90 = 1.0; } else { - tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_89.z - u_params1.x) / _shadowCoord_89.w))); + tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_89.z - u_params1.x) + / _shadowCoord_89.w))); }; result_21 = (result_21 + tmpvar_90); vec4 tmpvar_93; @@ -374,7 +399,7 @@ void main () tmpvar_93.xy = (vec2(1.5, 0.5) * tmpvar_22); vec4 _shadowCoord_94; _shadowCoord_94 = (v_texcoord1 + tmpvar_93); - float tmpvar_95; + lowp float tmpvar_95; vec2 tmpvar_96; tmpvar_96 = (_shadowCoord_94.xy / _shadowCoord_94.w); bool tmpvar_97; @@ -386,7 +411,9 @@ void main () if (tmpvar_97) { tmpvar_95 = 1.0; } else { - tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_94.z - u_params1.x) / _shadowCoord_94.w))); + tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_94.z - u_params1.x) + / _shadowCoord_94.w))); }; result_21 = (result_21 + tmpvar_95); vec4 tmpvar_98; @@ -394,7 +421,7 @@ void main () tmpvar_98.xy = (vec2(1.5, 1.5) * tmpvar_22); vec4 _shadowCoord_99; _shadowCoord_99 = (v_texcoord1 + tmpvar_98); - float tmpvar_100; + lowp float tmpvar_100; vec2 tmpvar_101; tmpvar_101 = (_shadowCoord_99.xy / _shadowCoord_99.w); bool tmpvar_102; @@ -406,9 +433,11 @@ void main () if (tmpvar_102) { tmpvar_100 = 1.0; } else { - tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_99.z - u_params1.x) / _shadowCoord_99.w))); + tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_99.z - u_params1.x) + / _shadowCoord_99.w))); }; - float tmpvar_103; + lowp float tmpvar_103; tmpvar_103 = (result_21 + tmpvar_100); result_21 = tmpvar_103; visibility_1 = (tmpvar_103 / 16.0); @@ -426,14 +455,14 @@ void main () } else { tmpvar_106 = bool(0); }; - float tmpvar_108; + lowp float tmpvar_108; tmpvar_108 = (float(tmpvar_106) * 0.4); - vec3 tmpvar_109; + lowp vec3 tmpvar_109; tmpvar_109.x = tmpvar_108; tmpvar_109.y = tmpvar_108; tmpvar_109.z = -(tmpvar_108); colorCoverage_2 = tmpvar_109; - float result_110; + lowp float result_110; result_110 = 0.0; vec2 tmpvar_111; tmpvar_111 = ((u_smSamplingParams.zw * (u_params2.zz / 2.0)) * v_texcoord2.w); @@ -442,7 +471,7 @@ void main () tmpvar_112.xy = (vec2(-1.5, -1.5) * tmpvar_111); vec4 _shadowCoord_113; _shadowCoord_113 = (v_texcoord2 + tmpvar_112); - float tmpvar_114; + lowp float tmpvar_114; vec2 tmpvar_115; tmpvar_115 = (_shadowCoord_113.xy / _shadowCoord_113.w); bool tmpvar_116; @@ -454,7 +483,9 @@ void main () if (tmpvar_116) { tmpvar_114 = 1.0; } else { - tmpvar_114 = float((dot (texture2D (u_shadowMap1, tmpvar_115), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_113.z - u_params1.x) / _shadowCoord_113.w))); + tmpvar_114 = float((dot (texture2D (u_shadowMap1, tmpvar_115), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_113.z - u_params1.x) + / _shadowCoord_113.w))); }; result_110 = tmpvar_114; vec4 tmpvar_117; @@ -462,7 +493,7 @@ void main () tmpvar_117.xy = (vec2(-1.5, -0.5) * tmpvar_111); vec4 _shadowCoord_118; _shadowCoord_118 = (v_texcoord2 + tmpvar_117); - float tmpvar_119; + lowp float tmpvar_119; vec2 tmpvar_120; tmpvar_120 = (_shadowCoord_118.xy / _shadowCoord_118.w); bool tmpvar_121; @@ -474,7 +505,9 @@ void main () if (tmpvar_121) { tmpvar_119 = 1.0; } else { - tmpvar_119 = float((dot (texture2D (u_shadowMap1, tmpvar_120), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_118.z - u_params1.x) / _shadowCoord_118.w))); + tmpvar_119 = float((dot (texture2D (u_shadowMap1, tmpvar_120), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_118.z - u_params1.x) + / _shadowCoord_118.w))); }; result_110 = (tmpvar_114 + tmpvar_119); vec4 tmpvar_122; @@ -482,7 +515,7 @@ void main () tmpvar_122.xy = (vec2(-1.5, 0.5) * tmpvar_111); vec4 _shadowCoord_123; _shadowCoord_123 = (v_texcoord2 + tmpvar_122); - float tmpvar_124; + lowp float tmpvar_124; vec2 tmpvar_125; tmpvar_125 = (_shadowCoord_123.xy / _shadowCoord_123.w); bool tmpvar_126; @@ -494,7 +527,9 @@ void main () if (tmpvar_126) { tmpvar_124 = 1.0; } else { - tmpvar_124 = float((dot (texture2D (u_shadowMap1, tmpvar_125), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_123.z - u_params1.x) / _shadowCoord_123.w))); + tmpvar_124 = float((dot (texture2D (u_shadowMap1, tmpvar_125), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_123.z - u_params1.x) + / _shadowCoord_123.w))); }; result_110 = (result_110 + tmpvar_124); vec4 tmpvar_127; @@ -502,7 +537,7 @@ void main () tmpvar_127.xy = (vec2(-1.5, 1.5) * tmpvar_111); vec4 _shadowCoord_128; _shadowCoord_128 = (v_texcoord2 + tmpvar_127); - float tmpvar_129; + lowp float tmpvar_129; vec2 tmpvar_130; tmpvar_130 = (_shadowCoord_128.xy / _shadowCoord_128.w); bool tmpvar_131; @@ -514,7 +549,9 @@ void main () if (tmpvar_131) { tmpvar_129 = 1.0; } else { - tmpvar_129 = float((dot (texture2D (u_shadowMap1, tmpvar_130), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_128.z - u_params1.x) / _shadowCoord_128.w))); + tmpvar_129 = float((dot (texture2D (u_shadowMap1, tmpvar_130), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_128.z - u_params1.x) + / _shadowCoord_128.w))); }; result_110 = (result_110 + tmpvar_129); vec4 tmpvar_132; @@ -522,7 +559,7 @@ void main () tmpvar_132.xy = (vec2(-0.5, -1.5) * tmpvar_111); vec4 _shadowCoord_133; _shadowCoord_133 = (v_texcoord2 + tmpvar_132); - float tmpvar_134; + lowp float tmpvar_134; vec2 tmpvar_135; tmpvar_135 = (_shadowCoord_133.xy / _shadowCoord_133.w); bool tmpvar_136; @@ -534,7 +571,9 @@ void main () if (tmpvar_136) { tmpvar_134 = 1.0; } else { - tmpvar_134 = float((dot (texture2D (u_shadowMap1, tmpvar_135), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_133.z - u_params1.x) / _shadowCoord_133.w))); + tmpvar_134 = float((dot (texture2D (u_shadowMap1, tmpvar_135), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_133.z - u_params1.x) + / _shadowCoord_133.w))); }; result_110 = (result_110 + tmpvar_134); vec4 tmpvar_137; @@ -542,7 +581,7 @@ void main () tmpvar_137.xy = (vec2(-0.5, -0.5) * tmpvar_111); vec4 _shadowCoord_138; _shadowCoord_138 = (v_texcoord2 + tmpvar_137); - float tmpvar_139; + lowp float tmpvar_139; vec2 tmpvar_140; tmpvar_140 = (_shadowCoord_138.xy / _shadowCoord_138.w); bool tmpvar_141; @@ -554,7 +593,9 @@ void main () if (tmpvar_141) { tmpvar_139 = 1.0; } else { - tmpvar_139 = float((dot (texture2D (u_shadowMap1, tmpvar_140), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_138.z - u_params1.x) / _shadowCoord_138.w))); + tmpvar_139 = float((dot (texture2D (u_shadowMap1, tmpvar_140), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_138.z - u_params1.x) + / _shadowCoord_138.w))); }; result_110 = (result_110 + tmpvar_139); vec4 tmpvar_142; @@ -562,7 +603,7 @@ void main () tmpvar_142.xy = (vec2(-0.5, 0.5) * tmpvar_111); vec4 _shadowCoord_143; _shadowCoord_143 = (v_texcoord2 + tmpvar_142); - float tmpvar_144; + lowp float tmpvar_144; vec2 tmpvar_145; tmpvar_145 = (_shadowCoord_143.xy / _shadowCoord_143.w); bool tmpvar_146; @@ -574,7 +615,9 @@ void main () if (tmpvar_146) { tmpvar_144 = 1.0; } else { - tmpvar_144 = float((dot (texture2D (u_shadowMap1, tmpvar_145), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_143.z - u_params1.x) / _shadowCoord_143.w))); + tmpvar_144 = float((dot (texture2D (u_shadowMap1, tmpvar_145), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_143.z - u_params1.x) + / _shadowCoord_143.w))); }; result_110 = (result_110 + tmpvar_144); vec4 tmpvar_147; @@ -582,7 +625,7 @@ void main () tmpvar_147.xy = (vec2(-0.5, 1.5) * tmpvar_111); vec4 _shadowCoord_148; _shadowCoord_148 = (v_texcoord2 + tmpvar_147); - float tmpvar_149; + lowp float tmpvar_149; vec2 tmpvar_150; tmpvar_150 = (_shadowCoord_148.xy / _shadowCoord_148.w); bool tmpvar_151; @@ -594,7 +637,9 @@ void main () if (tmpvar_151) { tmpvar_149 = 1.0; } else { - tmpvar_149 = float((dot (texture2D (u_shadowMap1, tmpvar_150), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_148.z - u_params1.x) / _shadowCoord_148.w))); + tmpvar_149 = float((dot (texture2D (u_shadowMap1, tmpvar_150), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_148.z - u_params1.x) + / _shadowCoord_148.w))); }; result_110 = (result_110 + tmpvar_149); vec4 tmpvar_152; @@ -602,7 +647,7 @@ void main () tmpvar_152.xy = (vec2(0.5, -1.5) * tmpvar_111); vec4 _shadowCoord_153; _shadowCoord_153 = (v_texcoord2 + tmpvar_152); - float tmpvar_154; + lowp float tmpvar_154; vec2 tmpvar_155; tmpvar_155 = (_shadowCoord_153.xy / _shadowCoord_153.w); bool tmpvar_156; @@ -614,7 +659,9 @@ void main () if (tmpvar_156) { tmpvar_154 = 1.0; } else { - tmpvar_154 = float((dot (texture2D (u_shadowMap1, tmpvar_155), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_153.z - u_params1.x) / _shadowCoord_153.w))); + tmpvar_154 = float((dot (texture2D (u_shadowMap1, tmpvar_155), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_153.z - u_params1.x) + / _shadowCoord_153.w))); }; result_110 = (result_110 + tmpvar_154); vec4 tmpvar_157; @@ -622,7 +669,7 @@ void main () tmpvar_157.xy = (vec2(0.5, -0.5) * tmpvar_111); vec4 _shadowCoord_158; _shadowCoord_158 = (v_texcoord2 + tmpvar_157); - float tmpvar_159; + lowp float tmpvar_159; vec2 tmpvar_160; tmpvar_160 = (_shadowCoord_158.xy / _shadowCoord_158.w); bool tmpvar_161; @@ -634,7 +681,9 @@ void main () if (tmpvar_161) { tmpvar_159 = 1.0; } else { - tmpvar_159 = float((dot (texture2D (u_shadowMap1, tmpvar_160), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_158.z - u_params1.x) / _shadowCoord_158.w))); + tmpvar_159 = float((dot (texture2D (u_shadowMap1, tmpvar_160), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_158.z - u_params1.x) + / _shadowCoord_158.w))); }; result_110 = (result_110 + tmpvar_159); vec4 tmpvar_162; @@ -642,7 +691,7 @@ void main () tmpvar_162.xy = (vec2(0.5, 0.5) * tmpvar_111); vec4 _shadowCoord_163; _shadowCoord_163 = (v_texcoord2 + tmpvar_162); - float tmpvar_164; + lowp float tmpvar_164; vec2 tmpvar_165; tmpvar_165 = (_shadowCoord_163.xy / _shadowCoord_163.w); bool tmpvar_166; @@ -654,7 +703,9 @@ void main () if (tmpvar_166) { tmpvar_164 = 1.0; } else { - tmpvar_164 = float((dot (texture2D (u_shadowMap1, tmpvar_165), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_163.z - u_params1.x) / _shadowCoord_163.w))); + tmpvar_164 = float((dot (texture2D (u_shadowMap1, tmpvar_165), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_163.z - u_params1.x) + / _shadowCoord_163.w))); }; result_110 = (result_110 + tmpvar_164); vec4 tmpvar_167; @@ -662,7 +713,7 @@ void main () tmpvar_167.xy = (vec2(0.5, 1.5) * tmpvar_111); vec4 _shadowCoord_168; _shadowCoord_168 = (v_texcoord2 + tmpvar_167); - float tmpvar_169; + lowp float tmpvar_169; vec2 tmpvar_170; tmpvar_170 = (_shadowCoord_168.xy / _shadowCoord_168.w); bool tmpvar_171; @@ -674,7 +725,9 @@ void main () if (tmpvar_171) { tmpvar_169 = 1.0; } else { - tmpvar_169 = float((dot (texture2D (u_shadowMap1, tmpvar_170), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_168.z - u_params1.x) / _shadowCoord_168.w))); + tmpvar_169 = float((dot (texture2D (u_shadowMap1, tmpvar_170), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_168.z - u_params1.x) + / _shadowCoord_168.w))); }; result_110 = (result_110 + tmpvar_169); vec4 tmpvar_172; @@ -682,7 +735,7 @@ void main () tmpvar_172.xy = (vec2(1.5, -1.5) * tmpvar_111); vec4 _shadowCoord_173; _shadowCoord_173 = (v_texcoord2 + tmpvar_172); - float tmpvar_174; + lowp float tmpvar_174; vec2 tmpvar_175; tmpvar_175 = (_shadowCoord_173.xy / _shadowCoord_173.w); bool tmpvar_176; @@ -694,7 +747,9 @@ void main () if (tmpvar_176) { tmpvar_174 = 1.0; } else { - tmpvar_174 = float((dot (texture2D (u_shadowMap1, tmpvar_175), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_173.z - u_params1.x) / _shadowCoord_173.w))); + tmpvar_174 = float((dot (texture2D (u_shadowMap1, tmpvar_175), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_173.z - u_params1.x) + / _shadowCoord_173.w))); }; result_110 = (result_110 + tmpvar_174); vec4 tmpvar_177; @@ -702,7 +757,7 @@ void main () tmpvar_177.xy = (vec2(1.5, -0.5) * tmpvar_111); vec4 _shadowCoord_178; _shadowCoord_178 = (v_texcoord2 + tmpvar_177); - float tmpvar_179; + lowp float tmpvar_179; vec2 tmpvar_180; tmpvar_180 = (_shadowCoord_178.xy / _shadowCoord_178.w); bool tmpvar_181; @@ -714,7 +769,9 @@ void main () if (tmpvar_181) { tmpvar_179 = 1.0; } else { - tmpvar_179 = float((dot (texture2D (u_shadowMap1, tmpvar_180), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_178.z - u_params1.x) / _shadowCoord_178.w))); + tmpvar_179 = float((dot (texture2D (u_shadowMap1, tmpvar_180), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_178.z - u_params1.x) + / _shadowCoord_178.w))); }; result_110 = (result_110 + tmpvar_179); vec4 tmpvar_182; @@ -722,7 +779,7 @@ void main () tmpvar_182.xy = (vec2(1.5, 0.5) * tmpvar_111); vec4 _shadowCoord_183; _shadowCoord_183 = (v_texcoord2 + tmpvar_182); - float tmpvar_184; + lowp float tmpvar_184; vec2 tmpvar_185; tmpvar_185 = (_shadowCoord_183.xy / _shadowCoord_183.w); bool tmpvar_186; @@ -734,7 +791,9 @@ void main () if (tmpvar_186) { tmpvar_184 = 1.0; } else { - tmpvar_184 = float((dot (texture2D (u_shadowMap1, tmpvar_185), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_183.z - u_params1.x) / _shadowCoord_183.w))); + tmpvar_184 = float((dot (texture2D (u_shadowMap1, tmpvar_185), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_183.z - u_params1.x) + / _shadowCoord_183.w))); }; result_110 = (result_110 + tmpvar_184); vec4 tmpvar_187; @@ -742,7 +801,7 @@ void main () tmpvar_187.xy = (vec2(1.5, 1.5) * tmpvar_111); vec4 _shadowCoord_188; _shadowCoord_188 = (v_texcoord2 + tmpvar_187); - float tmpvar_189; + lowp float tmpvar_189; vec2 tmpvar_190; tmpvar_190 = (_shadowCoord_188.xy / _shadowCoord_188.w); bool tmpvar_191; @@ -754,9 +813,11 @@ void main () if (tmpvar_191) { tmpvar_189 = 1.0; } else { - tmpvar_189 = float((dot (texture2D (u_shadowMap1, tmpvar_190), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_188.z - u_params1.x) / _shadowCoord_188.w))); + tmpvar_189 = float((dot (texture2D (u_shadowMap1, tmpvar_190), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_188.z - u_params1.x) + / _shadowCoord_188.w))); }; - float tmpvar_192; + lowp float tmpvar_192; tmpvar_192 = (result_110 + tmpvar_189); result_110 = tmpvar_192; visibility_1 = (tmpvar_192 / 16.0); @@ -774,14 +835,14 @@ void main () } else { tmpvar_195 = bool(0); }; - float tmpvar_197; + lowp float tmpvar_197; tmpvar_197 = (float(tmpvar_195) * 0.4); - vec3 tmpvar_198; + lowp vec3 tmpvar_198; tmpvar_198.x = -(tmpvar_197); tmpvar_198.y = -(tmpvar_197); tmpvar_198.z = tmpvar_197; colorCoverage_2 = tmpvar_198; - float result_199; + lowp float result_199; result_199 = 0.0; vec2 tmpvar_200; tmpvar_200 = ((u_smSamplingParams.zw * (u_params2.zz / 3.0)) * v_texcoord3.w); @@ -790,7 +851,7 @@ void main () tmpvar_201.xy = (vec2(-1.5, -1.5) * tmpvar_200); vec4 _shadowCoord_202; _shadowCoord_202 = (v_texcoord3 + tmpvar_201); - float tmpvar_203; + lowp float tmpvar_203; vec2 tmpvar_204; tmpvar_204 = (_shadowCoord_202.xy / _shadowCoord_202.w); bool tmpvar_205; @@ -802,7 +863,9 @@ void main () if (tmpvar_205) { tmpvar_203 = 1.0; } else { - tmpvar_203 = float((dot (texture2D (u_shadowMap2, tmpvar_204), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_202.z - u_params1.x) / _shadowCoord_202.w))); + tmpvar_203 = float((dot (texture2D (u_shadowMap2, tmpvar_204), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_202.z - u_params1.x) + / _shadowCoord_202.w))); }; result_199 = tmpvar_203; vec4 tmpvar_206; @@ -810,7 +873,7 @@ void main () tmpvar_206.xy = (vec2(-1.5, -0.5) * tmpvar_200); vec4 _shadowCoord_207; _shadowCoord_207 = (v_texcoord3 + tmpvar_206); - float tmpvar_208; + lowp float tmpvar_208; vec2 tmpvar_209; tmpvar_209 = (_shadowCoord_207.xy / _shadowCoord_207.w); bool tmpvar_210; @@ -822,7 +885,9 @@ void main () if (tmpvar_210) { tmpvar_208 = 1.0; } else { - tmpvar_208 = float((dot (texture2D (u_shadowMap2, tmpvar_209), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_207.z - u_params1.x) / _shadowCoord_207.w))); + tmpvar_208 = float((dot (texture2D (u_shadowMap2, tmpvar_209), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_207.z - u_params1.x) + / _shadowCoord_207.w))); }; result_199 = (tmpvar_203 + tmpvar_208); vec4 tmpvar_211; @@ -830,7 +895,7 @@ void main () tmpvar_211.xy = (vec2(-1.5, 0.5) * tmpvar_200); vec4 _shadowCoord_212; _shadowCoord_212 = (v_texcoord3 + tmpvar_211); - float tmpvar_213; + lowp float tmpvar_213; vec2 tmpvar_214; tmpvar_214 = (_shadowCoord_212.xy / _shadowCoord_212.w); bool tmpvar_215; @@ -842,7 +907,9 @@ void main () if (tmpvar_215) { tmpvar_213 = 1.0; } else { - tmpvar_213 = float((dot (texture2D (u_shadowMap2, tmpvar_214), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_212.z - u_params1.x) / _shadowCoord_212.w))); + tmpvar_213 = float((dot (texture2D (u_shadowMap2, tmpvar_214), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_212.z - u_params1.x) + / _shadowCoord_212.w))); }; result_199 = (result_199 + tmpvar_213); vec4 tmpvar_216; @@ -850,7 +917,7 @@ void main () tmpvar_216.xy = (vec2(-1.5, 1.5) * tmpvar_200); vec4 _shadowCoord_217; _shadowCoord_217 = (v_texcoord3 + tmpvar_216); - float tmpvar_218; + lowp float tmpvar_218; vec2 tmpvar_219; tmpvar_219 = (_shadowCoord_217.xy / _shadowCoord_217.w); bool tmpvar_220; @@ -862,7 +929,9 @@ void main () if (tmpvar_220) { tmpvar_218 = 1.0; } else { - tmpvar_218 = float((dot (texture2D (u_shadowMap2, tmpvar_219), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_217.z - u_params1.x) / _shadowCoord_217.w))); + tmpvar_218 = float((dot (texture2D (u_shadowMap2, tmpvar_219), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_217.z - u_params1.x) + / _shadowCoord_217.w))); }; result_199 = (result_199 + tmpvar_218); vec4 tmpvar_221; @@ -870,7 +939,7 @@ void main () tmpvar_221.xy = (vec2(-0.5, -1.5) * tmpvar_200); vec4 _shadowCoord_222; _shadowCoord_222 = (v_texcoord3 + tmpvar_221); - float tmpvar_223; + lowp float tmpvar_223; vec2 tmpvar_224; tmpvar_224 = (_shadowCoord_222.xy / _shadowCoord_222.w); bool tmpvar_225; @@ -882,7 +951,9 @@ void main () if (tmpvar_225) { tmpvar_223 = 1.0; } else { - tmpvar_223 = float((dot (texture2D (u_shadowMap2, tmpvar_224), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_222.z - u_params1.x) / _shadowCoord_222.w))); + tmpvar_223 = float((dot (texture2D (u_shadowMap2, tmpvar_224), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_222.z - u_params1.x) + / _shadowCoord_222.w))); }; result_199 = (result_199 + tmpvar_223); vec4 tmpvar_226; @@ -890,7 +961,7 @@ void main () tmpvar_226.xy = (vec2(-0.5, -0.5) * tmpvar_200); vec4 _shadowCoord_227; _shadowCoord_227 = (v_texcoord3 + tmpvar_226); - float tmpvar_228; + lowp float tmpvar_228; vec2 tmpvar_229; tmpvar_229 = (_shadowCoord_227.xy / _shadowCoord_227.w); bool tmpvar_230; @@ -902,7 +973,9 @@ void main () if (tmpvar_230) { tmpvar_228 = 1.0; } else { - tmpvar_228 = float((dot (texture2D (u_shadowMap2, tmpvar_229), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_227.z - u_params1.x) / _shadowCoord_227.w))); + tmpvar_228 = float((dot (texture2D (u_shadowMap2, tmpvar_229), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_227.z - u_params1.x) + / _shadowCoord_227.w))); }; result_199 = (result_199 + tmpvar_228); vec4 tmpvar_231; @@ -910,7 +983,7 @@ void main () tmpvar_231.xy = (vec2(-0.5, 0.5) * tmpvar_200); vec4 _shadowCoord_232; _shadowCoord_232 = (v_texcoord3 + tmpvar_231); - float tmpvar_233; + lowp float tmpvar_233; vec2 tmpvar_234; tmpvar_234 = (_shadowCoord_232.xy / _shadowCoord_232.w); bool tmpvar_235; @@ -922,7 +995,9 @@ void main () if (tmpvar_235) { tmpvar_233 = 1.0; } else { - tmpvar_233 = float((dot (texture2D (u_shadowMap2, tmpvar_234), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_232.z - u_params1.x) / _shadowCoord_232.w))); + tmpvar_233 = float((dot (texture2D (u_shadowMap2, tmpvar_234), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_232.z - u_params1.x) + / _shadowCoord_232.w))); }; result_199 = (result_199 + tmpvar_233); vec4 tmpvar_236; @@ -930,7 +1005,7 @@ void main () tmpvar_236.xy = (vec2(-0.5, 1.5) * tmpvar_200); vec4 _shadowCoord_237; _shadowCoord_237 = (v_texcoord3 + tmpvar_236); - float tmpvar_238; + lowp float tmpvar_238; vec2 tmpvar_239; tmpvar_239 = (_shadowCoord_237.xy / _shadowCoord_237.w); bool tmpvar_240; @@ -942,7 +1017,9 @@ void main () if (tmpvar_240) { tmpvar_238 = 1.0; } else { - tmpvar_238 = float((dot (texture2D (u_shadowMap2, tmpvar_239), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_237.z - u_params1.x) / _shadowCoord_237.w))); + tmpvar_238 = float((dot (texture2D (u_shadowMap2, tmpvar_239), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_237.z - u_params1.x) + / _shadowCoord_237.w))); }; result_199 = (result_199 + tmpvar_238); vec4 tmpvar_241; @@ -950,7 +1027,7 @@ void main () tmpvar_241.xy = (vec2(0.5, -1.5) * tmpvar_200); vec4 _shadowCoord_242; _shadowCoord_242 = (v_texcoord3 + tmpvar_241); - float tmpvar_243; + lowp float tmpvar_243; vec2 tmpvar_244; tmpvar_244 = (_shadowCoord_242.xy / _shadowCoord_242.w); bool tmpvar_245; @@ -962,7 +1039,9 @@ void main () if (tmpvar_245) { tmpvar_243 = 1.0; } else { - tmpvar_243 = float((dot (texture2D (u_shadowMap2, tmpvar_244), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_242.z - u_params1.x) / _shadowCoord_242.w))); + tmpvar_243 = float((dot (texture2D (u_shadowMap2, tmpvar_244), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_242.z - u_params1.x) + / _shadowCoord_242.w))); }; result_199 = (result_199 + tmpvar_243); vec4 tmpvar_246; @@ -970,7 +1049,7 @@ void main () tmpvar_246.xy = (vec2(0.5, -0.5) * tmpvar_200); vec4 _shadowCoord_247; _shadowCoord_247 = (v_texcoord3 + tmpvar_246); - float tmpvar_248; + lowp float tmpvar_248; vec2 tmpvar_249; tmpvar_249 = (_shadowCoord_247.xy / _shadowCoord_247.w); bool tmpvar_250; @@ -982,7 +1061,9 @@ void main () if (tmpvar_250) { tmpvar_248 = 1.0; } else { - tmpvar_248 = float((dot (texture2D (u_shadowMap2, tmpvar_249), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_247.z - u_params1.x) / _shadowCoord_247.w))); + tmpvar_248 = float((dot (texture2D (u_shadowMap2, tmpvar_249), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_247.z - u_params1.x) + / _shadowCoord_247.w))); }; result_199 = (result_199 + tmpvar_248); vec4 tmpvar_251; @@ -990,7 +1071,7 @@ void main () tmpvar_251.xy = (vec2(0.5, 0.5) * tmpvar_200); vec4 _shadowCoord_252; _shadowCoord_252 = (v_texcoord3 + tmpvar_251); - float tmpvar_253; + lowp float tmpvar_253; vec2 tmpvar_254; tmpvar_254 = (_shadowCoord_252.xy / _shadowCoord_252.w); bool tmpvar_255; @@ -1002,7 +1083,9 @@ void main () if (tmpvar_255) { tmpvar_253 = 1.0; } else { - tmpvar_253 = float((dot (texture2D (u_shadowMap2, tmpvar_254), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_252.z - u_params1.x) / _shadowCoord_252.w))); + tmpvar_253 = float((dot (texture2D (u_shadowMap2, tmpvar_254), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_252.z - u_params1.x) + / _shadowCoord_252.w))); }; result_199 = (result_199 + tmpvar_253); vec4 tmpvar_256; @@ -1010,7 +1093,7 @@ void main () tmpvar_256.xy = (vec2(0.5, 1.5) * tmpvar_200); vec4 _shadowCoord_257; _shadowCoord_257 = (v_texcoord3 + tmpvar_256); - float tmpvar_258; + lowp float tmpvar_258; vec2 tmpvar_259; tmpvar_259 = (_shadowCoord_257.xy / _shadowCoord_257.w); bool tmpvar_260; @@ -1022,7 +1105,9 @@ void main () if (tmpvar_260) { tmpvar_258 = 1.0; } else { - tmpvar_258 = float((dot (texture2D (u_shadowMap2, tmpvar_259), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_257.z - u_params1.x) / _shadowCoord_257.w))); + tmpvar_258 = float((dot (texture2D (u_shadowMap2, tmpvar_259), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_257.z - u_params1.x) + / _shadowCoord_257.w))); }; result_199 = (result_199 + tmpvar_258); vec4 tmpvar_261; @@ -1030,7 +1115,7 @@ void main () tmpvar_261.xy = (vec2(1.5, -1.5) * tmpvar_200); vec4 _shadowCoord_262; _shadowCoord_262 = (v_texcoord3 + tmpvar_261); - float tmpvar_263; + lowp float tmpvar_263; vec2 tmpvar_264; tmpvar_264 = (_shadowCoord_262.xy / _shadowCoord_262.w); bool tmpvar_265; @@ -1042,7 +1127,9 @@ void main () if (tmpvar_265) { tmpvar_263 = 1.0; } else { - tmpvar_263 = float((dot (texture2D (u_shadowMap2, tmpvar_264), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_262.z - u_params1.x) / _shadowCoord_262.w))); + tmpvar_263 = float((dot (texture2D (u_shadowMap2, tmpvar_264), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_262.z - u_params1.x) + / _shadowCoord_262.w))); }; result_199 = (result_199 + tmpvar_263); vec4 tmpvar_266; @@ -1050,7 +1137,7 @@ void main () tmpvar_266.xy = (vec2(1.5, -0.5) * tmpvar_200); vec4 _shadowCoord_267; _shadowCoord_267 = (v_texcoord3 + tmpvar_266); - float tmpvar_268; + lowp float tmpvar_268; vec2 tmpvar_269; tmpvar_269 = (_shadowCoord_267.xy / _shadowCoord_267.w); bool tmpvar_270; @@ -1062,7 +1149,9 @@ void main () if (tmpvar_270) { tmpvar_268 = 1.0; } else { - tmpvar_268 = float((dot (texture2D (u_shadowMap2, tmpvar_269), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_267.z - u_params1.x) / _shadowCoord_267.w))); + tmpvar_268 = float((dot (texture2D (u_shadowMap2, tmpvar_269), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_267.z - u_params1.x) + / _shadowCoord_267.w))); }; result_199 = (result_199 + tmpvar_268); vec4 tmpvar_271; @@ -1070,7 +1159,7 @@ void main () tmpvar_271.xy = (vec2(1.5, 0.5) * tmpvar_200); vec4 _shadowCoord_272; _shadowCoord_272 = (v_texcoord3 + tmpvar_271); - float tmpvar_273; + lowp float tmpvar_273; vec2 tmpvar_274; tmpvar_274 = (_shadowCoord_272.xy / _shadowCoord_272.w); bool tmpvar_275; @@ -1082,7 +1171,9 @@ void main () if (tmpvar_275) { tmpvar_273 = 1.0; } else { - tmpvar_273 = float((dot (texture2D (u_shadowMap2, tmpvar_274), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_272.z - u_params1.x) / _shadowCoord_272.w))); + tmpvar_273 = float((dot (texture2D (u_shadowMap2, tmpvar_274), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_272.z - u_params1.x) + / _shadowCoord_272.w))); }; result_199 = (result_199 + tmpvar_273); vec4 tmpvar_276; @@ -1090,7 +1181,7 @@ void main () tmpvar_276.xy = (vec2(1.5, 1.5) * tmpvar_200); vec4 _shadowCoord_277; _shadowCoord_277 = (v_texcoord3 + tmpvar_276); - float tmpvar_278; + lowp float tmpvar_278; vec2 tmpvar_279; tmpvar_279 = (_shadowCoord_277.xy / _shadowCoord_277.w); bool tmpvar_280; @@ -1102,9 +1193,11 @@ void main () if (tmpvar_280) { tmpvar_278 = 1.0; } else { - tmpvar_278 = float((dot (texture2D (u_shadowMap2, tmpvar_279), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_277.z - u_params1.x) / _shadowCoord_277.w))); + tmpvar_278 = float((dot (texture2D (u_shadowMap2, tmpvar_279), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_277.z - u_params1.x) + / _shadowCoord_277.w))); }; - float tmpvar_281; + lowp float tmpvar_281; tmpvar_281 = (result_199 + tmpvar_278); result_199 = tmpvar_281; visibility_1 = (tmpvar_281 / 16.0); @@ -1121,14 +1214,14 @@ void main () } else { tmpvar_284 = bool(0); }; - float tmpvar_286; + lowp float tmpvar_286; tmpvar_286 = (float(tmpvar_284) * 0.4); - vec3 tmpvar_287; + lowp vec3 tmpvar_287; tmpvar_287.x = tmpvar_286; tmpvar_287.y = -(tmpvar_286); tmpvar_287.z = -(tmpvar_286); colorCoverage_2 = tmpvar_287; - float result_288; + lowp float result_288; result_288 = 0.0; vec2 tmpvar_289; tmpvar_289 = ((u_smSamplingParams.zw * (u_params2.zz / 4.0)) * v_texcoord4.w); @@ -1137,7 +1230,7 @@ void main () tmpvar_290.xy = (vec2(-1.5, -1.5) * tmpvar_289); vec4 _shadowCoord_291; _shadowCoord_291 = (v_texcoord4 + tmpvar_290); - float tmpvar_292; + lowp float tmpvar_292; vec2 tmpvar_293; tmpvar_293 = (_shadowCoord_291.xy / _shadowCoord_291.w); bool tmpvar_294; @@ -1149,7 +1242,9 @@ void main () if (tmpvar_294) { tmpvar_292 = 1.0; } else { - tmpvar_292 = float((dot (texture2D (u_shadowMap3, tmpvar_293), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_291.z - u_params1.x) / _shadowCoord_291.w))); + tmpvar_292 = float((dot (texture2D (u_shadowMap3, tmpvar_293), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_291.z - u_params1.x) + / _shadowCoord_291.w))); }; result_288 = tmpvar_292; vec4 tmpvar_295; @@ -1157,7 +1252,7 @@ void main () tmpvar_295.xy = (vec2(-1.5, -0.5) * tmpvar_289); vec4 _shadowCoord_296; _shadowCoord_296 = (v_texcoord4 + tmpvar_295); - float tmpvar_297; + lowp float tmpvar_297; vec2 tmpvar_298; tmpvar_298 = (_shadowCoord_296.xy / _shadowCoord_296.w); bool tmpvar_299; @@ -1169,7 +1264,9 @@ void main () if (tmpvar_299) { tmpvar_297 = 1.0; } else { - tmpvar_297 = float((dot (texture2D (u_shadowMap3, tmpvar_298), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_296.z - u_params1.x) / _shadowCoord_296.w))); + tmpvar_297 = float((dot (texture2D (u_shadowMap3, tmpvar_298), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_296.z - u_params1.x) + / _shadowCoord_296.w))); }; result_288 = (tmpvar_292 + tmpvar_297); vec4 tmpvar_300; @@ -1177,7 +1274,7 @@ void main () tmpvar_300.xy = (vec2(-1.5, 0.5) * tmpvar_289); vec4 _shadowCoord_301; _shadowCoord_301 = (v_texcoord4 + tmpvar_300); - float tmpvar_302; + lowp float tmpvar_302; vec2 tmpvar_303; tmpvar_303 = (_shadowCoord_301.xy / _shadowCoord_301.w); bool tmpvar_304; @@ -1189,7 +1286,9 @@ void main () if (tmpvar_304) { tmpvar_302 = 1.0; } else { - tmpvar_302 = float((dot (texture2D (u_shadowMap3, tmpvar_303), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_301.z - u_params1.x) / _shadowCoord_301.w))); + tmpvar_302 = float((dot (texture2D (u_shadowMap3, tmpvar_303), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_301.z - u_params1.x) + / _shadowCoord_301.w))); }; result_288 = (result_288 + tmpvar_302); vec4 tmpvar_305; @@ -1197,7 +1296,7 @@ void main () tmpvar_305.xy = (vec2(-1.5, 1.5) * tmpvar_289); vec4 _shadowCoord_306; _shadowCoord_306 = (v_texcoord4 + tmpvar_305); - float tmpvar_307; + lowp float tmpvar_307; vec2 tmpvar_308; tmpvar_308 = (_shadowCoord_306.xy / _shadowCoord_306.w); bool tmpvar_309; @@ -1209,7 +1308,9 @@ void main () if (tmpvar_309) { tmpvar_307 = 1.0; } else { - tmpvar_307 = float((dot (texture2D (u_shadowMap3, tmpvar_308), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_306.z - u_params1.x) / _shadowCoord_306.w))); + tmpvar_307 = float((dot (texture2D (u_shadowMap3, tmpvar_308), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_306.z - u_params1.x) + / _shadowCoord_306.w))); }; result_288 = (result_288 + tmpvar_307); vec4 tmpvar_310; @@ -1217,7 +1318,7 @@ void main () tmpvar_310.xy = (vec2(-0.5, -1.5) * tmpvar_289); vec4 _shadowCoord_311; _shadowCoord_311 = (v_texcoord4 + tmpvar_310); - float tmpvar_312; + lowp float tmpvar_312; vec2 tmpvar_313; tmpvar_313 = (_shadowCoord_311.xy / _shadowCoord_311.w); bool tmpvar_314; @@ -1229,7 +1330,9 @@ void main () if (tmpvar_314) { tmpvar_312 = 1.0; } else { - tmpvar_312 = float((dot (texture2D (u_shadowMap3, tmpvar_313), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_311.z - u_params1.x) / _shadowCoord_311.w))); + tmpvar_312 = float((dot (texture2D (u_shadowMap3, tmpvar_313), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_311.z - u_params1.x) + / _shadowCoord_311.w))); }; result_288 = (result_288 + tmpvar_312); vec4 tmpvar_315; @@ -1237,7 +1340,7 @@ void main () tmpvar_315.xy = (vec2(-0.5, -0.5) * tmpvar_289); vec4 _shadowCoord_316; _shadowCoord_316 = (v_texcoord4 + tmpvar_315); - float tmpvar_317; + lowp float tmpvar_317; vec2 tmpvar_318; tmpvar_318 = (_shadowCoord_316.xy / _shadowCoord_316.w); bool tmpvar_319; @@ -1249,7 +1352,9 @@ void main () if (tmpvar_319) { tmpvar_317 = 1.0; } else { - tmpvar_317 = float((dot (texture2D (u_shadowMap3, tmpvar_318), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_316.z - u_params1.x) / _shadowCoord_316.w))); + tmpvar_317 = float((dot (texture2D (u_shadowMap3, tmpvar_318), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_316.z - u_params1.x) + / _shadowCoord_316.w))); }; result_288 = (result_288 + tmpvar_317); vec4 tmpvar_320; @@ -1257,7 +1362,7 @@ void main () tmpvar_320.xy = (vec2(-0.5, 0.5) * tmpvar_289); vec4 _shadowCoord_321; _shadowCoord_321 = (v_texcoord4 + tmpvar_320); - float tmpvar_322; + lowp float tmpvar_322; vec2 tmpvar_323; tmpvar_323 = (_shadowCoord_321.xy / _shadowCoord_321.w); bool tmpvar_324; @@ -1269,7 +1374,9 @@ void main () if (tmpvar_324) { tmpvar_322 = 1.0; } else { - tmpvar_322 = float((dot (texture2D (u_shadowMap3, tmpvar_323), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_321.z - u_params1.x) / _shadowCoord_321.w))); + tmpvar_322 = float((dot (texture2D (u_shadowMap3, tmpvar_323), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_321.z - u_params1.x) + / _shadowCoord_321.w))); }; result_288 = (result_288 + tmpvar_322); vec4 tmpvar_325; @@ -1277,7 +1384,7 @@ void main () tmpvar_325.xy = (vec2(-0.5, 1.5) * tmpvar_289); vec4 _shadowCoord_326; _shadowCoord_326 = (v_texcoord4 + tmpvar_325); - float tmpvar_327; + lowp float tmpvar_327; vec2 tmpvar_328; tmpvar_328 = (_shadowCoord_326.xy / _shadowCoord_326.w); bool tmpvar_329; @@ -1289,7 +1396,9 @@ void main () if (tmpvar_329) { tmpvar_327 = 1.0; } else { - tmpvar_327 = float((dot (texture2D (u_shadowMap3, tmpvar_328), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_326.z - u_params1.x) / _shadowCoord_326.w))); + tmpvar_327 = float((dot (texture2D (u_shadowMap3, tmpvar_328), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_326.z - u_params1.x) + / _shadowCoord_326.w))); }; result_288 = (result_288 + tmpvar_327); vec4 tmpvar_330; @@ -1297,7 +1406,7 @@ void main () tmpvar_330.xy = (vec2(0.5, -1.5) * tmpvar_289); vec4 _shadowCoord_331; _shadowCoord_331 = (v_texcoord4 + tmpvar_330); - float tmpvar_332; + lowp float tmpvar_332; vec2 tmpvar_333; tmpvar_333 = (_shadowCoord_331.xy / _shadowCoord_331.w); bool tmpvar_334; @@ -1309,7 +1418,9 @@ void main () if (tmpvar_334) { tmpvar_332 = 1.0; } else { - tmpvar_332 = float((dot (texture2D (u_shadowMap3, tmpvar_333), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_331.z - u_params1.x) / _shadowCoord_331.w))); + tmpvar_332 = float((dot (texture2D (u_shadowMap3, tmpvar_333), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_331.z - u_params1.x) + / _shadowCoord_331.w))); }; result_288 = (result_288 + tmpvar_332); vec4 tmpvar_335; @@ -1317,7 +1428,7 @@ void main () tmpvar_335.xy = (vec2(0.5, -0.5) * tmpvar_289); vec4 _shadowCoord_336; _shadowCoord_336 = (v_texcoord4 + tmpvar_335); - float tmpvar_337; + lowp float tmpvar_337; vec2 tmpvar_338; tmpvar_338 = (_shadowCoord_336.xy / _shadowCoord_336.w); bool tmpvar_339; @@ -1329,7 +1440,9 @@ void main () if (tmpvar_339) { tmpvar_337 = 1.0; } else { - tmpvar_337 = float((dot (texture2D (u_shadowMap3, tmpvar_338), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_336.z - u_params1.x) / _shadowCoord_336.w))); + tmpvar_337 = float((dot (texture2D (u_shadowMap3, tmpvar_338), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_336.z - u_params1.x) + / _shadowCoord_336.w))); }; result_288 = (result_288 + tmpvar_337); vec4 tmpvar_340; @@ -1337,7 +1450,7 @@ void main () tmpvar_340.xy = (vec2(0.5, 0.5) * tmpvar_289); vec4 _shadowCoord_341; _shadowCoord_341 = (v_texcoord4 + tmpvar_340); - float tmpvar_342; + lowp float tmpvar_342; vec2 tmpvar_343; tmpvar_343 = (_shadowCoord_341.xy / _shadowCoord_341.w); bool tmpvar_344; @@ -1349,7 +1462,9 @@ void main () if (tmpvar_344) { tmpvar_342 = 1.0; } else { - tmpvar_342 = float((dot (texture2D (u_shadowMap3, tmpvar_343), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_341.z - u_params1.x) / _shadowCoord_341.w))); + tmpvar_342 = float((dot (texture2D (u_shadowMap3, tmpvar_343), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_341.z - u_params1.x) + / _shadowCoord_341.w))); }; result_288 = (result_288 + tmpvar_342); vec4 tmpvar_345; @@ -1357,7 +1472,7 @@ void main () tmpvar_345.xy = (vec2(0.5, 1.5) * tmpvar_289); vec4 _shadowCoord_346; _shadowCoord_346 = (v_texcoord4 + tmpvar_345); - float tmpvar_347; + lowp float tmpvar_347; vec2 tmpvar_348; tmpvar_348 = (_shadowCoord_346.xy / _shadowCoord_346.w); bool tmpvar_349; @@ -1369,7 +1484,9 @@ void main () if (tmpvar_349) { tmpvar_347 = 1.0; } else { - tmpvar_347 = float((dot (texture2D (u_shadowMap3, tmpvar_348), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_346.z - u_params1.x) / _shadowCoord_346.w))); + tmpvar_347 = float((dot (texture2D (u_shadowMap3, tmpvar_348), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_346.z - u_params1.x) + / _shadowCoord_346.w))); }; result_288 = (result_288 + tmpvar_347); vec4 tmpvar_350; @@ -1377,7 +1494,7 @@ void main () tmpvar_350.xy = (vec2(1.5, -1.5) * tmpvar_289); vec4 _shadowCoord_351; _shadowCoord_351 = (v_texcoord4 + tmpvar_350); - float tmpvar_352; + lowp float tmpvar_352; vec2 tmpvar_353; tmpvar_353 = (_shadowCoord_351.xy / _shadowCoord_351.w); bool tmpvar_354; @@ -1389,7 +1506,9 @@ void main () if (tmpvar_354) { tmpvar_352 = 1.0; } else { - tmpvar_352 = float((dot (texture2D (u_shadowMap3, tmpvar_353), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_351.z - u_params1.x) / _shadowCoord_351.w))); + tmpvar_352 = float((dot (texture2D (u_shadowMap3, tmpvar_353), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_351.z - u_params1.x) + / _shadowCoord_351.w))); }; result_288 = (result_288 + tmpvar_352); vec4 tmpvar_355; @@ -1397,7 +1516,7 @@ void main () tmpvar_355.xy = (vec2(1.5, -0.5) * tmpvar_289); vec4 _shadowCoord_356; _shadowCoord_356 = (v_texcoord4 + tmpvar_355); - float tmpvar_357; + lowp float tmpvar_357; vec2 tmpvar_358; tmpvar_358 = (_shadowCoord_356.xy / _shadowCoord_356.w); bool tmpvar_359; @@ -1409,7 +1528,9 @@ void main () if (tmpvar_359) { tmpvar_357 = 1.0; } else { - tmpvar_357 = float((dot (texture2D (u_shadowMap3, tmpvar_358), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_356.z - u_params1.x) / _shadowCoord_356.w))); + tmpvar_357 = float((dot (texture2D (u_shadowMap3, tmpvar_358), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_356.z - u_params1.x) + / _shadowCoord_356.w))); }; result_288 = (result_288 + tmpvar_357); vec4 tmpvar_360; @@ -1417,7 +1538,7 @@ void main () tmpvar_360.xy = (vec2(1.5, 0.5) * tmpvar_289); vec4 _shadowCoord_361; _shadowCoord_361 = (v_texcoord4 + tmpvar_360); - float tmpvar_362; + lowp float tmpvar_362; vec2 tmpvar_363; tmpvar_363 = (_shadowCoord_361.xy / _shadowCoord_361.w); bool tmpvar_364; @@ -1429,7 +1550,9 @@ void main () if (tmpvar_364) { tmpvar_362 = 1.0; } else { - tmpvar_362 = float((dot (texture2D (u_shadowMap3, tmpvar_363), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_361.z - u_params1.x) / _shadowCoord_361.w))); + tmpvar_362 = float((dot (texture2D (u_shadowMap3, tmpvar_363), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_361.z - u_params1.x) + / _shadowCoord_361.w))); }; result_288 = (result_288 + tmpvar_362); vec4 tmpvar_365; @@ -1437,7 +1560,7 @@ void main () tmpvar_365.xy = (vec2(1.5, 1.5) * tmpvar_289); vec4 _shadowCoord_366; _shadowCoord_366 = (v_texcoord4 + tmpvar_365); - float tmpvar_367; + lowp float tmpvar_367; vec2 tmpvar_368; tmpvar_368 = (_shadowCoord_366.xy / _shadowCoord_366.w); bool tmpvar_369; @@ -1449,9 +1572,11 @@ void main () if (tmpvar_369) { tmpvar_367 = 1.0; } else { - tmpvar_367 = float((dot (texture2D (u_shadowMap3, tmpvar_368), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_366.z - u_params1.x) / _shadowCoord_366.w))); + tmpvar_367 = float((dot (texture2D (u_shadowMap3, tmpvar_368), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_366.z - u_params1.x) + / _shadowCoord_366.w))); }; - float tmpvar_370; + lowp float tmpvar_370; tmpvar_370 = (result_288 + tmpvar_367); result_288 = tmpvar_370; visibility_1 = (tmpvar_370 / 16.0); @@ -1474,18 +1599,48 @@ void main () tmpvar_376 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_377; tmpvar_377 = sqrt(dot (tmpvar_374, tmpvar_374)); - tmpvar_373 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_377)) + ((u_lightAttenuationSpotOuter.z * tmpvar_377) * tmpvar_377)))) * mix (clamp (((max (0.0, dot (-(tmpvar_375), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_376) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_376)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_373 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_377)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_377) * tmpvar_377) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_375) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_376) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_376)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_378; tmpvar_378 = dot (v_normal, tmpvar_372); vec2 tmpvar_379; tmpvar_379.x = tmpvar_378; - tmpvar_379.y = (((float((tmpvar_378 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_378) * v_normal) - tmpvar_372), tmpvar_371)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_379.y = ((( + float((tmpvar_378 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_378) * v_normal) + - tmpvar_372), tmpvar_371)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_380; tmpvar_380 = (max (tmpvar_379, 0.0) * tmpvar_373); float tmpvar_381; tmpvar_381 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_380.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_380.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_381) * tmpvar_381)))), 0.0, 1.0)); + lowp vec3 tmpvar_382; + tmpvar_382 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_380.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_380.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_381) * tmpvar_381)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_382; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin index 28b431e90..081c194ce 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear.bin @@ -1,24 +1,21 @@ -FSHpjH#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_shadowcoord; +FSHpjHprecision highp float; varying vec3 v_normal; +varying vec4 v_shadowcoord; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; void main () { vec2 _texcoord_1; @@ -33,9 +30,9 @@ void main () } else { tmpvar_3 = bool(0); }; - float tmpvar_5; + lowp float tmpvar_5; tmpvar_5 = (float(tmpvar_3) * 0.3); - vec3 tmpvar_6; + lowp vec3 tmpvar_6; tmpvar_6.x = tmpvar_5; tmpvar_6.y = -(tmpvar_5); tmpvar_6.z = -(tmpvar_5); @@ -43,8 +40,8 @@ void main () tmpvar_7.w = 1.0; tmpvar_7.xy = (v_shadowcoord.xy / v_shadowcoord.w); tmpvar_7.z = v_shadowcoord.z; - float tmpvar_8; - float result_9; + lowp float tmpvar_8; + lowp float result_9; result_9 = 0.0; vec2 tmpvar_10; tmpvar_10 = (u_smSamplingParams.zw * u_params2.zz); @@ -53,7 +50,7 @@ void main () tmpvar_11.xy = (vec2(-1.5, -1.5) * tmpvar_10); vec4 _shadowCoord_12; _shadowCoord_12 = (tmpvar_7 + tmpvar_11); - float tmpvar_13; + lowp float tmpvar_13; vec2 tmpvar_14; tmpvar_14 = (_shadowCoord_12.xy / _shadowCoord_12.w); bool tmpvar_15; @@ -65,7 +62,9 @@ void main () if (tmpvar_15) { tmpvar_13 = 1.0; } else { - tmpvar_13 = float((dot (texture2D (u_shadowMap0, tmpvar_14), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_12.z - u_params1.x) / _shadowCoord_12.w))); + tmpvar_13 = float((dot (texture2D (u_shadowMap0, tmpvar_14), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_12.z - u_params1.x) + / _shadowCoord_12.w))); }; result_9 = tmpvar_13; vec4 tmpvar_16; @@ -73,7 +72,7 @@ void main () tmpvar_16.xy = (vec2(-1.5, -0.5) * tmpvar_10); vec4 _shadowCoord_17; _shadowCoord_17 = (tmpvar_7 + tmpvar_16); - float tmpvar_18; + lowp float tmpvar_18; vec2 tmpvar_19; tmpvar_19 = (_shadowCoord_17.xy / _shadowCoord_17.w); bool tmpvar_20; @@ -85,7 +84,9 @@ void main () if (tmpvar_20) { tmpvar_18 = 1.0; } else { - tmpvar_18 = float((dot (texture2D (u_shadowMap0, tmpvar_19), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_17.z - u_params1.x) / _shadowCoord_17.w))); + tmpvar_18 = float((dot (texture2D (u_shadowMap0, tmpvar_19), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_17.z - u_params1.x) + / _shadowCoord_17.w))); }; result_9 = (tmpvar_13 + tmpvar_18); vec4 tmpvar_21; @@ -93,7 +94,7 @@ void main () tmpvar_21.xy = (vec2(-1.5, 0.5) * tmpvar_10); vec4 _shadowCoord_22; _shadowCoord_22 = (tmpvar_7 + tmpvar_21); - float tmpvar_23; + lowp float tmpvar_23; vec2 tmpvar_24; tmpvar_24 = (_shadowCoord_22.xy / _shadowCoord_22.w); bool tmpvar_25; @@ -105,7 +106,9 @@ void main () if (tmpvar_25) { tmpvar_23 = 1.0; } else { - tmpvar_23 = float((dot (texture2D (u_shadowMap0, tmpvar_24), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_22.z - u_params1.x) / _shadowCoord_22.w))); + tmpvar_23 = float((dot (texture2D (u_shadowMap0, tmpvar_24), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_22.z - u_params1.x) + / _shadowCoord_22.w))); }; result_9 = (result_9 + tmpvar_23); vec4 tmpvar_26; @@ -113,7 +116,7 @@ void main () tmpvar_26.xy = (vec2(-1.5, 1.5) * tmpvar_10); vec4 _shadowCoord_27; _shadowCoord_27 = (tmpvar_7 + tmpvar_26); - float tmpvar_28; + lowp float tmpvar_28; vec2 tmpvar_29; tmpvar_29 = (_shadowCoord_27.xy / _shadowCoord_27.w); bool tmpvar_30; @@ -125,7 +128,9 @@ void main () if (tmpvar_30) { tmpvar_28 = 1.0; } else { - tmpvar_28 = float((dot (texture2D (u_shadowMap0, tmpvar_29), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_27.z - u_params1.x) / _shadowCoord_27.w))); + tmpvar_28 = float((dot (texture2D (u_shadowMap0, tmpvar_29), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_27.z - u_params1.x) + / _shadowCoord_27.w))); }; result_9 = (result_9 + tmpvar_28); vec4 tmpvar_31; @@ -133,7 +138,7 @@ void main () tmpvar_31.xy = (vec2(-0.5, -1.5) * tmpvar_10); vec4 _shadowCoord_32; _shadowCoord_32 = (tmpvar_7 + tmpvar_31); - float tmpvar_33; + lowp float tmpvar_33; vec2 tmpvar_34; tmpvar_34 = (_shadowCoord_32.xy / _shadowCoord_32.w); bool tmpvar_35; @@ -145,7 +150,9 @@ void main () if (tmpvar_35) { tmpvar_33 = 1.0; } else { - tmpvar_33 = float((dot (texture2D (u_shadowMap0, tmpvar_34), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_32.z - u_params1.x) / _shadowCoord_32.w))); + tmpvar_33 = float((dot (texture2D (u_shadowMap0, tmpvar_34), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_32.z - u_params1.x) + / _shadowCoord_32.w))); }; result_9 = (result_9 + tmpvar_33); vec4 tmpvar_36; @@ -153,7 +160,7 @@ void main () tmpvar_36.xy = (vec2(-0.5, -0.5) * tmpvar_10); vec4 _shadowCoord_37; _shadowCoord_37 = (tmpvar_7 + tmpvar_36); - float tmpvar_38; + lowp float tmpvar_38; vec2 tmpvar_39; tmpvar_39 = (_shadowCoord_37.xy / _shadowCoord_37.w); bool tmpvar_40; @@ -165,7 +172,9 @@ void main () if (tmpvar_40) { tmpvar_38 = 1.0; } else { - tmpvar_38 = float((dot (texture2D (u_shadowMap0, tmpvar_39), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_37.z - u_params1.x) / _shadowCoord_37.w))); + tmpvar_38 = float((dot (texture2D (u_shadowMap0, tmpvar_39), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_37.z - u_params1.x) + / _shadowCoord_37.w))); }; result_9 = (result_9 + tmpvar_38); vec4 tmpvar_41; @@ -173,7 +182,7 @@ void main () tmpvar_41.xy = (vec2(-0.5, 0.5) * tmpvar_10); vec4 _shadowCoord_42; _shadowCoord_42 = (tmpvar_7 + tmpvar_41); - float tmpvar_43; + lowp float tmpvar_43; vec2 tmpvar_44; tmpvar_44 = (_shadowCoord_42.xy / _shadowCoord_42.w); bool tmpvar_45; @@ -185,7 +194,9 @@ void main () if (tmpvar_45) { tmpvar_43 = 1.0; } else { - tmpvar_43 = float((dot (texture2D (u_shadowMap0, tmpvar_44), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_42.z - u_params1.x) / _shadowCoord_42.w))); + tmpvar_43 = float((dot (texture2D (u_shadowMap0, tmpvar_44), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_42.z - u_params1.x) + / _shadowCoord_42.w))); }; result_9 = (result_9 + tmpvar_43); vec4 tmpvar_46; @@ -193,7 +204,7 @@ void main () tmpvar_46.xy = (vec2(-0.5, 1.5) * tmpvar_10); vec4 _shadowCoord_47; _shadowCoord_47 = (tmpvar_7 + tmpvar_46); - float tmpvar_48; + lowp float tmpvar_48; vec2 tmpvar_49; tmpvar_49 = (_shadowCoord_47.xy / _shadowCoord_47.w); bool tmpvar_50; @@ -205,7 +216,9 @@ void main () if (tmpvar_50) { tmpvar_48 = 1.0; } else { - tmpvar_48 = float((dot (texture2D (u_shadowMap0, tmpvar_49), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_47.z - u_params1.x) / _shadowCoord_47.w))); + tmpvar_48 = float((dot (texture2D (u_shadowMap0, tmpvar_49), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_47.z - u_params1.x) + / _shadowCoord_47.w))); }; result_9 = (result_9 + tmpvar_48); vec4 tmpvar_51; @@ -213,7 +226,7 @@ void main () tmpvar_51.xy = (vec2(0.5, -1.5) * tmpvar_10); vec4 _shadowCoord_52; _shadowCoord_52 = (tmpvar_7 + tmpvar_51); - float tmpvar_53; + lowp float tmpvar_53; vec2 tmpvar_54; tmpvar_54 = (_shadowCoord_52.xy / _shadowCoord_52.w); bool tmpvar_55; @@ -225,7 +238,9 @@ void main () if (tmpvar_55) { tmpvar_53 = 1.0; } else { - tmpvar_53 = float((dot (texture2D (u_shadowMap0, tmpvar_54), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_52.z - u_params1.x) / _shadowCoord_52.w))); + tmpvar_53 = float((dot (texture2D (u_shadowMap0, tmpvar_54), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_52.z - u_params1.x) + / _shadowCoord_52.w))); }; result_9 = (result_9 + tmpvar_53); vec4 tmpvar_56; @@ -233,7 +248,7 @@ void main () tmpvar_56.xy = (vec2(0.5, -0.5) * tmpvar_10); vec4 _shadowCoord_57; _shadowCoord_57 = (tmpvar_7 + tmpvar_56); - float tmpvar_58; + lowp float tmpvar_58; vec2 tmpvar_59; tmpvar_59 = (_shadowCoord_57.xy / _shadowCoord_57.w); bool tmpvar_60; @@ -245,7 +260,9 @@ void main () if (tmpvar_60) { tmpvar_58 = 1.0; } else { - tmpvar_58 = float((dot (texture2D (u_shadowMap0, tmpvar_59), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_57.z - u_params1.x) / _shadowCoord_57.w))); + tmpvar_58 = float((dot (texture2D (u_shadowMap0, tmpvar_59), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_57.z - u_params1.x) + / _shadowCoord_57.w))); }; result_9 = (result_9 + tmpvar_58); vec4 tmpvar_61; @@ -253,7 +270,7 @@ void main () tmpvar_61.xy = (vec2(0.5, 0.5) * tmpvar_10); vec4 _shadowCoord_62; _shadowCoord_62 = (tmpvar_7 + tmpvar_61); - float tmpvar_63; + lowp float tmpvar_63; vec2 tmpvar_64; tmpvar_64 = (_shadowCoord_62.xy / _shadowCoord_62.w); bool tmpvar_65; @@ -265,7 +282,9 @@ void main () if (tmpvar_65) { tmpvar_63 = 1.0; } else { - tmpvar_63 = float((dot (texture2D (u_shadowMap0, tmpvar_64), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_62.z - u_params1.x) / _shadowCoord_62.w))); + tmpvar_63 = float((dot (texture2D (u_shadowMap0, tmpvar_64), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_62.z - u_params1.x) + / _shadowCoord_62.w))); }; result_9 = (result_9 + tmpvar_63); vec4 tmpvar_66; @@ -273,7 +292,7 @@ void main () tmpvar_66.xy = (vec2(0.5, 1.5) * tmpvar_10); vec4 _shadowCoord_67; _shadowCoord_67 = (tmpvar_7 + tmpvar_66); - float tmpvar_68; + lowp float tmpvar_68; vec2 tmpvar_69; tmpvar_69 = (_shadowCoord_67.xy / _shadowCoord_67.w); bool tmpvar_70; @@ -285,7 +304,9 @@ void main () if (tmpvar_70) { tmpvar_68 = 1.0; } else { - tmpvar_68 = float((dot (texture2D (u_shadowMap0, tmpvar_69), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_67.z - u_params1.x) / _shadowCoord_67.w))); + tmpvar_68 = float((dot (texture2D (u_shadowMap0, tmpvar_69), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_67.z - u_params1.x) + / _shadowCoord_67.w))); }; result_9 = (result_9 + tmpvar_68); vec4 tmpvar_71; @@ -293,7 +314,7 @@ void main () tmpvar_71.xy = (vec2(1.5, -1.5) * tmpvar_10); vec4 _shadowCoord_72; _shadowCoord_72 = (tmpvar_7 + tmpvar_71); - float tmpvar_73; + lowp float tmpvar_73; vec2 tmpvar_74; tmpvar_74 = (_shadowCoord_72.xy / _shadowCoord_72.w); bool tmpvar_75; @@ -305,7 +326,9 @@ void main () if (tmpvar_75) { tmpvar_73 = 1.0; } else { - tmpvar_73 = float((dot (texture2D (u_shadowMap0, tmpvar_74), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_72.z - u_params1.x) / _shadowCoord_72.w))); + tmpvar_73 = float((dot (texture2D (u_shadowMap0, tmpvar_74), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_72.z - u_params1.x) + / _shadowCoord_72.w))); }; result_9 = (result_9 + tmpvar_73); vec4 tmpvar_76; @@ -313,7 +336,7 @@ void main () tmpvar_76.xy = (vec2(1.5, -0.5) * tmpvar_10); vec4 _shadowCoord_77; _shadowCoord_77 = (tmpvar_7 + tmpvar_76); - float tmpvar_78; + lowp float tmpvar_78; vec2 tmpvar_79; tmpvar_79 = (_shadowCoord_77.xy / _shadowCoord_77.w); bool tmpvar_80; @@ -325,7 +348,9 @@ void main () if (tmpvar_80) { tmpvar_78 = 1.0; } else { - tmpvar_78 = float((dot (texture2D (u_shadowMap0, tmpvar_79), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_77.z - u_params1.x) / _shadowCoord_77.w))); + tmpvar_78 = float((dot (texture2D (u_shadowMap0, tmpvar_79), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_77.z - u_params1.x) + / _shadowCoord_77.w))); }; result_9 = (result_9 + tmpvar_78); vec4 tmpvar_81; @@ -333,7 +358,7 @@ void main () tmpvar_81.xy = (vec2(1.5, 0.5) * tmpvar_10); vec4 _shadowCoord_82; _shadowCoord_82 = (tmpvar_7 + tmpvar_81); - float tmpvar_83; + lowp float tmpvar_83; vec2 tmpvar_84; tmpvar_84 = (_shadowCoord_82.xy / _shadowCoord_82.w); bool tmpvar_85; @@ -345,7 +370,9 @@ void main () if (tmpvar_85) { tmpvar_83 = 1.0; } else { - tmpvar_83 = float((dot (texture2D (u_shadowMap0, tmpvar_84), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_82.z - u_params1.x) / _shadowCoord_82.w))); + tmpvar_83 = float((dot (texture2D (u_shadowMap0, tmpvar_84), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_82.z - u_params1.x) + / _shadowCoord_82.w))); }; result_9 = (result_9 + tmpvar_83); vec4 tmpvar_86; @@ -353,7 +380,7 @@ void main () tmpvar_86.xy = (vec2(1.5, 1.5) * tmpvar_10); vec4 _shadowCoord_87; _shadowCoord_87 = (tmpvar_7 + tmpvar_86); - float tmpvar_88; + lowp float tmpvar_88; vec2 tmpvar_89; tmpvar_89 = (_shadowCoord_87.xy / _shadowCoord_87.w); bool tmpvar_90; @@ -365,9 +392,11 @@ void main () if (tmpvar_90) { tmpvar_88 = 1.0; } else { - tmpvar_88 = float((dot (texture2D (u_shadowMap0, tmpvar_89), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_87.z - u_params1.x) / _shadowCoord_87.w))); + tmpvar_88 = float((dot (texture2D (u_shadowMap0, tmpvar_89), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_87.z - u_params1.x) + / _shadowCoord_87.w))); }; - float tmpvar_91; + lowp float tmpvar_91; tmpvar_91 = (result_9 + tmpvar_88); result_9 = tmpvar_91; tmpvar_8 = (tmpvar_91 / 16.0); @@ -387,18 +416,48 @@ void main () tmpvar_97 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_98; tmpvar_98 = sqrt(dot (tmpvar_95, tmpvar_95)); - tmpvar_94 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_98)) + ((u_lightAttenuationSpotOuter.z * tmpvar_98) * tmpvar_98)))) * mix (clamp (((max (0.0, dot (-(tmpvar_96), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_97) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_97)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_94 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_98)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_98) * tmpvar_98) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_96) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_97) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_97)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_99; tmpvar_99 = dot (v_normal, tmpvar_93); vec2 tmpvar_100; tmpvar_100.x = tmpvar_99; - tmpvar_100.y = (((float((tmpvar_99 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_99) * v_normal) - tmpvar_93), tmpvar_92)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_100.y = ((( + float((tmpvar_99 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_99) * v_normal) + - tmpvar_93), tmpvar_92)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_101; tmpvar_101 = (max (tmpvar_100, 0.0) * tmpvar_94); float tmpvar_102; tmpvar_102 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_101.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_101.y)) * u_color.xyz) * tmpvar_8))), vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_102) * tmpvar_102)))), 0.0, 1.0)); + lowp vec3 tmpvar_103; + tmpvar_103 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_101.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_101.y)) + * u_color.xyz) * tmpvar_8))) + , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_102) * tmpvar_102)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_103; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin index f00fc32f5..2c5da82a4 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_csm.bin @@ -1,34 +1,31 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -78,9 +75,9 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); @@ -89,7 +86,7 @@ void main () tmpvar_21.w = 1.0; tmpvar_21.xy = (v_texcoord1.xy / v_texcoord1.w); tmpvar_21.z = v_texcoord1.z; - float result_22; + lowp float result_22; result_22 = 0.0; vec2 tmpvar_23; tmpvar_23 = (u_smSamplingParams.zw * u_params2.zz); @@ -98,7 +95,7 @@ void main () tmpvar_24.xy = (vec2(-1.5, -1.5) * tmpvar_23); vec4 _shadowCoord_25; _shadowCoord_25 = (tmpvar_21 + tmpvar_24); - float tmpvar_26; + lowp float tmpvar_26; vec2 tmpvar_27; tmpvar_27 = (_shadowCoord_25.xy / _shadowCoord_25.w); bool tmpvar_28; @@ -110,7 +107,9 @@ void main () if (tmpvar_28) { tmpvar_26 = 1.0; } else { - tmpvar_26 = float((dot (texture2D (u_shadowMap0, tmpvar_27), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_25.z - u_params1.x) / _shadowCoord_25.w))); + tmpvar_26 = float((dot (texture2D (u_shadowMap0, tmpvar_27), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_25.z - u_params1.x) + / _shadowCoord_25.w))); }; result_22 = tmpvar_26; vec4 tmpvar_29; @@ -118,7 +117,7 @@ void main () tmpvar_29.xy = (vec2(-1.5, -0.5) * tmpvar_23); vec4 _shadowCoord_30; _shadowCoord_30 = (tmpvar_21 + tmpvar_29); - float tmpvar_31; + lowp float tmpvar_31; vec2 tmpvar_32; tmpvar_32 = (_shadowCoord_30.xy / _shadowCoord_30.w); bool tmpvar_33; @@ -130,7 +129,9 @@ void main () if (tmpvar_33) { tmpvar_31 = 1.0; } else { - tmpvar_31 = float((dot (texture2D (u_shadowMap0, tmpvar_32), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_30.z - u_params1.x) / _shadowCoord_30.w))); + tmpvar_31 = float((dot (texture2D (u_shadowMap0, tmpvar_32), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_30.z - u_params1.x) + / _shadowCoord_30.w))); }; result_22 = (tmpvar_26 + tmpvar_31); vec4 tmpvar_34; @@ -138,7 +139,7 @@ void main () tmpvar_34.xy = (vec2(-1.5, 0.5) * tmpvar_23); vec4 _shadowCoord_35; _shadowCoord_35 = (tmpvar_21 + tmpvar_34); - float tmpvar_36; + lowp float tmpvar_36; vec2 tmpvar_37; tmpvar_37 = (_shadowCoord_35.xy / _shadowCoord_35.w); bool tmpvar_38; @@ -150,7 +151,9 @@ void main () if (tmpvar_38) { tmpvar_36 = 1.0; } else { - tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_35.z - u_params1.x) / _shadowCoord_35.w))); + tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_35.z - u_params1.x) + / _shadowCoord_35.w))); }; result_22 = (result_22 + tmpvar_36); vec4 tmpvar_39; @@ -158,7 +161,7 @@ void main () tmpvar_39.xy = (vec2(-1.5, 1.5) * tmpvar_23); vec4 _shadowCoord_40; _shadowCoord_40 = (tmpvar_21 + tmpvar_39); - float tmpvar_41; + lowp float tmpvar_41; vec2 tmpvar_42; tmpvar_42 = (_shadowCoord_40.xy / _shadowCoord_40.w); bool tmpvar_43; @@ -170,7 +173,9 @@ void main () if (tmpvar_43) { tmpvar_41 = 1.0; } else { - tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_40.z - u_params1.x) / _shadowCoord_40.w))); + tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_40.z - u_params1.x) + / _shadowCoord_40.w))); }; result_22 = (result_22 + tmpvar_41); vec4 tmpvar_44; @@ -178,7 +183,7 @@ void main () tmpvar_44.xy = (vec2(-0.5, -1.5) * tmpvar_23); vec4 _shadowCoord_45; _shadowCoord_45 = (tmpvar_21 + tmpvar_44); - float tmpvar_46; + lowp float tmpvar_46; vec2 tmpvar_47; tmpvar_47 = (_shadowCoord_45.xy / _shadowCoord_45.w); bool tmpvar_48; @@ -190,7 +195,9 @@ void main () if (tmpvar_48) { tmpvar_46 = 1.0; } else { - tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_45.z - u_params1.x) / _shadowCoord_45.w))); + tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_45.z - u_params1.x) + / _shadowCoord_45.w))); }; result_22 = (result_22 + tmpvar_46); vec4 tmpvar_49; @@ -198,7 +205,7 @@ void main () tmpvar_49.xy = (vec2(-0.5, -0.5) * tmpvar_23); vec4 _shadowCoord_50; _shadowCoord_50 = (tmpvar_21 + tmpvar_49); - float tmpvar_51; + lowp float tmpvar_51; vec2 tmpvar_52; tmpvar_52 = (_shadowCoord_50.xy / _shadowCoord_50.w); bool tmpvar_53; @@ -210,7 +217,9 @@ void main () if (tmpvar_53) { tmpvar_51 = 1.0; } else { - tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_50.z - u_params1.x) / _shadowCoord_50.w))); + tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_50.z - u_params1.x) + / _shadowCoord_50.w))); }; result_22 = (result_22 + tmpvar_51); vec4 tmpvar_54; @@ -218,7 +227,7 @@ void main () tmpvar_54.xy = (vec2(-0.5, 0.5) * tmpvar_23); vec4 _shadowCoord_55; _shadowCoord_55 = (tmpvar_21 + tmpvar_54); - float tmpvar_56; + lowp float tmpvar_56; vec2 tmpvar_57; tmpvar_57 = (_shadowCoord_55.xy / _shadowCoord_55.w); bool tmpvar_58; @@ -230,7 +239,9 @@ void main () if (tmpvar_58) { tmpvar_56 = 1.0; } else { - tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_55.z - u_params1.x) / _shadowCoord_55.w))); + tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_55.z - u_params1.x) + / _shadowCoord_55.w))); }; result_22 = (result_22 + tmpvar_56); vec4 tmpvar_59; @@ -238,7 +249,7 @@ void main () tmpvar_59.xy = (vec2(-0.5, 1.5) * tmpvar_23); vec4 _shadowCoord_60; _shadowCoord_60 = (tmpvar_21 + tmpvar_59); - float tmpvar_61; + lowp float tmpvar_61; vec2 tmpvar_62; tmpvar_62 = (_shadowCoord_60.xy / _shadowCoord_60.w); bool tmpvar_63; @@ -250,7 +261,9 @@ void main () if (tmpvar_63) { tmpvar_61 = 1.0; } else { - tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_60.z - u_params1.x) / _shadowCoord_60.w))); + tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_60.z - u_params1.x) + / _shadowCoord_60.w))); }; result_22 = (result_22 + tmpvar_61); vec4 tmpvar_64; @@ -258,7 +271,7 @@ void main () tmpvar_64.xy = (vec2(0.5, -1.5) * tmpvar_23); vec4 _shadowCoord_65; _shadowCoord_65 = (tmpvar_21 + tmpvar_64); - float tmpvar_66; + lowp float tmpvar_66; vec2 tmpvar_67; tmpvar_67 = (_shadowCoord_65.xy / _shadowCoord_65.w); bool tmpvar_68; @@ -270,7 +283,9 @@ void main () if (tmpvar_68) { tmpvar_66 = 1.0; } else { - tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_65.z - u_params1.x) / _shadowCoord_65.w))); + tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_65.z - u_params1.x) + / _shadowCoord_65.w))); }; result_22 = (result_22 + tmpvar_66); vec4 tmpvar_69; @@ -278,7 +293,7 @@ void main () tmpvar_69.xy = (vec2(0.5, -0.5) * tmpvar_23); vec4 _shadowCoord_70; _shadowCoord_70 = (tmpvar_21 + tmpvar_69); - float tmpvar_71; + lowp float tmpvar_71; vec2 tmpvar_72; tmpvar_72 = (_shadowCoord_70.xy / _shadowCoord_70.w); bool tmpvar_73; @@ -290,7 +305,9 @@ void main () if (tmpvar_73) { tmpvar_71 = 1.0; } else { - tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_70.z - u_params1.x) / _shadowCoord_70.w))); + tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_70.z - u_params1.x) + / _shadowCoord_70.w))); }; result_22 = (result_22 + tmpvar_71); vec4 tmpvar_74; @@ -298,7 +315,7 @@ void main () tmpvar_74.xy = (vec2(0.5, 0.5) * tmpvar_23); vec4 _shadowCoord_75; _shadowCoord_75 = (tmpvar_21 + tmpvar_74); - float tmpvar_76; + lowp float tmpvar_76; vec2 tmpvar_77; tmpvar_77 = (_shadowCoord_75.xy / _shadowCoord_75.w); bool tmpvar_78; @@ -310,7 +327,9 @@ void main () if (tmpvar_78) { tmpvar_76 = 1.0; } else { - tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_75.z - u_params1.x) / _shadowCoord_75.w))); + tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_75.z - u_params1.x) + / _shadowCoord_75.w))); }; result_22 = (result_22 + tmpvar_76); vec4 tmpvar_79; @@ -318,7 +337,7 @@ void main () tmpvar_79.xy = (vec2(0.5, 1.5) * tmpvar_23); vec4 _shadowCoord_80; _shadowCoord_80 = (tmpvar_21 + tmpvar_79); - float tmpvar_81; + lowp float tmpvar_81; vec2 tmpvar_82; tmpvar_82 = (_shadowCoord_80.xy / _shadowCoord_80.w); bool tmpvar_83; @@ -330,7 +349,9 @@ void main () if (tmpvar_83) { tmpvar_81 = 1.0; } else { - tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_80.z - u_params1.x) / _shadowCoord_80.w))); + tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_80.z - u_params1.x) + / _shadowCoord_80.w))); }; result_22 = (result_22 + tmpvar_81); vec4 tmpvar_84; @@ -338,7 +359,7 @@ void main () tmpvar_84.xy = (vec2(1.5, -1.5) * tmpvar_23); vec4 _shadowCoord_85; _shadowCoord_85 = (tmpvar_21 + tmpvar_84); - float tmpvar_86; + lowp float tmpvar_86; vec2 tmpvar_87; tmpvar_87 = (_shadowCoord_85.xy / _shadowCoord_85.w); bool tmpvar_88; @@ -350,7 +371,9 @@ void main () if (tmpvar_88) { tmpvar_86 = 1.0; } else { - tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_85.z - u_params1.x) / _shadowCoord_85.w))); + tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_85.z - u_params1.x) + / _shadowCoord_85.w))); }; result_22 = (result_22 + tmpvar_86); vec4 tmpvar_89; @@ -358,7 +381,7 @@ void main () tmpvar_89.xy = (vec2(1.5, -0.5) * tmpvar_23); vec4 _shadowCoord_90; _shadowCoord_90 = (tmpvar_21 + tmpvar_89); - float tmpvar_91; + lowp float tmpvar_91; vec2 tmpvar_92; tmpvar_92 = (_shadowCoord_90.xy / _shadowCoord_90.w); bool tmpvar_93; @@ -370,7 +393,9 @@ void main () if (tmpvar_93) { tmpvar_91 = 1.0; } else { - tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_90.z - u_params1.x) / _shadowCoord_90.w))); + tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_90.z - u_params1.x) + / _shadowCoord_90.w))); }; result_22 = (result_22 + tmpvar_91); vec4 tmpvar_94; @@ -378,7 +403,7 @@ void main () tmpvar_94.xy = (vec2(1.5, 0.5) * tmpvar_23); vec4 _shadowCoord_95; _shadowCoord_95 = (tmpvar_21 + tmpvar_94); - float tmpvar_96; + lowp float tmpvar_96; vec2 tmpvar_97; tmpvar_97 = (_shadowCoord_95.xy / _shadowCoord_95.w); bool tmpvar_98; @@ -390,7 +415,9 @@ void main () if (tmpvar_98) { tmpvar_96 = 1.0; } else { - tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_95.z - u_params1.x) / _shadowCoord_95.w))); + tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_95.z - u_params1.x) + / _shadowCoord_95.w))); }; result_22 = (result_22 + tmpvar_96); vec4 tmpvar_99; @@ -398,7 +425,7 @@ void main () tmpvar_99.xy = (vec2(1.5, 1.5) * tmpvar_23); vec4 _shadowCoord_100; _shadowCoord_100 = (tmpvar_21 + tmpvar_99); - float tmpvar_101; + lowp float tmpvar_101; vec2 tmpvar_102; tmpvar_102 = (_shadowCoord_100.xy / _shadowCoord_100.w); bool tmpvar_103; @@ -410,9 +437,11 @@ void main () if (tmpvar_103) { tmpvar_101 = 1.0; } else { - tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_100.z - u_params1.x) / _shadowCoord_100.w))); + tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_100.z - u_params1.x) + / _shadowCoord_100.w))); }; - float tmpvar_104; + lowp float tmpvar_104; tmpvar_104 = (result_22 + tmpvar_101); result_22 = tmpvar_104; visibility_1 = (tmpvar_104 / 16.0); @@ -430,9 +459,9 @@ void main () } else { tmpvar_107 = bool(0); }; - float tmpvar_109; + lowp float tmpvar_109; tmpvar_109 = (float(tmpvar_107) * 0.4); - vec3 tmpvar_110; + lowp vec3 tmpvar_110; tmpvar_110.x = tmpvar_109; tmpvar_110.y = tmpvar_109; tmpvar_110.z = -(tmpvar_109); @@ -441,7 +470,7 @@ void main () tmpvar_111.w = 1.0; tmpvar_111.xy = (v_texcoord2.xy / v_texcoord2.w); tmpvar_111.z = v_texcoord2.z; - float result_112; + lowp float result_112; result_112 = 0.0; vec2 tmpvar_113; tmpvar_113 = (u_smSamplingParams.zw * (u_params2.zz / 2.0)); @@ -450,7 +479,7 @@ void main () tmpvar_114.xy = (vec2(-1.5, -1.5) * tmpvar_113); vec4 _shadowCoord_115; _shadowCoord_115 = (tmpvar_111 + tmpvar_114); - float tmpvar_116; + lowp float tmpvar_116; vec2 tmpvar_117; tmpvar_117 = (_shadowCoord_115.xy / _shadowCoord_115.w); bool tmpvar_118; @@ -462,7 +491,9 @@ void main () if (tmpvar_118) { tmpvar_116 = 1.0; } else { - tmpvar_116 = float((dot (texture2D (u_shadowMap1, tmpvar_117), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_115.z - u_params1.x) / _shadowCoord_115.w))); + tmpvar_116 = float((dot (texture2D (u_shadowMap1, tmpvar_117), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_115.z - u_params1.x) + / _shadowCoord_115.w))); }; result_112 = tmpvar_116; vec4 tmpvar_119; @@ -470,7 +501,7 @@ void main () tmpvar_119.xy = (vec2(-1.5, -0.5) * tmpvar_113); vec4 _shadowCoord_120; _shadowCoord_120 = (tmpvar_111 + tmpvar_119); - float tmpvar_121; + lowp float tmpvar_121; vec2 tmpvar_122; tmpvar_122 = (_shadowCoord_120.xy / _shadowCoord_120.w); bool tmpvar_123; @@ -482,7 +513,9 @@ void main () if (tmpvar_123) { tmpvar_121 = 1.0; } else { - tmpvar_121 = float((dot (texture2D (u_shadowMap1, tmpvar_122), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_120.z - u_params1.x) / _shadowCoord_120.w))); + tmpvar_121 = float((dot (texture2D (u_shadowMap1, tmpvar_122), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_120.z - u_params1.x) + / _shadowCoord_120.w))); }; result_112 = (tmpvar_116 + tmpvar_121); vec4 tmpvar_124; @@ -490,7 +523,7 @@ void main () tmpvar_124.xy = (vec2(-1.5, 0.5) * tmpvar_113); vec4 _shadowCoord_125; _shadowCoord_125 = (tmpvar_111 + tmpvar_124); - float tmpvar_126; + lowp float tmpvar_126; vec2 tmpvar_127; tmpvar_127 = (_shadowCoord_125.xy / _shadowCoord_125.w); bool tmpvar_128; @@ -502,7 +535,9 @@ void main () if (tmpvar_128) { tmpvar_126 = 1.0; } else { - tmpvar_126 = float((dot (texture2D (u_shadowMap1, tmpvar_127), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_125.z - u_params1.x) / _shadowCoord_125.w))); + tmpvar_126 = float((dot (texture2D (u_shadowMap1, tmpvar_127), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_125.z - u_params1.x) + / _shadowCoord_125.w))); }; result_112 = (result_112 + tmpvar_126); vec4 tmpvar_129; @@ -510,7 +545,7 @@ void main () tmpvar_129.xy = (vec2(-1.5, 1.5) * tmpvar_113); vec4 _shadowCoord_130; _shadowCoord_130 = (tmpvar_111 + tmpvar_129); - float tmpvar_131; + lowp float tmpvar_131; vec2 tmpvar_132; tmpvar_132 = (_shadowCoord_130.xy / _shadowCoord_130.w); bool tmpvar_133; @@ -522,7 +557,9 @@ void main () if (tmpvar_133) { tmpvar_131 = 1.0; } else { - tmpvar_131 = float((dot (texture2D (u_shadowMap1, tmpvar_132), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_130.z - u_params1.x) / _shadowCoord_130.w))); + tmpvar_131 = float((dot (texture2D (u_shadowMap1, tmpvar_132), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_130.z - u_params1.x) + / _shadowCoord_130.w))); }; result_112 = (result_112 + tmpvar_131); vec4 tmpvar_134; @@ -530,7 +567,7 @@ void main () tmpvar_134.xy = (vec2(-0.5, -1.5) * tmpvar_113); vec4 _shadowCoord_135; _shadowCoord_135 = (tmpvar_111 + tmpvar_134); - float tmpvar_136; + lowp float tmpvar_136; vec2 tmpvar_137; tmpvar_137 = (_shadowCoord_135.xy / _shadowCoord_135.w); bool tmpvar_138; @@ -542,7 +579,9 @@ void main () if (tmpvar_138) { tmpvar_136 = 1.0; } else { - tmpvar_136 = float((dot (texture2D (u_shadowMap1, tmpvar_137), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_135.z - u_params1.x) / _shadowCoord_135.w))); + tmpvar_136 = float((dot (texture2D (u_shadowMap1, tmpvar_137), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_135.z - u_params1.x) + / _shadowCoord_135.w))); }; result_112 = (result_112 + tmpvar_136); vec4 tmpvar_139; @@ -550,7 +589,7 @@ void main () tmpvar_139.xy = (vec2(-0.5, -0.5) * tmpvar_113); vec4 _shadowCoord_140; _shadowCoord_140 = (tmpvar_111 + tmpvar_139); - float tmpvar_141; + lowp float tmpvar_141; vec2 tmpvar_142; tmpvar_142 = (_shadowCoord_140.xy / _shadowCoord_140.w); bool tmpvar_143; @@ -562,7 +601,9 @@ void main () if (tmpvar_143) { tmpvar_141 = 1.0; } else { - tmpvar_141 = float((dot (texture2D (u_shadowMap1, tmpvar_142), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_140.z - u_params1.x) / _shadowCoord_140.w))); + tmpvar_141 = float((dot (texture2D (u_shadowMap1, tmpvar_142), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_140.z - u_params1.x) + / _shadowCoord_140.w))); }; result_112 = (result_112 + tmpvar_141); vec4 tmpvar_144; @@ -570,7 +611,7 @@ void main () tmpvar_144.xy = (vec2(-0.5, 0.5) * tmpvar_113); vec4 _shadowCoord_145; _shadowCoord_145 = (tmpvar_111 + tmpvar_144); - float tmpvar_146; + lowp float tmpvar_146; vec2 tmpvar_147; tmpvar_147 = (_shadowCoord_145.xy / _shadowCoord_145.w); bool tmpvar_148; @@ -582,7 +623,9 @@ void main () if (tmpvar_148) { tmpvar_146 = 1.0; } else { - tmpvar_146 = float((dot (texture2D (u_shadowMap1, tmpvar_147), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_145.z - u_params1.x) / _shadowCoord_145.w))); + tmpvar_146 = float((dot (texture2D (u_shadowMap1, tmpvar_147), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_145.z - u_params1.x) + / _shadowCoord_145.w))); }; result_112 = (result_112 + tmpvar_146); vec4 tmpvar_149; @@ -590,7 +633,7 @@ void main () tmpvar_149.xy = (vec2(-0.5, 1.5) * tmpvar_113); vec4 _shadowCoord_150; _shadowCoord_150 = (tmpvar_111 + tmpvar_149); - float tmpvar_151; + lowp float tmpvar_151; vec2 tmpvar_152; tmpvar_152 = (_shadowCoord_150.xy / _shadowCoord_150.w); bool tmpvar_153; @@ -602,7 +645,9 @@ void main () if (tmpvar_153) { tmpvar_151 = 1.0; } else { - tmpvar_151 = float((dot (texture2D (u_shadowMap1, tmpvar_152), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_150.z - u_params1.x) / _shadowCoord_150.w))); + tmpvar_151 = float((dot (texture2D (u_shadowMap1, tmpvar_152), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_150.z - u_params1.x) + / _shadowCoord_150.w))); }; result_112 = (result_112 + tmpvar_151); vec4 tmpvar_154; @@ -610,7 +655,7 @@ void main () tmpvar_154.xy = (vec2(0.5, -1.5) * tmpvar_113); vec4 _shadowCoord_155; _shadowCoord_155 = (tmpvar_111 + tmpvar_154); - float tmpvar_156; + lowp float tmpvar_156; vec2 tmpvar_157; tmpvar_157 = (_shadowCoord_155.xy / _shadowCoord_155.w); bool tmpvar_158; @@ -622,7 +667,9 @@ void main () if (tmpvar_158) { tmpvar_156 = 1.0; } else { - tmpvar_156 = float((dot (texture2D (u_shadowMap1, tmpvar_157), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_155.z - u_params1.x) / _shadowCoord_155.w))); + tmpvar_156 = float((dot (texture2D (u_shadowMap1, tmpvar_157), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_155.z - u_params1.x) + / _shadowCoord_155.w))); }; result_112 = (result_112 + tmpvar_156); vec4 tmpvar_159; @@ -630,7 +677,7 @@ void main () tmpvar_159.xy = (vec2(0.5, -0.5) * tmpvar_113); vec4 _shadowCoord_160; _shadowCoord_160 = (tmpvar_111 + tmpvar_159); - float tmpvar_161; + lowp float tmpvar_161; vec2 tmpvar_162; tmpvar_162 = (_shadowCoord_160.xy / _shadowCoord_160.w); bool tmpvar_163; @@ -642,7 +689,9 @@ void main () if (tmpvar_163) { tmpvar_161 = 1.0; } else { - tmpvar_161 = float((dot (texture2D (u_shadowMap1, tmpvar_162), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_160.z - u_params1.x) / _shadowCoord_160.w))); + tmpvar_161 = float((dot (texture2D (u_shadowMap1, tmpvar_162), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_160.z - u_params1.x) + / _shadowCoord_160.w))); }; result_112 = (result_112 + tmpvar_161); vec4 tmpvar_164; @@ -650,7 +699,7 @@ void main () tmpvar_164.xy = (vec2(0.5, 0.5) * tmpvar_113); vec4 _shadowCoord_165; _shadowCoord_165 = (tmpvar_111 + tmpvar_164); - float tmpvar_166; + lowp float tmpvar_166; vec2 tmpvar_167; tmpvar_167 = (_shadowCoord_165.xy / _shadowCoord_165.w); bool tmpvar_168; @@ -662,7 +711,9 @@ void main () if (tmpvar_168) { tmpvar_166 = 1.0; } else { - tmpvar_166 = float((dot (texture2D (u_shadowMap1, tmpvar_167), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_165.z - u_params1.x) / _shadowCoord_165.w))); + tmpvar_166 = float((dot (texture2D (u_shadowMap1, tmpvar_167), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_165.z - u_params1.x) + / _shadowCoord_165.w))); }; result_112 = (result_112 + tmpvar_166); vec4 tmpvar_169; @@ -670,7 +721,7 @@ void main () tmpvar_169.xy = (vec2(0.5, 1.5) * tmpvar_113); vec4 _shadowCoord_170; _shadowCoord_170 = (tmpvar_111 + tmpvar_169); - float tmpvar_171; + lowp float tmpvar_171; vec2 tmpvar_172; tmpvar_172 = (_shadowCoord_170.xy / _shadowCoord_170.w); bool tmpvar_173; @@ -682,7 +733,9 @@ void main () if (tmpvar_173) { tmpvar_171 = 1.0; } else { - tmpvar_171 = float((dot (texture2D (u_shadowMap1, tmpvar_172), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_170.z - u_params1.x) / _shadowCoord_170.w))); + tmpvar_171 = float((dot (texture2D (u_shadowMap1, tmpvar_172), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_170.z - u_params1.x) + / _shadowCoord_170.w))); }; result_112 = (result_112 + tmpvar_171); vec4 tmpvar_174; @@ -690,7 +743,7 @@ void main () tmpvar_174.xy = (vec2(1.5, -1.5) * tmpvar_113); vec4 _shadowCoord_175; _shadowCoord_175 = (tmpvar_111 + tmpvar_174); - float tmpvar_176; + lowp float tmpvar_176; vec2 tmpvar_177; tmpvar_177 = (_shadowCoord_175.xy / _shadowCoord_175.w); bool tmpvar_178; @@ -702,7 +755,9 @@ void main () if (tmpvar_178) { tmpvar_176 = 1.0; } else { - tmpvar_176 = float((dot (texture2D (u_shadowMap1, tmpvar_177), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_175.z - u_params1.x) / _shadowCoord_175.w))); + tmpvar_176 = float((dot (texture2D (u_shadowMap1, tmpvar_177), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_175.z - u_params1.x) + / _shadowCoord_175.w))); }; result_112 = (result_112 + tmpvar_176); vec4 tmpvar_179; @@ -710,7 +765,7 @@ void main () tmpvar_179.xy = (vec2(1.5, -0.5) * tmpvar_113); vec4 _shadowCoord_180; _shadowCoord_180 = (tmpvar_111 + tmpvar_179); - float tmpvar_181; + lowp float tmpvar_181; vec2 tmpvar_182; tmpvar_182 = (_shadowCoord_180.xy / _shadowCoord_180.w); bool tmpvar_183; @@ -722,7 +777,9 @@ void main () if (tmpvar_183) { tmpvar_181 = 1.0; } else { - tmpvar_181 = float((dot (texture2D (u_shadowMap1, tmpvar_182), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_180.z - u_params1.x) / _shadowCoord_180.w))); + tmpvar_181 = float((dot (texture2D (u_shadowMap1, tmpvar_182), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_180.z - u_params1.x) + / _shadowCoord_180.w))); }; result_112 = (result_112 + tmpvar_181); vec4 tmpvar_184; @@ -730,7 +787,7 @@ void main () tmpvar_184.xy = (vec2(1.5, 0.5) * tmpvar_113); vec4 _shadowCoord_185; _shadowCoord_185 = (tmpvar_111 + tmpvar_184); - float tmpvar_186; + lowp float tmpvar_186; vec2 tmpvar_187; tmpvar_187 = (_shadowCoord_185.xy / _shadowCoord_185.w); bool tmpvar_188; @@ -742,7 +799,9 @@ void main () if (tmpvar_188) { tmpvar_186 = 1.0; } else { - tmpvar_186 = float((dot (texture2D (u_shadowMap1, tmpvar_187), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_185.z - u_params1.x) / _shadowCoord_185.w))); + tmpvar_186 = float((dot (texture2D (u_shadowMap1, tmpvar_187), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_185.z - u_params1.x) + / _shadowCoord_185.w))); }; result_112 = (result_112 + tmpvar_186); vec4 tmpvar_189; @@ -750,7 +809,7 @@ void main () tmpvar_189.xy = (vec2(1.5, 1.5) * tmpvar_113); vec4 _shadowCoord_190; _shadowCoord_190 = (tmpvar_111 + tmpvar_189); - float tmpvar_191; + lowp float tmpvar_191; vec2 tmpvar_192; tmpvar_192 = (_shadowCoord_190.xy / _shadowCoord_190.w); bool tmpvar_193; @@ -762,9 +821,11 @@ void main () if (tmpvar_193) { tmpvar_191 = 1.0; } else { - tmpvar_191 = float((dot (texture2D (u_shadowMap1, tmpvar_192), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_190.z - u_params1.x) / _shadowCoord_190.w))); + tmpvar_191 = float((dot (texture2D (u_shadowMap1, tmpvar_192), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_190.z - u_params1.x) + / _shadowCoord_190.w))); }; - float tmpvar_194; + lowp float tmpvar_194; tmpvar_194 = (result_112 + tmpvar_191); result_112 = tmpvar_194; visibility_1 = (tmpvar_194 / 16.0); @@ -782,9 +843,9 @@ void main () } else { tmpvar_197 = bool(0); }; - float tmpvar_199; + lowp float tmpvar_199; tmpvar_199 = (float(tmpvar_197) * 0.4); - vec3 tmpvar_200; + lowp vec3 tmpvar_200; tmpvar_200.x = -(tmpvar_199); tmpvar_200.y = -(tmpvar_199); tmpvar_200.z = tmpvar_199; @@ -793,7 +854,7 @@ void main () tmpvar_201.w = 1.0; tmpvar_201.xy = (v_texcoord3.xy / v_texcoord3.w); tmpvar_201.z = v_texcoord3.z; - float result_202; + lowp float result_202; result_202 = 0.0; vec2 tmpvar_203; tmpvar_203 = (u_smSamplingParams.zw * (u_params2.zz / 3.0)); @@ -802,7 +863,7 @@ void main () tmpvar_204.xy = (vec2(-1.5, -1.5) * tmpvar_203); vec4 _shadowCoord_205; _shadowCoord_205 = (tmpvar_201 + tmpvar_204); - float tmpvar_206; + lowp float tmpvar_206; vec2 tmpvar_207; tmpvar_207 = (_shadowCoord_205.xy / _shadowCoord_205.w); bool tmpvar_208; @@ -814,7 +875,9 @@ void main () if (tmpvar_208) { tmpvar_206 = 1.0; } else { - tmpvar_206 = float((dot (texture2D (u_shadowMap2, tmpvar_207), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_205.z - u_params1.x) / _shadowCoord_205.w))); + tmpvar_206 = float((dot (texture2D (u_shadowMap2, tmpvar_207), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_205.z - u_params1.x) + / _shadowCoord_205.w))); }; result_202 = tmpvar_206; vec4 tmpvar_209; @@ -822,7 +885,7 @@ void main () tmpvar_209.xy = (vec2(-1.5, -0.5) * tmpvar_203); vec4 _shadowCoord_210; _shadowCoord_210 = (tmpvar_201 + tmpvar_209); - float tmpvar_211; + lowp float tmpvar_211; vec2 tmpvar_212; tmpvar_212 = (_shadowCoord_210.xy / _shadowCoord_210.w); bool tmpvar_213; @@ -834,7 +897,9 @@ void main () if (tmpvar_213) { tmpvar_211 = 1.0; } else { - tmpvar_211 = float((dot (texture2D (u_shadowMap2, tmpvar_212), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_210.z - u_params1.x) / _shadowCoord_210.w))); + tmpvar_211 = float((dot (texture2D (u_shadowMap2, tmpvar_212), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_210.z - u_params1.x) + / _shadowCoord_210.w))); }; result_202 = (tmpvar_206 + tmpvar_211); vec4 tmpvar_214; @@ -842,7 +907,7 @@ void main () tmpvar_214.xy = (vec2(-1.5, 0.5) * tmpvar_203); vec4 _shadowCoord_215; _shadowCoord_215 = (tmpvar_201 + tmpvar_214); - float tmpvar_216; + lowp float tmpvar_216; vec2 tmpvar_217; tmpvar_217 = (_shadowCoord_215.xy / _shadowCoord_215.w); bool tmpvar_218; @@ -854,7 +919,9 @@ void main () if (tmpvar_218) { tmpvar_216 = 1.0; } else { - tmpvar_216 = float((dot (texture2D (u_shadowMap2, tmpvar_217), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_215.z - u_params1.x) / _shadowCoord_215.w))); + tmpvar_216 = float((dot (texture2D (u_shadowMap2, tmpvar_217), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_215.z - u_params1.x) + / _shadowCoord_215.w))); }; result_202 = (result_202 + tmpvar_216); vec4 tmpvar_219; @@ -862,7 +929,7 @@ void main () tmpvar_219.xy = (vec2(-1.5, 1.5) * tmpvar_203); vec4 _shadowCoord_220; _shadowCoord_220 = (tmpvar_201 + tmpvar_219); - float tmpvar_221; + lowp float tmpvar_221; vec2 tmpvar_222; tmpvar_222 = (_shadowCoord_220.xy / _shadowCoord_220.w); bool tmpvar_223; @@ -874,7 +941,9 @@ void main () if (tmpvar_223) { tmpvar_221 = 1.0; } else { - tmpvar_221 = float((dot (texture2D (u_shadowMap2, tmpvar_222), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_220.z - u_params1.x) / _shadowCoord_220.w))); + tmpvar_221 = float((dot (texture2D (u_shadowMap2, tmpvar_222), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_220.z - u_params1.x) + / _shadowCoord_220.w))); }; result_202 = (result_202 + tmpvar_221); vec4 tmpvar_224; @@ -882,7 +951,7 @@ void main () tmpvar_224.xy = (vec2(-0.5, -1.5) * tmpvar_203); vec4 _shadowCoord_225; _shadowCoord_225 = (tmpvar_201 + tmpvar_224); - float tmpvar_226; + lowp float tmpvar_226; vec2 tmpvar_227; tmpvar_227 = (_shadowCoord_225.xy / _shadowCoord_225.w); bool tmpvar_228; @@ -894,7 +963,9 @@ void main () if (tmpvar_228) { tmpvar_226 = 1.0; } else { - tmpvar_226 = float((dot (texture2D (u_shadowMap2, tmpvar_227), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_225.z - u_params1.x) / _shadowCoord_225.w))); + tmpvar_226 = float((dot (texture2D (u_shadowMap2, tmpvar_227), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_225.z - u_params1.x) + / _shadowCoord_225.w))); }; result_202 = (result_202 + tmpvar_226); vec4 tmpvar_229; @@ -902,7 +973,7 @@ void main () tmpvar_229.xy = (vec2(-0.5, -0.5) * tmpvar_203); vec4 _shadowCoord_230; _shadowCoord_230 = (tmpvar_201 + tmpvar_229); - float tmpvar_231; + lowp float tmpvar_231; vec2 tmpvar_232; tmpvar_232 = (_shadowCoord_230.xy / _shadowCoord_230.w); bool tmpvar_233; @@ -914,7 +985,9 @@ void main () if (tmpvar_233) { tmpvar_231 = 1.0; } else { - tmpvar_231 = float((dot (texture2D (u_shadowMap2, tmpvar_232), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_230.z - u_params1.x) / _shadowCoord_230.w))); + tmpvar_231 = float((dot (texture2D (u_shadowMap2, tmpvar_232), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_230.z - u_params1.x) + / _shadowCoord_230.w))); }; result_202 = (result_202 + tmpvar_231); vec4 tmpvar_234; @@ -922,7 +995,7 @@ void main () tmpvar_234.xy = (vec2(-0.5, 0.5) * tmpvar_203); vec4 _shadowCoord_235; _shadowCoord_235 = (tmpvar_201 + tmpvar_234); - float tmpvar_236; + lowp float tmpvar_236; vec2 tmpvar_237; tmpvar_237 = (_shadowCoord_235.xy / _shadowCoord_235.w); bool tmpvar_238; @@ -934,7 +1007,9 @@ void main () if (tmpvar_238) { tmpvar_236 = 1.0; } else { - tmpvar_236 = float((dot (texture2D (u_shadowMap2, tmpvar_237), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_235.z - u_params1.x) / _shadowCoord_235.w))); + tmpvar_236 = float((dot (texture2D (u_shadowMap2, tmpvar_237), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_235.z - u_params1.x) + / _shadowCoord_235.w))); }; result_202 = (result_202 + tmpvar_236); vec4 tmpvar_239; @@ -942,7 +1017,7 @@ void main () tmpvar_239.xy = (vec2(-0.5, 1.5) * tmpvar_203); vec4 _shadowCoord_240; _shadowCoord_240 = (tmpvar_201 + tmpvar_239); - float tmpvar_241; + lowp float tmpvar_241; vec2 tmpvar_242; tmpvar_242 = (_shadowCoord_240.xy / _shadowCoord_240.w); bool tmpvar_243; @@ -954,7 +1029,9 @@ void main () if (tmpvar_243) { tmpvar_241 = 1.0; } else { - tmpvar_241 = float((dot (texture2D (u_shadowMap2, tmpvar_242), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_240.z - u_params1.x) / _shadowCoord_240.w))); + tmpvar_241 = float((dot (texture2D (u_shadowMap2, tmpvar_242), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_240.z - u_params1.x) + / _shadowCoord_240.w))); }; result_202 = (result_202 + tmpvar_241); vec4 tmpvar_244; @@ -962,7 +1039,7 @@ void main () tmpvar_244.xy = (vec2(0.5, -1.5) * tmpvar_203); vec4 _shadowCoord_245; _shadowCoord_245 = (tmpvar_201 + tmpvar_244); - float tmpvar_246; + lowp float tmpvar_246; vec2 tmpvar_247; tmpvar_247 = (_shadowCoord_245.xy / _shadowCoord_245.w); bool tmpvar_248; @@ -974,7 +1051,9 @@ void main () if (tmpvar_248) { tmpvar_246 = 1.0; } else { - tmpvar_246 = float((dot (texture2D (u_shadowMap2, tmpvar_247), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_245.z - u_params1.x) / _shadowCoord_245.w))); + tmpvar_246 = float((dot (texture2D (u_shadowMap2, tmpvar_247), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_245.z - u_params1.x) + / _shadowCoord_245.w))); }; result_202 = (result_202 + tmpvar_246); vec4 tmpvar_249; @@ -982,7 +1061,7 @@ void main () tmpvar_249.xy = (vec2(0.5, -0.5) * tmpvar_203); vec4 _shadowCoord_250; _shadowCoord_250 = (tmpvar_201 + tmpvar_249); - float tmpvar_251; + lowp float tmpvar_251; vec2 tmpvar_252; tmpvar_252 = (_shadowCoord_250.xy / _shadowCoord_250.w); bool tmpvar_253; @@ -994,7 +1073,9 @@ void main () if (tmpvar_253) { tmpvar_251 = 1.0; } else { - tmpvar_251 = float((dot (texture2D (u_shadowMap2, tmpvar_252), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_250.z - u_params1.x) / _shadowCoord_250.w))); + tmpvar_251 = float((dot (texture2D (u_shadowMap2, tmpvar_252), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_250.z - u_params1.x) + / _shadowCoord_250.w))); }; result_202 = (result_202 + tmpvar_251); vec4 tmpvar_254; @@ -1002,7 +1083,7 @@ void main () tmpvar_254.xy = (vec2(0.5, 0.5) * tmpvar_203); vec4 _shadowCoord_255; _shadowCoord_255 = (tmpvar_201 + tmpvar_254); - float tmpvar_256; + lowp float tmpvar_256; vec2 tmpvar_257; tmpvar_257 = (_shadowCoord_255.xy / _shadowCoord_255.w); bool tmpvar_258; @@ -1014,7 +1095,9 @@ void main () if (tmpvar_258) { tmpvar_256 = 1.0; } else { - tmpvar_256 = float((dot (texture2D (u_shadowMap2, tmpvar_257), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_255.z - u_params1.x) / _shadowCoord_255.w))); + tmpvar_256 = float((dot (texture2D (u_shadowMap2, tmpvar_257), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_255.z - u_params1.x) + / _shadowCoord_255.w))); }; result_202 = (result_202 + tmpvar_256); vec4 tmpvar_259; @@ -1022,7 +1105,7 @@ void main () tmpvar_259.xy = (vec2(0.5, 1.5) * tmpvar_203); vec4 _shadowCoord_260; _shadowCoord_260 = (tmpvar_201 + tmpvar_259); - float tmpvar_261; + lowp float tmpvar_261; vec2 tmpvar_262; tmpvar_262 = (_shadowCoord_260.xy / _shadowCoord_260.w); bool tmpvar_263; @@ -1034,7 +1117,9 @@ void main () if (tmpvar_263) { tmpvar_261 = 1.0; } else { - tmpvar_261 = float((dot (texture2D (u_shadowMap2, tmpvar_262), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_260.z - u_params1.x) / _shadowCoord_260.w))); + tmpvar_261 = float((dot (texture2D (u_shadowMap2, tmpvar_262), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_260.z - u_params1.x) + / _shadowCoord_260.w))); }; result_202 = (result_202 + tmpvar_261); vec4 tmpvar_264; @@ -1042,7 +1127,7 @@ void main () tmpvar_264.xy = (vec2(1.5, -1.5) * tmpvar_203); vec4 _shadowCoord_265; _shadowCoord_265 = (tmpvar_201 + tmpvar_264); - float tmpvar_266; + lowp float tmpvar_266; vec2 tmpvar_267; tmpvar_267 = (_shadowCoord_265.xy / _shadowCoord_265.w); bool tmpvar_268; @@ -1054,7 +1139,9 @@ void main () if (tmpvar_268) { tmpvar_266 = 1.0; } else { - tmpvar_266 = float((dot (texture2D (u_shadowMap2, tmpvar_267), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_265.z - u_params1.x) / _shadowCoord_265.w))); + tmpvar_266 = float((dot (texture2D (u_shadowMap2, tmpvar_267), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_265.z - u_params1.x) + / _shadowCoord_265.w))); }; result_202 = (result_202 + tmpvar_266); vec4 tmpvar_269; @@ -1062,7 +1149,7 @@ void main () tmpvar_269.xy = (vec2(1.5, -0.5) * tmpvar_203); vec4 _shadowCoord_270; _shadowCoord_270 = (tmpvar_201 + tmpvar_269); - float tmpvar_271; + lowp float tmpvar_271; vec2 tmpvar_272; tmpvar_272 = (_shadowCoord_270.xy / _shadowCoord_270.w); bool tmpvar_273; @@ -1074,7 +1161,9 @@ void main () if (tmpvar_273) { tmpvar_271 = 1.0; } else { - tmpvar_271 = float((dot (texture2D (u_shadowMap2, tmpvar_272), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_270.z - u_params1.x) / _shadowCoord_270.w))); + tmpvar_271 = float((dot (texture2D (u_shadowMap2, tmpvar_272), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_270.z - u_params1.x) + / _shadowCoord_270.w))); }; result_202 = (result_202 + tmpvar_271); vec4 tmpvar_274; @@ -1082,7 +1171,7 @@ void main () tmpvar_274.xy = (vec2(1.5, 0.5) * tmpvar_203); vec4 _shadowCoord_275; _shadowCoord_275 = (tmpvar_201 + tmpvar_274); - float tmpvar_276; + lowp float tmpvar_276; vec2 tmpvar_277; tmpvar_277 = (_shadowCoord_275.xy / _shadowCoord_275.w); bool tmpvar_278; @@ -1094,7 +1183,9 @@ void main () if (tmpvar_278) { tmpvar_276 = 1.0; } else { - tmpvar_276 = float((dot (texture2D (u_shadowMap2, tmpvar_277), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_275.z - u_params1.x) / _shadowCoord_275.w))); + tmpvar_276 = float((dot (texture2D (u_shadowMap2, tmpvar_277), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_275.z - u_params1.x) + / _shadowCoord_275.w))); }; result_202 = (result_202 + tmpvar_276); vec4 tmpvar_279; @@ -1102,7 +1193,7 @@ void main () tmpvar_279.xy = (vec2(1.5, 1.5) * tmpvar_203); vec4 _shadowCoord_280; _shadowCoord_280 = (tmpvar_201 + tmpvar_279); - float tmpvar_281; + lowp float tmpvar_281; vec2 tmpvar_282; tmpvar_282 = (_shadowCoord_280.xy / _shadowCoord_280.w); bool tmpvar_283; @@ -1114,9 +1205,11 @@ void main () if (tmpvar_283) { tmpvar_281 = 1.0; } else { - tmpvar_281 = float((dot (texture2D (u_shadowMap2, tmpvar_282), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_280.z - u_params1.x) / _shadowCoord_280.w))); + tmpvar_281 = float((dot (texture2D (u_shadowMap2, tmpvar_282), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_280.z - u_params1.x) + / _shadowCoord_280.w))); }; - float tmpvar_284; + lowp float tmpvar_284; tmpvar_284 = (result_202 + tmpvar_281); result_202 = tmpvar_284; visibility_1 = (tmpvar_284 / 16.0); @@ -1133,9 +1226,9 @@ void main () } else { tmpvar_287 = bool(0); }; - float tmpvar_289; + lowp float tmpvar_289; tmpvar_289 = (float(tmpvar_287) * 0.4); - vec3 tmpvar_290; + lowp vec3 tmpvar_290; tmpvar_290.x = tmpvar_289; tmpvar_290.y = -(tmpvar_289); tmpvar_290.z = -(tmpvar_289); @@ -1144,7 +1237,7 @@ void main () tmpvar_291.w = 1.0; tmpvar_291.xy = (v_texcoord4.xy / v_texcoord4.w); tmpvar_291.z = v_texcoord4.z; - float result_292; + lowp float result_292; result_292 = 0.0; vec2 tmpvar_293; tmpvar_293 = (u_smSamplingParams.zw * (u_params2.zz / 4.0)); @@ -1153,7 +1246,7 @@ void main () tmpvar_294.xy = (vec2(-1.5, -1.5) * tmpvar_293); vec4 _shadowCoord_295; _shadowCoord_295 = (tmpvar_291 + tmpvar_294); - float tmpvar_296; + lowp float tmpvar_296; vec2 tmpvar_297; tmpvar_297 = (_shadowCoord_295.xy / _shadowCoord_295.w); bool tmpvar_298; @@ -1165,7 +1258,9 @@ void main () if (tmpvar_298) { tmpvar_296 = 1.0; } else { - tmpvar_296 = float((dot (texture2D (u_shadowMap3, tmpvar_297), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_295.z - u_params1.x) / _shadowCoord_295.w))); + tmpvar_296 = float((dot (texture2D (u_shadowMap3, tmpvar_297), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_295.z - u_params1.x) + / _shadowCoord_295.w))); }; result_292 = tmpvar_296; vec4 tmpvar_299; @@ -1173,7 +1268,7 @@ void main () tmpvar_299.xy = (vec2(-1.5, -0.5) * tmpvar_293); vec4 _shadowCoord_300; _shadowCoord_300 = (tmpvar_291 + tmpvar_299); - float tmpvar_301; + lowp float tmpvar_301; vec2 tmpvar_302; tmpvar_302 = (_shadowCoord_300.xy / _shadowCoord_300.w); bool tmpvar_303; @@ -1185,7 +1280,9 @@ void main () if (tmpvar_303) { tmpvar_301 = 1.0; } else { - tmpvar_301 = float((dot (texture2D (u_shadowMap3, tmpvar_302), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_300.z - u_params1.x) / _shadowCoord_300.w))); + tmpvar_301 = float((dot (texture2D (u_shadowMap3, tmpvar_302), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_300.z - u_params1.x) + / _shadowCoord_300.w))); }; result_292 = (tmpvar_296 + tmpvar_301); vec4 tmpvar_304; @@ -1193,7 +1290,7 @@ void main () tmpvar_304.xy = (vec2(-1.5, 0.5) * tmpvar_293); vec4 _shadowCoord_305; _shadowCoord_305 = (tmpvar_291 + tmpvar_304); - float tmpvar_306; + lowp float tmpvar_306; vec2 tmpvar_307; tmpvar_307 = (_shadowCoord_305.xy / _shadowCoord_305.w); bool tmpvar_308; @@ -1205,7 +1302,9 @@ void main () if (tmpvar_308) { tmpvar_306 = 1.0; } else { - tmpvar_306 = float((dot (texture2D (u_shadowMap3, tmpvar_307), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_305.z - u_params1.x) / _shadowCoord_305.w))); + tmpvar_306 = float((dot (texture2D (u_shadowMap3, tmpvar_307), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_305.z - u_params1.x) + / _shadowCoord_305.w))); }; result_292 = (result_292 + tmpvar_306); vec4 tmpvar_309; @@ -1213,7 +1312,7 @@ void main () tmpvar_309.xy = (vec2(-1.5, 1.5) * tmpvar_293); vec4 _shadowCoord_310; _shadowCoord_310 = (tmpvar_291 + tmpvar_309); - float tmpvar_311; + lowp float tmpvar_311; vec2 tmpvar_312; tmpvar_312 = (_shadowCoord_310.xy / _shadowCoord_310.w); bool tmpvar_313; @@ -1225,7 +1324,9 @@ void main () if (tmpvar_313) { tmpvar_311 = 1.0; } else { - tmpvar_311 = float((dot (texture2D (u_shadowMap3, tmpvar_312), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_310.z - u_params1.x) / _shadowCoord_310.w))); + tmpvar_311 = float((dot (texture2D (u_shadowMap3, tmpvar_312), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_310.z - u_params1.x) + / _shadowCoord_310.w))); }; result_292 = (result_292 + tmpvar_311); vec4 tmpvar_314; @@ -1233,7 +1334,7 @@ void main () tmpvar_314.xy = (vec2(-0.5, -1.5) * tmpvar_293); vec4 _shadowCoord_315; _shadowCoord_315 = (tmpvar_291 + tmpvar_314); - float tmpvar_316; + lowp float tmpvar_316; vec2 tmpvar_317; tmpvar_317 = (_shadowCoord_315.xy / _shadowCoord_315.w); bool tmpvar_318; @@ -1245,7 +1346,9 @@ void main () if (tmpvar_318) { tmpvar_316 = 1.0; } else { - tmpvar_316 = float((dot (texture2D (u_shadowMap3, tmpvar_317), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_315.z - u_params1.x) / _shadowCoord_315.w))); + tmpvar_316 = float((dot (texture2D (u_shadowMap3, tmpvar_317), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_315.z - u_params1.x) + / _shadowCoord_315.w))); }; result_292 = (result_292 + tmpvar_316); vec4 tmpvar_319; @@ -1253,7 +1356,7 @@ void main () tmpvar_319.xy = (vec2(-0.5, -0.5) * tmpvar_293); vec4 _shadowCoord_320; _shadowCoord_320 = (tmpvar_291 + tmpvar_319); - float tmpvar_321; + lowp float tmpvar_321; vec2 tmpvar_322; tmpvar_322 = (_shadowCoord_320.xy / _shadowCoord_320.w); bool tmpvar_323; @@ -1265,7 +1368,9 @@ void main () if (tmpvar_323) { tmpvar_321 = 1.0; } else { - tmpvar_321 = float((dot (texture2D (u_shadowMap3, tmpvar_322), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_320.z - u_params1.x) / _shadowCoord_320.w))); + tmpvar_321 = float((dot (texture2D (u_shadowMap3, tmpvar_322), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_320.z - u_params1.x) + / _shadowCoord_320.w))); }; result_292 = (result_292 + tmpvar_321); vec4 tmpvar_324; @@ -1273,7 +1378,7 @@ void main () tmpvar_324.xy = (vec2(-0.5, 0.5) * tmpvar_293); vec4 _shadowCoord_325; _shadowCoord_325 = (tmpvar_291 + tmpvar_324); - float tmpvar_326; + lowp float tmpvar_326; vec2 tmpvar_327; tmpvar_327 = (_shadowCoord_325.xy / _shadowCoord_325.w); bool tmpvar_328; @@ -1285,7 +1390,9 @@ void main () if (tmpvar_328) { tmpvar_326 = 1.0; } else { - tmpvar_326 = float((dot (texture2D (u_shadowMap3, tmpvar_327), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_325.z - u_params1.x) / _shadowCoord_325.w))); + tmpvar_326 = float((dot (texture2D (u_shadowMap3, tmpvar_327), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_325.z - u_params1.x) + / _shadowCoord_325.w))); }; result_292 = (result_292 + tmpvar_326); vec4 tmpvar_329; @@ -1293,7 +1400,7 @@ void main () tmpvar_329.xy = (vec2(-0.5, 1.5) * tmpvar_293); vec4 _shadowCoord_330; _shadowCoord_330 = (tmpvar_291 + tmpvar_329); - float tmpvar_331; + lowp float tmpvar_331; vec2 tmpvar_332; tmpvar_332 = (_shadowCoord_330.xy / _shadowCoord_330.w); bool tmpvar_333; @@ -1305,7 +1412,9 @@ void main () if (tmpvar_333) { tmpvar_331 = 1.0; } else { - tmpvar_331 = float((dot (texture2D (u_shadowMap3, tmpvar_332), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_330.z - u_params1.x) / _shadowCoord_330.w))); + tmpvar_331 = float((dot (texture2D (u_shadowMap3, tmpvar_332), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_330.z - u_params1.x) + / _shadowCoord_330.w))); }; result_292 = (result_292 + tmpvar_331); vec4 tmpvar_334; @@ -1313,7 +1422,7 @@ void main () tmpvar_334.xy = (vec2(0.5, -1.5) * tmpvar_293); vec4 _shadowCoord_335; _shadowCoord_335 = (tmpvar_291 + tmpvar_334); - float tmpvar_336; + lowp float tmpvar_336; vec2 tmpvar_337; tmpvar_337 = (_shadowCoord_335.xy / _shadowCoord_335.w); bool tmpvar_338; @@ -1325,7 +1434,9 @@ void main () if (tmpvar_338) { tmpvar_336 = 1.0; } else { - tmpvar_336 = float((dot (texture2D (u_shadowMap3, tmpvar_337), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_335.z - u_params1.x) / _shadowCoord_335.w))); + tmpvar_336 = float((dot (texture2D (u_shadowMap3, tmpvar_337), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_335.z - u_params1.x) + / _shadowCoord_335.w))); }; result_292 = (result_292 + tmpvar_336); vec4 tmpvar_339; @@ -1333,7 +1444,7 @@ void main () tmpvar_339.xy = (vec2(0.5, -0.5) * tmpvar_293); vec4 _shadowCoord_340; _shadowCoord_340 = (tmpvar_291 + tmpvar_339); - float tmpvar_341; + lowp float tmpvar_341; vec2 tmpvar_342; tmpvar_342 = (_shadowCoord_340.xy / _shadowCoord_340.w); bool tmpvar_343; @@ -1345,7 +1456,9 @@ void main () if (tmpvar_343) { tmpvar_341 = 1.0; } else { - tmpvar_341 = float((dot (texture2D (u_shadowMap3, tmpvar_342), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_340.z - u_params1.x) / _shadowCoord_340.w))); + tmpvar_341 = float((dot (texture2D (u_shadowMap3, tmpvar_342), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_340.z - u_params1.x) + / _shadowCoord_340.w))); }; result_292 = (result_292 + tmpvar_341); vec4 tmpvar_344; @@ -1353,7 +1466,7 @@ void main () tmpvar_344.xy = (vec2(0.5, 0.5) * tmpvar_293); vec4 _shadowCoord_345; _shadowCoord_345 = (tmpvar_291 + tmpvar_344); - float tmpvar_346; + lowp float tmpvar_346; vec2 tmpvar_347; tmpvar_347 = (_shadowCoord_345.xy / _shadowCoord_345.w); bool tmpvar_348; @@ -1365,7 +1478,9 @@ void main () if (tmpvar_348) { tmpvar_346 = 1.0; } else { - tmpvar_346 = float((dot (texture2D (u_shadowMap3, tmpvar_347), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_345.z - u_params1.x) / _shadowCoord_345.w))); + tmpvar_346 = float((dot (texture2D (u_shadowMap3, tmpvar_347), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_345.z - u_params1.x) + / _shadowCoord_345.w))); }; result_292 = (result_292 + tmpvar_346); vec4 tmpvar_349; @@ -1373,7 +1488,7 @@ void main () tmpvar_349.xy = (vec2(0.5, 1.5) * tmpvar_293); vec4 _shadowCoord_350; _shadowCoord_350 = (tmpvar_291 + tmpvar_349); - float tmpvar_351; + lowp float tmpvar_351; vec2 tmpvar_352; tmpvar_352 = (_shadowCoord_350.xy / _shadowCoord_350.w); bool tmpvar_353; @@ -1385,7 +1500,9 @@ void main () if (tmpvar_353) { tmpvar_351 = 1.0; } else { - tmpvar_351 = float((dot (texture2D (u_shadowMap3, tmpvar_352), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_350.z - u_params1.x) / _shadowCoord_350.w))); + tmpvar_351 = float((dot (texture2D (u_shadowMap3, tmpvar_352), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_350.z - u_params1.x) + / _shadowCoord_350.w))); }; result_292 = (result_292 + tmpvar_351); vec4 tmpvar_354; @@ -1393,7 +1510,7 @@ void main () tmpvar_354.xy = (vec2(1.5, -1.5) * tmpvar_293); vec4 _shadowCoord_355; _shadowCoord_355 = (tmpvar_291 + tmpvar_354); - float tmpvar_356; + lowp float tmpvar_356; vec2 tmpvar_357; tmpvar_357 = (_shadowCoord_355.xy / _shadowCoord_355.w); bool tmpvar_358; @@ -1405,7 +1522,9 @@ void main () if (tmpvar_358) { tmpvar_356 = 1.0; } else { - tmpvar_356 = float((dot (texture2D (u_shadowMap3, tmpvar_357), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_355.z - u_params1.x) / _shadowCoord_355.w))); + tmpvar_356 = float((dot (texture2D (u_shadowMap3, tmpvar_357), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_355.z - u_params1.x) + / _shadowCoord_355.w))); }; result_292 = (result_292 + tmpvar_356); vec4 tmpvar_359; @@ -1413,7 +1532,7 @@ void main () tmpvar_359.xy = (vec2(1.5, -0.5) * tmpvar_293); vec4 _shadowCoord_360; _shadowCoord_360 = (tmpvar_291 + tmpvar_359); - float tmpvar_361; + lowp float tmpvar_361; vec2 tmpvar_362; tmpvar_362 = (_shadowCoord_360.xy / _shadowCoord_360.w); bool tmpvar_363; @@ -1425,7 +1544,9 @@ void main () if (tmpvar_363) { tmpvar_361 = 1.0; } else { - tmpvar_361 = float((dot (texture2D (u_shadowMap3, tmpvar_362), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_360.z - u_params1.x) / _shadowCoord_360.w))); + tmpvar_361 = float((dot (texture2D (u_shadowMap3, tmpvar_362), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_360.z - u_params1.x) + / _shadowCoord_360.w))); }; result_292 = (result_292 + tmpvar_361); vec4 tmpvar_364; @@ -1433,7 +1554,7 @@ void main () tmpvar_364.xy = (vec2(1.5, 0.5) * tmpvar_293); vec4 _shadowCoord_365; _shadowCoord_365 = (tmpvar_291 + tmpvar_364); - float tmpvar_366; + lowp float tmpvar_366; vec2 tmpvar_367; tmpvar_367 = (_shadowCoord_365.xy / _shadowCoord_365.w); bool tmpvar_368; @@ -1445,7 +1566,9 @@ void main () if (tmpvar_368) { tmpvar_366 = 1.0; } else { - tmpvar_366 = float((dot (texture2D (u_shadowMap3, tmpvar_367), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_365.z - u_params1.x) / _shadowCoord_365.w))); + tmpvar_366 = float((dot (texture2D (u_shadowMap3, tmpvar_367), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_365.z - u_params1.x) + / _shadowCoord_365.w))); }; result_292 = (result_292 + tmpvar_366); vec4 tmpvar_369; @@ -1453,7 +1576,7 @@ void main () tmpvar_369.xy = (vec2(1.5, 1.5) * tmpvar_293); vec4 _shadowCoord_370; _shadowCoord_370 = (tmpvar_291 + tmpvar_369); - float tmpvar_371; + lowp float tmpvar_371; vec2 tmpvar_372; tmpvar_372 = (_shadowCoord_370.xy / _shadowCoord_370.w); bool tmpvar_373; @@ -1465,9 +1588,11 @@ void main () if (tmpvar_373) { tmpvar_371 = 1.0; } else { - tmpvar_371 = float((dot (texture2D (u_shadowMap3, tmpvar_372), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_370.z - u_params1.x) / _shadowCoord_370.w))); + tmpvar_371 = float((dot (texture2D (u_shadowMap3, tmpvar_372), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_370.z - u_params1.x) + / _shadowCoord_370.w))); }; - float tmpvar_374; + lowp float tmpvar_374; tmpvar_374 = (result_292 + tmpvar_371); result_292 = tmpvar_374; visibility_1 = (tmpvar_374 / 16.0); @@ -1490,18 +1615,48 @@ void main () tmpvar_380 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_381; tmpvar_381 = sqrt(dot (tmpvar_378, tmpvar_378)); - tmpvar_377 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_381)) + ((u_lightAttenuationSpotOuter.z * tmpvar_381) * tmpvar_381)))) * mix (clamp (((max (0.0, dot (-(tmpvar_379), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_380) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_380)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_377 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_381)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_381) * tmpvar_381) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_379) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_380) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_380)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_382; tmpvar_382 = dot (v_normal, tmpvar_376); vec2 tmpvar_383; tmpvar_383.x = tmpvar_382; - tmpvar_383.y = (((float((tmpvar_382 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_382) * v_normal) - tmpvar_376), tmpvar_375)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_383.y = ((( + float((tmpvar_382 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_382) * v_normal) + - tmpvar_376), tmpvar_375)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_384; tmpvar_384 = (max (tmpvar_383, 0.0) * tmpvar_377); float tmpvar_385; tmpvar_385 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_384.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_384.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_385) * tmpvar_385)))), 0.0, 1.0)); + lowp vec3 tmpvar_386; + tmpvar_386 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_384.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_384.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_385) * tmpvar_385)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_386; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin index 451e928b5..0cc437ee9 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_linear_omni.bin @@ -1,37 +1,34 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap0; -uniform vec3 u_tetraNormalRed; -uniform vec3 u_tetraNormalBlue; -uniform vec3 u_tetraNormalYellow; -uniform vec3 u_tetraNormalGreen; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; -varying vec4 v_position; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_position; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform vec3 u_tetraNormalGreen; +uniform vec3 u_tetraNormalYellow; +uniform vec3 u_tetraNormalBlue; +uniform vec3 u_tetraNormalRed; +uniform sampler2D u_shadowMap0; void main () { vec4 shadowcoord_1; vec4 faceSelection_2; - vec3 colorCoverage_3; + lowp vec3 colorCoverage_3; vec2 tmpvar_4; tmpvar_4 = vec2((u_params2.z / 4.0)); faceSelection_2.x = dot (u_tetraNormalGreen, v_position.xyz); @@ -54,9 +51,9 @@ void main () } else { tmpvar_8 = bool(0); }; - float tmpvar_10; + lowp float tmpvar_10; tmpvar_10 = (float(tmpvar_8) * 0.3); - vec3 tmpvar_11; + lowp vec3 tmpvar_11; tmpvar_11.x = -(tmpvar_10); tmpvar_11.y = tmpvar_10; tmpvar_11.z = -(tmpvar_10); @@ -76,9 +73,9 @@ void main () } else { tmpvar_14 = bool(0); }; - float tmpvar_16; + lowp float tmpvar_16; tmpvar_16 = (float(tmpvar_14) * 0.3); - vec3 tmpvar_17; + lowp vec3 tmpvar_17; tmpvar_17.x = tmpvar_16; tmpvar_17.y = tmpvar_16; tmpvar_17.z = -(tmpvar_16); @@ -98,9 +95,9 @@ void main () } else { tmpvar_20 = bool(0); }; - float tmpvar_22; + lowp float tmpvar_22; tmpvar_22 = (float(tmpvar_20) * 0.3); - vec3 tmpvar_23; + lowp vec3 tmpvar_23; tmpvar_23.x = -(tmpvar_22); tmpvar_23.y = -(tmpvar_22); tmpvar_23.z = tmpvar_22; @@ -119,9 +116,9 @@ void main () } else { tmpvar_26 = bool(0); }; - float tmpvar_28; + lowp float tmpvar_28; tmpvar_28 = (float(tmpvar_26) * 0.3); - vec3 tmpvar_29; + lowp vec3 tmpvar_29; tmpvar_29.x = tmpvar_28; tmpvar_29.y = -(tmpvar_28); tmpvar_29.z = -(tmpvar_28); @@ -133,8 +130,8 @@ void main () tmpvar_30.w = 1.0; tmpvar_30.xy = (shadowcoord_1.xy / shadowcoord_1.w); tmpvar_30.z = shadowcoord_1.z; - float tmpvar_31; - float result_32; + lowp float tmpvar_31; + lowp float result_32; result_32 = 0.0; vec2 tmpvar_33; tmpvar_33 = (u_smSamplingParams.zw * tmpvar_4); @@ -143,7 +140,7 @@ void main () tmpvar_34.xy = (vec2(-1.5, -1.5) * tmpvar_33); vec4 _shadowCoord_35; _shadowCoord_35 = (tmpvar_30 + tmpvar_34); - float tmpvar_36; + lowp float tmpvar_36; vec2 tmpvar_37; tmpvar_37 = (_shadowCoord_35.xy / _shadowCoord_35.w); bool tmpvar_38; @@ -155,7 +152,9 @@ void main () if (tmpvar_38) { tmpvar_36 = 1.0; } else { - tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_35.z - u_params1.x) / _shadowCoord_35.w))); + tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_35.z - u_params1.x) + / _shadowCoord_35.w))); }; result_32 = tmpvar_36; vec4 tmpvar_39; @@ -163,7 +162,7 @@ void main () tmpvar_39.xy = (vec2(-1.5, -0.5) * tmpvar_33); vec4 _shadowCoord_40; _shadowCoord_40 = (tmpvar_30 + tmpvar_39); - float tmpvar_41; + lowp float tmpvar_41; vec2 tmpvar_42; tmpvar_42 = (_shadowCoord_40.xy / _shadowCoord_40.w); bool tmpvar_43; @@ -175,7 +174,9 @@ void main () if (tmpvar_43) { tmpvar_41 = 1.0; } else { - tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_40.z - u_params1.x) / _shadowCoord_40.w))); + tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_40.z - u_params1.x) + / _shadowCoord_40.w))); }; result_32 = (tmpvar_36 + tmpvar_41); vec4 tmpvar_44; @@ -183,7 +184,7 @@ void main () tmpvar_44.xy = (vec2(-1.5, 0.5) * tmpvar_33); vec4 _shadowCoord_45; _shadowCoord_45 = (tmpvar_30 + tmpvar_44); - float tmpvar_46; + lowp float tmpvar_46; vec2 tmpvar_47; tmpvar_47 = (_shadowCoord_45.xy / _shadowCoord_45.w); bool tmpvar_48; @@ -195,7 +196,9 @@ void main () if (tmpvar_48) { tmpvar_46 = 1.0; } else { - tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_45.z - u_params1.x) / _shadowCoord_45.w))); + tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_45.z - u_params1.x) + / _shadowCoord_45.w))); }; result_32 = (result_32 + tmpvar_46); vec4 tmpvar_49; @@ -203,7 +206,7 @@ void main () tmpvar_49.xy = (vec2(-1.5, 1.5) * tmpvar_33); vec4 _shadowCoord_50; _shadowCoord_50 = (tmpvar_30 + tmpvar_49); - float tmpvar_51; + lowp float tmpvar_51; vec2 tmpvar_52; tmpvar_52 = (_shadowCoord_50.xy / _shadowCoord_50.w); bool tmpvar_53; @@ -215,7 +218,9 @@ void main () if (tmpvar_53) { tmpvar_51 = 1.0; } else { - tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_50.z - u_params1.x) / _shadowCoord_50.w))); + tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_50.z - u_params1.x) + / _shadowCoord_50.w))); }; result_32 = (result_32 + tmpvar_51); vec4 tmpvar_54; @@ -223,7 +228,7 @@ void main () tmpvar_54.xy = (vec2(-0.5, -1.5) * tmpvar_33); vec4 _shadowCoord_55; _shadowCoord_55 = (tmpvar_30 + tmpvar_54); - float tmpvar_56; + lowp float tmpvar_56; vec2 tmpvar_57; tmpvar_57 = (_shadowCoord_55.xy / _shadowCoord_55.w); bool tmpvar_58; @@ -235,7 +240,9 @@ void main () if (tmpvar_58) { tmpvar_56 = 1.0; } else { - tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_55.z - u_params1.x) / _shadowCoord_55.w))); + tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_55.z - u_params1.x) + / _shadowCoord_55.w))); }; result_32 = (result_32 + tmpvar_56); vec4 tmpvar_59; @@ -243,7 +250,7 @@ void main () tmpvar_59.xy = (vec2(-0.5, -0.5) * tmpvar_33); vec4 _shadowCoord_60; _shadowCoord_60 = (tmpvar_30 + tmpvar_59); - float tmpvar_61; + lowp float tmpvar_61; vec2 tmpvar_62; tmpvar_62 = (_shadowCoord_60.xy / _shadowCoord_60.w); bool tmpvar_63; @@ -255,7 +262,9 @@ void main () if (tmpvar_63) { tmpvar_61 = 1.0; } else { - tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_60.z - u_params1.x) / _shadowCoord_60.w))); + tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_60.z - u_params1.x) + / _shadowCoord_60.w))); }; result_32 = (result_32 + tmpvar_61); vec4 tmpvar_64; @@ -263,7 +272,7 @@ void main () tmpvar_64.xy = (vec2(-0.5, 0.5) * tmpvar_33); vec4 _shadowCoord_65; _shadowCoord_65 = (tmpvar_30 + tmpvar_64); - float tmpvar_66; + lowp float tmpvar_66; vec2 tmpvar_67; tmpvar_67 = (_shadowCoord_65.xy / _shadowCoord_65.w); bool tmpvar_68; @@ -275,7 +284,9 @@ void main () if (tmpvar_68) { tmpvar_66 = 1.0; } else { - tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_65.z - u_params1.x) / _shadowCoord_65.w))); + tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_65.z - u_params1.x) + / _shadowCoord_65.w))); }; result_32 = (result_32 + tmpvar_66); vec4 tmpvar_69; @@ -283,7 +294,7 @@ void main () tmpvar_69.xy = (vec2(-0.5, 1.5) * tmpvar_33); vec4 _shadowCoord_70; _shadowCoord_70 = (tmpvar_30 + tmpvar_69); - float tmpvar_71; + lowp float tmpvar_71; vec2 tmpvar_72; tmpvar_72 = (_shadowCoord_70.xy / _shadowCoord_70.w); bool tmpvar_73; @@ -295,7 +306,9 @@ void main () if (tmpvar_73) { tmpvar_71 = 1.0; } else { - tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_70.z - u_params1.x) / _shadowCoord_70.w))); + tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_70.z - u_params1.x) + / _shadowCoord_70.w))); }; result_32 = (result_32 + tmpvar_71); vec4 tmpvar_74; @@ -303,7 +316,7 @@ void main () tmpvar_74.xy = (vec2(0.5, -1.5) * tmpvar_33); vec4 _shadowCoord_75; _shadowCoord_75 = (tmpvar_30 + tmpvar_74); - float tmpvar_76; + lowp float tmpvar_76; vec2 tmpvar_77; tmpvar_77 = (_shadowCoord_75.xy / _shadowCoord_75.w); bool tmpvar_78; @@ -315,7 +328,9 @@ void main () if (tmpvar_78) { tmpvar_76 = 1.0; } else { - tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_75.z - u_params1.x) / _shadowCoord_75.w))); + tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_75.z - u_params1.x) + / _shadowCoord_75.w))); }; result_32 = (result_32 + tmpvar_76); vec4 tmpvar_79; @@ -323,7 +338,7 @@ void main () tmpvar_79.xy = (vec2(0.5, -0.5) * tmpvar_33); vec4 _shadowCoord_80; _shadowCoord_80 = (tmpvar_30 + tmpvar_79); - float tmpvar_81; + lowp float tmpvar_81; vec2 tmpvar_82; tmpvar_82 = (_shadowCoord_80.xy / _shadowCoord_80.w); bool tmpvar_83; @@ -335,7 +350,9 @@ void main () if (tmpvar_83) { tmpvar_81 = 1.0; } else { - tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_80.z - u_params1.x) / _shadowCoord_80.w))); + tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_80.z - u_params1.x) + / _shadowCoord_80.w))); }; result_32 = (result_32 + tmpvar_81); vec4 tmpvar_84; @@ -343,7 +360,7 @@ void main () tmpvar_84.xy = (vec2(0.5, 0.5) * tmpvar_33); vec4 _shadowCoord_85; _shadowCoord_85 = (tmpvar_30 + tmpvar_84); - float tmpvar_86; + lowp float tmpvar_86; vec2 tmpvar_87; tmpvar_87 = (_shadowCoord_85.xy / _shadowCoord_85.w); bool tmpvar_88; @@ -355,7 +372,9 @@ void main () if (tmpvar_88) { tmpvar_86 = 1.0; } else { - tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_85.z - u_params1.x) / _shadowCoord_85.w))); + tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_85.z - u_params1.x) + / _shadowCoord_85.w))); }; result_32 = (result_32 + tmpvar_86); vec4 tmpvar_89; @@ -363,7 +382,7 @@ void main () tmpvar_89.xy = (vec2(0.5, 1.5) * tmpvar_33); vec4 _shadowCoord_90; _shadowCoord_90 = (tmpvar_30 + tmpvar_89); - float tmpvar_91; + lowp float tmpvar_91; vec2 tmpvar_92; tmpvar_92 = (_shadowCoord_90.xy / _shadowCoord_90.w); bool tmpvar_93; @@ -375,7 +394,9 @@ void main () if (tmpvar_93) { tmpvar_91 = 1.0; } else { - tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_90.z - u_params1.x) / _shadowCoord_90.w))); + tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_90.z - u_params1.x) + / _shadowCoord_90.w))); }; result_32 = (result_32 + tmpvar_91); vec4 tmpvar_94; @@ -383,7 +404,7 @@ void main () tmpvar_94.xy = (vec2(1.5, -1.5) * tmpvar_33); vec4 _shadowCoord_95; _shadowCoord_95 = (tmpvar_30 + tmpvar_94); - float tmpvar_96; + lowp float tmpvar_96; vec2 tmpvar_97; tmpvar_97 = (_shadowCoord_95.xy / _shadowCoord_95.w); bool tmpvar_98; @@ -395,7 +416,9 @@ void main () if (tmpvar_98) { tmpvar_96 = 1.0; } else { - tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_95.z - u_params1.x) / _shadowCoord_95.w))); + tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_95.z - u_params1.x) + / _shadowCoord_95.w))); }; result_32 = (result_32 + tmpvar_96); vec4 tmpvar_99; @@ -403,7 +426,7 @@ void main () tmpvar_99.xy = (vec2(1.5, -0.5) * tmpvar_33); vec4 _shadowCoord_100; _shadowCoord_100 = (tmpvar_30 + tmpvar_99); - float tmpvar_101; + lowp float tmpvar_101; vec2 tmpvar_102; tmpvar_102 = (_shadowCoord_100.xy / _shadowCoord_100.w); bool tmpvar_103; @@ -415,7 +438,9 @@ void main () if (tmpvar_103) { tmpvar_101 = 1.0; } else { - tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_100.z - u_params1.x) / _shadowCoord_100.w))); + tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_100.z - u_params1.x) + / _shadowCoord_100.w))); }; result_32 = (result_32 + tmpvar_101); vec4 tmpvar_104; @@ -423,7 +448,7 @@ void main () tmpvar_104.xy = (vec2(1.5, 0.5) * tmpvar_33); vec4 _shadowCoord_105; _shadowCoord_105 = (tmpvar_30 + tmpvar_104); - float tmpvar_106; + lowp float tmpvar_106; vec2 tmpvar_107; tmpvar_107 = (_shadowCoord_105.xy / _shadowCoord_105.w); bool tmpvar_108; @@ -435,7 +460,9 @@ void main () if (tmpvar_108) { tmpvar_106 = 1.0; } else { - tmpvar_106 = float((dot (texture2D (u_shadowMap0, tmpvar_107), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_105.z - u_params1.x) / _shadowCoord_105.w))); + tmpvar_106 = float((dot (texture2D (u_shadowMap0, tmpvar_107), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_105.z - u_params1.x) + / _shadowCoord_105.w))); }; result_32 = (result_32 + tmpvar_106); vec4 tmpvar_109; @@ -443,7 +470,7 @@ void main () tmpvar_109.xy = (vec2(1.5, 1.5) * tmpvar_33); vec4 _shadowCoord_110; _shadowCoord_110 = (tmpvar_30 + tmpvar_109); - float tmpvar_111; + lowp float tmpvar_111; vec2 tmpvar_112; tmpvar_112 = (_shadowCoord_110.xy / _shadowCoord_110.w); bool tmpvar_113; @@ -455,9 +482,11 @@ void main () if (tmpvar_113) { tmpvar_111 = 1.0; } else { - tmpvar_111 = float((dot (texture2D (u_shadowMap0, tmpvar_112), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_110.z - u_params1.x) / _shadowCoord_110.w))); + tmpvar_111 = float((dot (texture2D (u_shadowMap0, tmpvar_112), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_110.z - u_params1.x) + / _shadowCoord_110.w))); }; - float tmpvar_114; + lowp float tmpvar_114; tmpvar_114 = (result_32 + tmpvar_111); result_32 = tmpvar_114; tmpvar_31 = (tmpvar_114 / 16.0); @@ -477,18 +506,48 @@ void main () tmpvar_120 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_121; tmpvar_121 = sqrt(dot (tmpvar_118, tmpvar_118)); - tmpvar_117 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_121)) + ((u_lightAttenuationSpotOuter.z * tmpvar_121) * tmpvar_121)))) * mix (clamp (((max (0.0, dot (-(tmpvar_119), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_120) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_120)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_117 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_121)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_121) * tmpvar_121) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_119) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_120) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_120)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_122; tmpvar_122 = dot (v_normal, tmpvar_116); vec2 tmpvar_123; tmpvar_123.x = tmpvar_122; - tmpvar_123.y = (((float((tmpvar_122 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_122) * v_normal) - tmpvar_116), tmpvar_115)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_123.y = ((( + float((tmpvar_122 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_122) * v_normal) + - tmpvar_116), tmpvar_115)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_124; tmpvar_124 = (max (tmpvar_123, 0.0) * tmpvar_117); float tmpvar_125; tmpvar_125 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_124.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_124.y)) * u_color.xyz) * tmpvar_31))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_125) * tmpvar_125)))), 0.0, 1.0)); + lowp vec3 tmpvar_126; + tmpvar_126 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_124.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_124.y)) + * u_color.xyz) * tmpvar_31))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_125) * tmpvar_125)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_126; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin index 06facb629..cdc878002 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_pcf_omni.bin @@ -1,37 +1,34 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap0; -uniform vec3 u_tetraNormalRed; -uniform vec3 u_tetraNormalBlue; -uniform vec3 u_tetraNormalYellow; -uniform vec3 u_tetraNormalGreen; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; -varying vec4 v_position; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_position; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform vec3 u_tetraNormalGreen; +uniform vec3 u_tetraNormalYellow; +uniform vec3 u_tetraNormalBlue; +uniform vec3 u_tetraNormalRed; +uniform sampler2D u_shadowMap0; void main () { vec4 shadowcoord_1; vec4 faceSelection_2; - vec3 colorCoverage_3; + lowp vec3 colorCoverage_3; vec2 tmpvar_4; tmpvar_4 = vec2((u_params2.z / 4.0)); faceSelection_2.x = dot (u_tetraNormalGreen, v_position.xyz); @@ -54,9 +51,9 @@ void main () } else { tmpvar_8 = bool(0); }; - float tmpvar_10; + lowp float tmpvar_10; tmpvar_10 = (float(tmpvar_8) * 0.3); - vec3 tmpvar_11; + lowp vec3 tmpvar_11; tmpvar_11.x = -(tmpvar_10); tmpvar_11.y = tmpvar_10; tmpvar_11.z = -(tmpvar_10); @@ -76,9 +73,9 @@ void main () } else { tmpvar_14 = bool(0); }; - float tmpvar_16; + lowp float tmpvar_16; tmpvar_16 = (float(tmpvar_14) * 0.3); - vec3 tmpvar_17; + lowp vec3 tmpvar_17; tmpvar_17.x = tmpvar_16; tmpvar_17.y = tmpvar_16; tmpvar_17.z = -(tmpvar_16); @@ -98,9 +95,9 @@ void main () } else { tmpvar_20 = bool(0); }; - float tmpvar_22; + lowp float tmpvar_22; tmpvar_22 = (float(tmpvar_20) * 0.3); - vec3 tmpvar_23; + lowp vec3 tmpvar_23; tmpvar_23.x = -(tmpvar_22); tmpvar_23.y = -(tmpvar_22); tmpvar_23.z = tmpvar_22; @@ -119,9 +116,9 @@ void main () } else { tmpvar_26 = bool(0); }; - float tmpvar_28; + lowp float tmpvar_28; tmpvar_28 = (float(tmpvar_26) * 0.3); - vec3 tmpvar_29; + lowp vec3 tmpvar_29; tmpvar_29.x = tmpvar_28; tmpvar_29.y = -(tmpvar_28); tmpvar_29.z = -(tmpvar_28); @@ -129,8 +126,8 @@ void main () }; }; }; - float tmpvar_30; - float result_31; + lowp float tmpvar_30; + lowp float result_31; result_31 = 0.0; vec2 tmpvar_32; tmpvar_32 = ((u_smSamplingParams.zw * tmpvar_4) * shadowcoord_1.w); @@ -139,7 +136,7 @@ void main () tmpvar_33.xy = (vec2(-1.5, -1.5) * tmpvar_32); vec4 _shadowCoord_34; _shadowCoord_34 = (shadowcoord_1 + tmpvar_33); - float tmpvar_35; + lowp float tmpvar_35; vec2 tmpvar_36; tmpvar_36 = (_shadowCoord_34.xy / _shadowCoord_34.w); bool tmpvar_37; @@ -151,7 +148,9 @@ void main () if (tmpvar_37) { tmpvar_35 = 1.0; } else { - tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_34.z - u_params1.x) / _shadowCoord_34.w))); + tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_34.z - u_params1.x) + / _shadowCoord_34.w))); }; result_31 = tmpvar_35; vec4 tmpvar_38; @@ -159,7 +158,7 @@ void main () tmpvar_38.xy = (vec2(-1.5, -0.5) * tmpvar_32); vec4 _shadowCoord_39; _shadowCoord_39 = (shadowcoord_1 + tmpvar_38); - float tmpvar_40; + lowp float tmpvar_40; vec2 tmpvar_41; tmpvar_41 = (_shadowCoord_39.xy / _shadowCoord_39.w); bool tmpvar_42; @@ -171,7 +170,9 @@ void main () if (tmpvar_42) { tmpvar_40 = 1.0; } else { - tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_39.z - u_params1.x) / _shadowCoord_39.w))); + tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_39.z - u_params1.x) + / _shadowCoord_39.w))); }; result_31 = (tmpvar_35 + tmpvar_40); vec4 tmpvar_43; @@ -179,7 +180,7 @@ void main () tmpvar_43.xy = (vec2(-1.5, 0.5) * tmpvar_32); vec4 _shadowCoord_44; _shadowCoord_44 = (shadowcoord_1 + tmpvar_43); - float tmpvar_45; + lowp float tmpvar_45; vec2 tmpvar_46; tmpvar_46 = (_shadowCoord_44.xy / _shadowCoord_44.w); bool tmpvar_47; @@ -191,7 +192,9 @@ void main () if (tmpvar_47) { tmpvar_45 = 1.0; } else { - tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_44.z - u_params1.x) / _shadowCoord_44.w))); + tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_44.z - u_params1.x) + / _shadowCoord_44.w))); }; result_31 = (result_31 + tmpvar_45); vec4 tmpvar_48; @@ -199,7 +202,7 @@ void main () tmpvar_48.xy = (vec2(-1.5, 1.5) * tmpvar_32); vec4 _shadowCoord_49; _shadowCoord_49 = (shadowcoord_1 + tmpvar_48); - float tmpvar_50; + lowp float tmpvar_50; vec2 tmpvar_51; tmpvar_51 = (_shadowCoord_49.xy / _shadowCoord_49.w); bool tmpvar_52; @@ -211,7 +214,9 @@ void main () if (tmpvar_52) { tmpvar_50 = 1.0; } else { - tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_49.z - u_params1.x) / _shadowCoord_49.w))); + tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_49.z - u_params1.x) + / _shadowCoord_49.w))); }; result_31 = (result_31 + tmpvar_50); vec4 tmpvar_53; @@ -219,7 +224,7 @@ void main () tmpvar_53.xy = (vec2(-0.5, -1.5) * tmpvar_32); vec4 _shadowCoord_54; _shadowCoord_54 = (shadowcoord_1 + tmpvar_53); - float tmpvar_55; + lowp float tmpvar_55; vec2 tmpvar_56; tmpvar_56 = (_shadowCoord_54.xy / _shadowCoord_54.w); bool tmpvar_57; @@ -231,7 +236,9 @@ void main () if (tmpvar_57) { tmpvar_55 = 1.0; } else { - tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_54.z - u_params1.x) / _shadowCoord_54.w))); + tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_54.z - u_params1.x) + / _shadowCoord_54.w))); }; result_31 = (result_31 + tmpvar_55); vec4 tmpvar_58; @@ -239,7 +246,7 @@ void main () tmpvar_58.xy = (vec2(-0.5, -0.5) * tmpvar_32); vec4 _shadowCoord_59; _shadowCoord_59 = (shadowcoord_1 + tmpvar_58); - float tmpvar_60; + lowp float tmpvar_60; vec2 tmpvar_61; tmpvar_61 = (_shadowCoord_59.xy / _shadowCoord_59.w); bool tmpvar_62; @@ -251,7 +258,9 @@ void main () if (tmpvar_62) { tmpvar_60 = 1.0; } else { - tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_59.z - u_params1.x) / _shadowCoord_59.w))); + tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_59.z - u_params1.x) + / _shadowCoord_59.w))); }; result_31 = (result_31 + tmpvar_60); vec4 tmpvar_63; @@ -259,7 +268,7 @@ void main () tmpvar_63.xy = (vec2(-0.5, 0.5) * tmpvar_32); vec4 _shadowCoord_64; _shadowCoord_64 = (shadowcoord_1 + tmpvar_63); - float tmpvar_65; + lowp float tmpvar_65; vec2 tmpvar_66; tmpvar_66 = (_shadowCoord_64.xy / _shadowCoord_64.w); bool tmpvar_67; @@ -271,7 +280,9 @@ void main () if (tmpvar_67) { tmpvar_65 = 1.0; } else { - tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_64.z - u_params1.x) / _shadowCoord_64.w))); + tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_64.z - u_params1.x) + / _shadowCoord_64.w))); }; result_31 = (result_31 + tmpvar_65); vec4 tmpvar_68; @@ -279,7 +290,7 @@ void main () tmpvar_68.xy = (vec2(-0.5, 1.5) * tmpvar_32); vec4 _shadowCoord_69; _shadowCoord_69 = (shadowcoord_1 + tmpvar_68); - float tmpvar_70; + lowp float tmpvar_70; vec2 tmpvar_71; tmpvar_71 = (_shadowCoord_69.xy / _shadowCoord_69.w); bool tmpvar_72; @@ -291,7 +302,9 @@ void main () if (tmpvar_72) { tmpvar_70 = 1.0; } else { - tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_69.z - u_params1.x) / _shadowCoord_69.w))); + tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_69.z - u_params1.x) + / _shadowCoord_69.w))); }; result_31 = (result_31 + tmpvar_70); vec4 tmpvar_73; @@ -299,7 +312,7 @@ void main () tmpvar_73.xy = (vec2(0.5, -1.5) * tmpvar_32); vec4 _shadowCoord_74; _shadowCoord_74 = (shadowcoord_1 + tmpvar_73); - float tmpvar_75; + lowp float tmpvar_75; vec2 tmpvar_76; tmpvar_76 = (_shadowCoord_74.xy / _shadowCoord_74.w); bool tmpvar_77; @@ -311,7 +324,9 @@ void main () if (tmpvar_77) { tmpvar_75 = 1.0; } else { - tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_74.z - u_params1.x) / _shadowCoord_74.w))); + tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_74.z - u_params1.x) + / _shadowCoord_74.w))); }; result_31 = (result_31 + tmpvar_75); vec4 tmpvar_78; @@ -319,7 +334,7 @@ void main () tmpvar_78.xy = (vec2(0.5, -0.5) * tmpvar_32); vec4 _shadowCoord_79; _shadowCoord_79 = (shadowcoord_1 + tmpvar_78); - float tmpvar_80; + lowp float tmpvar_80; vec2 tmpvar_81; tmpvar_81 = (_shadowCoord_79.xy / _shadowCoord_79.w); bool tmpvar_82; @@ -331,7 +346,9 @@ void main () if (tmpvar_82) { tmpvar_80 = 1.0; } else { - tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_79.z - u_params1.x) / _shadowCoord_79.w))); + tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_79.z - u_params1.x) + / _shadowCoord_79.w))); }; result_31 = (result_31 + tmpvar_80); vec4 tmpvar_83; @@ -339,7 +356,7 @@ void main () tmpvar_83.xy = (vec2(0.5, 0.5) * tmpvar_32); vec4 _shadowCoord_84; _shadowCoord_84 = (shadowcoord_1 + tmpvar_83); - float tmpvar_85; + lowp float tmpvar_85; vec2 tmpvar_86; tmpvar_86 = (_shadowCoord_84.xy / _shadowCoord_84.w); bool tmpvar_87; @@ -351,7 +368,9 @@ void main () if (tmpvar_87) { tmpvar_85 = 1.0; } else { - tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_84.z - u_params1.x) / _shadowCoord_84.w))); + tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_84.z - u_params1.x) + / _shadowCoord_84.w))); }; result_31 = (result_31 + tmpvar_85); vec4 tmpvar_88; @@ -359,7 +378,7 @@ void main () tmpvar_88.xy = (vec2(0.5, 1.5) * tmpvar_32); vec4 _shadowCoord_89; _shadowCoord_89 = (shadowcoord_1 + tmpvar_88); - float tmpvar_90; + lowp float tmpvar_90; vec2 tmpvar_91; tmpvar_91 = (_shadowCoord_89.xy / _shadowCoord_89.w); bool tmpvar_92; @@ -371,7 +390,9 @@ void main () if (tmpvar_92) { tmpvar_90 = 1.0; } else { - tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_89.z - u_params1.x) / _shadowCoord_89.w))); + tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_89.z - u_params1.x) + / _shadowCoord_89.w))); }; result_31 = (result_31 + tmpvar_90); vec4 tmpvar_93; @@ -379,7 +400,7 @@ void main () tmpvar_93.xy = (vec2(1.5, -1.5) * tmpvar_32); vec4 _shadowCoord_94; _shadowCoord_94 = (shadowcoord_1 + tmpvar_93); - float tmpvar_95; + lowp float tmpvar_95; vec2 tmpvar_96; tmpvar_96 = (_shadowCoord_94.xy / _shadowCoord_94.w); bool tmpvar_97; @@ -391,7 +412,9 @@ void main () if (tmpvar_97) { tmpvar_95 = 1.0; } else { - tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_94.z - u_params1.x) / _shadowCoord_94.w))); + tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_94.z - u_params1.x) + / _shadowCoord_94.w))); }; result_31 = (result_31 + tmpvar_95); vec4 tmpvar_98; @@ -399,7 +422,7 @@ void main () tmpvar_98.xy = (vec2(1.5, -0.5) * tmpvar_32); vec4 _shadowCoord_99; _shadowCoord_99 = (shadowcoord_1 + tmpvar_98); - float tmpvar_100; + lowp float tmpvar_100; vec2 tmpvar_101; tmpvar_101 = (_shadowCoord_99.xy / _shadowCoord_99.w); bool tmpvar_102; @@ -411,7 +434,9 @@ void main () if (tmpvar_102) { tmpvar_100 = 1.0; } else { - tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_99.z - u_params1.x) / _shadowCoord_99.w))); + tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_99.z - u_params1.x) + / _shadowCoord_99.w))); }; result_31 = (result_31 + tmpvar_100); vec4 tmpvar_103; @@ -419,7 +444,7 @@ void main () tmpvar_103.xy = (vec2(1.5, 0.5) * tmpvar_32); vec4 _shadowCoord_104; _shadowCoord_104 = (shadowcoord_1 + tmpvar_103); - float tmpvar_105; + lowp float tmpvar_105; vec2 tmpvar_106; tmpvar_106 = (_shadowCoord_104.xy / _shadowCoord_104.w); bool tmpvar_107; @@ -431,7 +456,9 @@ void main () if (tmpvar_107) { tmpvar_105 = 1.0; } else { - tmpvar_105 = float((dot (texture2D (u_shadowMap0, tmpvar_106), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_104.z - u_params1.x) / _shadowCoord_104.w))); + tmpvar_105 = float((dot (texture2D (u_shadowMap0, tmpvar_106), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_104.z - u_params1.x) + / _shadowCoord_104.w))); }; result_31 = (result_31 + tmpvar_105); vec4 tmpvar_108; @@ -439,7 +466,7 @@ void main () tmpvar_108.xy = (vec2(1.5, 1.5) * tmpvar_32); vec4 _shadowCoord_109; _shadowCoord_109 = (shadowcoord_1 + tmpvar_108); - float tmpvar_110; + lowp float tmpvar_110; vec2 tmpvar_111; tmpvar_111 = (_shadowCoord_109.xy / _shadowCoord_109.w); bool tmpvar_112; @@ -451,9 +478,11 @@ void main () if (tmpvar_112) { tmpvar_110 = 1.0; } else { - tmpvar_110 = float((dot (texture2D (u_shadowMap0, tmpvar_111), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_109.z - u_params1.x) / _shadowCoord_109.w))); + tmpvar_110 = float((dot (texture2D (u_shadowMap0, tmpvar_111), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_109.z - u_params1.x) + / _shadowCoord_109.w))); }; - float tmpvar_113; + lowp float tmpvar_113; tmpvar_113 = (result_31 + tmpvar_110); result_31 = tmpvar_113; tmpvar_30 = (tmpvar_113 / 16.0); @@ -473,18 +502,48 @@ void main () tmpvar_119 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_120; tmpvar_120 = sqrt(dot (tmpvar_117, tmpvar_117)); - tmpvar_116 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_120)) + ((u_lightAttenuationSpotOuter.z * tmpvar_120) * tmpvar_120)))) * mix (clamp (((max (0.0, dot (-(tmpvar_118), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_119) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_119)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_116 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_120)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_120) * tmpvar_120) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_118) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_119) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_119)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_121; tmpvar_121 = dot (v_normal, tmpvar_115); vec2 tmpvar_122; tmpvar_122.x = tmpvar_121; - tmpvar_122.y = (((float((tmpvar_121 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_121) * v_normal) - tmpvar_115), tmpvar_114)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_122.y = ((( + float((tmpvar_121 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_121) * v_normal) + - tmpvar_115), tmpvar_114)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_123; tmpvar_123 = (max (tmpvar_122, 0.0) * tmpvar_116); float tmpvar_124; tmpvar_124 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_123.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_123.y)) * u_color.xyz) * tmpvar_30))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_124) * tmpvar_124)))), 0.0, 1.0)); + lowp vec3 tmpvar_125; + tmpvar_125 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_123.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_123.y)) + * u_color.xyz) * tmpvar_30))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_124) * tmpvar_124)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_125; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin index 5afefd9c5..2985209b0 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin index 8d0960d65..a8df1c848 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_csm.bin @@ -1,33 +1,30 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -77,14 +74,14 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); colorCoverage_2 = tmpvar_20; - float tmpvar_21; + lowp float tmpvar_21; vec2 tmpvar_22; tmpvar_22 = (v_texcoord1.xy / v_texcoord1.w); bool tmpvar_23; @@ -98,19 +95,19 @@ void main () } else { float tmpvar_24; tmpvar_24 = (((v_texcoord1.z - u_params1.x) / v_texcoord1.w) * u_params1.w); - vec4 tmpvar_25; + lowp vec4 tmpvar_25; tmpvar_25 = texture2D (u_shadowMap0, tmpvar_22); - vec2 tmpvar_26; + lowp vec2 tmpvar_26; tmpvar_26.x = dot (tmpvar_25.xy, vec2(0.00390625, 1.0)); tmpvar_26.y = dot (tmpvar_25.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_27; + lowp vec2 tmpvar_27; tmpvar_27 = (tmpvar_26 * u_params1.w); if ((tmpvar_24 < tmpvar_27.x)) { tmpvar_21 = 1.0; } else { - float tmpvar_28; + lowp float tmpvar_28; tmpvar_28 = max ((tmpvar_27.y - (tmpvar_27.x * tmpvar_27.x)), u_params1.z); - float tmpvar_29; + lowp float tmpvar_29; tmpvar_29 = (tmpvar_24 - tmpvar_27.x); tmpvar_21 = (tmpvar_28 / (tmpvar_28 + (tmpvar_29 * tmpvar_29))); }; @@ -130,14 +127,14 @@ void main () } else { tmpvar_32 = bool(0); }; - float tmpvar_34; + lowp float tmpvar_34; tmpvar_34 = (float(tmpvar_32) * 0.4); - vec3 tmpvar_35; + lowp vec3 tmpvar_35; tmpvar_35.x = tmpvar_34; tmpvar_35.y = tmpvar_34; tmpvar_35.z = -(tmpvar_34); colorCoverage_2 = tmpvar_35; - float tmpvar_36; + lowp float tmpvar_36; vec2 tmpvar_37; tmpvar_37 = (v_texcoord2.xy / v_texcoord2.w); bool tmpvar_38; @@ -151,19 +148,19 @@ void main () } else { float tmpvar_39; tmpvar_39 = (((v_texcoord2.z - u_params1.x) / v_texcoord2.w) * u_params1.w); - vec4 tmpvar_40; + lowp vec4 tmpvar_40; tmpvar_40 = texture2D (u_shadowMap1, tmpvar_37); - vec2 tmpvar_41; + lowp vec2 tmpvar_41; tmpvar_41.x = dot (tmpvar_40.xy, vec2(0.00390625, 1.0)); tmpvar_41.y = dot (tmpvar_40.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_42; + lowp vec2 tmpvar_42; tmpvar_42 = (tmpvar_41 * u_params1.w); if ((tmpvar_39 < tmpvar_42.x)) { tmpvar_36 = 1.0; } else { - float tmpvar_43; + lowp float tmpvar_43; tmpvar_43 = max ((tmpvar_42.y - (tmpvar_42.x * tmpvar_42.x)), u_params1.z); - float tmpvar_44; + lowp float tmpvar_44; tmpvar_44 = (tmpvar_39 - tmpvar_42.x); tmpvar_36 = (tmpvar_43 / (tmpvar_43 + (tmpvar_44 * tmpvar_44))); }; @@ -183,14 +180,14 @@ void main () } else { tmpvar_47 = bool(0); }; - float tmpvar_49; + lowp float tmpvar_49; tmpvar_49 = (float(tmpvar_47) * 0.4); - vec3 tmpvar_50; + lowp vec3 tmpvar_50; tmpvar_50.x = -(tmpvar_49); tmpvar_50.y = -(tmpvar_49); tmpvar_50.z = tmpvar_49; colorCoverage_2 = tmpvar_50; - float tmpvar_51; + lowp float tmpvar_51; vec2 tmpvar_52; tmpvar_52 = (v_texcoord3.xy / v_texcoord3.w); bool tmpvar_53; @@ -204,19 +201,19 @@ void main () } else { float tmpvar_54; tmpvar_54 = (((v_texcoord3.z - u_params1.x) / v_texcoord3.w) * u_params1.w); - vec4 tmpvar_55; + lowp vec4 tmpvar_55; tmpvar_55 = texture2D (u_shadowMap2, tmpvar_52); - vec2 tmpvar_56; + lowp vec2 tmpvar_56; tmpvar_56.x = dot (tmpvar_55.xy, vec2(0.00390625, 1.0)); tmpvar_56.y = dot (tmpvar_55.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_57; + lowp vec2 tmpvar_57; tmpvar_57 = (tmpvar_56 * u_params1.w); if ((tmpvar_54 < tmpvar_57.x)) { tmpvar_51 = 1.0; } else { - float tmpvar_58; + lowp float tmpvar_58; tmpvar_58 = max ((tmpvar_57.y - (tmpvar_57.x * tmpvar_57.x)), u_params1.z); - float tmpvar_59; + lowp float tmpvar_59; tmpvar_59 = (tmpvar_54 - tmpvar_57.x); tmpvar_51 = (tmpvar_58 / (tmpvar_58 + (tmpvar_59 * tmpvar_59))); }; @@ -235,14 +232,14 @@ void main () } else { tmpvar_62 = bool(0); }; - float tmpvar_64; + lowp float tmpvar_64; tmpvar_64 = (float(tmpvar_62) * 0.4); - vec3 tmpvar_65; + lowp vec3 tmpvar_65; tmpvar_65.x = tmpvar_64; tmpvar_65.y = -(tmpvar_64); tmpvar_65.z = -(tmpvar_64); colorCoverage_2 = tmpvar_65; - float tmpvar_66; + lowp float tmpvar_66; vec2 tmpvar_67; tmpvar_67 = (v_texcoord4.xy / v_texcoord4.w); bool tmpvar_68; @@ -256,19 +253,19 @@ void main () } else { float tmpvar_69; tmpvar_69 = (((v_texcoord4.z - u_params1.x) / v_texcoord4.w) * u_params1.w); - vec4 tmpvar_70; + lowp vec4 tmpvar_70; tmpvar_70 = texture2D (u_shadowMap3, tmpvar_67); - vec2 tmpvar_71; + lowp vec2 tmpvar_71; tmpvar_71.x = dot (tmpvar_70.xy, vec2(0.00390625, 1.0)); tmpvar_71.y = dot (tmpvar_70.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_72; + lowp vec2 tmpvar_72; tmpvar_72 = (tmpvar_71 * u_params1.w); if ((tmpvar_69 < tmpvar_72.x)) { tmpvar_66 = 1.0; } else { - float tmpvar_73; + lowp float tmpvar_73; tmpvar_73 = max ((tmpvar_72.y - (tmpvar_72.x * tmpvar_72.x)), u_params1.z); - float tmpvar_74; + lowp float tmpvar_74; tmpvar_74 = (tmpvar_69 - tmpvar_72.x); tmpvar_66 = (tmpvar_73 / (tmpvar_73 + (tmpvar_74 * tmpvar_74))); }; @@ -293,18 +290,48 @@ void main () tmpvar_80 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_81; tmpvar_81 = sqrt(dot (tmpvar_78, tmpvar_78)); - tmpvar_77 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81)))) * mix (clamp (((max (0.0, dot (-(tmpvar_79), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_80) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_80)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_77 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_79) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_80) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_80)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_82; tmpvar_82 = dot (v_normal, tmpvar_76); vec2 tmpvar_83; tmpvar_83.x = tmpvar_82; - tmpvar_83.y = (((float((tmpvar_82 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_82) * v_normal) - tmpvar_76), tmpvar_75)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_83.y = ((( + float((tmpvar_82 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_82) * v_normal) + - tmpvar_76), tmpvar_75)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_84; tmpvar_84 = (max (tmpvar_83, 0.0) * tmpvar_77); float tmpvar_85; tmpvar_85 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_85) * tmpvar_85)))), 0.0, 1.0)); + lowp vec3 tmpvar_86; + tmpvar_86 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_85) * tmpvar_85)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_86; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin index 68228e896..a5389bc56 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin index 86cbf7c61..7f021137b 100644 --- a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin +++ b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_csm.bin @@ -1,33 +1,30 @@ -FSHF#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFprecision highp float; varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { - float visibility_1; - vec3 colorCoverage_2; + lowp float visibility_1; + lowp vec3 colorCoverage_2; vec2 tmpvar_3; tmpvar_3 = (v_texcoord1.xy / v_texcoord1.w); vec2 tmpvar_4; @@ -77,9 +74,9 @@ void main () } else { tmpvar_17 = bool(0); }; - float tmpvar_19; + lowp float tmpvar_19; tmpvar_19 = (float(tmpvar_17) * 0.4); - vec3 tmpvar_20; + lowp vec3 tmpvar_20; tmpvar_20.x = -(tmpvar_19); tmpvar_20.y = tmpvar_19; tmpvar_20.z = -(tmpvar_19); @@ -88,7 +85,7 @@ void main () tmpvar_21.w = 1.0; tmpvar_21.xy = (v_texcoord1.xy / v_texcoord1.w); tmpvar_21.z = v_texcoord1.z; - float tmpvar_22; + lowp float tmpvar_22; bool tmpvar_23; if (any(greaterThan (tmpvar_21.xy, vec2(1.0, 1.0)))) { tmpvar_23 = bool(1); @@ -100,19 +97,19 @@ void main () } else { float tmpvar_24; tmpvar_24 = ((v_texcoord1.z - u_params1.x) * u_params1.w); - vec4 tmpvar_25; + lowp vec4 tmpvar_25; tmpvar_25 = texture2D (u_shadowMap0, tmpvar_21.xy); - vec2 tmpvar_26; + lowp vec2 tmpvar_26; tmpvar_26.x = dot (tmpvar_25.xy, vec2(0.00390625, 1.0)); tmpvar_26.y = dot (tmpvar_25.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_27; + lowp vec2 tmpvar_27; tmpvar_27 = (tmpvar_26 * u_params1.w); if ((tmpvar_24 < tmpvar_27.x)) { tmpvar_22 = 1.0; } else { - float tmpvar_28; + lowp float tmpvar_28; tmpvar_28 = max ((tmpvar_27.y - (tmpvar_27.x * tmpvar_27.x)), u_params1.z); - float tmpvar_29; + lowp float tmpvar_29; tmpvar_29 = (tmpvar_24 - tmpvar_27.x); tmpvar_22 = (tmpvar_28 / (tmpvar_28 + (tmpvar_29 * tmpvar_29))); }; @@ -132,9 +129,9 @@ void main () } else { tmpvar_32 = bool(0); }; - float tmpvar_34; + lowp float tmpvar_34; tmpvar_34 = (float(tmpvar_32) * 0.4); - vec3 tmpvar_35; + lowp vec3 tmpvar_35; tmpvar_35.x = tmpvar_34; tmpvar_35.y = tmpvar_34; tmpvar_35.z = -(tmpvar_34); @@ -143,7 +140,7 @@ void main () tmpvar_36.w = 1.0; tmpvar_36.xy = (v_texcoord2.xy / v_texcoord2.w); tmpvar_36.z = v_texcoord2.z; - float tmpvar_37; + lowp float tmpvar_37; bool tmpvar_38; if (any(greaterThan (tmpvar_36.xy, vec2(1.0, 1.0)))) { tmpvar_38 = bool(1); @@ -155,19 +152,19 @@ void main () } else { float tmpvar_39; tmpvar_39 = ((v_texcoord2.z - u_params1.x) * u_params1.w); - vec4 tmpvar_40; + lowp vec4 tmpvar_40; tmpvar_40 = texture2D (u_shadowMap1, tmpvar_36.xy); - vec2 tmpvar_41; + lowp vec2 tmpvar_41; tmpvar_41.x = dot (tmpvar_40.xy, vec2(0.00390625, 1.0)); tmpvar_41.y = dot (tmpvar_40.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_42; + lowp vec2 tmpvar_42; tmpvar_42 = (tmpvar_41 * u_params1.w); if ((tmpvar_39 < tmpvar_42.x)) { tmpvar_37 = 1.0; } else { - float tmpvar_43; + lowp float tmpvar_43; tmpvar_43 = max ((tmpvar_42.y - (tmpvar_42.x * tmpvar_42.x)), u_params1.z); - float tmpvar_44; + lowp float tmpvar_44; tmpvar_44 = (tmpvar_39 - tmpvar_42.x); tmpvar_37 = (tmpvar_43 / (tmpvar_43 + (tmpvar_44 * tmpvar_44))); }; @@ -187,9 +184,9 @@ void main () } else { tmpvar_47 = bool(0); }; - float tmpvar_49; + lowp float tmpvar_49; tmpvar_49 = (float(tmpvar_47) * 0.4); - vec3 tmpvar_50; + lowp vec3 tmpvar_50; tmpvar_50.x = -(tmpvar_49); tmpvar_50.y = -(tmpvar_49); tmpvar_50.z = tmpvar_49; @@ -198,7 +195,7 @@ void main () tmpvar_51.w = 1.0; tmpvar_51.xy = (v_texcoord3.xy / v_texcoord3.w); tmpvar_51.z = v_texcoord3.z; - float tmpvar_52; + lowp float tmpvar_52; bool tmpvar_53; if (any(greaterThan (tmpvar_51.xy, vec2(1.0, 1.0)))) { tmpvar_53 = bool(1); @@ -210,19 +207,19 @@ void main () } else { float tmpvar_54; tmpvar_54 = ((v_texcoord3.z - u_params1.x) * u_params1.w); - vec4 tmpvar_55; + lowp vec4 tmpvar_55; tmpvar_55 = texture2D (u_shadowMap2, tmpvar_51.xy); - vec2 tmpvar_56; + lowp vec2 tmpvar_56; tmpvar_56.x = dot (tmpvar_55.xy, vec2(0.00390625, 1.0)); tmpvar_56.y = dot (tmpvar_55.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_57; + lowp vec2 tmpvar_57; tmpvar_57 = (tmpvar_56 * u_params1.w); if ((tmpvar_54 < tmpvar_57.x)) { tmpvar_52 = 1.0; } else { - float tmpvar_58; + lowp float tmpvar_58; tmpvar_58 = max ((tmpvar_57.y - (tmpvar_57.x * tmpvar_57.x)), u_params1.z); - float tmpvar_59; + lowp float tmpvar_59; tmpvar_59 = (tmpvar_54 - tmpvar_57.x); tmpvar_52 = (tmpvar_58 / (tmpvar_58 + (tmpvar_59 * tmpvar_59))); }; @@ -241,9 +238,9 @@ void main () } else { tmpvar_62 = bool(0); }; - float tmpvar_64; + lowp float tmpvar_64; tmpvar_64 = (float(tmpvar_62) * 0.4); - vec3 tmpvar_65; + lowp vec3 tmpvar_65; tmpvar_65.x = tmpvar_64; tmpvar_65.y = -(tmpvar_64); tmpvar_65.z = -(tmpvar_64); @@ -252,7 +249,7 @@ void main () tmpvar_66.w = 1.0; tmpvar_66.xy = (v_texcoord4.xy / v_texcoord4.w); tmpvar_66.z = v_texcoord4.z; - float tmpvar_67; + lowp float tmpvar_67; bool tmpvar_68; if (any(greaterThan (tmpvar_66.xy, vec2(1.0, 1.0)))) { tmpvar_68 = bool(1); @@ -264,19 +261,19 @@ void main () } else { float tmpvar_69; tmpvar_69 = ((v_texcoord4.z - u_params1.x) * u_params1.w); - vec4 tmpvar_70; + lowp vec4 tmpvar_70; tmpvar_70 = texture2D (u_shadowMap3, tmpvar_66.xy); - vec2 tmpvar_71; + lowp vec2 tmpvar_71; tmpvar_71.x = dot (tmpvar_70.xy, vec2(0.00390625, 1.0)); tmpvar_71.y = dot (tmpvar_70.zw, vec2(0.00390625, 1.0)); - vec2 tmpvar_72; + lowp vec2 tmpvar_72; tmpvar_72 = (tmpvar_71 * u_params1.w); if ((tmpvar_69 < tmpvar_72.x)) { tmpvar_67 = 1.0; } else { - float tmpvar_73; + lowp float tmpvar_73; tmpvar_73 = max ((tmpvar_72.y - (tmpvar_72.x * tmpvar_72.x)), u_params1.z); - float tmpvar_74; + lowp float tmpvar_74; tmpvar_74 = (tmpvar_69 - tmpvar_72.x); tmpvar_67 = (tmpvar_73 / (tmpvar_73 + (tmpvar_74 * tmpvar_74))); }; @@ -301,18 +298,48 @@ void main () tmpvar_80 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_81; tmpvar_81 = sqrt(dot (tmpvar_78, tmpvar_78)); - tmpvar_77 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81)))) * mix (clamp (((max (0.0, dot (-(tmpvar_79), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_80) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_80)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_77 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_79) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_80) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_80)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_82; tmpvar_82 = dot (v_normal, tmpvar_76); vec2 tmpvar_83; tmpvar_83.x = tmpvar_82; - tmpvar_83.y = (((float((tmpvar_82 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_82) * v_normal) - tmpvar_76), tmpvar_75)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_83.y = ((( + float((tmpvar_82 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_82) * v_normal) + - tmpvar_76), tmpvar_75)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_84; tmpvar_84 = (max (tmpvar_83, 0.0) * tmpvar_77); float tmpvar_85; tmpvar_85 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-005 * tmpvar_85) * tmpvar_85)))), 0.0, 1.0)); + lowp vec3 tmpvar_86; + tmpvar_86 = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_85) * tmpvar_85)) + )), 0.0, 1.0)); + gl_FragColor.xyz = tmpvar_86; gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin index 056cb15b7..d834a8f90 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_linear_omni.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin index 367d049f8..ab6c6c979 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_lightning_vsm_omni.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin b/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin index d3345883e..51f89699b 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin b/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin index dbc567856..d03bee454 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_hblur.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin index 6af9051f8..8d16fb82d 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_hblur_vsm.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin index dfd8804ee..e28e110bd 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin index a55287736..d06e4136c 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_linear.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin index 53f00d91f..2cdffddfe 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin index 2935cc499..3848511f4 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_packdepth_vsm_linear.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin b/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin index 2f33a4946..90f318139 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin b/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin index 158d75d61..4cb3b3d1b 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin index d6fce1257..720a22480 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_unpackdepth_vsm.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin b/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin index dbc567856..d03bee454 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_vblur.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin b/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin index 6af9051f8..8d16fb82d 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin and b/examples/runtime/shaders/gles/fs_shadowmaps_vblur_vsm.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin b/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin index 2072e8db1..5db1734d9 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_color_lightning.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin b/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin index d3345883e..51f89699b 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin index 6158f6fee..037b4c7e1 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svbackblank.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin index e456dc249..76b2f17d3 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svbackcolor.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin index a26daf520..5bfc487ae 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex1.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin index dca7a091a..92b8b2a9c 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svbacktex2.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin index 91105d207..df968ebcb 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svfrontblank.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin index e456dc249..76b2f17d3 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svfrontcolor.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin index 662f9b22c..33952c9a5 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex1.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin index 63c22ae88..c84af2ad9 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svfronttex2.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin index a6ac99f28..e86847080 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svside.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin index f8ad47b31..c6f4e39ce 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svsideblank.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin index aee6f2992..7338e3d52 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svsidecolor.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin b/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin index 87600068a..0ed13d291 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_svsidetex.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin b/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin index 2f33a4946..90f318139 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin b/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin index eda4855a0..21e6c2eda 100644 Binary files a/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin and b/examples/runtime/shaders/gles/fs_shadowvolume_texture_lightning.bin differ diff --git a/examples/runtime/shaders/gles/fs_smsimple_draw.bin b/examples/runtime/shaders/gles/fs_smsimple_draw.bin index 54b0bd259..7e7fa0245 100644 --- a/examples/runtime/shaders/gles/fs_smsimple_draw.bin +++ b/examples/runtime/shaders/gles/fs_smsimple_draw.bin @@ -1,12 +1,9 @@ -FSHpjH#ifdef GL_ES -precision highp float; -#endif // GL_ES - -uniform sampler2D u_shadowMap; -uniform vec4 u_lightPos; -varying vec3 v_view; -varying vec4 v_shadowcoord; +FSHpjHprecision highp float; varying vec3 v_normal; +varying vec4 v_shadowcoord; +varying vec3 v_view; +uniform vec4 u_lightPos; +uniform sampler2D u_shadowMap; void main () { vec2 lc_1; @@ -16,9 +13,17 @@ void main () tmpvar_3 = dot (v_normal, tmpvar_2); vec2 tmpvar_4; tmpvar_4.x = tmpvar_3; - tmpvar_4.y = (((float((tmpvar_3 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_3) * v_normal) - tmpvar_2), -(normalize(v_view)))), 1.0)) * 3.0) / 8.0); + tmpvar_4.y = ((( + float((tmpvar_3 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_3) * v_normal) + - tmpvar_2), -( + normalize(v_view) + ))), 1.0) + ) * 3.0) / 8.0); lc_1 = max (tmpvar_4, 0.0); - float result_5; + lowp float result_5; result_5 = 0.0; vec2 tmpvar_6; tmpvar_6 = (vec2(0.00195313, 0.00195313) * v_shadowcoord.w); @@ -27,7 +32,7 @@ void main () tmpvar_7.xy = (vec2(-1.5, -1.5) * tmpvar_6); vec4 _shadowCoord_8; _shadowCoord_8 = (v_shadowcoord + tmpvar_7); - float tmpvar_9; + lowp float tmpvar_9; vec2 tmpvar_10; tmpvar_10 = (_shadowCoord_8.xy / _shadowCoord_8.w); bool tmpvar_11; @@ -39,7 +44,9 @@ void main () if (tmpvar_11) { tmpvar_9 = 1.0; } else { - tmpvar_9 = float((dot (texture2D (u_shadowMap, tmpvar_10), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_8.z - 0.005) / _shadowCoord_8.w))); + tmpvar_9 = float((dot (texture2D (u_shadowMap, tmpvar_10), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_8.z - 0.005) + / _shadowCoord_8.w))); }; result_5 = tmpvar_9; vec4 tmpvar_12; @@ -47,7 +54,7 @@ void main () tmpvar_12.xy = (vec2(-1.5, -0.5) * tmpvar_6); vec4 _shadowCoord_13; _shadowCoord_13 = (v_shadowcoord + tmpvar_12); - float tmpvar_14; + lowp float tmpvar_14; vec2 tmpvar_15; tmpvar_15 = (_shadowCoord_13.xy / _shadowCoord_13.w); bool tmpvar_16; @@ -59,7 +66,9 @@ void main () if (tmpvar_16) { tmpvar_14 = 1.0; } else { - tmpvar_14 = float((dot (texture2D (u_shadowMap, tmpvar_15), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_13.z - 0.005) / _shadowCoord_13.w))); + tmpvar_14 = float((dot (texture2D (u_shadowMap, tmpvar_15), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_13.z - 0.005) + / _shadowCoord_13.w))); }; result_5 = (tmpvar_9 + tmpvar_14); vec4 tmpvar_17; @@ -67,7 +76,7 @@ void main () tmpvar_17.xy = (vec2(-1.5, 0.5) * tmpvar_6); vec4 _shadowCoord_18; _shadowCoord_18 = (v_shadowcoord + tmpvar_17); - float tmpvar_19; + lowp float tmpvar_19; vec2 tmpvar_20; tmpvar_20 = (_shadowCoord_18.xy / _shadowCoord_18.w); bool tmpvar_21; @@ -79,7 +88,9 @@ void main () if (tmpvar_21) { tmpvar_19 = 1.0; } else { - tmpvar_19 = float((dot (texture2D (u_shadowMap, tmpvar_20), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_18.z - 0.005) / _shadowCoord_18.w))); + tmpvar_19 = float((dot (texture2D (u_shadowMap, tmpvar_20), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_18.z - 0.005) + / _shadowCoord_18.w))); }; result_5 = (result_5 + tmpvar_19); vec4 tmpvar_22; @@ -87,7 +98,7 @@ void main () tmpvar_22.xy = (vec2(-1.5, 1.5) * tmpvar_6); vec4 _shadowCoord_23; _shadowCoord_23 = (v_shadowcoord + tmpvar_22); - float tmpvar_24; + lowp float tmpvar_24; vec2 tmpvar_25; tmpvar_25 = (_shadowCoord_23.xy / _shadowCoord_23.w); bool tmpvar_26; @@ -99,7 +110,9 @@ void main () if (tmpvar_26) { tmpvar_24 = 1.0; } else { - tmpvar_24 = float((dot (texture2D (u_shadowMap, tmpvar_25), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_23.z - 0.005) / _shadowCoord_23.w))); + tmpvar_24 = float((dot (texture2D (u_shadowMap, tmpvar_25), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_23.z - 0.005) + / _shadowCoord_23.w))); }; result_5 = (result_5 + tmpvar_24); vec4 tmpvar_27; @@ -107,7 +120,7 @@ void main () tmpvar_27.xy = (vec2(-0.5, -1.5) * tmpvar_6); vec4 _shadowCoord_28; _shadowCoord_28 = (v_shadowcoord + tmpvar_27); - float tmpvar_29; + lowp float tmpvar_29; vec2 tmpvar_30; tmpvar_30 = (_shadowCoord_28.xy / _shadowCoord_28.w); bool tmpvar_31; @@ -119,7 +132,9 @@ void main () if (tmpvar_31) { tmpvar_29 = 1.0; } else { - tmpvar_29 = float((dot (texture2D (u_shadowMap, tmpvar_30), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_28.z - 0.005) / _shadowCoord_28.w))); + tmpvar_29 = float((dot (texture2D (u_shadowMap, tmpvar_30), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_28.z - 0.005) + / _shadowCoord_28.w))); }; result_5 = (result_5 + tmpvar_29); vec4 tmpvar_32; @@ -127,7 +142,7 @@ void main () tmpvar_32.xy = (vec2(-0.5, -0.5) * tmpvar_6); vec4 _shadowCoord_33; _shadowCoord_33 = (v_shadowcoord + tmpvar_32); - float tmpvar_34; + lowp float tmpvar_34; vec2 tmpvar_35; tmpvar_35 = (_shadowCoord_33.xy / _shadowCoord_33.w); bool tmpvar_36; @@ -139,7 +154,9 @@ void main () if (tmpvar_36) { tmpvar_34 = 1.0; } else { - tmpvar_34 = float((dot (texture2D (u_shadowMap, tmpvar_35), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_33.z - 0.005) / _shadowCoord_33.w))); + tmpvar_34 = float((dot (texture2D (u_shadowMap, tmpvar_35), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_33.z - 0.005) + / _shadowCoord_33.w))); }; result_5 = (result_5 + tmpvar_34); vec4 tmpvar_37; @@ -147,7 +164,7 @@ void main () tmpvar_37.xy = (vec2(-0.5, 0.5) * tmpvar_6); vec4 _shadowCoord_38; _shadowCoord_38 = (v_shadowcoord + tmpvar_37); - float tmpvar_39; + lowp float tmpvar_39; vec2 tmpvar_40; tmpvar_40 = (_shadowCoord_38.xy / _shadowCoord_38.w); bool tmpvar_41; @@ -159,7 +176,9 @@ void main () if (tmpvar_41) { tmpvar_39 = 1.0; } else { - tmpvar_39 = float((dot (texture2D (u_shadowMap, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_38.z - 0.005) / _shadowCoord_38.w))); + tmpvar_39 = float((dot (texture2D (u_shadowMap, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_38.z - 0.005) + / _shadowCoord_38.w))); }; result_5 = (result_5 + tmpvar_39); vec4 tmpvar_42; @@ -167,7 +186,7 @@ void main () tmpvar_42.xy = (vec2(-0.5, 1.5) * tmpvar_6); vec4 _shadowCoord_43; _shadowCoord_43 = (v_shadowcoord + tmpvar_42); - float tmpvar_44; + lowp float tmpvar_44; vec2 tmpvar_45; tmpvar_45 = (_shadowCoord_43.xy / _shadowCoord_43.w); bool tmpvar_46; @@ -179,7 +198,9 @@ void main () if (tmpvar_46) { tmpvar_44 = 1.0; } else { - tmpvar_44 = float((dot (texture2D (u_shadowMap, tmpvar_45), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_43.z - 0.005) / _shadowCoord_43.w))); + tmpvar_44 = float((dot (texture2D (u_shadowMap, tmpvar_45), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_43.z - 0.005) + / _shadowCoord_43.w))); }; result_5 = (result_5 + tmpvar_44); vec4 tmpvar_47; @@ -187,7 +208,7 @@ void main () tmpvar_47.xy = (vec2(0.5, -1.5) * tmpvar_6); vec4 _shadowCoord_48; _shadowCoord_48 = (v_shadowcoord + tmpvar_47); - float tmpvar_49; + lowp float tmpvar_49; vec2 tmpvar_50; tmpvar_50 = (_shadowCoord_48.xy / _shadowCoord_48.w); bool tmpvar_51; @@ -199,7 +220,9 @@ void main () if (tmpvar_51) { tmpvar_49 = 1.0; } else { - tmpvar_49 = float((dot (texture2D (u_shadowMap, tmpvar_50), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_48.z - 0.005) / _shadowCoord_48.w))); + tmpvar_49 = float((dot (texture2D (u_shadowMap, tmpvar_50), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_48.z - 0.005) + / _shadowCoord_48.w))); }; result_5 = (result_5 + tmpvar_49); vec4 tmpvar_52; @@ -207,7 +230,7 @@ void main () tmpvar_52.xy = (vec2(0.5, -0.5) * tmpvar_6); vec4 _shadowCoord_53; _shadowCoord_53 = (v_shadowcoord + tmpvar_52); - float tmpvar_54; + lowp float tmpvar_54; vec2 tmpvar_55; tmpvar_55 = (_shadowCoord_53.xy / _shadowCoord_53.w); bool tmpvar_56; @@ -219,7 +242,9 @@ void main () if (tmpvar_56) { tmpvar_54 = 1.0; } else { - tmpvar_54 = float((dot (texture2D (u_shadowMap, tmpvar_55), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_53.z - 0.005) / _shadowCoord_53.w))); + tmpvar_54 = float((dot (texture2D (u_shadowMap, tmpvar_55), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_53.z - 0.005) + / _shadowCoord_53.w))); }; result_5 = (result_5 + tmpvar_54); vec4 tmpvar_57; @@ -227,7 +252,7 @@ void main () tmpvar_57.xy = (vec2(0.5, 0.5) * tmpvar_6); vec4 _shadowCoord_58; _shadowCoord_58 = (v_shadowcoord + tmpvar_57); - float tmpvar_59; + lowp float tmpvar_59; vec2 tmpvar_60; tmpvar_60 = (_shadowCoord_58.xy / _shadowCoord_58.w); bool tmpvar_61; @@ -239,7 +264,9 @@ void main () if (tmpvar_61) { tmpvar_59 = 1.0; } else { - tmpvar_59 = float((dot (texture2D (u_shadowMap, tmpvar_60), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_58.z - 0.005) / _shadowCoord_58.w))); + tmpvar_59 = float((dot (texture2D (u_shadowMap, tmpvar_60), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_58.z - 0.005) + / _shadowCoord_58.w))); }; result_5 = (result_5 + tmpvar_59); vec4 tmpvar_62; @@ -247,7 +274,7 @@ void main () tmpvar_62.xy = (vec2(0.5, 1.5) * tmpvar_6); vec4 _shadowCoord_63; _shadowCoord_63 = (v_shadowcoord + tmpvar_62); - float tmpvar_64; + lowp float tmpvar_64; vec2 tmpvar_65; tmpvar_65 = (_shadowCoord_63.xy / _shadowCoord_63.w); bool tmpvar_66; @@ -259,7 +286,9 @@ void main () if (tmpvar_66) { tmpvar_64 = 1.0; } else { - tmpvar_64 = float((dot (texture2D (u_shadowMap, tmpvar_65), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_63.z - 0.005) / _shadowCoord_63.w))); + tmpvar_64 = float((dot (texture2D (u_shadowMap, tmpvar_65), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_63.z - 0.005) + / _shadowCoord_63.w))); }; result_5 = (result_5 + tmpvar_64); vec4 tmpvar_67; @@ -267,7 +296,7 @@ void main () tmpvar_67.xy = (vec2(1.5, -1.5) * tmpvar_6); vec4 _shadowCoord_68; _shadowCoord_68 = (v_shadowcoord + tmpvar_67); - float tmpvar_69; + lowp float tmpvar_69; vec2 tmpvar_70; tmpvar_70 = (_shadowCoord_68.xy / _shadowCoord_68.w); bool tmpvar_71; @@ -279,7 +308,9 @@ void main () if (tmpvar_71) { tmpvar_69 = 1.0; } else { - tmpvar_69 = float((dot (texture2D (u_shadowMap, tmpvar_70), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_68.z - 0.005) / _shadowCoord_68.w))); + tmpvar_69 = float((dot (texture2D (u_shadowMap, tmpvar_70), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_68.z - 0.005) + / _shadowCoord_68.w))); }; result_5 = (result_5 + tmpvar_69); vec4 tmpvar_72; @@ -287,7 +318,7 @@ void main () tmpvar_72.xy = (vec2(1.5, -0.5) * tmpvar_6); vec4 _shadowCoord_73; _shadowCoord_73 = (v_shadowcoord + tmpvar_72); - float tmpvar_74; + lowp float tmpvar_74; vec2 tmpvar_75; tmpvar_75 = (_shadowCoord_73.xy / _shadowCoord_73.w); bool tmpvar_76; @@ -299,7 +330,9 @@ void main () if (tmpvar_76) { tmpvar_74 = 1.0; } else { - tmpvar_74 = float((dot (texture2D (u_shadowMap, tmpvar_75), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_73.z - 0.005) / _shadowCoord_73.w))); + tmpvar_74 = float((dot (texture2D (u_shadowMap, tmpvar_75), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_73.z - 0.005) + / _shadowCoord_73.w))); }; result_5 = (result_5 + tmpvar_74); vec4 tmpvar_77; @@ -307,7 +340,7 @@ void main () tmpvar_77.xy = (vec2(1.5, 0.5) * tmpvar_6); vec4 _shadowCoord_78; _shadowCoord_78 = (v_shadowcoord + tmpvar_77); - float tmpvar_79; + lowp float tmpvar_79; vec2 tmpvar_80; tmpvar_80 = (_shadowCoord_78.xy / _shadowCoord_78.w); bool tmpvar_81; @@ -319,7 +352,9 @@ void main () if (tmpvar_81) { tmpvar_79 = 1.0; } else { - tmpvar_79 = float((dot (texture2D (u_shadowMap, tmpvar_80), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_78.z - 0.005) / _shadowCoord_78.w))); + tmpvar_79 = float((dot (texture2D (u_shadowMap, tmpvar_80), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_78.z - 0.005) + / _shadowCoord_78.w))); }; result_5 = (result_5 + tmpvar_79); vec4 tmpvar_82; @@ -327,7 +362,7 @@ void main () tmpvar_82.xy = (vec2(1.5, 1.5) * tmpvar_6); vec4 _shadowCoord_83; _shadowCoord_83 = (v_shadowcoord + tmpvar_82); - float tmpvar_84; + lowp float tmpvar_84; vec2 tmpvar_85; tmpvar_85 = (_shadowCoord_83.xy / _shadowCoord_83.w); bool tmpvar_86; @@ -339,12 +374,16 @@ void main () if (tmpvar_86) { tmpvar_84 = 1.0; } else { - tmpvar_84 = float((dot (texture2D (u_shadowMap, tmpvar_85), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_83.z - 0.005) / _shadowCoord_83.w))); + tmpvar_84 = float((dot (texture2D (u_shadowMap, tmpvar_85), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_83.z - 0.005) + / _shadowCoord_83.w))); }; - float tmpvar_87; + lowp float tmpvar_87; tmpvar_87 = (result_5 + tmpvar_84); result_5 = tmpvar_87; - gl_FragColor.xyz = pow (abs((vec3(0.1, 0.1, 0.1) + (vec3((lc_1.x + lc_1.y)) * (tmpvar_87 / 16.0)))), vec3(0.454545, 0.454545, 0.454545)); + gl_FragColor.xyz = pow (abs((vec3(0.1, 0.1, 0.1) + + (vec3((lc_1.x + lc_1.y)) * (tmpvar_87 / 16.0)) + )), vec3(0.454545, 0.454545, 0.454545)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/gles/fs_smsimple_packdepth.bin b/examples/runtime/shaders/gles/fs_smsimple_packdepth.bin index dfd8804ee..e28e110bd 100644 Binary files a/examples/runtime/shaders/gles/fs_smsimple_packdepth.bin and b/examples/runtime/shaders/gles/fs_smsimple_packdepth.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_color_black.bin b/examples/runtime/shaders/gles/fs_stencil_color_black.bin index 6432488d8..e9b0e8cd9 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_color_black.bin and b/examples/runtime/shaders/gles/fs_stencil_color_black.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin b/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin index 3cc91606b..9ddee4a68 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin and b/examples/runtime/shaders/gles/fs_stencil_color_lightning.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_color_texture.bin b/examples/runtime/shaders/gles/fs_stencil_color_texture.bin index d3345883e..51f89699b 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_color_texture.bin and b/examples/runtime/shaders/gles/fs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_texture.bin b/examples/runtime/shaders/gles/fs_stencil_texture.bin index 2f33a4946..90f318139 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_texture.bin and b/examples/runtime/shaders/gles/fs_stencil_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin b/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin index 83b263332..7d90e1ad3 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin and b/examples/runtime/shaders/gles/fs_stencil_texture_lightning.bin differ diff --git a/examples/runtime/shaders/gles/fs_tree.bin b/examples/runtime/shaders/gles/fs_tree.bin index fd3cc1af1..e56bd14ec 100644 Binary files a/examples/runtime/shaders/gles/fs_tree.bin and b/examples/runtime/shaders/gles/fs_tree.bin differ diff --git a/examples/runtime/shaders/gles/fs_update.bin b/examples/runtime/shaders/gles/fs_update.bin index 880d148e9..b7fa7da1f 100644 Binary files a/examples/runtime/shaders/gles/fs_update.bin and b/examples/runtime/shaders/gles/fs_update.bin differ diff --git a/examples/runtime/shaders/gles/fs_update_cmp.bin b/examples/runtime/shaders/gles/fs_update_cmp.bin index 0fc11bdd1..848cc54f9 100644 Binary files a/examples/runtime/shaders/gles/fs_update_cmp.bin and b/examples/runtime/shaders/gles/fs_update_cmp.bin differ diff --git a/examples/runtime/shaders/gles/vs_bump.bin b/examples/runtime/shaders/gles/vs_bump.bin index 58a60d432..a823a1feb 100644 Binary files a/examples/runtime/shaders/gles/vs_bump.bin and b/examples/runtime/shaders/gles/vs_bump.bin differ diff --git a/examples/runtime/shaders/gles/vs_bump_instanced.bin b/examples/runtime/shaders/gles/vs_bump_instanced.bin index 176e23f1d..1c833a84b 100644 Binary files a/examples/runtime/shaders/gles/vs_bump_instanced.bin and b/examples/runtime/shaders/gles/vs_bump_instanced.bin differ diff --git a/examples/runtime/shaders/gles/vs_callback.bin b/examples/runtime/shaders/gles/vs_callback.bin index 9e1ab1c26..2566532cc 100644 Binary files a/examples/runtime/shaders/gles/vs_callback.bin and b/examples/runtime/shaders/gles/vs_callback.bin differ diff --git a/examples/runtime/shaders/gles/vs_cubes.bin b/examples/runtime/shaders/gles/vs_cubes.bin index 638673772..abef26edb 100644 Binary files a/examples/runtime/shaders/gles/vs_cubes.bin and b/examples/runtime/shaders/gles/vs_cubes.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_blur.bin b/examples/runtime/shaders/gles/vs_hdr_blur.bin index e72c29078..ac2cd579e 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_blur.bin and b/examples/runtime/shaders/gles/vs_hdr_blur.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_bright.bin b/examples/runtime/shaders/gles/vs_hdr_bright.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_bright.bin and b/examples/runtime/shaders/gles/vs_hdr_bright.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_lum.bin b/examples/runtime/shaders/gles/vs_hdr_lum.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_lum.bin and b/examples/runtime/shaders/gles/vs_hdr_lum.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_lumavg.bin b/examples/runtime/shaders/gles/vs_hdr_lumavg.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_lumavg.bin and b/examples/runtime/shaders/gles/vs_hdr_lumavg.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_mesh.bin b/examples/runtime/shaders/gles/vs_hdr_mesh.bin index e81a93d7c..62fcee243 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_mesh.bin and b/examples/runtime/shaders/gles/vs_hdr_mesh.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_skybox.bin b/examples/runtime/shaders/gles/vs_hdr_skybox.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_skybox.bin and b/examples/runtime/shaders/gles/vs_hdr_skybox.bin differ diff --git a/examples/runtime/shaders/gles/vs_hdr_tonemap.bin b/examples/runtime/shaders/gles/vs_hdr_tonemap.bin index 8df6d2bb8..323e29527 100644 Binary files a/examples/runtime/shaders/gles/vs_hdr_tonemap.bin and b/examples/runtime/shaders/gles/vs_hdr_tonemap.bin differ diff --git a/examples/runtime/shaders/gles/vs_instancing.bin b/examples/runtime/shaders/gles/vs_instancing.bin index 83afbe97d..cb7316193 100644 Binary files a/examples/runtime/shaders/gles/vs_instancing.bin and b/examples/runtime/shaders/gles/vs_instancing.bin differ diff --git a/examples/runtime/shaders/gles/vs_mesh.bin b/examples/runtime/shaders/gles/vs_mesh.bin index 54f9d38fc..b0fa79919 100644 Binary files a/examples/runtime/shaders/gles/vs_mesh.bin and b/examples/runtime/shaders/gles/vs_mesh.bin differ diff --git a/examples/runtime/shaders/gles/vs_raymarching.bin b/examples/runtime/shaders/gles/vs_raymarching.bin index c7afdef03..c884629bd 100644 Binary files a/examples/runtime/shaders/gles/vs_raymarching.bin and b/examples/runtime/shaders/gles/vs_raymarching.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color.bin index 1a3fc98b6..fba74c92f 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin index dd6637ab9..ba612a0a1 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin index 4e34c092c..04f4d93bc 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_csm.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin index 76f0f0378..fceaacfe8 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin index 9e39f4785..25d436784 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_csm.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin index f9d6fabf8..85e436d22 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_linear_omni.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin index fc21229f8..3eafaed58 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_lightning_omni.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin b/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin b/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin index 1a3fc98b6..fba74c92f 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_depth.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin b/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin index 9220c1ca2..99be0b6c8 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_hblur.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin b/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin index 30d616fb5..cfdadecea 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_packdepth.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin index 0683120ed..efbf38a9e 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_packdepth_linear.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin b/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_texture.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin b/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin index f6df25caf..54be64220 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_texture_lightning.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin b/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_unpackdepth.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin b/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin index 8366c8b65..f0df9d88a 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin and b/examples/runtime/shaders/gles/vs_shadowmaps_vblur.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin b/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin index 913c512a5..eb8a92731 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_color_lightning.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin b/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin b/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin index d52a8526d..192bb03ca 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_svback.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin b/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin index 1a3fc98b6..fba74c92f 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_svfront.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin b/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin index a6a9e6c1e..786f5f19a 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_svside.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin b/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_texture.bin differ diff --git a/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin b/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin index 24105ac00..929351d4f 100644 Binary files a/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin and b/examples/runtime/shaders/gles/vs_shadowvolume_texture_lightning.bin differ diff --git a/examples/runtime/shaders/gles/vs_smsimple_draw.bin b/examples/runtime/shaders/gles/vs_smsimple_draw.bin index e5b99749e..55a156a98 100644 Binary files a/examples/runtime/shaders/gles/vs_smsimple_draw.bin and b/examples/runtime/shaders/gles/vs_smsimple_draw.bin differ diff --git a/examples/runtime/shaders/gles/vs_smsimple_packdepth.bin b/examples/runtime/shaders/gles/vs_smsimple_packdepth.bin index 30d616fb5..cfdadecea 100644 Binary files a/examples/runtime/shaders/gles/vs_smsimple_packdepth.bin and b/examples/runtime/shaders/gles/vs_smsimple_packdepth.bin differ diff --git a/examples/runtime/shaders/gles/vs_stencil_color.bin b/examples/runtime/shaders/gles/vs_stencil_color.bin index 1a3fc98b6..fba74c92f 100644 Binary files a/examples/runtime/shaders/gles/vs_stencil_color.bin and b/examples/runtime/shaders/gles/vs_stencil_color.bin differ diff --git a/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin b/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin index d2798c917..9ec82c683 100644 Binary files a/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin and b/examples/runtime/shaders/gles/vs_stencil_color_lightning.bin differ diff --git a/examples/runtime/shaders/gles/vs_stencil_color_texture.bin b/examples/runtime/shaders/gles/vs_stencil_color_texture.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_stencil_color_texture.bin and b/examples/runtime/shaders/gles/vs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/vs_stencil_texture.bin b/examples/runtime/shaders/gles/vs_stencil_texture.bin index cd30b43cd..99c521559 100644 Binary files a/examples/runtime/shaders/gles/vs_stencil_texture.bin and b/examples/runtime/shaders/gles/vs_stencil_texture.bin differ diff --git a/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin b/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin index f6df25caf..54be64220 100644 Binary files a/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin and b/examples/runtime/shaders/gles/vs_stencil_texture_lightning.bin differ diff --git a/examples/runtime/shaders/gles/vs_tree.bin b/examples/runtime/shaders/gles/vs_tree.bin index 4d1df679f..26d44443f 100644 Binary files a/examples/runtime/shaders/gles/vs_tree.bin and b/examples/runtime/shaders/gles/vs_tree.bin differ diff --git a/examples/runtime/shaders/gles/vs_update.bin b/examples/runtime/shaders/gles/vs_update.bin index ffd893897..1f2d73312 100644 Binary files a/examples/runtime/shaders/gles/vs_update.bin and b/examples/runtime/shaders/gles/vs_update.bin differ diff --git a/examples/runtime/shaders/glsl/fs_bump.bin b/examples/runtime/shaders/glsl/fs_bump.bin index 053fa60f2..fd1a1f62c 100644 Binary files a/examples/runtime/shaders/glsl/fs_bump.bin and b/examples/runtime/shaders/glsl/fs_bump.bin differ diff --git a/examples/runtime/shaders/glsl/fs_callback.bin b/examples/runtime/shaders/glsl/fs_callback.bin index cd33eb568..3de1a98bf 100644 Binary files a/examples/runtime/shaders/glsl/fs_callback.bin and b/examples/runtime/shaders/glsl/fs_callback.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_blur.bin b/examples/runtime/shaders/glsl/fs_hdr_blur.bin index 150c06b64..72f56a9c8 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_blur.bin and b/examples/runtime/shaders/glsl/fs_hdr_blur.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_bright.bin b/examples/runtime/shaders/glsl/fs_hdr_bright.bin index eff7591b5..db64777ab 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_bright.bin and b/examples/runtime/shaders/glsl/fs_hdr_bright.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_lum.bin b/examples/runtime/shaders/glsl/fs_hdr_lum.bin index e1545ed11..afe9df9a9 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_lum.bin and b/examples/runtime/shaders/glsl/fs_hdr_lum.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin b/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin index 13de50fa0..5c962a202 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin and b/examples/runtime/shaders/glsl/fs_hdr_lumavg.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_mesh.bin b/examples/runtime/shaders/glsl/fs_hdr_mesh.bin index c7752bb39..ec356fdcf 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_mesh.bin and b/examples/runtime/shaders/glsl/fs_hdr_mesh.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_skybox.bin b/examples/runtime/shaders/glsl/fs_hdr_skybox.bin index ccb565589..e66ffa5f1 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_skybox.bin and b/examples/runtime/shaders/glsl/fs_hdr_skybox.bin differ diff --git a/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin b/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin index 2fb13f5ac..82e530aa9 100644 Binary files a/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin and b/examples/runtime/shaders/glsl/fs_hdr_tonemap.bin differ diff --git a/examples/runtime/shaders/glsl/fs_mesh.bin b/examples/runtime/shaders/glsl/fs_mesh.bin index f66aa293a..3ad77fcae 100644 Binary files a/examples/runtime/shaders/glsl/fs_mesh.bin and b/examples/runtime/shaders/glsl/fs_mesh.bin differ diff --git a/examples/runtime/shaders/glsl/fs_raymarching.bin b/examples/runtime/shaders/glsl/fs_raymarching.bin index c1fefd0e3..b515ef727 100644 --- a/examples/runtime/shaders/glsl/fs_raymarching.bin +++ b/examples/runtime/shaders/glsl/fs_raymarching.bin @@ -1,40 +1,36 @@ -FSHuniform vec3 u_lightDir; -uniform mat4 u_mtx; +FSHvarying vec4 v_color0; varying vec2 v_texcoord0; -varying vec4 v_color0; +uniform mat4 u_mtx; +uniform vec3 u_lightDir; void main () { vec4 tmpvar_1; tmpvar_1.zw = vec2(0.0, 1.0); - tmpvar_1.x = v_texcoord0.x; - tmpvar_1.y = v_texcoord0.y; + tmpvar_1.xy = v_texcoord0; vec4 tmpvar_2; tmpvar_2 = (u_mtx * tmpvar_1); vec3 tmpvar_3; tmpvar_3 = (tmpvar_2.xyz / tmpvar_2.w); vec4 tmpvar_4; tmpvar_4.zw = vec2(1.0, 1.0); - tmpvar_4.x = v_texcoord0.x; - tmpvar_4.y = v_texcoord0.y; + tmpvar_4.xy = v_texcoord0; vec4 tmpvar_5; tmpvar_5 = (u_mtx * tmpvar_4); vec3 tmpvar_6; tmpvar_6 = (tmpvar_5.xyz / tmpvar_5.w); float tmpvar_7; - vec3 arg0_8; - arg0_8 = (tmpvar_6 - tmpvar_3); - tmpvar_7 = sqrt(dot (arg0_8, arg0_8)); + vec3 x_8; + x_8 = (tmpvar_6 - tmpvar_3); + tmpvar_7 = sqrt(dot (x_8, x_8)); vec3 tmpvar_9; tmpvar_9 = normalize((tmpvar_6 - tmpvar_3)); vec3 _ray_10; _ray_10 = tmpvar_3; vec3 _dir_11; _dir_11 = tmpvar_9; - int ii_12; float tt_13; tt_13 = 0.0; - ii_12 = 0; - for (int ii_12 = 0; ii_12 < 64; ) { + for (int ii_12 = 0; ii_12 < 64; ii_12++) { vec3 _pos_14; _pos_14 = (_ray_10 + (_dir_11 * tt_13)); vec3 tmpvar_15; @@ -52,11 +48,24 @@ void main () vec3 _pos_21; _pos_21 = (_pos_14 + vec3(0.0, 0.0, -4.0)); float tmpvar_22; - tmpvar_22 = min (min (min (min (min (min ((sqrt(dot (tmpvar_15, tmpvar_15)) - 0.5), (sqrt(dot (_pos_16, _pos_16)) - 1.0)), (sqrt(dot (_pos_17, _pos_17)) - 1.0)), (sqrt(dot (_pos_18, _pos_18)) - 1.0)), (sqrt(dot (_pos_19, _pos_19)) - 1.0)), (sqrt(dot (_pos_20, _pos_20)) - 1.0)), (sqrt(dot (_pos_21, _pos_21)) - 1.0)); + tmpvar_22 = min (min (min ( + min (min (min (( + sqrt(dot (tmpvar_15, tmpvar_15)) + - 0.5), ( + sqrt(dot (_pos_16, _pos_16)) + - 1.0)), (sqrt( + dot (_pos_17, _pos_17) + ) - 1.0)), (sqrt(dot (_pos_18, _pos_18)) - 1.0)) + , + (sqrt(dot (_pos_19, _pos_19)) - 1.0) + ), ( + sqrt(dot (_pos_20, _pos_20)) + - 1.0)), (sqrt( + dot (_pos_21, _pos_21) + ) - 1.0)); if ((tmpvar_22 > 0.001)) { tt_13 = (tt_13 + tmpvar_22); }; - ii_12 = (ii_12 + 1); }; float tmpvar_23; if ((tt_13 < tmpvar_7)) { @@ -164,16 +173,102 @@ void main () vec3 _pos_72; _pos_72 = (_pos_65 + vec3(0.0, 0.0, -4.0)); vec3 tmpvar_73; - tmpvar_73.x = (min (min (min (min (min (min ((sqrt(dot (tmpvar_26, tmpvar_26)) - 0.5), (sqrt(dot (_pos_27, _pos_27)) - 1.0)), (sqrt(dot (_pos_28, _pos_28)) - 1.0)), (sqrt(dot (_pos_29, _pos_29)) - 1.0)), (sqrt(dot (_pos_30, _pos_30)) - 1.0)), (sqrt(dot (_pos_31, _pos_31)) - 1.0)), (sqrt(dot (_pos_32, _pos_32)) - 1.0)) - min (min (min (min (min (min ((sqrt(dot (tmpvar_34, tmpvar_34)) - 0.5), (sqrt(dot (_pos_35, _pos_35)) - 1.0)), (sqrt(dot (_pos_36, _pos_36)) - 1.0)), (sqrt(dot (_pos_37, _pos_37)) - 1.0)), (sqrt(dot (_pos_38, _pos_38)) - 1.0)), (sqrt(dot (_pos_39, _pos_39)) - 1.0)), (sqrt(dot (_pos_40, _pos_40)) - 1.0))); - tmpvar_73.y = (min (min (min (min (min (min ((sqrt(dot (tmpvar_42, tmpvar_42)) - 0.5), (sqrt(dot (_pos_43, _pos_43)) - 1.0)), (sqrt(dot (_pos_44, _pos_44)) - 1.0)), (sqrt(dot (_pos_45, _pos_45)) - 1.0)), (sqrt(dot (_pos_46, _pos_46)) - 1.0)), (sqrt(dot (_pos_47, _pos_47)) - 1.0)), (sqrt(dot (_pos_48, _pos_48)) - 1.0)) - min (min (min (min (min (min ((sqrt(dot (tmpvar_50, tmpvar_50)) - 0.5), (sqrt(dot (_pos_51, _pos_51)) - 1.0)), (sqrt(dot (_pos_52, _pos_52)) - 1.0)), (sqrt(dot (_pos_53, _pos_53)) - 1.0)), (sqrt(dot (_pos_54, _pos_54)) - 1.0)), (sqrt(dot (_pos_55, _pos_55)) - 1.0)), (sqrt(dot (_pos_56, _pos_56)) - 1.0))); - tmpvar_73.z = (min (min (min (min (min (min ((sqrt(dot (tmpvar_58, tmpvar_58)) - 0.5), (sqrt(dot (_pos_59, _pos_59)) - 1.0)), (sqrt(dot (_pos_60, _pos_60)) - 1.0)), (sqrt(dot (_pos_61, _pos_61)) - 1.0)), (sqrt(dot (_pos_62, _pos_62)) - 1.0)), (sqrt(dot (_pos_63, _pos_63)) - 1.0)), (sqrt(dot (_pos_64, _pos_64)) - 1.0)) - min (min (min (min (min (min ((sqrt(dot (tmpvar_66, tmpvar_66)) - 0.5), (sqrt(dot (_pos_67, _pos_67)) - 1.0)), (sqrt(dot (_pos_68, _pos_68)) - 1.0)), (sqrt(dot (_pos_69, _pos_69)) - 1.0)), (sqrt(dot (_pos_70, _pos_70)) - 1.0)), (sqrt(dot (_pos_71, _pos_71)) - 1.0)), (sqrt(dot (_pos_72, _pos_72)) - 1.0))); + tmpvar_73.x = (min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_26, tmpvar_26)) - 0.5) + , + (sqrt(dot (_pos_27, _pos_27)) - 1.0) + ), ( + sqrt(dot (_pos_28, _pos_28)) + - 1.0)), (sqrt( + dot (_pos_29, _pos_29) + ) - 1.0)), (sqrt(dot (_pos_30, _pos_30)) - 1.0)) + , + (sqrt(dot (_pos_31, _pos_31)) - 1.0) + ), ( + sqrt(dot (_pos_32, _pos_32)) + - 1.0)) - min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_34, tmpvar_34)) - 0.5) + , + (sqrt(dot (_pos_35, _pos_35)) - 1.0) + ), ( + sqrt(dot (_pos_36, _pos_36)) + - 1.0)), (sqrt( + dot (_pos_37, _pos_37) + ) - 1.0)), (sqrt(dot (_pos_38, _pos_38)) - 1.0)) + , + (sqrt(dot (_pos_39, _pos_39)) - 1.0) + ), ( + sqrt(dot (_pos_40, _pos_40)) + - 1.0))); + tmpvar_73.y = (min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_42, tmpvar_42)) - 0.5) + , + (sqrt(dot (_pos_43, _pos_43)) - 1.0) + ), ( + sqrt(dot (_pos_44, _pos_44)) + - 1.0)), (sqrt( + dot (_pos_45, _pos_45) + ) - 1.0)), (sqrt(dot (_pos_46, _pos_46)) - 1.0)) + , + (sqrt(dot (_pos_47, _pos_47)) - 1.0) + ), ( + sqrt(dot (_pos_48, _pos_48)) + - 1.0)) - min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_50, tmpvar_50)) - 0.5) + , + (sqrt(dot (_pos_51, _pos_51)) - 1.0) + ), ( + sqrt(dot (_pos_52, _pos_52)) + - 1.0)), (sqrt( + dot (_pos_53, _pos_53) + ) - 1.0)), (sqrt(dot (_pos_54, _pos_54)) - 1.0)) + , + (sqrt(dot (_pos_55, _pos_55)) - 1.0) + ), ( + sqrt(dot (_pos_56, _pos_56)) + - 1.0))); + tmpvar_73.z = (min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_58, tmpvar_58)) - 0.5) + , + (sqrt(dot (_pos_59, _pos_59)) - 1.0) + ), ( + sqrt(dot (_pos_60, _pos_60)) + - 1.0)), (sqrt( + dot (_pos_61, _pos_61) + ) - 1.0)), (sqrt(dot (_pos_62, _pos_62)) - 1.0)) + , + (sqrt(dot (_pos_63, _pos_63)) - 1.0) + ), ( + sqrt(dot (_pos_64, _pos_64)) + - 1.0)) - min (min ( + min (min (min (min ( + (sqrt(dot (tmpvar_66, tmpvar_66)) - 0.5) + , + (sqrt(dot (_pos_67, _pos_67)) - 1.0) + ), ( + sqrt(dot (_pos_68, _pos_68)) + - 1.0)), (sqrt( + dot (_pos_69, _pos_69) + ) - 1.0)), (sqrt(dot (_pos_70, _pos_70)) - 1.0)) + , + (sqrt(dot (_pos_71, _pos_71)) - 1.0) + ), ( + sqrt(dot (_pos_72, _pos_72)) + - 1.0))); vec3 tmpvar_74; tmpvar_74 = normalize(tmpvar_73); float tmpvar_75; tmpvar_75 = dot (tmpvar_74, u_lightDir); vec2 tmpvar_76; tmpvar_76.x = tmpvar_75; - tmpvar_76.y = dot ((u_lightDir - ((2.0 * tmpvar_75) * tmpvar_74)), tmpvar_9); + tmpvar_76.y = dot ((u_lightDir - ( + (2.0 * tmpvar_75) + * tmpvar_74)), tmpvar_9); float tmpvar_77; tmpvar_77 = max (0.0, tmpvar_75); vec4 tmpvar_78; @@ -181,16 +276,16 @@ void main () tmpvar_78.y = tmpvar_77; tmpvar_78.z = (float((tmpvar_75 >= 0.0)) * max (0.0, tmpvar_76.y)); float tmpvar_79; - tmpvar_79 = ((0.9 * tmpvar_77) + (pow (tmpvar_78.z, 128.0) * max ((0.2 + (0.8 * pow ((1.0 - tmpvar_75), 5.0))), 0.0))); + tmpvar_79 = ((0.9 * tmpvar_77) + (pow (tmpvar_78.z, 128.0) * max ( + (0.2 + (0.8 * pow ((1.0 - tmpvar_75), 5.0))) + , 0.0))); vec3 _pos_80; _pos_80 = tmpvar_24; vec3 _normal_81; _normal_81 = tmpvar_74; - int ii_82; float occ_83; occ_83 = 0.0; - ii_82 = 1; - for (int ii_82 = 1; ii_82 < 4; ) { + for (int ii_82 = 1; ii_82 < 4; ii_82++) { float tmpvar_84; tmpvar_84 = float(ii_82); vec3 _pos_85; @@ -209,8 +304,23 @@ void main () _pos_91 = (_pos_85 + vec3(0.0, 0.0, 4.0)); vec3 _pos_92; _pos_92 = (_pos_85 + vec3(0.0, 0.0, -4.0)); - occ_83 = (occ_83 + (((tmpvar_84 * 0.2) - min (min (min (min (min (min ((sqrt(dot (tmpvar_86, tmpvar_86)) - 0.5), (sqrt(dot (_pos_87, _pos_87)) - 1.0)), (sqrt(dot (_pos_88, _pos_88)) - 1.0)), (sqrt(dot (_pos_89, _pos_89)) - 1.0)), (sqrt(dot (_pos_90, _pos_90)) - 1.0)), (sqrt(dot (_pos_91, _pos_91)) - 1.0)), (sqrt(dot (_pos_92, _pos_92)) - 1.0))) / pow (2.0, tmpvar_84))); - ii_82 = (ii_82 + 1); + occ_83 = (occ_83 + (( + (tmpvar_84 * 0.2) + - + min (min (min (min ( + min (min ((sqrt( + dot (tmpvar_86, tmpvar_86) + ) - 0.5), (sqrt( + dot (_pos_87, _pos_87) + ) - 1.0)), (sqrt(dot (_pos_88, _pos_88)) - 1.0)) + , + (sqrt(dot (_pos_89, _pos_89)) - 1.0) + ), ( + sqrt(dot (_pos_90, _pos_90)) + - 1.0)), (sqrt( + dot (_pos_91, _pos_91) + ) - 1.0)), (sqrt(dot (_pos_92, _pos_92)) - 1.0)) + ) / exp2(tmpvar_84))); }; float tmpvar_93; tmpvar_93 = pow ((tmpvar_79 * (1.0 - occ_83)), 0.454545); diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin index 963a09dc5..c64a8f708 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin index 4c3b50077..c3d93e5be 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_csm.bin @@ -1,25 +1,25 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -94,7 +94,9 @@ void main () if (tmpvar_24) { tmpvar_22 = 1.0; } else { - tmpvar_22 = clamp (exp((_depthMultiplier_21 * (dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord1.z - u_params1.x) / v_texcoord1.w)))), 0.0, 1.0); + tmpvar_22 = clamp (exp((_depthMultiplier_21 * + (dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord1.z - u_params1.x) / v_texcoord1.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_22; } else { @@ -132,7 +134,9 @@ void main () if (tmpvar_34) { tmpvar_32 = 1.0; } else { - tmpvar_32 = clamp (exp((_depthMultiplier_31 * (dot (texture2D (u_shadowMap1, tmpvar_33), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord2.z - u_params1.x) / v_texcoord2.w)))), 0.0, 1.0); + tmpvar_32 = clamp (exp((_depthMultiplier_31 * + (dot (texture2D (u_shadowMap1, tmpvar_33), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord2.z - u_params1.x) / v_texcoord2.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_32; } else { @@ -170,7 +174,9 @@ void main () if (tmpvar_44) { tmpvar_42 = 1.0; } else { - tmpvar_42 = clamp (exp((_depthMultiplier_41 * (dot (texture2D (u_shadowMap2, tmpvar_43), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord3.z - u_params1.x) / v_texcoord3.w)))), 0.0, 1.0); + tmpvar_42 = clamp (exp((_depthMultiplier_41 * + (dot (texture2D (u_shadowMap2, tmpvar_43), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord3.z - u_params1.x) / v_texcoord3.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_42; } else { @@ -207,7 +213,9 @@ void main () if (tmpvar_54) { tmpvar_52 = 1.0; } else { - tmpvar_52 = clamp (exp((_depthMultiplier_51 * (dot (texture2D (u_shadowMap3, tmpvar_53), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - ((v_texcoord4.z - u_params1.x) / v_texcoord4.w)))), 0.0, 1.0); + tmpvar_52 = clamp (exp((_depthMultiplier_51 * + (dot (texture2D (u_shadowMap3, tmpvar_53), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - ((v_texcoord4.z - u_params1.x) / v_texcoord4.w)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_52; }; @@ -229,18 +237,46 @@ void main () tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_61; tmpvar_61 = sqrt(dot (tmpvar_58, tmpvar_58)); - tmpvar_57 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61)))) * mix (clamp (((max (0.0, dot (-(tmpvar_59), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_60) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_60)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_57 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_59) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_60) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_60)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_62; tmpvar_62 = dot (v_normal, tmpvar_56); vec2 tmpvar_63; tmpvar_63.x = tmpvar_62; - tmpvar_63.y = (((float((tmpvar_62 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_62) * v_normal) - tmpvar_56), tmpvar_55)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_63.y = ((( + float((tmpvar_62 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_62) * v_normal) + - tmpvar_56), tmpvar_55)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_64; tmpvar_64 = (max (tmpvar_63, 0.0) * tmpvar_57); float tmpvar_65; tmpvar_65 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_65) * tmpvar_65)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_65) * tmpvar_65)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin index 28ec861f2..30c71c70f 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin index f660d3e18..1c0d536d4 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_csm.bin @@ -1,25 +1,25 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -96,7 +96,9 @@ void main () if (tmpvar_24) { tmpvar_23 = 1.0; } else { - tmpvar_23 = clamp (exp((_depthMultiplier_22 * (dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord1.z - u_params1.x)))), 0.0, 1.0); + tmpvar_23 = clamp (exp((_depthMultiplier_22 * + (dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord1.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_23; } else { @@ -136,7 +138,9 @@ void main () if (tmpvar_34) { tmpvar_33 = 1.0; } else { - tmpvar_33 = clamp (exp((_depthMultiplier_32 * (dot (texture2D (u_shadowMap1, tmpvar_31.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord2.z - u_params1.x)))), 0.0, 1.0); + tmpvar_33 = clamp (exp((_depthMultiplier_32 * + (dot (texture2D (u_shadowMap1, tmpvar_31.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord2.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_33; } else { @@ -176,7 +180,9 @@ void main () if (tmpvar_44) { tmpvar_43 = 1.0; } else { - tmpvar_43 = clamp (exp((_depthMultiplier_42 * (dot (texture2D (u_shadowMap2, tmpvar_41.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord3.z - u_params1.x)))), 0.0, 1.0); + tmpvar_43 = clamp (exp((_depthMultiplier_42 * + (dot (texture2D (u_shadowMap2, tmpvar_41.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord3.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_43; } else { @@ -215,7 +221,9 @@ void main () if (tmpvar_54) { tmpvar_53 = 1.0; } else { - tmpvar_53 = clamp (exp((_depthMultiplier_52 * (dot (texture2D (u_shadowMap3, tmpvar_51.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) - (v_texcoord4.z - u_params1.x)))), 0.0, 1.0); + tmpvar_53 = clamp (exp((_depthMultiplier_52 * + (dot (texture2D (u_shadowMap3, tmpvar_51.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) - (v_texcoord4.z - u_params1.x)) + )), 0.0, 1.0); }; visibility_1 = tmpvar_53; }; @@ -237,18 +245,46 @@ void main () tmpvar_60 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_61; tmpvar_61 = sqrt(dot (tmpvar_58, tmpvar_58)); - tmpvar_57 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61)))) * mix (clamp (((max (0.0, dot (-(tmpvar_59), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_60) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_60)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_57 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_61)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_61) * tmpvar_61) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_59) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_60) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_60)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_62; tmpvar_62 = dot (v_normal, tmpvar_56); vec2 tmpvar_63; tmpvar_63.x = tmpvar_62; - tmpvar_63.y = (((float((tmpvar_62 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_62) * v_normal) - tmpvar_56), tmpvar_55)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_63.y = ((( + float((tmpvar_62 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_62) * v_normal) + - tmpvar_56), tmpvar_55)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_64; tmpvar_64 = (max (tmpvar_63, 0.0) * tmpvar_57); float tmpvar_65; tmpvar_65 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_65) * tmpvar_65)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_64.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_64.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_65) * tmpvar_65)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin index 05c713796..8dc6971bb 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_linear_omni.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin index fe708724f..090b4670b 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_esm_omni.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin index 4a9e3a69e..464393017 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin index eaa6b6332..057ceeb2c 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_csm.bin @@ -1,25 +1,25 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -92,7 +92,9 @@ void main () if (tmpvar_23) { tmpvar_21 = 1.0; } else { - tmpvar_21 = float((dot (texture2D (u_shadowMap0, tmpvar_22), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((v_texcoord1.z - u_params1.x) / v_texcoord1.w))); + tmpvar_21 = float((dot (texture2D (u_shadowMap0, tmpvar_22), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord1.z - u_params1.x) + / v_texcoord1.w))); }; visibility_1 = tmpvar_21; } else { @@ -128,7 +130,9 @@ void main () if (tmpvar_32) { tmpvar_30 = 1.0; } else { - tmpvar_30 = float((dot (texture2D (u_shadowMap1, tmpvar_31), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((v_texcoord2.z - u_params1.x) / v_texcoord2.w))); + tmpvar_30 = float((dot (texture2D (u_shadowMap1, tmpvar_31), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord2.z - u_params1.x) + / v_texcoord2.w))); }; visibility_1 = tmpvar_30; } else { @@ -164,7 +168,9 @@ void main () if (tmpvar_41) { tmpvar_39 = 1.0; } else { - tmpvar_39 = float((dot (texture2D (u_shadowMap2, tmpvar_40), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((v_texcoord3.z - u_params1.x) / v_texcoord3.w))); + tmpvar_39 = float((dot (texture2D (u_shadowMap2, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord3.z - u_params1.x) + / v_texcoord3.w))); }; visibility_1 = tmpvar_39; } else { @@ -199,7 +205,9 @@ void main () if (tmpvar_50) { tmpvar_48 = 1.0; } else { - tmpvar_48 = float((dot (texture2D (u_shadowMap3, tmpvar_49), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((v_texcoord4.z - u_params1.x) / v_texcoord4.w))); + tmpvar_48 = float((dot (texture2D (u_shadowMap3, tmpvar_49), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (v_texcoord4.z - u_params1.x) + / v_texcoord4.w))); }; visibility_1 = tmpvar_48; }; @@ -221,18 +229,46 @@ void main () tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_57; tmpvar_57 = sqrt(dot (tmpvar_54, tmpvar_54)); - tmpvar_53 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57)))) * mix (clamp (((max (0.0, dot (-(tmpvar_55), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_56) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_56)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_53 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_55) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_56) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_56)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_58; tmpvar_58 = dot (v_normal, tmpvar_52); vec2 tmpvar_59; tmpvar_59.x = tmpvar_58; - tmpvar_59.y = (((float((tmpvar_58 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_58) * v_normal) - tmpvar_52), tmpvar_51)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_59.y = ((( + float((tmpvar_58 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_58) * v_normal) + - tmpvar_52), tmpvar_51)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_60; tmpvar_60 = (max (tmpvar_59, 0.0) * tmpvar_53); float tmpvar_61; tmpvar_61 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_61) * tmpvar_61)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_61) * tmpvar_61)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin index 54d17c0de..263b19494 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin index 8ac72f450..52153c6d1 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_csm.bin @@ -1,25 +1,25 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -94,7 +94,7 @@ void main () if (tmpvar_23) { tmpvar_22 = 1.0; } else { - tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord1.z - u_params1.x))); + tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_21.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= (v_texcoord1.z - u_params1.x))); }; visibility_1 = tmpvar_22; } else { @@ -132,7 +132,7 @@ void main () if (tmpvar_32) { tmpvar_31 = 1.0; } else { - tmpvar_31 = float((dot (texture2D (u_shadowMap1, tmpvar_30.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord2.z - u_params1.x))); + tmpvar_31 = float((dot (texture2D (u_shadowMap1, tmpvar_30.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= (v_texcoord2.z - u_params1.x))); }; visibility_1 = tmpvar_31; } else { @@ -170,7 +170,7 @@ void main () if (tmpvar_41) { tmpvar_40 = 1.0; } else { - tmpvar_40 = float((dot (texture2D (u_shadowMap2, tmpvar_39.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord3.z - u_params1.x))); + tmpvar_40 = float((dot (texture2D (u_shadowMap2, tmpvar_39.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= (v_texcoord3.z - u_params1.x))); }; visibility_1 = tmpvar_40; } else { @@ -207,7 +207,7 @@ void main () if (tmpvar_50) { tmpvar_49 = 1.0; } else { - tmpvar_49 = float((dot (texture2D (u_shadowMap3, tmpvar_48.xy), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= (v_texcoord4.z - u_params1.x))); + tmpvar_49 = float((dot (texture2D (u_shadowMap3, tmpvar_48.xy), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= (v_texcoord4.z - u_params1.x))); }; visibility_1 = tmpvar_49; }; @@ -229,18 +229,46 @@ void main () tmpvar_56 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_57; tmpvar_57 = sqrt(dot (tmpvar_54, tmpvar_54)); - tmpvar_53 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57)))) * mix (clamp (((max (0.0, dot (-(tmpvar_55), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_56) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_56)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_53 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_57)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_57) * tmpvar_57) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_55) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_56) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_56)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_58; tmpvar_58 = dot (v_normal, tmpvar_52); vec2 tmpvar_59; tmpvar_59.x = tmpvar_58; - tmpvar_59.y = (((float((tmpvar_58 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_58) * v_normal) - tmpvar_52), tmpvar_51)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_59.y = ((( + float((tmpvar_58 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_58) * v_normal) + - tmpvar_52), tmpvar_51)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_60; tmpvar_60 = (max (tmpvar_59, 0.0) * tmpvar_53); float tmpvar_61; tmpvar_61 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_61) * tmpvar_61)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_60.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_60.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_61) * tmpvar_61)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin index ea975c8f2..f08c025ff 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_linear_omni.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin index 001e243ea..06b006ccc 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_hard_omni.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin index 6a53d1382..0272a573a 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf.bin @@ -1,20 +1,20 @@ -FSHpjHuniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; +FSHpjHvarying vec3 v_normal; varying vec4 v_shadowcoord; -varying vec3 v_normal; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; void main () { vec2 _texcoord_1; @@ -57,7 +57,9 @@ void main () if (tmpvar_14) { tmpvar_12 = 1.0; } else { - tmpvar_12 = float((dot (texture2D (u_shadowMap0, tmpvar_13), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_11.z - u_params1.x) / _shadowCoord_11.w))); + tmpvar_12 = float((dot (texture2D (u_shadowMap0, tmpvar_13), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_11.z - u_params1.x) + / _shadowCoord_11.w))); }; result_8 = tmpvar_12; vec4 tmpvar_15; @@ -77,7 +79,9 @@ void main () if (tmpvar_19) { tmpvar_17 = 1.0; } else { - tmpvar_17 = float((dot (texture2D (u_shadowMap0, tmpvar_18), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_16.z - u_params1.x) / _shadowCoord_16.w))); + tmpvar_17 = float((dot (texture2D (u_shadowMap0, tmpvar_18), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_16.z - u_params1.x) + / _shadowCoord_16.w))); }; result_8 = (tmpvar_12 + tmpvar_17); vec4 tmpvar_20; @@ -97,7 +101,9 @@ void main () if (tmpvar_24) { tmpvar_22 = 1.0; } else { - tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_21.z - u_params1.x) / _shadowCoord_21.w))); + tmpvar_22 = float((dot (texture2D (u_shadowMap0, tmpvar_23), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_21.z - u_params1.x) + / _shadowCoord_21.w))); }; result_8 = (result_8 + tmpvar_22); vec4 tmpvar_25; @@ -117,7 +123,9 @@ void main () if (tmpvar_29) { tmpvar_27 = 1.0; } else { - tmpvar_27 = float((dot (texture2D (u_shadowMap0, tmpvar_28), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_26.z - u_params1.x) / _shadowCoord_26.w))); + tmpvar_27 = float((dot (texture2D (u_shadowMap0, tmpvar_28), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_26.z - u_params1.x) + / _shadowCoord_26.w))); }; result_8 = (result_8 + tmpvar_27); vec4 tmpvar_30; @@ -137,7 +145,9 @@ void main () if (tmpvar_34) { tmpvar_32 = 1.0; } else { - tmpvar_32 = float((dot (texture2D (u_shadowMap0, tmpvar_33), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_31.z - u_params1.x) / _shadowCoord_31.w))); + tmpvar_32 = float((dot (texture2D (u_shadowMap0, tmpvar_33), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_31.z - u_params1.x) + / _shadowCoord_31.w))); }; result_8 = (result_8 + tmpvar_32); vec4 tmpvar_35; @@ -157,7 +167,9 @@ void main () if (tmpvar_39) { tmpvar_37 = 1.0; } else { - tmpvar_37 = float((dot (texture2D (u_shadowMap0, tmpvar_38), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_36.z - u_params1.x) / _shadowCoord_36.w))); + tmpvar_37 = float((dot (texture2D (u_shadowMap0, tmpvar_38), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_36.z - u_params1.x) + / _shadowCoord_36.w))); }; result_8 = (result_8 + tmpvar_37); vec4 tmpvar_40; @@ -177,7 +189,9 @@ void main () if (tmpvar_44) { tmpvar_42 = 1.0; } else { - tmpvar_42 = float((dot (texture2D (u_shadowMap0, tmpvar_43), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_41.z - u_params1.x) / _shadowCoord_41.w))); + tmpvar_42 = float((dot (texture2D (u_shadowMap0, tmpvar_43), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_41.z - u_params1.x) + / _shadowCoord_41.w))); }; result_8 = (result_8 + tmpvar_42); vec4 tmpvar_45; @@ -197,7 +211,9 @@ void main () if (tmpvar_49) { tmpvar_47 = 1.0; } else { - tmpvar_47 = float((dot (texture2D (u_shadowMap0, tmpvar_48), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_46.z - u_params1.x) / _shadowCoord_46.w))); + tmpvar_47 = float((dot (texture2D (u_shadowMap0, tmpvar_48), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_46.z - u_params1.x) + / _shadowCoord_46.w))); }; result_8 = (result_8 + tmpvar_47); vec4 tmpvar_50; @@ -217,7 +233,9 @@ void main () if (tmpvar_54) { tmpvar_52 = 1.0; } else { - tmpvar_52 = float((dot (texture2D (u_shadowMap0, tmpvar_53), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_51.z - u_params1.x) / _shadowCoord_51.w))); + tmpvar_52 = float((dot (texture2D (u_shadowMap0, tmpvar_53), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_51.z - u_params1.x) + / _shadowCoord_51.w))); }; result_8 = (result_8 + tmpvar_52); vec4 tmpvar_55; @@ -237,7 +255,9 @@ void main () if (tmpvar_59) { tmpvar_57 = 1.0; } else { - tmpvar_57 = float((dot (texture2D (u_shadowMap0, tmpvar_58), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_56.z - u_params1.x) / _shadowCoord_56.w))); + tmpvar_57 = float((dot (texture2D (u_shadowMap0, tmpvar_58), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_56.z - u_params1.x) + / _shadowCoord_56.w))); }; result_8 = (result_8 + tmpvar_57); vec4 tmpvar_60; @@ -257,7 +277,9 @@ void main () if (tmpvar_64) { tmpvar_62 = 1.0; } else { - tmpvar_62 = float((dot (texture2D (u_shadowMap0, tmpvar_63), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_61.z - u_params1.x) / _shadowCoord_61.w))); + tmpvar_62 = float((dot (texture2D (u_shadowMap0, tmpvar_63), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_61.z - u_params1.x) + / _shadowCoord_61.w))); }; result_8 = (result_8 + tmpvar_62); vec4 tmpvar_65; @@ -277,7 +299,9 @@ void main () if (tmpvar_69) { tmpvar_67 = 1.0; } else { - tmpvar_67 = float((dot (texture2D (u_shadowMap0, tmpvar_68), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_66.z - u_params1.x) / _shadowCoord_66.w))); + tmpvar_67 = float((dot (texture2D (u_shadowMap0, tmpvar_68), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_66.z - u_params1.x) + / _shadowCoord_66.w))); }; result_8 = (result_8 + tmpvar_67); vec4 tmpvar_70; @@ -297,7 +321,9 @@ void main () if (tmpvar_74) { tmpvar_72 = 1.0; } else { - tmpvar_72 = float((dot (texture2D (u_shadowMap0, tmpvar_73), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_71.z - u_params1.x) / _shadowCoord_71.w))); + tmpvar_72 = float((dot (texture2D (u_shadowMap0, tmpvar_73), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_71.z - u_params1.x) + / _shadowCoord_71.w))); }; result_8 = (result_8 + tmpvar_72); vec4 tmpvar_75; @@ -317,7 +343,9 @@ void main () if (tmpvar_79) { tmpvar_77 = 1.0; } else { - tmpvar_77 = float((dot (texture2D (u_shadowMap0, tmpvar_78), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_76.z - u_params1.x) / _shadowCoord_76.w))); + tmpvar_77 = float((dot (texture2D (u_shadowMap0, tmpvar_78), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_76.z - u_params1.x) + / _shadowCoord_76.w))); }; result_8 = (result_8 + tmpvar_77); vec4 tmpvar_80; @@ -337,7 +365,9 @@ void main () if (tmpvar_84) { tmpvar_82 = 1.0; } else { - tmpvar_82 = float((dot (texture2D (u_shadowMap0, tmpvar_83), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_81.z - u_params1.x) / _shadowCoord_81.w))); + tmpvar_82 = float((dot (texture2D (u_shadowMap0, tmpvar_83), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_81.z - u_params1.x) + / _shadowCoord_81.w))); }; result_8 = (result_8 + tmpvar_82); vec4 tmpvar_85; @@ -357,7 +387,9 @@ void main () if (tmpvar_89) { tmpvar_87 = 1.0; } else { - tmpvar_87 = float((dot (texture2D (u_shadowMap0, tmpvar_88), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_86.z - u_params1.x) / _shadowCoord_86.w))); + tmpvar_87 = float((dot (texture2D (u_shadowMap0, tmpvar_88), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_86.z - u_params1.x) + / _shadowCoord_86.w))); }; float tmpvar_90; tmpvar_90 = (result_8 + tmpvar_87); @@ -379,18 +411,46 @@ void main () tmpvar_96 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_97; tmpvar_97 = sqrt(dot (tmpvar_94, tmpvar_94)); - tmpvar_93 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_97)) + ((u_lightAttenuationSpotOuter.z * tmpvar_97) * tmpvar_97)))) * mix (clamp (((max (0.0, dot (-(tmpvar_95), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_96) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_96)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_93 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_97)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_97) * tmpvar_97) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_95) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_96) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_96)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_98; tmpvar_98 = dot (v_normal, tmpvar_92); vec2 tmpvar_99; tmpvar_99.x = tmpvar_98; - tmpvar_99.y = (((float((tmpvar_98 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_98) * v_normal) - tmpvar_92), tmpvar_91)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_99.y = ((( + float((tmpvar_98 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_98) * v_normal) + - tmpvar_92), tmpvar_91)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_100; tmpvar_100 = (max (tmpvar_99, 0.0) * tmpvar_93); float tmpvar_101; tmpvar_101 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_100.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_100.y)) * u_color.xyz) * tmpvar_7))), vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_101) * tmpvar_101)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_100.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_100.y)) + * u_color.xyz) * tmpvar_7))) + , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_101) * tmpvar_101)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin index f7f05d180..3fff34d66 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_csm.bin @@ -1,26 +1,26 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -102,7 +102,9 @@ void main () if (tmpvar_27) { tmpvar_25 = 1.0; } else { - tmpvar_25 = float((dot (texture2D (u_shadowMap0, tmpvar_26), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_24.z - u_params1.x) / _shadowCoord_24.w))); + tmpvar_25 = float((dot (texture2D (u_shadowMap0, tmpvar_26), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_24.z - u_params1.x) + / _shadowCoord_24.w))); }; result_21 = tmpvar_25; vec4 tmpvar_28; @@ -122,7 +124,9 @@ void main () if (tmpvar_32) { tmpvar_30 = 1.0; } else { - tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_29.z - u_params1.x) / _shadowCoord_29.w))); + tmpvar_30 = float((dot (texture2D (u_shadowMap0, tmpvar_31), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_29.z - u_params1.x) + / _shadowCoord_29.w))); }; result_21 = (tmpvar_25 + tmpvar_30); vec4 tmpvar_33; @@ -142,7 +146,9 @@ void main () if (tmpvar_37) { tmpvar_35 = 1.0; } else { - tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_34.z - u_params1.x) / _shadowCoord_34.w))); + tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_34.z - u_params1.x) + / _shadowCoord_34.w))); }; result_21 = (result_21 + tmpvar_35); vec4 tmpvar_38; @@ -162,7 +168,9 @@ void main () if (tmpvar_42) { tmpvar_40 = 1.0; } else { - tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_39.z - u_params1.x) / _shadowCoord_39.w))); + tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_39.z - u_params1.x) + / _shadowCoord_39.w))); }; result_21 = (result_21 + tmpvar_40); vec4 tmpvar_43; @@ -182,7 +190,9 @@ void main () if (tmpvar_47) { tmpvar_45 = 1.0; } else { - tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_44.z - u_params1.x) / _shadowCoord_44.w))); + tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_44.z - u_params1.x) + / _shadowCoord_44.w))); }; result_21 = (result_21 + tmpvar_45); vec4 tmpvar_48; @@ -202,7 +212,9 @@ void main () if (tmpvar_52) { tmpvar_50 = 1.0; } else { - tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_49.z - u_params1.x) / _shadowCoord_49.w))); + tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_49.z - u_params1.x) + / _shadowCoord_49.w))); }; result_21 = (result_21 + tmpvar_50); vec4 tmpvar_53; @@ -222,7 +234,9 @@ void main () if (tmpvar_57) { tmpvar_55 = 1.0; } else { - tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_54.z - u_params1.x) / _shadowCoord_54.w))); + tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_54.z - u_params1.x) + / _shadowCoord_54.w))); }; result_21 = (result_21 + tmpvar_55); vec4 tmpvar_58; @@ -242,7 +256,9 @@ void main () if (tmpvar_62) { tmpvar_60 = 1.0; } else { - tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_59.z - u_params1.x) / _shadowCoord_59.w))); + tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_59.z - u_params1.x) + / _shadowCoord_59.w))); }; result_21 = (result_21 + tmpvar_60); vec4 tmpvar_63; @@ -262,7 +278,9 @@ void main () if (tmpvar_67) { tmpvar_65 = 1.0; } else { - tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_64.z - u_params1.x) / _shadowCoord_64.w))); + tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_64.z - u_params1.x) + / _shadowCoord_64.w))); }; result_21 = (result_21 + tmpvar_65); vec4 tmpvar_68; @@ -282,7 +300,9 @@ void main () if (tmpvar_72) { tmpvar_70 = 1.0; } else { - tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_69.z - u_params1.x) / _shadowCoord_69.w))); + tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_69.z - u_params1.x) + / _shadowCoord_69.w))); }; result_21 = (result_21 + tmpvar_70); vec4 tmpvar_73; @@ -302,7 +322,9 @@ void main () if (tmpvar_77) { tmpvar_75 = 1.0; } else { - tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_74.z - u_params1.x) / _shadowCoord_74.w))); + tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_74.z - u_params1.x) + / _shadowCoord_74.w))); }; result_21 = (result_21 + tmpvar_75); vec4 tmpvar_78; @@ -322,7 +344,9 @@ void main () if (tmpvar_82) { tmpvar_80 = 1.0; } else { - tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_79.z - u_params1.x) / _shadowCoord_79.w))); + tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_79.z - u_params1.x) + / _shadowCoord_79.w))); }; result_21 = (result_21 + tmpvar_80); vec4 tmpvar_83; @@ -342,7 +366,9 @@ void main () if (tmpvar_87) { tmpvar_85 = 1.0; } else { - tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_84.z - u_params1.x) / _shadowCoord_84.w))); + tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_84.z - u_params1.x) + / _shadowCoord_84.w))); }; result_21 = (result_21 + tmpvar_85); vec4 tmpvar_88; @@ -362,7 +388,9 @@ void main () if (tmpvar_92) { tmpvar_90 = 1.0; } else { - tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_89.z - u_params1.x) / _shadowCoord_89.w))); + tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_89.z - u_params1.x) + / _shadowCoord_89.w))); }; result_21 = (result_21 + tmpvar_90); vec4 tmpvar_93; @@ -382,7 +410,9 @@ void main () if (tmpvar_97) { tmpvar_95 = 1.0; } else { - tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_94.z - u_params1.x) / _shadowCoord_94.w))); + tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_94.z - u_params1.x) + / _shadowCoord_94.w))); }; result_21 = (result_21 + tmpvar_95); vec4 tmpvar_98; @@ -402,7 +432,9 @@ void main () if (tmpvar_102) { tmpvar_100 = 1.0; } else { - tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_99.z - u_params1.x) / _shadowCoord_99.w))); + tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_99.z - u_params1.x) + / _shadowCoord_99.w))); }; float tmpvar_103; tmpvar_103 = (result_21 + tmpvar_100); @@ -450,7 +482,9 @@ void main () if (tmpvar_116) { tmpvar_114 = 1.0; } else { - tmpvar_114 = float((dot (texture2D (u_shadowMap1, tmpvar_115), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_113.z - u_params1.x) / _shadowCoord_113.w))); + tmpvar_114 = float((dot (texture2D (u_shadowMap1, tmpvar_115), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_113.z - u_params1.x) + / _shadowCoord_113.w))); }; result_110 = tmpvar_114; vec4 tmpvar_117; @@ -470,7 +504,9 @@ void main () if (tmpvar_121) { tmpvar_119 = 1.0; } else { - tmpvar_119 = float((dot (texture2D (u_shadowMap1, tmpvar_120), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_118.z - u_params1.x) / _shadowCoord_118.w))); + tmpvar_119 = float((dot (texture2D (u_shadowMap1, tmpvar_120), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_118.z - u_params1.x) + / _shadowCoord_118.w))); }; result_110 = (tmpvar_114 + tmpvar_119); vec4 tmpvar_122; @@ -490,7 +526,9 @@ void main () if (tmpvar_126) { tmpvar_124 = 1.0; } else { - tmpvar_124 = float((dot (texture2D (u_shadowMap1, tmpvar_125), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_123.z - u_params1.x) / _shadowCoord_123.w))); + tmpvar_124 = float((dot (texture2D (u_shadowMap1, tmpvar_125), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_123.z - u_params1.x) + / _shadowCoord_123.w))); }; result_110 = (result_110 + tmpvar_124); vec4 tmpvar_127; @@ -510,7 +548,9 @@ void main () if (tmpvar_131) { tmpvar_129 = 1.0; } else { - tmpvar_129 = float((dot (texture2D (u_shadowMap1, tmpvar_130), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_128.z - u_params1.x) / _shadowCoord_128.w))); + tmpvar_129 = float((dot (texture2D (u_shadowMap1, tmpvar_130), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_128.z - u_params1.x) + / _shadowCoord_128.w))); }; result_110 = (result_110 + tmpvar_129); vec4 tmpvar_132; @@ -530,7 +570,9 @@ void main () if (tmpvar_136) { tmpvar_134 = 1.0; } else { - tmpvar_134 = float((dot (texture2D (u_shadowMap1, tmpvar_135), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_133.z - u_params1.x) / _shadowCoord_133.w))); + tmpvar_134 = float((dot (texture2D (u_shadowMap1, tmpvar_135), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_133.z - u_params1.x) + / _shadowCoord_133.w))); }; result_110 = (result_110 + tmpvar_134); vec4 tmpvar_137; @@ -550,7 +592,9 @@ void main () if (tmpvar_141) { tmpvar_139 = 1.0; } else { - tmpvar_139 = float((dot (texture2D (u_shadowMap1, tmpvar_140), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_138.z - u_params1.x) / _shadowCoord_138.w))); + tmpvar_139 = float((dot (texture2D (u_shadowMap1, tmpvar_140), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_138.z - u_params1.x) + / _shadowCoord_138.w))); }; result_110 = (result_110 + tmpvar_139); vec4 tmpvar_142; @@ -570,7 +614,9 @@ void main () if (tmpvar_146) { tmpvar_144 = 1.0; } else { - tmpvar_144 = float((dot (texture2D (u_shadowMap1, tmpvar_145), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_143.z - u_params1.x) / _shadowCoord_143.w))); + tmpvar_144 = float((dot (texture2D (u_shadowMap1, tmpvar_145), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_143.z - u_params1.x) + / _shadowCoord_143.w))); }; result_110 = (result_110 + tmpvar_144); vec4 tmpvar_147; @@ -590,7 +636,9 @@ void main () if (tmpvar_151) { tmpvar_149 = 1.0; } else { - tmpvar_149 = float((dot (texture2D (u_shadowMap1, tmpvar_150), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_148.z - u_params1.x) / _shadowCoord_148.w))); + tmpvar_149 = float((dot (texture2D (u_shadowMap1, tmpvar_150), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_148.z - u_params1.x) + / _shadowCoord_148.w))); }; result_110 = (result_110 + tmpvar_149); vec4 tmpvar_152; @@ -610,7 +658,9 @@ void main () if (tmpvar_156) { tmpvar_154 = 1.0; } else { - tmpvar_154 = float((dot (texture2D (u_shadowMap1, tmpvar_155), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_153.z - u_params1.x) / _shadowCoord_153.w))); + tmpvar_154 = float((dot (texture2D (u_shadowMap1, tmpvar_155), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_153.z - u_params1.x) + / _shadowCoord_153.w))); }; result_110 = (result_110 + tmpvar_154); vec4 tmpvar_157; @@ -630,7 +680,9 @@ void main () if (tmpvar_161) { tmpvar_159 = 1.0; } else { - tmpvar_159 = float((dot (texture2D (u_shadowMap1, tmpvar_160), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_158.z - u_params1.x) / _shadowCoord_158.w))); + tmpvar_159 = float((dot (texture2D (u_shadowMap1, tmpvar_160), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_158.z - u_params1.x) + / _shadowCoord_158.w))); }; result_110 = (result_110 + tmpvar_159); vec4 tmpvar_162; @@ -650,7 +702,9 @@ void main () if (tmpvar_166) { tmpvar_164 = 1.0; } else { - tmpvar_164 = float((dot (texture2D (u_shadowMap1, tmpvar_165), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_163.z - u_params1.x) / _shadowCoord_163.w))); + tmpvar_164 = float((dot (texture2D (u_shadowMap1, tmpvar_165), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_163.z - u_params1.x) + / _shadowCoord_163.w))); }; result_110 = (result_110 + tmpvar_164); vec4 tmpvar_167; @@ -670,7 +724,9 @@ void main () if (tmpvar_171) { tmpvar_169 = 1.0; } else { - tmpvar_169 = float((dot (texture2D (u_shadowMap1, tmpvar_170), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_168.z - u_params1.x) / _shadowCoord_168.w))); + tmpvar_169 = float((dot (texture2D (u_shadowMap1, tmpvar_170), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_168.z - u_params1.x) + / _shadowCoord_168.w))); }; result_110 = (result_110 + tmpvar_169); vec4 tmpvar_172; @@ -690,7 +746,9 @@ void main () if (tmpvar_176) { tmpvar_174 = 1.0; } else { - tmpvar_174 = float((dot (texture2D (u_shadowMap1, tmpvar_175), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_173.z - u_params1.x) / _shadowCoord_173.w))); + tmpvar_174 = float((dot (texture2D (u_shadowMap1, tmpvar_175), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_173.z - u_params1.x) + / _shadowCoord_173.w))); }; result_110 = (result_110 + tmpvar_174); vec4 tmpvar_177; @@ -710,7 +768,9 @@ void main () if (tmpvar_181) { tmpvar_179 = 1.0; } else { - tmpvar_179 = float((dot (texture2D (u_shadowMap1, tmpvar_180), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_178.z - u_params1.x) / _shadowCoord_178.w))); + tmpvar_179 = float((dot (texture2D (u_shadowMap1, tmpvar_180), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_178.z - u_params1.x) + / _shadowCoord_178.w))); }; result_110 = (result_110 + tmpvar_179); vec4 tmpvar_182; @@ -730,7 +790,9 @@ void main () if (tmpvar_186) { tmpvar_184 = 1.0; } else { - tmpvar_184 = float((dot (texture2D (u_shadowMap1, tmpvar_185), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_183.z - u_params1.x) / _shadowCoord_183.w))); + tmpvar_184 = float((dot (texture2D (u_shadowMap1, tmpvar_185), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_183.z - u_params1.x) + / _shadowCoord_183.w))); }; result_110 = (result_110 + tmpvar_184); vec4 tmpvar_187; @@ -750,7 +812,9 @@ void main () if (tmpvar_191) { tmpvar_189 = 1.0; } else { - tmpvar_189 = float((dot (texture2D (u_shadowMap1, tmpvar_190), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_188.z - u_params1.x) / _shadowCoord_188.w))); + tmpvar_189 = float((dot (texture2D (u_shadowMap1, tmpvar_190), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_188.z - u_params1.x) + / _shadowCoord_188.w))); }; float tmpvar_192; tmpvar_192 = (result_110 + tmpvar_189); @@ -798,7 +862,9 @@ void main () if (tmpvar_205) { tmpvar_203 = 1.0; } else { - tmpvar_203 = float((dot (texture2D (u_shadowMap2, tmpvar_204), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_202.z - u_params1.x) / _shadowCoord_202.w))); + tmpvar_203 = float((dot (texture2D (u_shadowMap2, tmpvar_204), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_202.z - u_params1.x) + / _shadowCoord_202.w))); }; result_199 = tmpvar_203; vec4 tmpvar_206; @@ -818,7 +884,9 @@ void main () if (tmpvar_210) { tmpvar_208 = 1.0; } else { - tmpvar_208 = float((dot (texture2D (u_shadowMap2, tmpvar_209), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_207.z - u_params1.x) / _shadowCoord_207.w))); + tmpvar_208 = float((dot (texture2D (u_shadowMap2, tmpvar_209), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_207.z - u_params1.x) + / _shadowCoord_207.w))); }; result_199 = (tmpvar_203 + tmpvar_208); vec4 tmpvar_211; @@ -838,7 +906,9 @@ void main () if (tmpvar_215) { tmpvar_213 = 1.0; } else { - tmpvar_213 = float((dot (texture2D (u_shadowMap2, tmpvar_214), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_212.z - u_params1.x) / _shadowCoord_212.w))); + tmpvar_213 = float((dot (texture2D (u_shadowMap2, tmpvar_214), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_212.z - u_params1.x) + / _shadowCoord_212.w))); }; result_199 = (result_199 + tmpvar_213); vec4 tmpvar_216; @@ -858,7 +928,9 @@ void main () if (tmpvar_220) { tmpvar_218 = 1.0; } else { - tmpvar_218 = float((dot (texture2D (u_shadowMap2, tmpvar_219), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_217.z - u_params1.x) / _shadowCoord_217.w))); + tmpvar_218 = float((dot (texture2D (u_shadowMap2, tmpvar_219), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_217.z - u_params1.x) + / _shadowCoord_217.w))); }; result_199 = (result_199 + tmpvar_218); vec4 tmpvar_221; @@ -878,7 +950,9 @@ void main () if (tmpvar_225) { tmpvar_223 = 1.0; } else { - tmpvar_223 = float((dot (texture2D (u_shadowMap2, tmpvar_224), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_222.z - u_params1.x) / _shadowCoord_222.w))); + tmpvar_223 = float((dot (texture2D (u_shadowMap2, tmpvar_224), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_222.z - u_params1.x) + / _shadowCoord_222.w))); }; result_199 = (result_199 + tmpvar_223); vec4 tmpvar_226; @@ -898,7 +972,9 @@ void main () if (tmpvar_230) { tmpvar_228 = 1.0; } else { - tmpvar_228 = float((dot (texture2D (u_shadowMap2, tmpvar_229), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_227.z - u_params1.x) / _shadowCoord_227.w))); + tmpvar_228 = float((dot (texture2D (u_shadowMap2, tmpvar_229), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_227.z - u_params1.x) + / _shadowCoord_227.w))); }; result_199 = (result_199 + tmpvar_228); vec4 tmpvar_231; @@ -918,7 +994,9 @@ void main () if (tmpvar_235) { tmpvar_233 = 1.0; } else { - tmpvar_233 = float((dot (texture2D (u_shadowMap2, tmpvar_234), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_232.z - u_params1.x) / _shadowCoord_232.w))); + tmpvar_233 = float((dot (texture2D (u_shadowMap2, tmpvar_234), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_232.z - u_params1.x) + / _shadowCoord_232.w))); }; result_199 = (result_199 + tmpvar_233); vec4 tmpvar_236; @@ -938,7 +1016,9 @@ void main () if (tmpvar_240) { tmpvar_238 = 1.0; } else { - tmpvar_238 = float((dot (texture2D (u_shadowMap2, tmpvar_239), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_237.z - u_params1.x) / _shadowCoord_237.w))); + tmpvar_238 = float((dot (texture2D (u_shadowMap2, tmpvar_239), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_237.z - u_params1.x) + / _shadowCoord_237.w))); }; result_199 = (result_199 + tmpvar_238); vec4 tmpvar_241; @@ -958,7 +1038,9 @@ void main () if (tmpvar_245) { tmpvar_243 = 1.0; } else { - tmpvar_243 = float((dot (texture2D (u_shadowMap2, tmpvar_244), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_242.z - u_params1.x) / _shadowCoord_242.w))); + tmpvar_243 = float((dot (texture2D (u_shadowMap2, tmpvar_244), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_242.z - u_params1.x) + / _shadowCoord_242.w))); }; result_199 = (result_199 + tmpvar_243); vec4 tmpvar_246; @@ -978,7 +1060,9 @@ void main () if (tmpvar_250) { tmpvar_248 = 1.0; } else { - tmpvar_248 = float((dot (texture2D (u_shadowMap2, tmpvar_249), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_247.z - u_params1.x) / _shadowCoord_247.w))); + tmpvar_248 = float((dot (texture2D (u_shadowMap2, tmpvar_249), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_247.z - u_params1.x) + / _shadowCoord_247.w))); }; result_199 = (result_199 + tmpvar_248); vec4 tmpvar_251; @@ -998,7 +1082,9 @@ void main () if (tmpvar_255) { tmpvar_253 = 1.0; } else { - tmpvar_253 = float((dot (texture2D (u_shadowMap2, tmpvar_254), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_252.z - u_params1.x) / _shadowCoord_252.w))); + tmpvar_253 = float((dot (texture2D (u_shadowMap2, tmpvar_254), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_252.z - u_params1.x) + / _shadowCoord_252.w))); }; result_199 = (result_199 + tmpvar_253); vec4 tmpvar_256; @@ -1018,7 +1104,9 @@ void main () if (tmpvar_260) { tmpvar_258 = 1.0; } else { - tmpvar_258 = float((dot (texture2D (u_shadowMap2, tmpvar_259), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_257.z - u_params1.x) / _shadowCoord_257.w))); + tmpvar_258 = float((dot (texture2D (u_shadowMap2, tmpvar_259), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_257.z - u_params1.x) + / _shadowCoord_257.w))); }; result_199 = (result_199 + tmpvar_258); vec4 tmpvar_261; @@ -1038,7 +1126,9 @@ void main () if (tmpvar_265) { tmpvar_263 = 1.0; } else { - tmpvar_263 = float((dot (texture2D (u_shadowMap2, tmpvar_264), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_262.z - u_params1.x) / _shadowCoord_262.w))); + tmpvar_263 = float((dot (texture2D (u_shadowMap2, tmpvar_264), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_262.z - u_params1.x) + / _shadowCoord_262.w))); }; result_199 = (result_199 + tmpvar_263); vec4 tmpvar_266; @@ -1058,7 +1148,9 @@ void main () if (tmpvar_270) { tmpvar_268 = 1.0; } else { - tmpvar_268 = float((dot (texture2D (u_shadowMap2, tmpvar_269), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_267.z - u_params1.x) / _shadowCoord_267.w))); + tmpvar_268 = float((dot (texture2D (u_shadowMap2, tmpvar_269), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_267.z - u_params1.x) + / _shadowCoord_267.w))); }; result_199 = (result_199 + tmpvar_268); vec4 tmpvar_271; @@ -1078,7 +1170,9 @@ void main () if (tmpvar_275) { tmpvar_273 = 1.0; } else { - tmpvar_273 = float((dot (texture2D (u_shadowMap2, tmpvar_274), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_272.z - u_params1.x) / _shadowCoord_272.w))); + tmpvar_273 = float((dot (texture2D (u_shadowMap2, tmpvar_274), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_272.z - u_params1.x) + / _shadowCoord_272.w))); }; result_199 = (result_199 + tmpvar_273); vec4 tmpvar_276; @@ -1098,7 +1192,9 @@ void main () if (tmpvar_280) { tmpvar_278 = 1.0; } else { - tmpvar_278 = float((dot (texture2D (u_shadowMap2, tmpvar_279), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_277.z - u_params1.x) / _shadowCoord_277.w))); + tmpvar_278 = float((dot (texture2D (u_shadowMap2, tmpvar_279), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_277.z - u_params1.x) + / _shadowCoord_277.w))); }; float tmpvar_281; tmpvar_281 = (result_199 + tmpvar_278); @@ -1145,7 +1241,9 @@ void main () if (tmpvar_294) { tmpvar_292 = 1.0; } else { - tmpvar_292 = float((dot (texture2D (u_shadowMap3, tmpvar_293), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_291.z - u_params1.x) / _shadowCoord_291.w))); + tmpvar_292 = float((dot (texture2D (u_shadowMap3, tmpvar_293), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_291.z - u_params1.x) + / _shadowCoord_291.w))); }; result_288 = tmpvar_292; vec4 tmpvar_295; @@ -1165,7 +1263,9 @@ void main () if (tmpvar_299) { tmpvar_297 = 1.0; } else { - tmpvar_297 = float((dot (texture2D (u_shadowMap3, tmpvar_298), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_296.z - u_params1.x) / _shadowCoord_296.w))); + tmpvar_297 = float((dot (texture2D (u_shadowMap3, tmpvar_298), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_296.z - u_params1.x) + / _shadowCoord_296.w))); }; result_288 = (tmpvar_292 + tmpvar_297); vec4 tmpvar_300; @@ -1185,7 +1285,9 @@ void main () if (tmpvar_304) { tmpvar_302 = 1.0; } else { - tmpvar_302 = float((dot (texture2D (u_shadowMap3, tmpvar_303), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_301.z - u_params1.x) / _shadowCoord_301.w))); + tmpvar_302 = float((dot (texture2D (u_shadowMap3, tmpvar_303), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_301.z - u_params1.x) + / _shadowCoord_301.w))); }; result_288 = (result_288 + tmpvar_302); vec4 tmpvar_305; @@ -1205,7 +1307,9 @@ void main () if (tmpvar_309) { tmpvar_307 = 1.0; } else { - tmpvar_307 = float((dot (texture2D (u_shadowMap3, tmpvar_308), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_306.z - u_params1.x) / _shadowCoord_306.w))); + tmpvar_307 = float((dot (texture2D (u_shadowMap3, tmpvar_308), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_306.z - u_params1.x) + / _shadowCoord_306.w))); }; result_288 = (result_288 + tmpvar_307); vec4 tmpvar_310; @@ -1225,7 +1329,9 @@ void main () if (tmpvar_314) { tmpvar_312 = 1.0; } else { - tmpvar_312 = float((dot (texture2D (u_shadowMap3, tmpvar_313), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_311.z - u_params1.x) / _shadowCoord_311.w))); + tmpvar_312 = float((dot (texture2D (u_shadowMap3, tmpvar_313), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_311.z - u_params1.x) + / _shadowCoord_311.w))); }; result_288 = (result_288 + tmpvar_312); vec4 tmpvar_315; @@ -1245,7 +1351,9 @@ void main () if (tmpvar_319) { tmpvar_317 = 1.0; } else { - tmpvar_317 = float((dot (texture2D (u_shadowMap3, tmpvar_318), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_316.z - u_params1.x) / _shadowCoord_316.w))); + tmpvar_317 = float((dot (texture2D (u_shadowMap3, tmpvar_318), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_316.z - u_params1.x) + / _shadowCoord_316.w))); }; result_288 = (result_288 + tmpvar_317); vec4 tmpvar_320; @@ -1265,7 +1373,9 @@ void main () if (tmpvar_324) { tmpvar_322 = 1.0; } else { - tmpvar_322 = float((dot (texture2D (u_shadowMap3, tmpvar_323), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_321.z - u_params1.x) / _shadowCoord_321.w))); + tmpvar_322 = float((dot (texture2D (u_shadowMap3, tmpvar_323), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_321.z - u_params1.x) + / _shadowCoord_321.w))); }; result_288 = (result_288 + tmpvar_322); vec4 tmpvar_325; @@ -1285,7 +1395,9 @@ void main () if (tmpvar_329) { tmpvar_327 = 1.0; } else { - tmpvar_327 = float((dot (texture2D (u_shadowMap3, tmpvar_328), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_326.z - u_params1.x) / _shadowCoord_326.w))); + tmpvar_327 = float((dot (texture2D (u_shadowMap3, tmpvar_328), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_326.z - u_params1.x) + / _shadowCoord_326.w))); }; result_288 = (result_288 + tmpvar_327); vec4 tmpvar_330; @@ -1305,7 +1417,9 @@ void main () if (tmpvar_334) { tmpvar_332 = 1.0; } else { - tmpvar_332 = float((dot (texture2D (u_shadowMap3, tmpvar_333), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_331.z - u_params1.x) / _shadowCoord_331.w))); + tmpvar_332 = float((dot (texture2D (u_shadowMap3, tmpvar_333), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_331.z - u_params1.x) + / _shadowCoord_331.w))); }; result_288 = (result_288 + tmpvar_332); vec4 tmpvar_335; @@ -1325,7 +1439,9 @@ void main () if (tmpvar_339) { tmpvar_337 = 1.0; } else { - tmpvar_337 = float((dot (texture2D (u_shadowMap3, tmpvar_338), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_336.z - u_params1.x) / _shadowCoord_336.w))); + tmpvar_337 = float((dot (texture2D (u_shadowMap3, tmpvar_338), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_336.z - u_params1.x) + / _shadowCoord_336.w))); }; result_288 = (result_288 + tmpvar_337); vec4 tmpvar_340; @@ -1345,7 +1461,9 @@ void main () if (tmpvar_344) { tmpvar_342 = 1.0; } else { - tmpvar_342 = float((dot (texture2D (u_shadowMap3, tmpvar_343), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_341.z - u_params1.x) / _shadowCoord_341.w))); + tmpvar_342 = float((dot (texture2D (u_shadowMap3, tmpvar_343), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_341.z - u_params1.x) + / _shadowCoord_341.w))); }; result_288 = (result_288 + tmpvar_342); vec4 tmpvar_345; @@ -1365,7 +1483,9 @@ void main () if (tmpvar_349) { tmpvar_347 = 1.0; } else { - tmpvar_347 = float((dot (texture2D (u_shadowMap3, tmpvar_348), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_346.z - u_params1.x) / _shadowCoord_346.w))); + tmpvar_347 = float((dot (texture2D (u_shadowMap3, tmpvar_348), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_346.z - u_params1.x) + / _shadowCoord_346.w))); }; result_288 = (result_288 + tmpvar_347); vec4 tmpvar_350; @@ -1385,7 +1505,9 @@ void main () if (tmpvar_354) { tmpvar_352 = 1.0; } else { - tmpvar_352 = float((dot (texture2D (u_shadowMap3, tmpvar_353), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_351.z - u_params1.x) / _shadowCoord_351.w))); + tmpvar_352 = float((dot (texture2D (u_shadowMap3, tmpvar_353), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_351.z - u_params1.x) + / _shadowCoord_351.w))); }; result_288 = (result_288 + tmpvar_352); vec4 tmpvar_355; @@ -1405,7 +1527,9 @@ void main () if (tmpvar_359) { tmpvar_357 = 1.0; } else { - tmpvar_357 = float((dot (texture2D (u_shadowMap3, tmpvar_358), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_356.z - u_params1.x) / _shadowCoord_356.w))); + tmpvar_357 = float((dot (texture2D (u_shadowMap3, tmpvar_358), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_356.z - u_params1.x) + / _shadowCoord_356.w))); }; result_288 = (result_288 + tmpvar_357); vec4 tmpvar_360; @@ -1425,7 +1549,9 @@ void main () if (tmpvar_364) { tmpvar_362 = 1.0; } else { - tmpvar_362 = float((dot (texture2D (u_shadowMap3, tmpvar_363), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_361.z - u_params1.x) / _shadowCoord_361.w))); + tmpvar_362 = float((dot (texture2D (u_shadowMap3, tmpvar_363), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_361.z - u_params1.x) + / _shadowCoord_361.w))); }; result_288 = (result_288 + tmpvar_362); vec4 tmpvar_365; @@ -1445,7 +1571,9 @@ void main () if (tmpvar_369) { tmpvar_367 = 1.0; } else { - tmpvar_367 = float((dot (texture2D (u_shadowMap3, tmpvar_368), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_366.z - u_params1.x) / _shadowCoord_366.w))); + tmpvar_367 = float((dot (texture2D (u_shadowMap3, tmpvar_368), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_366.z - u_params1.x) + / _shadowCoord_366.w))); }; float tmpvar_370; tmpvar_370 = (result_288 + tmpvar_367); @@ -1470,18 +1598,46 @@ void main () tmpvar_376 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_377; tmpvar_377 = sqrt(dot (tmpvar_374, tmpvar_374)); - tmpvar_373 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_377)) + ((u_lightAttenuationSpotOuter.z * tmpvar_377) * tmpvar_377)))) * mix (clamp (((max (0.0, dot (-(tmpvar_375), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_376) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_376)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_373 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_377)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_377) * tmpvar_377) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_375) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_376) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_376)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_378; tmpvar_378 = dot (v_normal, tmpvar_372); vec2 tmpvar_379; tmpvar_379.x = tmpvar_378; - tmpvar_379.y = (((float((tmpvar_378 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_378) * v_normal) - tmpvar_372), tmpvar_371)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_379.y = ((( + float((tmpvar_378 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_378) * v_normal) + - tmpvar_372), tmpvar_371)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_380; tmpvar_380 = (max (tmpvar_379, 0.0) * tmpvar_373); float tmpvar_381; tmpvar_381 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_380.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_380.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_381) * tmpvar_381)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_380.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_380.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_381) * tmpvar_381)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin index b215d1134..61c766884 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear.bin @@ -1,20 +1,20 @@ -FSHpjHuniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; +FSHpjHvarying vec3 v_normal; varying vec4 v_shadowcoord; -varying vec3 v_normal; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; void main () { vec2 _texcoord_1; @@ -61,7 +61,9 @@ void main () if (tmpvar_15) { tmpvar_13 = 1.0; } else { - tmpvar_13 = float((dot (texture2D (u_shadowMap0, tmpvar_14), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_12.z - u_params1.x) / _shadowCoord_12.w))); + tmpvar_13 = float((dot (texture2D (u_shadowMap0, tmpvar_14), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_12.z - u_params1.x) + / _shadowCoord_12.w))); }; result_9 = tmpvar_13; vec4 tmpvar_16; @@ -81,7 +83,9 @@ void main () if (tmpvar_20) { tmpvar_18 = 1.0; } else { - tmpvar_18 = float((dot (texture2D (u_shadowMap0, tmpvar_19), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_17.z - u_params1.x) / _shadowCoord_17.w))); + tmpvar_18 = float((dot (texture2D (u_shadowMap0, tmpvar_19), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_17.z - u_params1.x) + / _shadowCoord_17.w))); }; result_9 = (tmpvar_13 + tmpvar_18); vec4 tmpvar_21; @@ -101,7 +105,9 @@ void main () if (tmpvar_25) { tmpvar_23 = 1.0; } else { - tmpvar_23 = float((dot (texture2D (u_shadowMap0, tmpvar_24), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_22.z - u_params1.x) / _shadowCoord_22.w))); + tmpvar_23 = float((dot (texture2D (u_shadowMap0, tmpvar_24), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_22.z - u_params1.x) + / _shadowCoord_22.w))); }; result_9 = (result_9 + tmpvar_23); vec4 tmpvar_26; @@ -121,7 +127,9 @@ void main () if (tmpvar_30) { tmpvar_28 = 1.0; } else { - tmpvar_28 = float((dot (texture2D (u_shadowMap0, tmpvar_29), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_27.z - u_params1.x) / _shadowCoord_27.w))); + tmpvar_28 = float((dot (texture2D (u_shadowMap0, tmpvar_29), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_27.z - u_params1.x) + / _shadowCoord_27.w))); }; result_9 = (result_9 + tmpvar_28); vec4 tmpvar_31; @@ -141,7 +149,9 @@ void main () if (tmpvar_35) { tmpvar_33 = 1.0; } else { - tmpvar_33 = float((dot (texture2D (u_shadowMap0, tmpvar_34), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_32.z - u_params1.x) / _shadowCoord_32.w))); + tmpvar_33 = float((dot (texture2D (u_shadowMap0, tmpvar_34), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_32.z - u_params1.x) + / _shadowCoord_32.w))); }; result_9 = (result_9 + tmpvar_33); vec4 tmpvar_36; @@ -161,7 +171,9 @@ void main () if (tmpvar_40) { tmpvar_38 = 1.0; } else { - tmpvar_38 = float((dot (texture2D (u_shadowMap0, tmpvar_39), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_37.z - u_params1.x) / _shadowCoord_37.w))); + tmpvar_38 = float((dot (texture2D (u_shadowMap0, tmpvar_39), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_37.z - u_params1.x) + / _shadowCoord_37.w))); }; result_9 = (result_9 + tmpvar_38); vec4 tmpvar_41; @@ -181,7 +193,9 @@ void main () if (tmpvar_45) { tmpvar_43 = 1.0; } else { - tmpvar_43 = float((dot (texture2D (u_shadowMap0, tmpvar_44), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_42.z - u_params1.x) / _shadowCoord_42.w))); + tmpvar_43 = float((dot (texture2D (u_shadowMap0, tmpvar_44), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_42.z - u_params1.x) + / _shadowCoord_42.w))); }; result_9 = (result_9 + tmpvar_43); vec4 tmpvar_46; @@ -201,7 +215,9 @@ void main () if (tmpvar_50) { tmpvar_48 = 1.0; } else { - tmpvar_48 = float((dot (texture2D (u_shadowMap0, tmpvar_49), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_47.z - u_params1.x) / _shadowCoord_47.w))); + tmpvar_48 = float((dot (texture2D (u_shadowMap0, tmpvar_49), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_47.z - u_params1.x) + / _shadowCoord_47.w))); }; result_9 = (result_9 + tmpvar_48); vec4 tmpvar_51; @@ -221,7 +237,9 @@ void main () if (tmpvar_55) { tmpvar_53 = 1.0; } else { - tmpvar_53 = float((dot (texture2D (u_shadowMap0, tmpvar_54), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_52.z - u_params1.x) / _shadowCoord_52.w))); + tmpvar_53 = float((dot (texture2D (u_shadowMap0, tmpvar_54), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_52.z - u_params1.x) + / _shadowCoord_52.w))); }; result_9 = (result_9 + tmpvar_53); vec4 tmpvar_56; @@ -241,7 +259,9 @@ void main () if (tmpvar_60) { tmpvar_58 = 1.0; } else { - tmpvar_58 = float((dot (texture2D (u_shadowMap0, tmpvar_59), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_57.z - u_params1.x) / _shadowCoord_57.w))); + tmpvar_58 = float((dot (texture2D (u_shadowMap0, tmpvar_59), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_57.z - u_params1.x) + / _shadowCoord_57.w))); }; result_9 = (result_9 + tmpvar_58); vec4 tmpvar_61; @@ -261,7 +281,9 @@ void main () if (tmpvar_65) { tmpvar_63 = 1.0; } else { - tmpvar_63 = float((dot (texture2D (u_shadowMap0, tmpvar_64), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_62.z - u_params1.x) / _shadowCoord_62.w))); + tmpvar_63 = float((dot (texture2D (u_shadowMap0, tmpvar_64), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_62.z - u_params1.x) + / _shadowCoord_62.w))); }; result_9 = (result_9 + tmpvar_63); vec4 tmpvar_66; @@ -281,7 +303,9 @@ void main () if (tmpvar_70) { tmpvar_68 = 1.0; } else { - tmpvar_68 = float((dot (texture2D (u_shadowMap0, tmpvar_69), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_67.z - u_params1.x) / _shadowCoord_67.w))); + tmpvar_68 = float((dot (texture2D (u_shadowMap0, tmpvar_69), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_67.z - u_params1.x) + / _shadowCoord_67.w))); }; result_9 = (result_9 + tmpvar_68); vec4 tmpvar_71; @@ -301,7 +325,9 @@ void main () if (tmpvar_75) { tmpvar_73 = 1.0; } else { - tmpvar_73 = float((dot (texture2D (u_shadowMap0, tmpvar_74), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_72.z - u_params1.x) / _shadowCoord_72.w))); + tmpvar_73 = float((dot (texture2D (u_shadowMap0, tmpvar_74), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_72.z - u_params1.x) + / _shadowCoord_72.w))); }; result_9 = (result_9 + tmpvar_73); vec4 tmpvar_76; @@ -321,7 +347,9 @@ void main () if (tmpvar_80) { tmpvar_78 = 1.0; } else { - tmpvar_78 = float((dot (texture2D (u_shadowMap0, tmpvar_79), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_77.z - u_params1.x) / _shadowCoord_77.w))); + tmpvar_78 = float((dot (texture2D (u_shadowMap0, tmpvar_79), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_77.z - u_params1.x) + / _shadowCoord_77.w))); }; result_9 = (result_9 + tmpvar_78); vec4 tmpvar_81; @@ -341,7 +369,9 @@ void main () if (tmpvar_85) { tmpvar_83 = 1.0; } else { - tmpvar_83 = float((dot (texture2D (u_shadowMap0, tmpvar_84), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_82.z - u_params1.x) / _shadowCoord_82.w))); + tmpvar_83 = float((dot (texture2D (u_shadowMap0, tmpvar_84), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_82.z - u_params1.x) + / _shadowCoord_82.w))); }; result_9 = (result_9 + tmpvar_83); vec4 tmpvar_86; @@ -361,7 +391,9 @@ void main () if (tmpvar_90) { tmpvar_88 = 1.0; } else { - tmpvar_88 = float((dot (texture2D (u_shadowMap0, tmpvar_89), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_87.z - u_params1.x) / _shadowCoord_87.w))); + tmpvar_88 = float((dot (texture2D (u_shadowMap0, tmpvar_89), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_87.z - u_params1.x) + / _shadowCoord_87.w))); }; float tmpvar_91; tmpvar_91 = (result_9 + tmpvar_88); @@ -383,18 +415,46 @@ void main () tmpvar_97 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_98; tmpvar_98 = sqrt(dot (tmpvar_95, tmpvar_95)); - tmpvar_94 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_98)) + ((u_lightAttenuationSpotOuter.z * tmpvar_98) * tmpvar_98)))) * mix (clamp (((max (0.0, dot (-(tmpvar_96), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_97) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_97)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_94 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_98)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_98) * tmpvar_98) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_96) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_97) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_97)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_99; tmpvar_99 = dot (v_normal, tmpvar_93); vec2 tmpvar_100; tmpvar_100.x = tmpvar_99; - tmpvar_100.y = (((float((tmpvar_99 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_99) * v_normal) - tmpvar_93), tmpvar_92)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_100.y = ((( + float((tmpvar_99 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_99) * v_normal) + - tmpvar_93), tmpvar_92)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_101; tmpvar_101 = (max (tmpvar_100, 0.0) * tmpvar_94); float tmpvar_102; tmpvar_102 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_101.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_101.y)) * u_color.xyz) * tmpvar_8))), vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_102) * tmpvar_102)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_101.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_101.y)) + * u_color.xyz) * tmpvar_8))) + , vec3(0.454545, 0.454545, 0.454545)) + (tmpvar_6 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_102) * tmpvar_102)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin index b6f7c94fd..325e00ca0 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_csm.bin @@ -1,26 +1,26 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -106,7 +106,9 @@ void main () if (tmpvar_28) { tmpvar_26 = 1.0; } else { - tmpvar_26 = float((dot (texture2D (u_shadowMap0, tmpvar_27), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_25.z - u_params1.x) / _shadowCoord_25.w))); + tmpvar_26 = float((dot (texture2D (u_shadowMap0, tmpvar_27), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_25.z - u_params1.x) + / _shadowCoord_25.w))); }; result_22 = tmpvar_26; vec4 tmpvar_29; @@ -126,7 +128,9 @@ void main () if (tmpvar_33) { tmpvar_31 = 1.0; } else { - tmpvar_31 = float((dot (texture2D (u_shadowMap0, tmpvar_32), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_30.z - u_params1.x) / _shadowCoord_30.w))); + tmpvar_31 = float((dot (texture2D (u_shadowMap0, tmpvar_32), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_30.z - u_params1.x) + / _shadowCoord_30.w))); }; result_22 = (tmpvar_26 + tmpvar_31); vec4 tmpvar_34; @@ -146,7 +150,9 @@ void main () if (tmpvar_38) { tmpvar_36 = 1.0; } else { - tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_35.z - u_params1.x) / _shadowCoord_35.w))); + tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_35.z - u_params1.x) + / _shadowCoord_35.w))); }; result_22 = (result_22 + tmpvar_36); vec4 tmpvar_39; @@ -166,7 +172,9 @@ void main () if (tmpvar_43) { tmpvar_41 = 1.0; } else { - tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_40.z - u_params1.x) / _shadowCoord_40.w))); + tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_40.z - u_params1.x) + / _shadowCoord_40.w))); }; result_22 = (result_22 + tmpvar_41); vec4 tmpvar_44; @@ -186,7 +194,9 @@ void main () if (tmpvar_48) { tmpvar_46 = 1.0; } else { - tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_45.z - u_params1.x) / _shadowCoord_45.w))); + tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_45.z - u_params1.x) + / _shadowCoord_45.w))); }; result_22 = (result_22 + tmpvar_46); vec4 tmpvar_49; @@ -206,7 +216,9 @@ void main () if (tmpvar_53) { tmpvar_51 = 1.0; } else { - tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_50.z - u_params1.x) / _shadowCoord_50.w))); + tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_50.z - u_params1.x) + / _shadowCoord_50.w))); }; result_22 = (result_22 + tmpvar_51); vec4 tmpvar_54; @@ -226,7 +238,9 @@ void main () if (tmpvar_58) { tmpvar_56 = 1.0; } else { - tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_55.z - u_params1.x) / _shadowCoord_55.w))); + tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_55.z - u_params1.x) + / _shadowCoord_55.w))); }; result_22 = (result_22 + tmpvar_56); vec4 tmpvar_59; @@ -246,7 +260,9 @@ void main () if (tmpvar_63) { tmpvar_61 = 1.0; } else { - tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_60.z - u_params1.x) / _shadowCoord_60.w))); + tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_60.z - u_params1.x) + / _shadowCoord_60.w))); }; result_22 = (result_22 + tmpvar_61); vec4 tmpvar_64; @@ -266,7 +282,9 @@ void main () if (tmpvar_68) { tmpvar_66 = 1.0; } else { - tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_65.z - u_params1.x) / _shadowCoord_65.w))); + tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_65.z - u_params1.x) + / _shadowCoord_65.w))); }; result_22 = (result_22 + tmpvar_66); vec4 tmpvar_69; @@ -286,7 +304,9 @@ void main () if (tmpvar_73) { tmpvar_71 = 1.0; } else { - tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_70.z - u_params1.x) / _shadowCoord_70.w))); + tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_70.z - u_params1.x) + / _shadowCoord_70.w))); }; result_22 = (result_22 + tmpvar_71); vec4 tmpvar_74; @@ -306,7 +326,9 @@ void main () if (tmpvar_78) { tmpvar_76 = 1.0; } else { - tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_75.z - u_params1.x) / _shadowCoord_75.w))); + tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_75.z - u_params1.x) + / _shadowCoord_75.w))); }; result_22 = (result_22 + tmpvar_76); vec4 tmpvar_79; @@ -326,7 +348,9 @@ void main () if (tmpvar_83) { tmpvar_81 = 1.0; } else { - tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_80.z - u_params1.x) / _shadowCoord_80.w))); + tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_80.z - u_params1.x) + / _shadowCoord_80.w))); }; result_22 = (result_22 + tmpvar_81); vec4 tmpvar_84; @@ -346,7 +370,9 @@ void main () if (tmpvar_88) { tmpvar_86 = 1.0; } else { - tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_85.z - u_params1.x) / _shadowCoord_85.w))); + tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_85.z - u_params1.x) + / _shadowCoord_85.w))); }; result_22 = (result_22 + tmpvar_86); vec4 tmpvar_89; @@ -366,7 +392,9 @@ void main () if (tmpvar_93) { tmpvar_91 = 1.0; } else { - tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_90.z - u_params1.x) / _shadowCoord_90.w))); + tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_90.z - u_params1.x) + / _shadowCoord_90.w))); }; result_22 = (result_22 + tmpvar_91); vec4 tmpvar_94; @@ -386,7 +414,9 @@ void main () if (tmpvar_98) { tmpvar_96 = 1.0; } else { - tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_95.z - u_params1.x) / _shadowCoord_95.w))); + tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_95.z - u_params1.x) + / _shadowCoord_95.w))); }; result_22 = (result_22 + tmpvar_96); vec4 tmpvar_99; @@ -406,7 +436,9 @@ void main () if (tmpvar_103) { tmpvar_101 = 1.0; } else { - tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_100.z - u_params1.x) / _shadowCoord_100.w))); + tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_100.z - u_params1.x) + / _shadowCoord_100.w))); }; float tmpvar_104; tmpvar_104 = (result_22 + tmpvar_101); @@ -458,7 +490,9 @@ void main () if (tmpvar_118) { tmpvar_116 = 1.0; } else { - tmpvar_116 = float((dot (texture2D (u_shadowMap1, tmpvar_117), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_115.z - u_params1.x) / _shadowCoord_115.w))); + tmpvar_116 = float((dot (texture2D (u_shadowMap1, tmpvar_117), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_115.z - u_params1.x) + / _shadowCoord_115.w))); }; result_112 = tmpvar_116; vec4 tmpvar_119; @@ -478,7 +512,9 @@ void main () if (tmpvar_123) { tmpvar_121 = 1.0; } else { - tmpvar_121 = float((dot (texture2D (u_shadowMap1, tmpvar_122), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_120.z - u_params1.x) / _shadowCoord_120.w))); + tmpvar_121 = float((dot (texture2D (u_shadowMap1, tmpvar_122), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_120.z - u_params1.x) + / _shadowCoord_120.w))); }; result_112 = (tmpvar_116 + tmpvar_121); vec4 tmpvar_124; @@ -498,7 +534,9 @@ void main () if (tmpvar_128) { tmpvar_126 = 1.0; } else { - tmpvar_126 = float((dot (texture2D (u_shadowMap1, tmpvar_127), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_125.z - u_params1.x) / _shadowCoord_125.w))); + tmpvar_126 = float((dot (texture2D (u_shadowMap1, tmpvar_127), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_125.z - u_params1.x) + / _shadowCoord_125.w))); }; result_112 = (result_112 + tmpvar_126); vec4 tmpvar_129; @@ -518,7 +556,9 @@ void main () if (tmpvar_133) { tmpvar_131 = 1.0; } else { - tmpvar_131 = float((dot (texture2D (u_shadowMap1, tmpvar_132), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_130.z - u_params1.x) / _shadowCoord_130.w))); + tmpvar_131 = float((dot (texture2D (u_shadowMap1, tmpvar_132), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_130.z - u_params1.x) + / _shadowCoord_130.w))); }; result_112 = (result_112 + tmpvar_131); vec4 tmpvar_134; @@ -538,7 +578,9 @@ void main () if (tmpvar_138) { tmpvar_136 = 1.0; } else { - tmpvar_136 = float((dot (texture2D (u_shadowMap1, tmpvar_137), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_135.z - u_params1.x) / _shadowCoord_135.w))); + tmpvar_136 = float((dot (texture2D (u_shadowMap1, tmpvar_137), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_135.z - u_params1.x) + / _shadowCoord_135.w))); }; result_112 = (result_112 + tmpvar_136); vec4 tmpvar_139; @@ -558,7 +600,9 @@ void main () if (tmpvar_143) { tmpvar_141 = 1.0; } else { - tmpvar_141 = float((dot (texture2D (u_shadowMap1, tmpvar_142), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_140.z - u_params1.x) / _shadowCoord_140.w))); + tmpvar_141 = float((dot (texture2D (u_shadowMap1, tmpvar_142), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_140.z - u_params1.x) + / _shadowCoord_140.w))); }; result_112 = (result_112 + tmpvar_141); vec4 tmpvar_144; @@ -578,7 +622,9 @@ void main () if (tmpvar_148) { tmpvar_146 = 1.0; } else { - tmpvar_146 = float((dot (texture2D (u_shadowMap1, tmpvar_147), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_145.z - u_params1.x) / _shadowCoord_145.w))); + tmpvar_146 = float((dot (texture2D (u_shadowMap1, tmpvar_147), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_145.z - u_params1.x) + / _shadowCoord_145.w))); }; result_112 = (result_112 + tmpvar_146); vec4 tmpvar_149; @@ -598,7 +644,9 @@ void main () if (tmpvar_153) { tmpvar_151 = 1.0; } else { - tmpvar_151 = float((dot (texture2D (u_shadowMap1, tmpvar_152), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_150.z - u_params1.x) / _shadowCoord_150.w))); + tmpvar_151 = float((dot (texture2D (u_shadowMap1, tmpvar_152), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_150.z - u_params1.x) + / _shadowCoord_150.w))); }; result_112 = (result_112 + tmpvar_151); vec4 tmpvar_154; @@ -618,7 +666,9 @@ void main () if (tmpvar_158) { tmpvar_156 = 1.0; } else { - tmpvar_156 = float((dot (texture2D (u_shadowMap1, tmpvar_157), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_155.z - u_params1.x) / _shadowCoord_155.w))); + tmpvar_156 = float((dot (texture2D (u_shadowMap1, tmpvar_157), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_155.z - u_params1.x) + / _shadowCoord_155.w))); }; result_112 = (result_112 + tmpvar_156); vec4 tmpvar_159; @@ -638,7 +688,9 @@ void main () if (tmpvar_163) { tmpvar_161 = 1.0; } else { - tmpvar_161 = float((dot (texture2D (u_shadowMap1, tmpvar_162), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_160.z - u_params1.x) / _shadowCoord_160.w))); + tmpvar_161 = float((dot (texture2D (u_shadowMap1, tmpvar_162), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_160.z - u_params1.x) + / _shadowCoord_160.w))); }; result_112 = (result_112 + tmpvar_161); vec4 tmpvar_164; @@ -658,7 +710,9 @@ void main () if (tmpvar_168) { tmpvar_166 = 1.0; } else { - tmpvar_166 = float((dot (texture2D (u_shadowMap1, tmpvar_167), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_165.z - u_params1.x) / _shadowCoord_165.w))); + tmpvar_166 = float((dot (texture2D (u_shadowMap1, tmpvar_167), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_165.z - u_params1.x) + / _shadowCoord_165.w))); }; result_112 = (result_112 + tmpvar_166); vec4 tmpvar_169; @@ -678,7 +732,9 @@ void main () if (tmpvar_173) { tmpvar_171 = 1.0; } else { - tmpvar_171 = float((dot (texture2D (u_shadowMap1, tmpvar_172), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_170.z - u_params1.x) / _shadowCoord_170.w))); + tmpvar_171 = float((dot (texture2D (u_shadowMap1, tmpvar_172), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_170.z - u_params1.x) + / _shadowCoord_170.w))); }; result_112 = (result_112 + tmpvar_171); vec4 tmpvar_174; @@ -698,7 +754,9 @@ void main () if (tmpvar_178) { tmpvar_176 = 1.0; } else { - tmpvar_176 = float((dot (texture2D (u_shadowMap1, tmpvar_177), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_175.z - u_params1.x) / _shadowCoord_175.w))); + tmpvar_176 = float((dot (texture2D (u_shadowMap1, tmpvar_177), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_175.z - u_params1.x) + / _shadowCoord_175.w))); }; result_112 = (result_112 + tmpvar_176); vec4 tmpvar_179; @@ -718,7 +776,9 @@ void main () if (tmpvar_183) { tmpvar_181 = 1.0; } else { - tmpvar_181 = float((dot (texture2D (u_shadowMap1, tmpvar_182), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_180.z - u_params1.x) / _shadowCoord_180.w))); + tmpvar_181 = float((dot (texture2D (u_shadowMap1, tmpvar_182), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_180.z - u_params1.x) + / _shadowCoord_180.w))); }; result_112 = (result_112 + tmpvar_181); vec4 tmpvar_184; @@ -738,7 +798,9 @@ void main () if (tmpvar_188) { tmpvar_186 = 1.0; } else { - tmpvar_186 = float((dot (texture2D (u_shadowMap1, tmpvar_187), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_185.z - u_params1.x) / _shadowCoord_185.w))); + tmpvar_186 = float((dot (texture2D (u_shadowMap1, tmpvar_187), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_185.z - u_params1.x) + / _shadowCoord_185.w))); }; result_112 = (result_112 + tmpvar_186); vec4 tmpvar_189; @@ -758,7 +820,9 @@ void main () if (tmpvar_193) { tmpvar_191 = 1.0; } else { - tmpvar_191 = float((dot (texture2D (u_shadowMap1, tmpvar_192), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_190.z - u_params1.x) / _shadowCoord_190.w))); + tmpvar_191 = float((dot (texture2D (u_shadowMap1, tmpvar_192), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_190.z - u_params1.x) + / _shadowCoord_190.w))); }; float tmpvar_194; tmpvar_194 = (result_112 + tmpvar_191); @@ -810,7 +874,9 @@ void main () if (tmpvar_208) { tmpvar_206 = 1.0; } else { - tmpvar_206 = float((dot (texture2D (u_shadowMap2, tmpvar_207), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_205.z - u_params1.x) / _shadowCoord_205.w))); + tmpvar_206 = float((dot (texture2D (u_shadowMap2, tmpvar_207), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_205.z - u_params1.x) + / _shadowCoord_205.w))); }; result_202 = tmpvar_206; vec4 tmpvar_209; @@ -830,7 +896,9 @@ void main () if (tmpvar_213) { tmpvar_211 = 1.0; } else { - tmpvar_211 = float((dot (texture2D (u_shadowMap2, tmpvar_212), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_210.z - u_params1.x) / _shadowCoord_210.w))); + tmpvar_211 = float((dot (texture2D (u_shadowMap2, tmpvar_212), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_210.z - u_params1.x) + / _shadowCoord_210.w))); }; result_202 = (tmpvar_206 + tmpvar_211); vec4 tmpvar_214; @@ -850,7 +918,9 @@ void main () if (tmpvar_218) { tmpvar_216 = 1.0; } else { - tmpvar_216 = float((dot (texture2D (u_shadowMap2, tmpvar_217), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_215.z - u_params1.x) / _shadowCoord_215.w))); + tmpvar_216 = float((dot (texture2D (u_shadowMap2, tmpvar_217), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_215.z - u_params1.x) + / _shadowCoord_215.w))); }; result_202 = (result_202 + tmpvar_216); vec4 tmpvar_219; @@ -870,7 +940,9 @@ void main () if (tmpvar_223) { tmpvar_221 = 1.0; } else { - tmpvar_221 = float((dot (texture2D (u_shadowMap2, tmpvar_222), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_220.z - u_params1.x) / _shadowCoord_220.w))); + tmpvar_221 = float((dot (texture2D (u_shadowMap2, tmpvar_222), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_220.z - u_params1.x) + / _shadowCoord_220.w))); }; result_202 = (result_202 + tmpvar_221); vec4 tmpvar_224; @@ -890,7 +962,9 @@ void main () if (tmpvar_228) { tmpvar_226 = 1.0; } else { - tmpvar_226 = float((dot (texture2D (u_shadowMap2, tmpvar_227), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_225.z - u_params1.x) / _shadowCoord_225.w))); + tmpvar_226 = float((dot (texture2D (u_shadowMap2, tmpvar_227), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_225.z - u_params1.x) + / _shadowCoord_225.w))); }; result_202 = (result_202 + tmpvar_226); vec4 tmpvar_229; @@ -910,7 +984,9 @@ void main () if (tmpvar_233) { tmpvar_231 = 1.0; } else { - tmpvar_231 = float((dot (texture2D (u_shadowMap2, tmpvar_232), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_230.z - u_params1.x) / _shadowCoord_230.w))); + tmpvar_231 = float((dot (texture2D (u_shadowMap2, tmpvar_232), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_230.z - u_params1.x) + / _shadowCoord_230.w))); }; result_202 = (result_202 + tmpvar_231); vec4 tmpvar_234; @@ -930,7 +1006,9 @@ void main () if (tmpvar_238) { tmpvar_236 = 1.0; } else { - tmpvar_236 = float((dot (texture2D (u_shadowMap2, tmpvar_237), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_235.z - u_params1.x) / _shadowCoord_235.w))); + tmpvar_236 = float((dot (texture2D (u_shadowMap2, tmpvar_237), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_235.z - u_params1.x) + / _shadowCoord_235.w))); }; result_202 = (result_202 + tmpvar_236); vec4 tmpvar_239; @@ -950,7 +1028,9 @@ void main () if (tmpvar_243) { tmpvar_241 = 1.0; } else { - tmpvar_241 = float((dot (texture2D (u_shadowMap2, tmpvar_242), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_240.z - u_params1.x) / _shadowCoord_240.w))); + tmpvar_241 = float((dot (texture2D (u_shadowMap2, tmpvar_242), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_240.z - u_params1.x) + / _shadowCoord_240.w))); }; result_202 = (result_202 + tmpvar_241); vec4 tmpvar_244; @@ -970,7 +1050,9 @@ void main () if (tmpvar_248) { tmpvar_246 = 1.0; } else { - tmpvar_246 = float((dot (texture2D (u_shadowMap2, tmpvar_247), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_245.z - u_params1.x) / _shadowCoord_245.w))); + tmpvar_246 = float((dot (texture2D (u_shadowMap2, tmpvar_247), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_245.z - u_params1.x) + / _shadowCoord_245.w))); }; result_202 = (result_202 + tmpvar_246); vec4 tmpvar_249; @@ -990,7 +1072,9 @@ void main () if (tmpvar_253) { tmpvar_251 = 1.0; } else { - tmpvar_251 = float((dot (texture2D (u_shadowMap2, tmpvar_252), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_250.z - u_params1.x) / _shadowCoord_250.w))); + tmpvar_251 = float((dot (texture2D (u_shadowMap2, tmpvar_252), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_250.z - u_params1.x) + / _shadowCoord_250.w))); }; result_202 = (result_202 + tmpvar_251); vec4 tmpvar_254; @@ -1010,7 +1094,9 @@ void main () if (tmpvar_258) { tmpvar_256 = 1.0; } else { - tmpvar_256 = float((dot (texture2D (u_shadowMap2, tmpvar_257), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_255.z - u_params1.x) / _shadowCoord_255.w))); + tmpvar_256 = float((dot (texture2D (u_shadowMap2, tmpvar_257), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_255.z - u_params1.x) + / _shadowCoord_255.w))); }; result_202 = (result_202 + tmpvar_256); vec4 tmpvar_259; @@ -1030,7 +1116,9 @@ void main () if (tmpvar_263) { tmpvar_261 = 1.0; } else { - tmpvar_261 = float((dot (texture2D (u_shadowMap2, tmpvar_262), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_260.z - u_params1.x) / _shadowCoord_260.w))); + tmpvar_261 = float((dot (texture2D (u_shadowMap2, tmpvar_262), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_260.z - u_params1.x) + / _shadowCoord_260.w))); }; result_202 = (result_202 + tmpvar_261); vec4 tmpvar_264; @@ -1050,7 +1138,9 @@ void main () if (tmpvar_268) { tmpvar_266 = 1.0; } else { - tmpvar_266 = float((dot (texture2D (u_shadowMap2, tmpvar_267), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_265.z - u_params1.x) / _shadowCoord_265.w))); + tmpvar_266 = float((dot (texture2D (u_shadowMap2, tmpvar_267), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_265.z - u_params1.x) + / _shadowCoord_265.w))); }; result_202 = (result_202 + tmpvar_266); vec4 tmpvar_269; @@ -1070,7 +1160,9 @@ void main () if (tmpvar_273) { tmpvar_271 = 1.0; } else { - tmpvar_271 = float((dot (texture2D (u_shadowMap2, tmpvar_272), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_270.z - u_params1.x) / _shadowCoord_270.w))); + tmpvar_271 = float((dot (texture2D (u_shadowMap2, tmpvar_272), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_270.z - u_params1.x) + / _shadowCoord_270.w))); }; result_202 = (result_202 + tmpvar_271); vec4 tmpvar_274; @@ -1090,7 +1182,9 @@ void main () if (tmpvar_278) { tmpvar_276 = 1.0; } else { - tmpvar_276 = float((dot (texture2D (u_shadowMap2, tmpvar_277), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_275.z - u_params1.x) / _shadowCoord_275.w))); + tmpvar_276 = float((dot (texture2D (u_shadowMap2, tmpvar_277), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_275.z - u_params1.x) + / _shadowCoord_275.w))); }; result_202 = (result_202 + tmpvar_276); vec4 tmpvar_279; @@ -1110,7 +1204,9 @@ void main () if (tmpvar_283) { tmpvar_281 = 1.0; } else { - tmpvar_281 = float((dot (texture2D (u_shadowMap2, tmpvar_282), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_280.z - u_params1.x) / _shadowCoord_280.w))); + tmpvar_281 = float((dot (texture2D (u_shadowMap2, tmpvar_282), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_280.z - u_params1.x) + / _shadowCoord_280.w))); }; float tmpvar_284; tmpvar_284 = (result_202 + tmpvar_281); @@ -1161,7 +1257,9 @@ void main () if (tmpvar_298) { tmpvar_296 = 1.0; } else { - tmpvar_296 = float((dot (texture2D (u_shadowMap3, tmpvar_297), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_295.z - u_params1.x) / _shadowCoord_295.w))); + tmpvar_296 = float((dot (texture2D (u_shadowMap3, tmpvar_297), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_295.z - u_params1.x) + / _shadowCoord_295.w))); }; result_292 = tmpvar_296; vec4 tmpvar_299; @@ -1181,7 +1279,9 @@ void main () if (tmpvar_303) { tmpvar_301 = 1.0; } else { - tmpvar_301 = float((dot (texture2D (u_shadowMap3, tmpvar_302), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_300.z - u_params1.x) / _shadowCoord_300.w))); + tmpvar_301 = float((dot (texture2D (u_shadowMap3, tmpvar_302), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_300.z - u_params1.x) + / _shadowCoord_300.w))); }; result_292 = (tmpvar_296 + tmpvar_301); vec4 tmpvar_304; @@ -1201,7 +1301,9 @@ void main () if (tmpvar_308) { tmpvar_306 = 1.0; } else { - tmpvar_306 = float((dot (texture2D (u_shadowMap3, tmpvar_307), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_305.z - u_params1.x) / _shadowCoord_305.w))); + tmpvar_306 = float((dot (texture2D (u_shadowMap3, tmpvar_307), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_305.z - u_params1.x) + / _shadowCoord_305.w))); }; result_292 = (result_292 + tmpvar_306); vec4 tmpvar_309; @@ -1221,7 +1323,9 @@ void main () if (tmpvar_313) { tmpvar_311 = 1.0; } else { - tmpvar_311 = float((dot (texture2D (u_shadowMap3, tmpvar_312), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_310.z - u_params1.x) / _shadowCoord_310.w))); + tmpvar_311 = float((dot (texture2D (u_shadowMap3, tmpvar_312), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_310.z - u_params1.x) + / _shadowCoord_310.w))); }; result_292 = (result_292 + tmpvar_311); vec4 tmpvar_314; @@ -1241,7 +1345,9 @@ void main () if (tmpvar_318) { tmpvar_316 = 1.0; } else { - tmpvar_316 = float((dot (texture2D (u_shadowMap3, tmpvar_317), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_315.z - u_params1.x) / _shadowCoord_315.w))); + tmpvar_316 = float((dot (texture2D (u_shadowMap3, tmpvar_317), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_315.z - u_params1.x) + / _shadowCoord_315.w))); }; result_292 = (result_292 + tmpvar_316); vec4 tmpvar_319; @@ -1261,7 +1367,9 @@ void main () if (tmpvar_323) { tmpvar_321 = 1.0; } else { - tmpvar_321 = float((dot (texture2D (u_shadowMap3, tmpvar_322), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_320.z - u_params1.x) / _shadowCoord_320.w))); + tmpvar_321 = float((dot (texture2D (u_shadowMap3, tmpvar_322), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_320.z - u_params1.x) + / _shadowCoord_320.w))); }; result_292 = (result_292 + tmpvar_321); vec4 tmpvar_324; @@ -1281,7 +1389,9 @@ void main () if (tmpvar_328) { tmpvar_326 = 1.0; } else { - tmpvar_326 = float((dot (texture2D (u_shadowMap3, tmpvar_327), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_325.z - u_params1.x) / _shadowCoord_325.w))); + tmpvar_326 = float((dot (texture2D (u_shadowMap3, tmpvar_327), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_325.z - u_params1.x) + / _shadowCoord_325.w))); }; result_292 = (result_292 + tmpvar_326); vec4 tmpvar_329; @@ -1301,7 +1411,9 @@ void main () if (tmpvar_333) { tmpvar_331 = 1.0; } else { - tmpvar_331 = float((dot (texture2D (u_shadowMap3, tmpvar_332), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_330.z - u_params1.x) / _shadowCoord_330.w))); + tmpvar_331 = float((dot (texture2D (u_shadowMap3, tmpvar_332), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_330.z - u_params1.x) + / _shadowCoord_330.w))); }; result_292 = (result_292 + tmpvar_331); vec4 tmpvar_334; @@ -1321,7 +1433,9 @@ void main () if (tmpvar_338) { tmpvar_336 = 1.0; } else { - tmpvar_336 = float((dot (texture2D (u_shadowMap3, tmpvar_337), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_335.z - u_params1.x) / _shadowCoord_335.w))); + tmpvar_336 = float((dot (texture2D (u_shadowMap3, tmpvar_337), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_335.z - u_params1.x) + / _shadowCoord_335.w))); }; result_292 = (result_292 + tmpvar_336); vec4 tmpvar_339; @@ -1341,7 +1455,9 @@ void main () if (tmpvar_343) { tmpvar_341 = 1.0; } else { - tmpvar_341 = float((dot (texture2D (u_shadowMap3, tmpvar_342), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_340.z - u_params1.x) / _shadowCoord_340.w))); + tmpvar_341 = float((dot (texture2D (u_shadowMap3, tmpvar_342), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_340.z - u_params1.x) + / _shadowCoord_340.w))); }; result_292 = (result_292 + tmpvar_341); vec4 tmpvar_344; @@ -1361,7 +1477,9 @@ void main () if (tmpvar_348) { tmpvar_346 = 1.0; } else { - tmpvar_346 = float((dot (texture2D (u_shadowMap3, tmpvar_347), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_345.z - u_params1.x) / _shadowCoord_345.w))); + tmpvar_346 = float((dot (texture2D (u_shadowMap3, tmpvar_347), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_345.z - u_params1.x) + / _shadowCoord_345.w))); }; result_292 = (result_292 + tmpvar_346); vec4 tmpvar_349; @@ -1381,7 +1499,9 @@ void main () if (tmpvar_353) { tmpvar_351 = 1.0; } else { - tmpvar_351 = float((dot (texture2D (u_shadowMap3, tmpvar_352), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_350.z - u_params1.x) / _shadowCoord_350.w))); + tmpvar_351 = float((dot (texture2D (u_shadowMap3, tmpvar_352), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_350.z - u_params1.x) + / _shadowCoord_350.w))); }; result_292 = (result_292 + tmpvar_351); vec4 tmpvar_354; @@ -1401,7 +1521,9 @@ void main () if (tmpvar_358) { tmpvar_356 = 1.0; } else { - tmpvar_356 = float((dot (texture2D (u_shadowMap3, tmpvar_357), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_355.z - u_params1.x) / _shadowCoord_355.w))); + tmpvar_356 = float((dot (texture2D (u_shadowMap3, tmpvar_357), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_355.z - u_params1.x) + / _shadowCoord_355.w))); }; result_292 = (result_292 + tmpvar_356); vec4 tmpvar_359; @@ -1421,7 +1543,9 @@ void main () if (tmpvar_363) { tmpvar_361 = 1.0; } else { - tmpvar_361 = float((dot (texture2D (u_shadowMap3, tmpvar_362), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_360.z - u_params1.x) / _shadowCoord_360.w))); + tmpvar_361 = float((dot (texture2D (u_shadowMap3, tmpvar_362), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_360.z - u_params1.x) + / _shadowCoord_360.w))); }; result_292 = (result_292 + tmpvar_361); vec4 tmpvar_364; @@ -1441,7 +1565,9 @@ void main () if (tmpvar_368) { tmpvar_366 = 1.0; } else { - tmpvar_366 = float((dot (texture2D (u_shadowMap3, tmpvar_367), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_365.z - u_params1.x) / _shadowCoord_365.w))); + tmpvar_366 = float((dot (texture2D (u_shadowMap3, tmpvar_367), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_365.z - u_params1.x) + / _shadowCoord_365.w))); }; result_292 = (result_292 + tmpvar_366); vec4 tmpvar_369; @@ -1461,7 +1587,9 @@ void main () if (tmpvar_373) { tmpvar_371 = 1.0; } else { - tmpvar_371 = float((dot (texture2D (u_shadowMap3, tmpvar_372), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_370.z - u_params1.x) / _shadowCoord_370.w))); + tmpvar_371 = float((dot (texture2D (u_shadowMap3, tmpvar_372), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_370.z - u_params1.x) + / _shadowCoord_370.w))); }; float tmpvar_374; tmpvar_374 = (result_292 + tmpvar_371); @@ -1486,18 +1614,46 @@ void main () tmpvar_380 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_381; tmpvar_381 = sqrt(dot (tmpvar_378, tmpvar_378)); - tmpvar_377 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_381)) + ((u_lightAttenuationSpotOuter.z * tmpvar_381) * tmpvar_381)))) * mix (clamp (((max (0.0, dot (-(tmpvar_379), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_380) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_380)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_377 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_381)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_381) * tmpvar_381) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_379) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_380) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_380)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_382; tmpvar_382 = dot (v_normal, tmpvar_376); vec2 tmpvar_383; tmpvar_383.x = tmpvar_382; - tmpvar_383.y = (((float((tmpvar_382 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_382) * v_normal) - tmpvar_376), tmpvar_375)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_383.y = ((( + float((tmpvar_382 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_382) * v_normal) + - tmpvar_376), tmpvar_375)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_384; tmpvar_384 = (max (tmpvar_383, 0.0) * tmpvar_377); float tmpvar_385; tmpvar_385 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_384.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_384.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_385) * tmpvar_385)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_384.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_384.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_385) * tmpvar_385)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin index 8b1002410..3149ecc6a 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_linear_omni.bin @@ -1,28 +1,28 @@ -FSHFuniform sampler2D u_shadowMap0; -uniform vec3 u_tetraNormalRed; -uniform vec3 u_tetraNormalBlue; -uniform vec3 u_tetraNormalYellow; -uniform vec3 u_tetraNormalGreen; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFvarying vec3 v_normal; varying vec4 v_position; -varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform vec3 u_tetraNormalGreen; +uniform vec3 u_tetraNormalYellow; +uniform vec3 u_tetraNormalBlue; +uniform vec3 u_tetraNormalRed; +uniform sampler2D u_shadowMap0; void main () { vec4 shadowcoord_1; @@ -151,7 +151,9 @@ void main () if (tmpvar_38) { tmpvar_36 = 1.0; } else { - tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_35.z - u_params1.x) / _shadowCoord_35.w))); + tmpvar_36 = float((dot (texture2D (u_shadowMap0, tmpvar_37), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_35.z - u_params1.x) + / _shadowCoord_35.w))); }; result_32 = tmpvar_36; vec4 tmpvar_39; @@ -171,7 +173,9 @@ void main () if (tmpvar_43) { tmpvar_41 = 1.0; } else { - tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_40.z - u_params1.x) / _shadowCoord_40.w))); + tmpvar_41 = float((dot (texture2D (u_shadowMap0, tmpvar_42), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_40.z - u_params1.x) + / _shadowCoord_40.w))); }; result_32 = (tmpvar_36 + tmpvar_41); vec4 tmpvar_44; @@ -191,7 +195,9 @@ void main () if (tmpvar_48) { tmpvar_46 = 1.0; } else { - tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_45.z - u_params1.x) / _shadowCoord_45.w))); + tmpvar_46 = float((dot (texture2D (u_shadowMap0, tmpvar_47), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_45.z - u_params1.x) + / _shadowCoord_45.w))); }; result_32 = (result_32 + tmpvar_46); vec4 tmpvar_49; @@ -211,7 +217,9 @@ void main () if (tmpvar_53) { tmpvar_51 = 1.0; } else { - tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_50.z - u_params1.x) / _shadowCoord_50.w))); + tmpvar_51 = float((dot (texture2D (u_shadowMap0, tmpvar_52), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_50.z - u_params1.x) + / _shadowCoord_50.w))); }; result_32 = (result_32 + tmpvar_51); vec4 tmpvar_54; @@ -231,7 +239,9 @@ void main () if (tmpvar_58) { tmpvar_56 = 1.0; } else { - tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_55.z - u_params1.x) / _shadowCoord_55.w))); + tmpvar_56 = float((dot (texture2D (u_shadowMap0, tmpvar_57), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_55.z - u_params1.x) + / _shadowCoord_55.w))); }; result_32 = (result_32 + tmpvar_56); vec4 tmpvar_59; @@ -251,7 +261,9 @@ void main () if (tmpvar_63) { tmpvar_61 = 1.0; } else { - tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_60.z - u_params1.x) / _shadowCoord_60.w))); + tmpvar_61 = float((dot (texture2D (u_shadowMap0, tmpvar_62), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_60.z - u_params1.x) + / _shadowCoord_60.w))); }; result_32 = (result_32 + tmpvar_61); vec4 tmpvar_64; @@ -271,7 +283,9 @@ void main () if (tmpvar_68) { tmpvar_66 = 1.0; } else { - tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_65.z - u_params1.x) / _shadowCoord_65.w))); + tmpvar_66 = float((dot (texture2D (u_shadowMap0, tmpvar_67), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_65.z - u_params1.x) + / _shadowCoord_65.w))); }; result_32 = (result_32 + tmpvar_66); vec4 tmpvar_69; @@ -291,7 +305,9 @@ void main () if (tmpvar_73) { tmpvar_71 = 1.0; } else { - tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_70.z - u_params1.x) / _shadowCoord_70.w))); + tmpvar_71 = float((dot (texture2D (u_shadowMap0, tmpvar_72), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_70.z - u_params1.x) + / _shadowCoord_70.w))); }; result_32 = (result_32 + tmpvar_71); vec4 tmpvar_74; @@ -311,7 +327,9 @@ void main () if (tmpvar_78) { tmpvar_76 = 1.0; } else { - tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_75.z - u_params1.x) / _shadowCoord_75.w))); + tmpvar_76 = float((dot (texture2D (u_shadowMap0, tmpvar_77), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_75.z - u_params1.x) + / _shadowCoord_75.w))); }; result_32 = (result_32 + tmpvar_76); vec4 tmpvar_79; @@ -331,7 +349,9 @@ void main () if (tmpvar_83) { tmpvar_81 = 1.0; } else { - tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_80.z - u_params1.x) / _shadowCoord_80.w))); + tmpvar_81 = float((dot (texture2D (u_shadowMap0, tmpvar_82), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_80.z - u_params1.x) + / _shadowCoord_80.w))); }; result_32 = (result_32 + tmpvar_81); vec4 tmpvar_84; @@ -351,7 +371,9 @@ void main () if (tmpvar_88) { tmpvar_86 = 1.0; } else { - tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_85.z - u_params1.x) / _shadowCoord_85.w))); + tmpvar_86 = float((dot (texture2D (u_shadowMap0, tmpvar_87), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_85.z - u_params1.x) + / _shadowCoord_85.w))); }; result_32 = (result_32 + tmpvar_86); vec4 tmpvar_89; @@ -371,7 +393,9 @@ void main () if (tmpvar_93) { tmpvar_91 = 1.0; } else { - tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_90.z - u_params1.x) / _shadowCoord_90.w))); + tmpvar_91 = float((dot (texture2D (u_shadowMap0, tmpvar_92), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_90.z - u_params1.x) + / _shadowCoord_90.w))); }; result_32 = (result_32 + tmpvar_91); vec4 tmpvar_94; @@ -391,7 +415,9 @@ void main () if (tmpvar_98) { tmpvar_96 = 1.0; } else { - tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_95.z - u_params1.x) / _shadowCoord_95.w))); + tmpvar_96 = float((dot (texture2D (u_shadowMap0, tmpvar_97), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_95.z - u_params1.x) + / _shadowCoord_95.w))); }; result_32 = (result_32 + tmpvar_96); vec4 tmpvar_99; @@ -411,7 +437,9 @@ void main () if (tmpvar_103) { tmpvar_101 = 1.0; } else { - tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_100.z - u_params1.x) / _shadowCoord_100.w))); + tmpvar_101 = float((dot (texture2D (u_shadowMap0, tmpvar_102), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_100.z - u_params1.x) + / _shadowCoord_100.w))); }; result_32 = (result_32 + tmpvar_101); vec4 tmpvar_104; @@ -431,7 +459,9 @@ void main () if (tmpvar_108) { tmpvar_106 = 1.0; } else { - tmpvar_106 = float((dot (texture2D (u_shadowMap0, tmpvar_107), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_105.z - u_params1.x) / _shadowCoord_105.w))); + tmpvar_106 = float((dot (texture2D (u_shadowMap0, tmpvar_107), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_105.z - u_params1.x) + / _shadowCoord_105.w))); }; result_32 = (result_32 + tmpvar_106); vec4 tmpvar_109; @@ -451,7 +481,9 @@ void main () if (tmpvar_113) { tmpvar_111 = 1.0; } else { - tmpvar_111 = float((dot (texture2D (u_shadowMap0, tmpvar_112), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_110.z - u_params1.x) / _shadowCoord_110.w))); + tmpvar_111 = float((dot (texture2D (u_shadowMap0, tmpvar_112), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_110.z - u_params1.x) + / _shadowCoord_110.w))); }; float tmpvar_114; tmpvar_114 = (result_32 + tmpvar_111); @@ -473,18 +505,46 @@ void main () tmpvar_120 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_121; tmpvar_121 = sqrt(dot (tmpvar_118, tmpvar_118)); - tmpvar_117 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_121)) + ((u_lightAttenuationSpotOuter.z * tmpvar_121) * tmpvar_121)))) * mix (clamp (((max (0.0, dot (-(tmpvar_119), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_120) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_120)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_117 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_121)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_121) * tmpvar_121) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_119) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_120) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_120)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_122; tmpvar_122 = dot (v_normal, tmpvar_116); vec2 tmpvar_123; tmpvar_123.x = tmpvar_122; - tmpvar_123.y = (((float((tmpvar_122 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_122) * v_normal) - tmpvar_116), tmpvar_115)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_123.y = ((( + float((tmpvar_122 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_122) * v_normal) + - tmpvar_116), tmpvar_115)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_124; tmpvar_124 = (max (tmpvar_123, 0.0) * tmpvar_117); float tmpvar_125; tmpvar_125 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_124.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_124.y)) * u_color.xyz) * tmpvar_31))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_125) * tmpvar_125)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_124.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_124.y)) + * u_color.xyz) * tmpvar_31))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_125) * tmpvar_125)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin index 5ab373ad1..85f0c1ac7 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_pcf_omni.bin @@ -1,28 +1,28 @@ -FSHFuniform sampler2D u_shadowMap0; -uniform vec3 u_tetraNormalRed; -uniform vec3 u_tetraNormalBlue; -uniform vec3 u_tetraNormalYellow; -uniform vec3 u_tetraNormalGreen; -uniform vec4 u_smSamplingParams; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; -varying vec4 v_texcoord1; +FSHFvarying vec3 v_normal; varying vec4 v_position; -varying vec3 v_normal; +varying vec4 v_texcoord1; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform vec4 u_smSamplingParams; +uniform vec3 u_tetraNormalGreen; +uniform vec3 u_tetraNormalYellow; +uniform vec3 u_tetraNormalBlue; +uniform vec3 u_tetraNormalRed; +uniform sampler2D u_shadowMap0; void main () { vec4 shadowcoord_1; @@ -147,7 +147,9 @@ void main () if (tmpvar_37) { tmpvar_35 = 1.0; } else { - tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_34.z - u_params1.x) / _shadowCoord_34.w))); + tmpvar_35 = float((dot (texture2D (u_shadowMap0, tmpvar_36), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_34.z - u_params1.x) + / _shadowCoord_34.w))); }; result_31 = tmpvar_35; vec4 tmpvar_38; @@ -167,7 +169,9 @@ void main () if (tmpvar_42) { tmpvar_40 = 1.0; } else { - tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_39.z - u_params1.x) / _shadowCoord_39.w))); + tmpvar_40 = float((dot (texture2D (u_shadowMap0, tmpvar_41), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_39.z - u_params1.x) + / _shadowCoord_39.w))); }; result_31 = (tmpvar_35 + tmpvar_40); vec4 tmpvar_43; @@ -187,7 +191,9 @@ void main () if (tmpvar_47) { tmpvar_45 = 1.0; } else { - tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_44.z - u_params1.x) / _shadowCoord_44.w))); + tmpvar_45 = float((dot (texture2D (u_shadowMap0, tmpvar_46), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_44.z - u_params1.x) + / _shadowCoord_44.w))); }; result_31 = (result_31 + tmpvar_45); vec4 tmpvar_48; @@ -207,7 +213,9 @@ void main () if (tmpvar_52) { tmpvar_50 = 1.0; } else { - tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_49.z - u_params1.x) / _shadowCoord_49.w))); + tmpvar_50 = float((dot (texture2D (u_shadowMap0, tmpvar_51), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_49.z - u_params1.x) + / _shadowCoord_49.w))); }; result_31 = (result_31 + tmpvar_50); vec4 tmpvar_53; @@ -227,7 +235,9 @@ void main () if (tmpvar_57) { tmpvar_55 = 1.0; } else { - tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_54.z - u_params1.x) / _shadowCoord_54.w))); + tmpvar_55 = float((dot (texture2D (u_shadowMap0, tmpvar_56), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_54.z - u_params1.x) + / _shadowCoord_54.w))); }; result_31 = (result_31 + tmpvar_55); vec4 tmpvar_58; @@ -247,7 +257,9 @@ void main () if (tmpvar_62) { tmpvar_60 = 1.0; } else { - tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_59.z - u_params1.x) / _shadowCoord_59.w))); + tmpvar_60 = float((dot (texture2D (u_shadowMap0, tmpvar_61), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_59.z - u_params1.x) + / _shadowCoord_59.w))); }; result_31 = (result_31 + tmpvar_60); vec4 tmpvar_63; @@ -267,7 +279,9 @@ void main () if (tmpvar_67) { tmpvar_65 = 1.0; } else { - tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_64.z - u_params1.x) / _shadowCoord_64.w))); + tmpvar_65 = float((dot (texture2D (u_shadowMap0, tmpvar_66), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_64.z - u_params1.x) + / _shadowCoord_64.w))); }; result_31 = (result_31 + tmpvar_65); vec4 tmpvar_68; @@ -287,7 +301,9 @@ void main () if (tmpvar_72) { tmpvar_70 = 1.0; } else { - tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_69.z - u_params1.x) / _shadowCoord_69.w))); + tmpvar_70 = float((dot (texture2D (u_shadowMap0, tmpvar_71), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_69.z - u_params1.x) + / _shadowCoord_69.w))); }; result_31 = (result_31 + tmpvar_70); vec4 tmpvar_73; @@ -307,7 +323,9 @@ void main () if (tmpvar_77) { tmpvar_75 = 1.0; } else { - tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_74.z - u_params1.x) / _shadowCoord_74.w))); + tmpvar_75 = float((dot (texture2D (u_shadowMap0, tmpvar_76), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_74.z - u_params1.x) + / _shadowCoord_74.w))); }; result_31 = (result_31 + tmpvar_75); vec4 tmpvar_78; @@ -327,7 +345,9 @@ void main () if (tmpvar_82) { tmpvar_80 = 1.0; } else { - tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_79.z - u_params1.x) / _shadowCoord_79.w))); + tmpvar_80 = float((dot (texture2D (u_shadowMap0, tmpvar_81), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_79.z - u_params1.x) + / _shadowCoord_79.w))); }; result_31 = (result_31 + tmpvar_80); vec4 tmpvar_83; @@ -347,7 +367,9 @@ void main () if (tmpvar_87) { tmpvar_85 = 1.0; } else { - tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_84.z - u_params1.x) / _shadowCoord_84.w))); + tmpvar_85 = float((dot (texture2D (u_shadowMap0, tmpvar_86), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_84.z - u_params1.x) + / _shadowCoord_84.w))); }; result_31 = (result_31 + tmpvar_85); vec4 tmpvar_88; @@ -367,7 +389,9 @@ void main () if (tmpvar_92) { tmpvar_90 = 1.0; } else { - tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_89.z - u_params1.x) / _shadowCoord_89.w))); + tmpvar_90 = float((dot (texture2D (u_shadowMap0, tmpvar_91), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_89.z - u_params1.x) + / _shadowCoord_89.w))); }; result_31 = (result_31 + tmpvar_90); vec4 tmpvar_93; @@ -387,7 +411,9 @@ void main () if (tmpvar_97) { tmpvar_95 = 1.0; } else { - tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_94.z - u_params1.x) / _shadowCoord_94.w))); + tmpvar_95 = float((dot (texture2D (u_shadowMap0, tmpvar_96), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_94.z - u_params1.x) + / _shadowCoord_94.w))); }; result_31 = (result_31 + tmpvar_95); vec4 tmpvar_98; @@ -407,7 +433,9 @@ void main () if (tmpvar_102) { tmpvar_100 = 1.0; } else { - tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_99.z - u_params1.x) / _shadowCoord_99.w))); + tmpvar_100 = float((dot (texture2D (u_shadowMap0, tmpvar_101), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_99.z - u_params1.x) + / _shadowCoord_99.w))); }; result_31 = (result_31 + tmpvar_100); vec4 tmpvar_103; @@ -427,7 +455,9 @@ void main () if (tmpvar_107) { tmpvar_105 = 1.0; } else { - tmpvar_105 = float((dot (texture2D (u_shadowMap0, tmpvar_106), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_104.z - u_params1.x) / _shadowCoord_104.w))); + tmpvar_105 = float((dot (texture2D (u_shadowMap0, tmpvar_106), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_104.z - u_params1.x) + / _shadowCoord_104.w))); }; result_31 = (result_31 + tmpvar_105); vec4 tmpvar_108; @@ -447,7 +477,9 @@ void main () if (tmpvar_112) { tmpvar_110 = 1.0; } else { - tmpvar_110 = float((dot (texture2D (u_shadowMap0, tmpvar_111), vec4(5.96046e-08, 1.52588e-05, 0.00390625, 1.0)) >= ((_shadowCoord_109.z - u_params1.x) / _shadowCoord_109.w))); + tmpvar_110 = float((dot (texture2D (u_shadowMap0, tmpvar_111), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_109.z - u_params1.x) + / _shadowCoord_109.w))); }; float tmpvar_113; tmpvar_113 = (result_31 + tmpvar_110); @@ -469,18 +501,46 @@ void main () tmpvar_119 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_120; tmpvar_120 = sqrt(dot (tmpvar_117, tmpvar_117)); - tmpvar_116 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_120)) + ((u_lightAttenuationSpotOuter.z * tmpvar_120) * tmpvar_120)))) * mix (clamp (((max (0.0, dot (-(tmpvar_118), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_119) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_119)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_116 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_120)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_120) * tmpvar_120) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_118) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_119) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_119)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_121; tmpvar_121 = dot (v_normal, tmpvar_115); vec2 tmpvar_122; tmpvar_122.x = tmpvar_121; - tmpvar_122.y = (((float((tmpvar_121 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_121) * v_normal) - tmpvar_115), tmpvar_114)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_122.y = ((( + float((tmpvar_121 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_121) * v_normal) + - tmpvar_115), tmpvar_114)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_123; tmpvar_123 = (max (tmpvar_122, 0.0) * tmpvar_116); float tmpvar_124; tmpvar_124 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_123.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_123.y)) * u_color.xyz) * tmpvar_30))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_124) * tmpvar_124)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_123.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_123.y)) + * u_color.xyz) * tmpvar_30))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_3 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_124) * tmpvar_124)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin index 097577f07..93d49fff8 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin index a7da63711..d7ffd602d 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_csm.bin @@ -1,25 +1,25 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -289,18 +289,46 @@ void main () tmpvar_80 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_81; tmpvar_81 = sqrt(dot (tmpvar_78, tmpvar_78)); - tmpvar_77 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81)))) * mix (clamp (((max (0.0, dot (-(tmpvar_79), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_80) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_80)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_77 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_79) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_80) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_80)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_82; tmpvar_82 = dot (v_normal, tmpvar_76); vec2 tmpvar_83; tmpvar_83.x = tmpvar_82; - tmpvar_83.y = (((float((tmpvar_82 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_82) * v_normal) - tmpvar_76), tmpvar_75)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_83.y = ((( + float((tmpvar_82 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_82) * v_normal) + - tmpvar_76), tmpvar_75)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_84; tmpvar_84 = (max (tmpvar_83, 0.0) * tmpvar_77); float tmpvar_85; tmpvar_85 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_85) * tmpvar_85)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_85) * tmpvar_85)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin index 6bd7d818c..d882db70b 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin index db30cd0c0..ab383d1f6 100644 --- a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin +++ b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_csm.bin @@ -1,25 +1,25 @@ -FSHFuniform sampler2D u_shadowMap3; -uniform sampler2D u_shadowMap2; -uniform sampler2D u_shadowMap1; -uniform sampler2D u_shadowMap0; -uniform vec4 u_lightAttenuationSpotOuter; -uniform vec4 u_lightSpotDirectionInner; -uniform vec4 u_lightSpecularPower; -uniform vec4 u_lightDiffusePower; -uniform vec4 u_lightAmbientPower; -uniform vec4 u_lightPosition; -uniform vec4 u_materialKs; -uniform vec3 u_materialKd; -uniform vec3 u_materialKa; -uniform vec4 u_color; -uniform vec4 u_params2; -uniform vec4 u_params1; -varying vec3 v_view; -varying vec4 v_texcoord4; -varying vec4 v_texcoord3; -varying vec4 v_texcoord2; +FSHFvarying vec3 v_normal; varying vec4 v_texcoord1; -varying vec3 v_normal; +varying vec4 v_texcoord2; +varying vec4 v_texcoord3; +varying vec4 v_texcoord4; +varying vec3 v_view; +uniform vec4 u_params1; +uniform vec4 u_params2; +uniform vec4 u_color; +uniform vec3 u_materialKa; +uniform vec3 u_materialKd; +uniform vec4 u_materialKs; +uniform vec4 u_lightPosition; +uniform vec4 u_lightAmbientPower; +uniform vec4 u_lightDiffusePower; +uniform vec4 u_lightSpecularPower; +uniform vec4 u_lightSpotDirectionInner; +uniform vec4 u_lightAttenuationSpotOuter; +uniform sampler2D u_shadowMap0; +uniform sampler2D u_shadowMap1; +uniform sampler2D u_shadowMap2; +uniform sampler2D u_shadowMap3; void main () { float visibility_1; @@ -297,18 +297,46 @@ void main () tmpvar_80 = cos((u_lightAttenuationSpotOuter.w * 0.0174533)); float tmpvar_81; tmpvar_81 = sqrt(dot (tmpvar_78, tmpvar_78)); - tmpvar_77 = ((1.0/(((u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81)))) * mix (clamp (((max (0.0, dot (-(tmpvar_79), normalize(u_lightSpotDirectionInner.xyz))) - tmpvar_80) / (cos((min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) * 0.0174533)) - tmpvar_80)), 0.0, 1.0), 1.0, float((u_lightAttenuationSpotOuter.w >= 90.0)))); + tmpvar_77 = ((1.0/(( + (u_lightAttenuationSpotOuter.x + (u_lightAttenuationSpotOuter.y * tmpvar_81)) + + + ((u_lightAttenuationSpotOuter.z * tmpvar_81) * tmpvar_81) + ))) * mix (clamp ( + ((max (0.0, dot ( + -(tmpvar_79) + , + normalize(u_lightSpotDirectionInner.xyz) + )) - tmpvar_80) / (cos(( + min (u_lightSpotDirectionInner.w, (u_lightAttenuationSpotOuter.w - 0.001)) + * 0.0174533)) - tmpvar_80)) + , 0.0, 1.0), 1.0, float( + (u_lightAttenuationSpotOuter.w >= 90.0) + ))); }; float tmpvar_82; tmpvar_82 = dot (v_normal, tmpvar_76); vec2 tmpvar_83; tmpvar_83.x = tmpvar_82; - tmpvar_83.y = (((float((tmpvar_82 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_82) * v_normal) - tmpvar_76), tmpvar_75)), u_materialKs.w)) * (2.0 + u_materialKs.w)) / 8.0); + tmpvar_83.y = ((( + float((tmpvar_82 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_82) * v_normal) + - tmpvar_76), tmpvar_75)), u_materialKs.w) + ) * (2.0 + u_materialKs.w)) / 8.0); vec2 tmpvar_84; tmpvar_84 = (max (tmpvar_83, 0.0) * tmpvar_77); float tmpvar_85; tmpvar_85 = sqrt(dot (v_view, v_view)); - gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow (abs(((((u_lightAmbientPower.xyz * u_lightAmbientPower.w) * u_materialKa) * u_color.xyz) + ((((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) * u_color.xyz) * visibility_1))), vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/(exp2(((1.7673e-05 * tmpvar_85) * tmpvar_85)))), 0.0, 1.0)); + gl_FragColor.xyz = mix (vec3(0.0, 0.0, 0.0), (pow ( + abs(((( + (u_lightAmbientPower.xyz * u_lightAmbientPower.w) + * u_materialKa) * u_color.xyz) + (( + ((((u_lightDiffusePower.xyz * u_lightDiffusePower.w) * u_materialKd) * tmpvar_84.x) + (((u_lightSpecularPower.xyz * u_lightSpecularPower.w) * u_materialKs.xyz) * tmpvar_84.y)) + * u_color.xyz) * visibility_1))) + , vec3(0.454545, 0.454545, 0.454545)) + (colorCoverage_2 * u_params2.y)), clamp ((1.0/( + exp2(((1.7673e-005 * tmpvar_85) * tmpvar_85)) + )), 0.0, 1.0)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin index 89346b345..8468e8397 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_linear_omni.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin index 6780dae49..3d470654a 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_lightning_vsm_omni.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin index 6eb00aced..8ffbdc44a 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin index a68bc874a..acda76ced 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_hblur.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin index dc8f5608b..1679ccfa9 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_hblur_vsm.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin index 5e17307d2..09b93ac3a 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin index 2e6372096..c98de4172 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_packdepth_linear.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin index 3ea416c80..ce215d26f 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin index 2e237bbc9..058e4aeca 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin index fdc3ba085..9fa9f14b7 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_unpackdepth_vsm.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin index a68bc874a..acda76ced 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_vblur.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin b/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin index dc8f5608b..1679ccfa9 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin and b/examples/runtime/shaders/glsl/fs_shadowmaps_vblur_vsm.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin index 51b225765..652fab507 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_color_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin index 6eb00aced..8ffbdc44a 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin index 64a9fd9ea..aef88dcc7 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex1.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin index 227aec935..e819f99ee 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_svbacktex2.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin index a46c596c9..f2fa49056 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex1.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin index 7c2dc8b1c..59c0dd70b 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_svfronttex2.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin index 64bab921e..ac333d138 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_svside.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin index 96fad0d23..a8c04260c 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_svsidetex.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin index 3ea416c80..ce215d26f 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin b/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin index 3a688f1e0..f7de9ed68 100644 Binary files a/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin and b/examples/runtime/shaders/glsl/fs_shadowvolume_texture_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/fs_smsimple_draw.bin b/examples/runtime/shaders/glsl/fs_smsimple_draw.bin index 8e7380346..ab0eb5eb9 100644 --- a/examples/runtime/shaders/glsl/fs_smsimple_draw.bin +++ b/examples/runtime/shaders/glsl/fs_smsimple_draw.bin @@ -1,8 +1,8 @@ -FSHpjHuniform sampler2D u_shadowMap; -uniform vec4 u_lightPos; -varying vec3 v_view; +FSHpjHvarying vec3 v_normal; varying vec4 v_shadowcoord; -varying vec3 v_normal; +varying vec3 v_view; +uniform vec4 u_lightPos; +uniform sampler2D u_shadowMap; void main () { vec2 lc_1; @@ -12,7 +12,15 @@ void main () tmpvar_3 = dot (v_normal, tmpvar_2); vec2 tmpvar_4; tmpvar_4.x = tmpvar_3; - tmpvar_4.y = (((float((tmpvar_3 >= 0.0)) * pow (max (0.0, dot ((((2.0 * tmpvar_3) * v_normal) - tmpvar_2), -(normalize(v_view)))), 1.0)) * 3.0) / 8.0); + tmpvar_4.y = ((( + float((tmpvar_3 >= 0.0)) + * + pow (max (0.0, dot (( + ((2.0 * tmpvar_3) * v_normal) + - tmpvar_2), -( + normalize(v_view) + ))), 1.0) + ) * 3.0) / 8.0); lc_1 = max (tmpvar_4, 0.0); float result_5; result_5 = 0.0; @@ -35,7 +43,9 @@ void main () if (tmpvar_11) { tmpvar_9 = 1.0; } else { - tmpvar_9 = float((dot (texture2D (u_shadowMap, tmpvar_10), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_8.z - 0.005) / _shadowCoord_8.w))); + tmpvar_9 = float((dot (texture2D (u_shadowMap, tmpvar_10), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_8.z - 0.005) + / _shadowCoord_8.w))); }; result_5 = tmpvar_9; vec4 tmpvar_12; @@ -55,7 +65,9 @@ void main () if (tmpvar_16) { tmpvar_14 = 1.0; } else { - tmpvar_14 = float((dot (texture2D (u_shadowMap, tmpvar_15), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_13.z - 0.005) / _shadowCoord_13.w))); + tmpvar_14 = float((dot (texture2D (u_shadowMap, tmpvar_15), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_13.z - 0.005) + / _shadowCoord_13.w))); }; result_5 = (tmpvar_9 + tmpvar_14); vec4 tmpvar_17; @@ -75,7 +87,9 @@ void main () if (tmpvar_21) { tmpvar_19 = 1.0; } else { - tmpvar_19 = float((dot (texture2D (u_shadowMap, tmpvar_20), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_18.z - 0.005) / _shadowCoord_18.w))); + tmpvar_19 = float((dot (texture2D (u_shadowMap, tmpvar_20), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_18.z - 0.005) + / _shadowCoord_18.w))); }; result_5 = (result_5 + tmpvar_19); vec4 tmpvar_22; @@ -95,7 +109,9 @@ void main () if (tmpvar_26) { tmpvar_24 = 1.0; } else { - tmpvar_24 = float((dot (texture2D (u_shadowMap, tmpvar_25), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_23.z - 0.005) / _shadowCoord_23.w))); + tmpvar_24 = float((dot (texture2D (u_shadowMap, tmpvar_25), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_23.z - 0.005) + / _shadowCoord_23.w))); }; result_5 = (result_5 + tmpvar_24); vec4 tmpvar_27; @@ -115,7 +131,9 @@ void main () if (tmpvar_31) { tmpvar_29 = 1.0; } else { - tmpvar_29 = float((dot (texture2D (u_shadowMap, tmpvar_30), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_28.z - 0.005) / _shadowCoord_28.w))); + tmpvar_29 = float((dot (texture2D (u_shadowMap, tmpvar_30), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_28.z - 0.005) + / _shadowCoord_28.w))); }; result_5 = (result_5 + tmpvar_29); vec4 tmpvar_32; @@ -135,7 +153,9 @@ void main () if (tmpvar_36) { tmpvar_34 = 1.0; } else { - tmpvar_34 = float((dot (texture2D (u_shadowMap, tmpvar_35), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_33.z - 0.005) / _shadowCoord_33.w))); + tmpvar_34 = float((dot (texture2D (u_shadowMap, tmpvar_35), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_33.z - 0.005) + / _shadowCoord_33.w))); }; result_5 = (result_5 + tmpvar_34); vec4 tmpvar_37; @@ -155,7 +175,9 @@ void main () if (tmpvar_41) { tmpvar_39 = 1.0; } else { - tmpvar_39 = float((dot (texture2D (u_shadowMap, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_38.z - 0.005) / _shadowCoord_38.w))); + tmpvar_39 = float((dot (texture2D (u_shadowMap, tmpvar_40), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_38.z - 0.005) + / _shadowCoord_38.w))); }; result_5 = (result_5 + tmpvar_39); vec4 tmpvar_42; @@ -175,7 +197,9 @@ void main () if (tmpvar_46) { tmpvar_44 = 1.0; } else { - tmpvar_44 = float((dot (texture2D (u_shadowMap, tmpvar_45), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_43.z - 0.005) / _shadowCoord_43.w))); + tmpvar_44 = float((dot (texture2D (u_shadowMap, tmpvar_45), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_43.z - 0.005) + / _shadowCoord_43.w))); }; result_5 = (result_5 + tmpvar_44); vec4 tmpvar_47; @@ -195,7 +219,9 @@ void main () if (tmpvar_51) { tmpvar_49 = 1.0; } else { - tmpvar_49 = float((dot (texture2D (u_shadowMap, tmpvar_50), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_48.z - 0.005) / _shadowCoord_48.w))); + tmpvar_49 = float((dot (texture2D (u_shadowMap, tmpvar_50), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_48.z - 0.005) + / _shadowCoord_48.w))); }; result_5 = (result_5 + tmpvar_49); vec4 tmpvar_52; @@ -215,7 +241,9 @@ void main () if (tmpvar_56) { tmpvar_54 = 1.0; } else { - tmpvar_54 = float((dot (texture2D (u_shadowMap, tmpvar_55), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_53.z - 0.005) / _shadowCoord_53.w))); + tmpvar_54 = float((dot (texture2D (u_shadowMap, tmpvar_55), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_53.z - 0.005) + / _shadowCoord_53.w))); }; result_5 = (result_5 + tmpvar_54); vec4 tmpvar_57; @@ -235,7 +263,9 @@ void main () if (tmpvar_61) { tmpvar_59 = 1.0; } else { - tmpvar_59 = float((dot (texture2D (u_shadowMap, tmpvar_60), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_58.z - 0.005) / _shadowCoord_58.w))); + tmpvar_59 = float((dot (texture2D (u_shadowMap, tmpvar_60), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_58.z - 0.005) + / _shadowCoord_58.w))); }; result_5 = (result_5 + tmpvar_59); vec4 tmpvar_62; @@ -255,7 +285,9 @@ void main () if (tmpvar_66) { tmpvar_64 = 1.0; } else { - tmpvar_64 = float((dot (texture2D (u_shadowMap, tmpvar_65), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_63.z - 0.005) / _shadowCoord_63.w))); + tmpvar_64 = float((dot (texture2D (u_shadowMap, tmpvar_65), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_63.z - 0.005) + / _shadowCoord_63.w))); }; result_5 = (result_5 + tmpvar_64); vec4 tmpvar_67; @@ -275,7 +307,9 @@ void main () if (tmpvar_71) { tmpvar_69 = 1.0; } else { - tmpvar_69 = float((dot (texture2D (u_shadowMap, tmpvar_70), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_68.z - 0.005) / _shadowCoord_68.w))); + tmpvar_69 = float((dot (texture2D (u_shadowMap, tmpvar_70), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_68.z - 0.005) + / _shadowCoord_68.w))); }; result_5 = (result_5 + tmpvar_69); vec4 tmpvar_72; @@ -295,7 +329,9 @@ void main () if (tmpvar_76) { tmpvar_74 = 1.0; } else { - tmpvar_74 = float((dot (texture2D (u_shadowMap, tmpvar_75), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_73.z - 0.005) / _shadowCoord_73.w))); + tmpvar_74 = float((dot (texture2D (u_shadowMap, tmpvar_75), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_73.z - 0.005) + / _shadowCoord_73.w))); }; result_5 = (result_5 + tmpvar_74); vec4 tmpvar_77; @@ -315,7 +351,9 @@ void main () if (tmpvar_81) { tmpvar_79 = 1.0; } else { - tmpvar_79 = float((dot (texture2D (u_shadowMap, tmpvar_80), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_78.z - 0.005) / _shadowCoord_78.w))); + tmpvar_79 = float((dot (texture2D (u_shadowMap, tmpvar_80), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_78.z - 0.005) + / _shadowCoord_78.w))); }; result_5 = (result_5 + tmpvar_79); vec4 tmpvar_82; @@ -335,12 +373,16 @@ void main () if (tmpvar_86) { tmpvar_84 = 1.0; } else { - tmpvar_84 = float((dot (texture2D (u_shadowMap, tmpvar_85), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ((_shadowCoord_83.z - 0.005) / _shadowCoord_83.w))); + tmpvar_84 = float((dot (texture2D (u_shadowMap, tmpvar_85), vec4(5.96046e-008, 1.52588e-005, 0.00390625, 1.0)) >= ( + (_shadowCoord_83.z - 0.005) + / _shadowCoord_83.w))); }; float tmpvar_87; tmpvar_87 = (result_5 + tmpvar_84); result_5 = tmpvar_87; - gl_FragColor.xyz = pow (abs((vec3(0.1, 0.1, 0.1) + (vec3((lc_1.x + lc_1.y)) * (tmpvar_87 / 16.0)))), vec3(0.454545, 0.454545, 0.454545)); + gl_FragColor.xyz = pow (abs((vec3(0.1, 0.1, 0.1) + + (vec3((lc_1.x + lc_1.y)) * (tmpvar_87 / 16.0)) + )), vec3(0.454545, 0.454545, 0.454545)); gl_FragColor.w = 1.0; } diff --git a/examples/runtime/shaders/glsl/fs_smsimple_packdepth.bin b/examples/runtime/shaders/glsl/fs_smsimple_packdepth.bin index 169b26c2c..09b93ac3a 100644 Binary files a/examples/runtime/shaders/glsl/fs_smsimple_packdepth.bin and b/examples/runtime/shaders/glsl/fs_smsimple_packdepth.bin differ diff --git a/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin b/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin index e3b75388d..06eecc3d1 100644 Binary files a/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin and b/examples/runtime/shaders/glsl/fs_stencil_color_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin b/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin index 6eb00aced..8ffbdc44a 100644 Binary files a/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin and b/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_stencil_texture.bin b/examples/runtime/shaders/glsl/fs_stencil_texture.bin index 3ea416c80..ce215d26f 100644 Binary files a/examples/runtime/shaders/glsl/fs_stencil_texture.bin and b/examples/runtime/shaders/glsl/fs_stencil_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin b/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin index f681aa55f..aaf8f9515 100644 Binary files a/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin and b/examples/runtime/shaders/glsl/fs_stencil_texture_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/fs_tree.bin b/examples/runtime/shaders/glsl/fs_tree.bin index 5dd43cb23..54df7966a 100644 Binary files a/examples/runtime/shaders/glsl/fs_tree.bin and b/examples/runtime/shaders/glsl/fs_tree.bin differ diff --git a/examples/runtime/shaders/glsl/fs_update.bin b/examples/runtime/shaders/glsl/fs_update.bin index 40844d125..ea2f1ac60 100644 Binary files a/examples/runtime/shaders/glsl/fs_update.bin and b/examples/runtime/shaders/glsl/fs_update.bin differ diff --git a/examples/runtime/shaders/glsl/fs_update_cmp.bin b/examples/runtime/shaders/glsl/fs_update_cmp.bin index 391304c05..308ce8789 100644 Binary files a/examples/runtime/shaders/glsl/fs_update_cmp.bin and b/examples/runtime/shaders/glsl/fs_update_cmp.bin differ diff --git a/examples/runtime/shaders/glsl/vs_bump.bin b/examples/runtime/shaders/glsl/vs_bump.bin index 2c6679972..b6b7e8335 100644 Binary files a/examples/runtime/shaders/glsl/vs_bump.bin and b/examples/runtime/shaders/glsl/vs_bump.bin differ diff --git a/examples/runtime/shaders/glsl/vs_bump_instanced.bin b/examples/runtime/shaders/glsl/vs_bump_instanced.bin index 8ad62fde7..a28c7aff8 100644 Binary files a/examples/runtime/shaders/glsl/vs_bump_instanced.bin and b/examples/runtime/shaders/glsl/vs_bump_instanced.bin differ diff --git a/examples/runtime/shaders/glsl/vs_callback.bin b/examples/runtime/shaders/glsl/vs_callback.bin index c1722ec33..6bacfa008 100644 Binary files a/examples/runtime/shaders/glsl/vs_callback.bin and b/examples/runtime/shaders/glsl/vs_callback.bin differ diff --git a/examples/runtime/shaders/glsl/vs_cubes.bin b/examples/runtime/shaders/glsl/vs_cubes.bin index e226f13c4..a95ee0cd5 100644 Binary files a/examples/runtime/shaders/glsl/vs_cubes.bin and b/examples/runtime/shaders/glsl/vs_cubes.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_blur.bin b/examples/runtime/shaders/glsl/vs_hdr_blur.bin index 3d6338c50..803d8c85b 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_blur.bin and b/examples/runtime/shaders/glsl/vs_hdr_blur.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_bright.bin b/examples/runtime/shaders/glsl/vs_hdr_bright.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_bright.bin and b/examples/runtime/shaders/glsl/vs_hdr_bright.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_lum.bin b/examples/runtime/shaders/glsl/vs_hdr_lum.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_lum.bin and b/examples/runtime/shaders/glsl/vs_hdr_lum.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin b/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin and b/examples/runtime/shaders/glsl/vs_hdr_lumavg.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_mesh.bin b/examples/runtime/shaders/glsl/vs_hdr_mesh.bin index f1c7bdc2e..0730b765a 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_mesh.bin and b/examples/runtime/shaders/glsl/vs_hdr_mesh.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_skybox.bin b/examples/runtime/shaders/glsl/vs_hdr_skybox.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_skybox.bin and b/examples/runtime/shaders/glsl/vs_hdr_skybox.bin differ diff --git a/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin b/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin index 36c120a0a..5ef806ae4 100644 Binary files a/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin and b/examples/runtime/shaders/glsl/vs_hdr_tonemap.bin differ diff --git a/examples/runtime/shaders/glsl/vs_instancing.bin b/examples/runtime/shaders/glsl/vs_instancing.bin index 27636041c..b3c42b99f 100644 Binary files a/examples/runtime/shaders/glsl/vs_instancing.bin and b/examples/runtime/shaders/glsl/vs_instancing.bin differ diff --git a/examples/runtime/shaders/glsl/vs_mesh.bin b/examples/runtime/shaders/glsl/vs_mesh.bin index cf336ac46..5b9c2e7c5 100644 Binary files a/examples/runtime/shaders/glsl/vs_mesh.bin and b/examples/runtime/shaders/glsl/vs_mesh.bin differ diff --git a/examples/runtime/shaders/glsl/vs_raymarching.bin b/examples/runtime/shaders/glsl/vs_raymarching.bin index a5954dd09..e5ce571c4 100644 Binary files a/examples/runtime/shaders/glsl/vs_raymarching.bin and b/examples/runtime/shaders/glsl/vs_raymarching.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin index c08b5667c..bb6aab4f3 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin index c95465f2a..649c5b944 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin index 0a45a09d0..e836887d5 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_csm.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin index 031192276..0461e4d7b 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin index 8ec50ef73..eedb14f86 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_csm.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin index 2abd81fe7..655e56879 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_linear_omni.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin index dc91946e3..5a6e7f390 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_lightning_omni.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin index c08b5667c..bb6aab4f3 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_depth.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin index 21870f0dc..5b34eda77 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_hblur.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin index 71bbbc323..3a4265457 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin index dc0cd079a..6cb47bbb1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_packdepth_linear.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_texture.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin index 3d5205f36..4e09e76e7 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_texture_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_unpackdepth.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin b/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin index b0d51f7bc..665c46851 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin and b/examples/runtime/shaders/glsl/vs_shadowmaps_vblur.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin index ef1e42a99..0c64a04ea 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_color_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin index 4f920aeea..3d1f6a8b1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_svback.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin index c08b5667c..bb6aab4f3 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_svfront.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin index c73da93ca..2400e3a85 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_svside.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_texture.bin differ diff --git a/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin b/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin index edd0ff75d..790a33fe3 100644 Binary files a/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin and b/examples/runtime/shaders/glsl/vs_shadowvolume_texture_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/vs_smsimple_draw.bin b/examples/runtime/shaders/glsl/vs_smsimple_draw.bin index 2f407f320..7dc1f62f6 100644 Binary files a/examples/runtime/shaders/glsl/vs_smsimple_draw.bin and b/examples/runtime/shaders/glsl/vs_smsimple_draw.bin differ diff --git a/examples/runtime/shaders/glsl/vs_smsimple_packdepth.bin b/examples/runtime/shaders/glsl/vs_smsimple_packdepth.bin index 71bbbc323..3a4265457 100644 Binary files a/examples/runtime/shaders/glsl/vs_smsimple_packdepth.bin and b/examples/runtime/shaders/glsl/vs_smsimple_packdepth.bin differ diff --git a/examples/runtime/shaders/glsl/vs_stencil_color.bin b/examples/runtime/shaders/glsl/vs_stencil_color.bin index c08b5667c..bb6aab4f3 100644 Binary files a/examples/runtime/shaders/glsl/vs_stencil_color.bin and b/examples/runtime/shaders/glsl/vs_stencil_color.bin differ diff --git a/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin b/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin index e16656f3f..77c76b83f 100644 Binary files a/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin and b/examples/runtime/shaders/glsl/vs_stencil_color_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin b/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin and b/examples/runtime/shaders/glsl/vs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/vs_stencil_texture.bin b/examples/runtime/shaders/glsl/vs_stencil_texture.bin index 82cd38130..94cc7cda1 100644 Binary files a/examples/runtime/shaders/glsl/vs_stencil_texture.bin and b/examples/runtime/shaders/glsl/vs_stencil_texture.bin differ diff --git a/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin b/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin index 3d5205f36..4e09e76e7 100644 Binary files a/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin and b/examples/runtime/shaders/glsl/vs_stencil_texture_lightning.bin differ diff --git a/examples/runtime/shaders/glsl/vs_tree.bin b/examples/runtime/shaders/glsl/vs_tree.bin index 4de00d5dd..14bc0dce7 100644 Binary files a/examples/runtime/shaders/glsl/vs_tree.bin and b/examples/runtime/shaders/glsl/vs_tree.bin differ diff --git a/examples/runtime/shaders/glsl/vs_update.bin b/examples/runtime/shaders/glsl/vs_update.bin index 1190296a9..359cae129 100644 Binary files a/examples/runtime/shaders/glsl/vs_update.bin and b/examples/runtime/shaders/glsl/vs_update.bin differ diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index b59768581..fedfc8d21 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -601,7 +601,7 @@ bool compileGLSLShader(bx::CommandLine& _cmdLine, uint32_t _gles, const std::str const char* profile = _cmdLine.findOption('p', "profile"); bool gles = NULL == profile; - glslopt_ctx* ctx = glslopt_initialize(gles); + glslopt_ctx* ctx = glslopt_initialize( (glslopt_target)gles); glslopt_shader* shader = glslopt_optimize(ctx, type, _code.c_str(), 0);