Updated glsl-optimizer.
This commit is contained in:
parent
e7b42f13c6
commit
557dcef3dd
13
3rdparty/glsl-optimizer/.gitignore
vendored
13
3rdparty/glsl-optimizer/.gitignore
vendored
@ -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
|
2
3rdparty/glsl-optimizer/.npmignore
vendored
Normal file
2
3rdparty/glsl-optimizer/.npmignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
projects
|
||||
tests
|
10
3rdparty/glsl-optimizer/CMakeLists.txt
vendored
10
3rdparty/glsl-optimizer/CMakeLists.txt
vendored
@ -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)
|
||||
#add_executable(glcpp src/glsl/glcpp/glcpp.c)
|
||||
#target_link_libraries(glcpp glsl_optimizer)
|
||||
|
60
3rdparty/glsl-optimizer/Changelog.md
vendored
Normal file
60
3rdparty/glsl-optimizer/Changelog.md
vendored
Normal file
@ -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
|
49
3rdparty/glsl-optimizer/README.md
vendored
49
3rdparty/glsl-optimizer/README.md
vendored
@ -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)
|
||||
|
||||
|
25
3rdparty/glsl-optimizer/binding.gyp
vendored
Normal file
25
3rdparty/glsl-optimizer/binding.gyp
vendored
Normal file
@ -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],
|
||||
}],
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
@ -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
|
||||
|
||||
|
145
3rdparty/glsl-optimizer/include/c99_compat.h
vendored
Normal file
145
3rdparty/glsl-optimizer/include/c99_compat.h
vendored
Normal file
@ -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 <crtdefs.h>
|
||||
# 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__ "<unknown>"
|
||||
# endif
|
||||
# elif defined(_MSC_VER)
|
||||
# if _MSC_VER >= 1300
|
||||
# define __func__ __FUNCTION__
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# 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_ */
|
2
3rdparty/glsl-optimizer/license.txt
vendored
2
3rdparty/glsl-optimizer/license.txt
vendored
@ -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"),
|
||||
|
21
3rdparty/glsl-optimizer/package.json
vendored
Normal file
21
3rdparty/glsl-optimizer/package.json
vendored
Normal file
@ -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"
|
||||
}
|
@ -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
|
365
3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
vendored
Normal file
365
3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
vendored
Normal file
@ -0,0 +1,365 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B475A403-9D9B-410D-8A93-BA49FC4DD811}</ProjectGuid>
|
||||
<RootNamespace>glsl_optimizer_lib</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(Platform)\$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)-win32.lib</OutputFile>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)-x64.lib</OutputFile>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)-win32.lib</OutputFile>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>../../src/mesa;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)-x64.lib</OutputFile>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\glsl\ast.h" />
|
||||
<ClInclude Include="..\..\src\glsl\builtin_type_macros.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glsl_optimizer.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glsl_parser.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glsl_parser_extras.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glsl_symbol_table.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glsl_types.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_basic_block.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_builder.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_expression_flattening.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_function_inlining.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_hierarchical_visitor.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_optimization.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_print_glsl_visitor.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_print_visitor.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_rvalue_visitor.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_stats.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_uniform.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_unused_structs.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_variable_refcount.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ir_visitor.h" />
|
||||
<ClInclude Include="..\..\src\glsl\linker.h" />
|
||||
<ClInclude Include="..\..\src\glsl\link_uniform_block_active_visitor.h" />
|
||||
<ClInclude Include="..\..\src\glsl\link_varyings.h" />
|
||||
<ClInclude Include="..\..\src\glsl\list.h" />
|
||||
<ClInclude Include="..\..\src\glsl\loop_analysis.h" />
|
||||
<ClInclude Include="..\..\src\glsl\program.h" />
|
||||
<ClInclude Include="..\..\src\glsl\ralloc.h" />
|
||||
<ClInclude Include="..\..\src\glsl\s_expression.h" />
|
||||
<ClInclude Include="..\..\src\glsl\standalone_scaffolding.h" />
|
||||
<ClInclude Include="..\..\src\glsl\strtod.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glcpp\glcpp-parse.h" />
|
||||
<ClInclude Include="..\..\src\glsl\glcpp\glcpp.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\hash_table.h" />
|
||||
<ClInclude Include="..\..\src\mesa\program\hash_table.h" />
|
||||
<ClInclude Include="..\..\src\mesa\program\prog_instruction.h" />
|
||||
<ClInclude Include="..\..\src\mesa\program\prog_parameter.h" />
|
||||
<ClInclude Include="..\..\src\mesa\program\prog_statevars.h" />
|
||||
<ClInclude Include="..\..\src\mesa\program\symbol_table.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\compiler.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\config.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\context.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\core.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\dd.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\glheader.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\glminimal.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\imports.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\macros.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\mtypes.h" />
|
||||
<ClInclude Include="..\..\src\mesa\main\simple_list.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\glsl\ast_array_index.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ast_expr.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ast_function.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ast_to_hir.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ast_type.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\builtin_functions.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\builtin_types.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\builtin_variables.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\glsl_lexer.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\glsl_optimizer.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\glsl_parser.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\glsl_parser_extras.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\glsl_symbol_table.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\glsl_types.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\hir_field_selection.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_basic_block.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_builder.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_clone.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_constant_expression.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_equals.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_expression_flattening.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_function.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_function_can_inline.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_function_detect_recursion.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_hierarchical_visitor.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_hv_accept.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_import_prototypes.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_print_glsl_visitor.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_print_visitor.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_rvalue_visitor.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_stats.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_unused_structs.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_validate.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ir_variable_refcount.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_atomics.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_functions.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_interface_blocks.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_uniform_blocks.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_uniform_block_active_visitor.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_uniform_initializers.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_uniforms.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\linker.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\link_varyings.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\loop_analysis.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\loop_controls.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\loop_unroll.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_clip_distance.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_discard.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_discard_flow.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_if_to_cond_assign.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_instructions.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_jumps.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_mat_op_to_vec.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_named_interface_blocks.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_noise.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_output_reads.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_packed_varyings.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_packing_builtins.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_ubo_reference.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_variable_index_to_cond_assign.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_vector_insert.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_vec_index_to_cond_assign.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_vec_index_to_swizzle.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\lower_vector.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\main.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_algebraic.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_array_splitting.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_constant_folding.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_constant_propagation.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_constant_variable.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_copy_propagation.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_copy_propagation_elements.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_cse.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_builtin_varyings.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_code.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_code_local.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_functions.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_flatten_nested_if_blocks.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_flip_matrices.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_function_inlining.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_if_simplification.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_noop_swizzle.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_redundant_jumps.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_structure_splitting.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_swizzle_swizzle.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_tree_grafting.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\opt_vectorize.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\ralloc.c" />
|
||||
<ClCompile Include="..\..\src\glsl\s_expression.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\standalone_scaffolding.cpp" />
|
||||
<ClCompile Include="..\..\src\glsl\strtod.c" />
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\glcpp-lex.c" />
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\glcpp-parse.c" />
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\glcpp.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\pp.c" />
|
||||
<ClCompile Include="..\..\src\mesa\main\hash_table.c" />
|
||||
<ClCompile Include="..\..\src\mesa\main\imports.c" />
|
||||
<ClCompile Include="..\..\src\mesa\program\prog_hash_table.c" />
|
||||
<ClCompile Include="..\..\src\mesa\program\symbol_table.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glsl_lexer.lpp">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glsl_parser.ypp">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-lex.l">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-parse.y">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</CustomBuildStep>
|
||||
<None Include="..\..\README.md" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
497
3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
vendored
Normal file
497
3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
vendored
Normal file
@ -0,0 +1,497 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{95543dab-5f63-41a8-8860-7e1659edc0b2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\glsl">
|
||||
<UniqueIdentifier>{c4cf23cb-22b9-4496-9cf7-8b25dc1e405f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\glsl\glcpp">
|
||||
<UniqueIdentifier>{7ec0058a-15c6-427d-9fce-27af39000e81}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\mesa">
|
||||
<UniqueIdentifier>{28f43e08-dfe8-424d-886c-db6e2ee33957}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\mesa\program">
|
||||
<UniqueIdentifier>{fd238409-ea7e-4bbe-8566-d5b8e7330242}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\mesa\main">
|
||||
<UniqueIdentifier>{b58605f3-8f5a-4800-838c-a0a04d1bdc96}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\glsl\ast.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glsl_optimizer.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glsl_parser.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glsl_parser_extras.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glsl_symbol_table.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glsl_types.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_basic_block.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_expression_flattening.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_function_inlining.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_hierarchical_visitor.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_optimization.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_print_glsl_visitor.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_print_visitor.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_rvalue_visitor.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_unused_structs.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_variable_refcount.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_visitor.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\linker.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\list.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\loop_analysis.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\program.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ralloc.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\s_expression.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\standalone_scaffolding.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\strtod.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glcpp\glcpp-parse.h">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\glcpp\glcpp.h">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\program\prog_instruction.h">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\program\prog_parameter.h">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\program\prog_statevars.h">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\program\symbol_table.h">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\compiler.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\config.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\context.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\core.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\dd.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\glheader.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\glminimal.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\imports.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\macros.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\mtypes.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\simple_list.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_uniform.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\main\hash_table.h">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\mesa\program\hash_table.h">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\link_uniform_block_active_visitor.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\link_varyings.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_builder.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\builtin_type_macros.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\glsl\ir_stats.h">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\glsl\ast_expr.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ast_function.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ast_to_hir.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ast_type.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\builtin_functions.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\builtin_variables.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glsl_lexer.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glsl_optimizer.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glsl_parser.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glsl_parser_extras.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glsl_symbol_table.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glsl_types.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\hir_field_selection.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_basic_block.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_clone.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_constant_expression.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_equals.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_expression_flattening.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_function.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_function_can_inline.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_function_detect_recursion.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_hierarchical_visitor.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_hv_accept.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_import_prototypes.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_print_glsl_visitor.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_print_visitor.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_rvalue_visitor.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_unused_structs.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_validate.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_variable_refcount.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_atomics.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_functions.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_uniform_initializers.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_uniforms.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\linker.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\loop_analysis.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\loop_controls.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\loop_unroll.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_clip_distance.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_discard.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_discard_flow.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_if_to_cond_assign.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_instructions.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_jumps.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_mat_op_to_vec.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_noise.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_variable_index_to_cond_assign.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_vec_index_to_cond_assign.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_vec_index_to_swizzle.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_vector.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\main.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_algebraic.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_array_splitting.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_constant_folding.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_constant_propagation.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_constant_variable.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_copy_propagation.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_copy_propagation_elements.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_cse.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_code.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_code_local.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_functions.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_function_inlining.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_if_simplification.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_noop_swizzle.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_redundant_jumps.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_structure_splitting.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_swizzle_swizzle.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_tree_grafting.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_vectorize.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ralloc.c">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\s_expression.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\standalone_scaffolding.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\strtod.c">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\glcpp-lex.c">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\glcpp-parse.c">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\glcpp.c">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\glcpp\pp.c">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\mesa\program\symbol_table.c">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\mesa\main\hash_table.c">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\mesa\main\imports.c">
|
||||
<Filter>src\mesa\main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\mesa\program\prog_hash_table.c">
|
||||
<Filter>src\mesa\program</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ast_array_index.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_uniform_block_active_visitor.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_uniform_blocks.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_varyings.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_flatten_nested_if_blocks.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_builder.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_packed_varyings.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_packing_builtins.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\link_interface_blocks.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_named_interface_blocks.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_output_reads.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_ubo_reference.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\lower_vector_insert.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\builtin_types.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_dead_builtin_varyings.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\opt_flip_matrices.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\glsl\ir_stats.cpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\README.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glsl_lexer.lpp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glsl_parser.ypp">
|
||||
<Filter>src\glsl</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-lex.l">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</CustomBuildStep>
|
||||
<CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-parse.y">
|
||||
<Filter>src\glsl\glcpp</Filter>
|
||||
</CustomBuildStep>
|
||||
</ItemGroup>
|
||||
</Project>
|
186
3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj
vendored
Normal file
186
3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{BB382242-6EBB-445F-989C-B9BA61D17965}</ProjectGuid>
|
||||
<RootNamespace>glsl_optimizer_tests</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
|
||||
<EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EmbedManifest>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
|
||||
<EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</EmbedManifest>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(ProjectName)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(ProjectName)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
|
||||
<EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</EmbedManifest>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
|
||||
<EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</EmbedManifest>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="glsl_optimizer_lib.vcxproj">
|
||||
<Project>{b475a403-9d9b-410d-8a93-ba49fc4dd811}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\glsl_optimizer_tests.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
File diff suppressed because it is too large
Load Diff
@ -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 = "<group>"; };
|
||||
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 = "<group>"; };
|
||||
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 = "<group>";
|
||||
};
|
||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||
@ -94,16 +90,16 @@
|
||||
1AB674ADFE9D54B511CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8DD76FB20486AB0100D96B5E /* glsl-optimizer-test */,
|
||||
8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2B62800913A15CE100B735C2 /* Products */ = {
|
||||
2BE167B1171937F4006A0537 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2B62800E13A15CE100B735C2 /* libmesaglsl2.a */,
|
||||
2B62801013A15CE100B735C2 /* builtin_compiler */,
|
||||
2BE167B6171937F4006A0537 /* libglsl_optimizer.a */,
|
||||
2BE167B8171937F4006A0537 /* builtincompiler */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@ -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 */,
|
6
3rdparty/glsl-optimizer/removeDeletedByUs.sh
vendored
6
3rdparty/glsl-optimizer/removeDeletedByUs.sh
vendored
@ -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
|
||||
|
1
3rdparty/glsl-optimizer/src/.gitignore
vendored
1
3rdparty/glsl-optimizer/src/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/Makefile
|
@ -1,3 +0,0 @@
|
||||
((c-mode . ((c-basic-offset . 3)))
|
||||
(c++-mode . ((c-basic-offset . 3)))
|
||||
)
|
6
3rdparty/glsl-optimizer/src/glsl/.gitignore
vendored
6
3rdparty/glsl-optimizer/src/glsl/.gitignore
vendored
@ -1,8 +1,4 @@
|
||||
glsl_compiler
|
||||
glsl_lexer.cc
|
||||
glsl_parser.cc
|
||||
glsl_parser.h
|
||||
glsl_parser.output
|
||||
builtin_compiler
|
||||
builtincompiler
|
||||
glsl_test
|
||||
|
||||
|
0
3rdparty/glsl-optimizer/src/glsl/.npmignore
vendored
Normal file
0
3rdparty/glsl-optimizer/src/glsl/.npmignore
vendored
Normal file
2
3rdparty/glsl-optimizer/src/glsl/Makefile
vendored
2
3rdparty/glsl-optimizer/src/glsl/Makefile
vendored
@ -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 \
|
||||
|
@ -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
|
||||
|
64
3rdparty/glsl-optimizer/src/glsl/SConscript
vendored
64
3rdparty/glsl-optimizer/src/glsl/SConscript
vendored
@ -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',
|
||||
|
337
3rdparty/glsl-optimizer/src/glsl/ast.h
vendored
337
3rdparty/glsl-optimizer/src/glsl/ast.h
vendored
@ -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 */
|
||||
|
254
3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp
vendored
Normal file
254
3rdparty/glsl-optimizer/src/glsl/ast_array_index.cpp
vendored
Normal file
@ -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;
|
||||
}
|
||||
}
|
632
3rdparty/glsl-optimizer/src/glsl/ast_function.cpp
vendored
632
3rdparty/glsl-optimizer/src/glsl/ast_function.cpp
vendored
@ -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);
|
||||
}
|
||||
|
2841
3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp
vendored
2841
3rdparty/glsl-optimizer/src/glsl/ast_to_hir.cpp
vendored
File diff suppressed because it is too large
Load Diff
88
3rdparty/glsl-optimizer/src/glsl/ast_type.cpp
vendored
88
3rdparty/glsl-optimizer/src/glsl/ast_type.cpp
vendored
@ -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;
|
||||
}
|
||||
|
||||
|
14992
3rdparty/glsl-optimizer/src/glsl/builtin_function.cpp
vendored
14992
3rdparty/glsl-optimizer/src/glsl/builtin_function.cpp
vendored
File diff suppressed because one or more lines are too long
4190
3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp
vendored
Normal file
4190
3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -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 <stdio.h>
|
||||
#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;
|
||||
}
|
122
3rdparty/glsl-optimizer/src/glsl/builtin_type_macros.h
vendored
Normal file
122
3rdparty/glsl-optimizer/src/glsl/builtin_type_macros.h
vendored
Normal file
@ -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)
|
298
3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp
vendored
Normal file
298
3rdparty/glsl-optimizer/src/glsl/builtin_types.cpp
vendored
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
/** @} */
|
329
3rdparty/glsl-optimizer/src/glsl/builtin_types.h
vendored
329
3rdparty/glsl-optimizer/src/glsl/builtin_types.h
vendored
@ -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"),
|
||||
};
|
||||
/*@}*/
|
1183
3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp
vendored
1183
3rdparty/glsl-optimizer/src/glsl/builtin_variables.cpp
vendored
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
}
|
||||
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))))))
|
||||
))
|
@ -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))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
109
3rdparty/glsl-optimizer/src/glsl/builtins/ir/asin.ir
vendored
109
3rdparty/glsl-optimizer/src/glsl/builtins/ir/asin.ir
vendored
@ -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))
|
||||
))))))))))))
|
||||
))
|
@ -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))))))))))
|
||||
))
|
134
3rdparty/glsl-optimizer/src/glsl/builtins/ir/atan.ir
vendored
134
3rdparty/glsl-optimizer/src/glsl/builtins/ir/atan.ir
vendored
@ -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))))
|
||||
|
||||
))
|
@ -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))))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))))))))
|
||||
))
|
@ -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)))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))))))
|
||||
))
|
@ -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))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
||||
|
@ -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)))))
|
||||
))
|
@ -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)))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))))))))
|
@ -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)))))))
|
@ -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))))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))))
|
||||
))
|
127
3rdparty/glsl-optimizer/src/glsl/builtins/ir/max.ir
vendored
127
3rdparty/glsl-optimizer/src/glsl/builtins/ir/max.ir
vendored
@ -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)))))
|
||||
))
|
127
3rdparty/glsl-optimizer/src/glsl/builtins/ir/min.ir
vendored
127
3rdparty/glsl-optimizer/src/glsl/builtins/ir/min.ir
vendored
@ -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)))))
|
||||
))
|
@ -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))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))
|
||||
))
|
||||
))
|
@ -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))
|
||||
))
|
||||
))
|
@ -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))
|
||||
))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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))))))
|
||||
))
|
@ -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)))))))
|
||||
|
||||
))
|
@ -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))))))))
|
||||
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
@ -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)))))
|
||||
))
|
||||
|
@ -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)))))
|
||||
))
|
@ -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))))))))
|
||||
))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user